[
  {
    "path": ".gitignore",
    "content": "node_modules\n.DS_Store\n.objs\nbin-debug\nbin-release\n"
  },
  {
    "path": "FairyGUI-egret.code-workspace",
    "content": "{\n\t\"folders\": [\n\t\t{\n\t\t\t\"path\": \"source\"\n\t\t},\n\t\t{\n\t\t\t\"path\": \"demo\"\n\t\t}\n\t],\n\t\"settings\": {}\n}"
  },
  {
    "path": "LICENSE",
    "content": "The MIT License (MIT)\n\nCopyright (c) 2015 fairygui.com\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n"
  },
  {
    "path": "README.md",
    "content": "FairyGUI-egret\n====\n\nA flexible UI framework for Egret Engine, working with the FREE professional Game UI Editor: FairyGUI Editor.\n\nOfficial website: [www.fairygui.com](http://www.fairygui.com)\n\n# 目录结构\n* source fairygui的源码\n* test 例子工程,可用Egret Wing直接打开\n  * UIProject UI 工程,可以FairyGUI编辑器打开\n\n# 获取fairygui库\n如果你只是想添加或者更新fairygui库到你的项目,那么下载以下文件即可:\n* source/bin/fairygui.js\n* source/bin/fairygui.min.js\n* source/bin/fairygui.d.ts\n\n# 编译源码\n使用VSC打开source目录,执行gulp build任务.\n\n# License\nMIT"
  },
  {
    "path": "demo/.vscode/tasks.json",
    "content": "{\n    // See https://go.microsoft.com/fwlink/?LinkId=733558 \n    // for the documentation about the tasks.json format\n    \"version\": \"2.0.0\",\n    \"tasks\": [\n        {\n            \"label\": \"Egret Run\",\n            \"type\": \"shell\",\n            \"command\": \"egret run -a\",\n            \"problemMatcher\": []\n        }\n    ]\n}"
  },
  {
    "path": "demo/.wing/launch.json",
    "content": "{\n\t\"version\": \"0.2.0\",\n\t\"configurations\": [\n\t\t{\n\t\t\t\"name\": \"Wing 内置播放器调试\",\n\t\t\t\"type\": \"chrome\",\n\t\t\t\"request\": \"launch\",\n\t\t\t\"file\": \"index.html\",\n\t\t\t//\"url\": \"http://mysite.com/index.html\",\n\t\t\t\"runtimeExecutable\": \"${execPath}\",\n\t\t\t\"sourceMaps\": true,\n\t\t\t\"webRoot\": \"${workspaceRoot}\",\n\t\t\t\"preLaunchTask\":\"build\",\n\t\t\t\"port\":5925\n\t\t},\n\t\t{\n\t\t\t\"name\": \"使用本机 Chrome 调试\",\n\t\t\t\"type\": \"chrome\",\n\t\t\t\"request\": \"launch\",\n\t\t\t\"file\": \"index.html\",\n\t\t\t//\"url\": \"http://mysite.com/index.html\",\n\t\t\t\"runtimeExecutable\": \"\",\n\t\t\t\"sourceMaps\": true,\n\t\t\t\"webRoot\": \"${workspaceRoot}\",\n\t\t\t\"preLaunchTask\":\"build\",\n\t\t\t\"userDataDir\":\"${tmpdir}\",\n\t\t\t\"port\":5925\n\t\t}\n\t]\n}"
  },
  {
    "path": "demo/.wing/tasks.json",
    "content": "{\n   \"version\": \"0.1.0\",\n   \"command\": \"egret\",\n   \"isShellCommand\": true,\n   \"tasks\": [\n      {\n         \"taskName\": \"build\",\n         \"showOutput\": \"always\",\n         \"args\": [\n            \"build\",\n            \"-sourcemap\"\n         ],\n         \"problemMatcher\": \"$tsc\"\n      },\n      {\n         \"taskName\": \"clean\",\n         \"showOutput\": \"always\",\n         \"args\": [\n            \"build\",\n            \"-e\"\n         ],\n         \"problemMatcher\": \"$tsc\"\n      },\n      {\n         \"taskName\": \"publish\",\n         \"showOutput\": \"always\",\n         \"args\": [\n            \"publish\"\n         ],\n         \"problemMatcher\": \"$tsc\"\n      }\n   ]\n}"
  },
  {
    "path": "demo/UIProject/FairyGUI-egret-demo.fairy",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<projectDescription id=\"42eb7038a35576a032d8aba97f9a18cc\" type=\"Egret\" version=\"3.0\"/>"
  },
  {
    "path": "demo/UIProject/assets/Bag/BagButton.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"90,100\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"thi7d\" xy=\"2,0\" aspect=\"true\">\n      <gearColor controller=\"button\" pages=\"0,1,2,3\" values=\"-|#aeaeae|-|#aeaeae\" default=\"#ffffff\"/>\n    </image>\n    <jta id=\"n2\" name=\"n2\" src=\"thi7j\" xy=\"-13,-6\"/>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Bag/BagGridSub.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"100,100\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n13\" name=\"n13\" src=\"jlmg8\" xy=\"5,4\"/>\n    <loader id=\"n4\" name=\"icon\" xy=\"6,6\" size=\"88,88\" align=\"center\" vAlign=\"middle\" fill=\"scale\"/>\n    <image id=\"n12\" name=\"n12\" src=\"jlmg9\" xy=\"0,0\"/>\n    <text id=\"n6\" name=\"title\" xy=\"9,66\" size=\"84,30\" fontSize=\"22\" color=\"#ff0000\" align=\"right\" vAlign=\"middle\" autoSize=\"none\" text=\"\"/>\n  </displayList>\n  <Button mode=\"Radio\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Bag/BagWin.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"640,582\">\n  <controller name=\"page\" pages=\"0,,1,,2,\" selected=\"0\"/>\n  <displayList>\n    <component id=\"n7\" name=\"frame\" src=\"dwwc3\" xy=\"0,0\" size=\"640,582\">\n      <Label title=\"Bag\"/>\n    </component>\n    <list id=\"n8\" name=\"list\" xy=\"54,71\" size=\"525,332\" layout=\"pagination\" overflow=\"scroll\" scroll=\"horizontal\" scrollBarFlags=\"8\" clipSoftness=\"0,49\" lineGap=\"5\" colGap=\"5\" defaultItem=\"ui://rbw1tv9tjlmg7\" pageController=\"page\">\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n    </list>\n    <image id=\"n9\" name=\"n9\" src=\"thi7g\" xy=\"61,418\" size=\"511,2\"/>\n    <image id=\"n10\" name=\"n10\" src=\"thi7h\" xy=\"61,425\" size=\"130,124\"/>\n    <loader id=\"n11\" name=\"n11\" xy=\"67,432\" size=\"120,110\" align=\"center\" vAlign=\"middle\"/>\n    <text id=\"n12\" name=\"n12\" xy=\"205,461\" size=\"113,28\" fontSize=\"24\" color=\"#ff0099\" text=\"Selected:\"/>\n    <text id=\"n13\" name=\"n13\" xy=\"336,461\" size=\"119,28\" fontSize=\"24\" color=\"#ff0099\" autoSize=\"height\" text=\"\"/>\n    <list id=\"n25_osdo\" name=\"n25\" xy=\"185,393\" size=\"269,19\" touchable=\"false\" layout=\"row\" colGap=\"40\" defaultItem=\"ui://rbw1tv9tosdok\" align=\"center\" selectionController=\"page\">\n      <item/>\n      <item/>\n      <item/>\n    </list>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Bag/CloseButton.xml",
    "content": "<component size=\"60,74\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"3\"/>\n  <controller name=\"c1\" pages=\"0,,1,\" selected=\"1\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"dwwc5\" xy=\"0,0\" size=\"61,74\" aspect=\"true\">\n      <gearDisplay controller=\"c1\" pages=\"0\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"dwwc5\" xy=\"0,0\" size=\"60,74\">\n      <gearDisplay controller=\"c1\" pages=\"0\"/>\n      <gearSize controller=\"button\" pages=\"0,1,2,3\" values=\"-|64,80|-|-\" default=\"60,74\"/>\n    </image>\n    <image id=\"n4\" name=\"n4\" src=\"dwwc6\" xy=\"2,13\" size=\"55,47\" aspect=\"true\">\n      <gearDisplay controller=\"c1\" pages=\"1\"/>\n      <gearXY controller=\"button\" pages=\"0,1,2,3\" values=\"0,10|2,13|0,10|2,13\" default=\"0,8\"/>\n      <gearSize controller=\"button\" pages=\"0,1,2,3\" values=\"61,53|-|61,53|-\" default=\"55,47\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Bag/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\">\n  <displayList>\n    <component id=\"n0\" name=\"bagBtn\" src=\"thi7c\" fileName=\"BagButton.xml\" xy=\"29,505\" group=\"n1\"/>\n    <group id=\"n1\" name=\"n1\" xy=\"29,505\" size=\"90,100\" advanced=\"true\">\n      <relation target=\"\" sidePair=\"bottom-bottom\"/>\n    </group>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Bag/WindowFrame.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"615,387\" extention=\"Label\" initName=\"frame\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"dwwc2\" xy=\"0,0\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <graph id=\"n3\" name=\"dragArea\" xy=\"10,1\" size=\"500,40\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </graph>\n    <text id=\"n1\" name=\"title\" xy=\"101,11\" size=\"412,26\" fontSize=\"22\" color=\"#ffffff\" align=\"center\" autoSize=\"none\" strokeColor=\"#000000\" text=\"窗口标题\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </text>\n    <component id=\"n2\" name=\"closeButton\" src=\"dwwc4\" xy=\"509,-9\">\n      <relation target=\"\" sidePair=\"left-right\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Bag/dot.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"15,15\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down\" selected=\"0\"/>\n  <displayList>\n    <graph id=\"n23_osdo\" name=\"n23\" xy=\"0,0\" size=\"15,15\" type=\"eclipse\" lineSize=\"0\" fillColor=\"#ff3f5b5f\"/>\n    <graph id=\"n22\" name=\"n22\" xy=\"0,0\" size=\"15,15\" type=\"eclipse\" lineSize=\"0\" fillColor=\"#ff849da4\">\n      <gearDisplay controller=\"button\" pages=\"1\"/>\n    </graph>\n  </displayList>\n  <Button mode=\"Radio\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Bag/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"rbw1tv9t\" jpegQuality=\"80\" compressPNG=\"true\">\n  <resources>\n    <component id=\"kcy10\" name=\"BagWin.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"dwwc2\" name=\"5.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"88,78,441,243\"/>\n    <component id=\"dwwc3\" name=\"WindowFrame.xml\" path=\"/\"/>\n    <component id=\"dwwc4\" name=\"CloseButton.xml\" path=\"/\"/>\n    <image id=\"dwwc5\" name=\"0.png\" path=\"/images/\"/>\n    <image id=\"dwwc6\" name=\"4.png\" path=\"/images/\"/>\n    <component id=\"jlmg7\" name=\"BagGridSub.xml\" path=\"/\"/>\n    <image id=\"jlmg8\" name=\"1.png\" path=\"/images/\"/>\n    <image id=\"jlmg9\" name=\"3.png\" path=\"/images/\"/>\n    <image id=\"jlmga\" name=\"2.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"17,16,74,73\"/>\n    <component id=\"fvaib\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"thi7c\" name=\"BagButton.xml\" path=\"/\"/>\n    <image id=\"thi7d\" name=\"btnimage.png\" path=\"/images/\"/>\n    <image id=\"thi7g\" name=\"7.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"83,1,166,2\"/>\n    <image id=\"thi7h\" name=\"8.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"31,26,62,52\"/>\n    <movieclip id=\"thi7j\" name=\"quan.jta\" path=\"/images/\"/>\n    <component id=\"osdok\" name=\"dot.xml\" path=\"/\"/>\n  </resources>\n  <publish name=\"Bag\">\n    <atlas name=\"Default\" index=\"0\"/>\n  </publish>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/Basics/CircleProgress.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"99,99\" extention=\"ProgressBar\">\n  <displayList>\n    <image id=\"n8\" name=\"bar\" src=\"gzpr80\" xy=\"0,0\" fillMethod=\"radial360\"/>\n  </displayList>\n  <ProgressBar/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Button.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <controller name=\"RadioGroup\" pages=\"0,,1,,2,\" selected=\"0\"/>\n  <controller name=\"tab\" homePageType=\"branch\" pages=\"0,,1,en,2,\" selected=\"0\"/>\n  <displayList>\n    <graph id=\"n26\" name=\"n26\" xy=\"705,154\" size=\"246,116\" type=\"rect\" fillColor=\"#ff333333\"/>\n    <component id=\"n3\" name=\"n3\" src=\"rpmbz\" fileName=\"components/Button.xml\" xy=\"30,26\">\n      <Button title=\"Simple\"/>\n    </component>\n    <component id=\"n4\" name=\"n4\" src=\"rpmb18\" fileName=\"components/Checkbox.xml\" xy=\"42,145\" size=\"88,19\">\n      <Button title=\"CheckBox\"/>\n    </component>\n    <component id=\"n5\" name=\"n5\" src=\"rpmb1a\" fileName=\"components/RadioButton.xml\" xy=\"161,145\" size=\"86,19\">\n      <Button title=\"Radio\"/>\n    </component>\n    <component id=\"n6\" name=\"n6\" src=\"rpmb10\" fileName=\"components/Button2.xml\" xy=\"158,19\" size=\"113,40\">\n      <gearXY controller=\"tab\" pages=\"1\" values=\"143,209\" default=\"158,19\"/>\n      <Button title=\"Click Me\" icon=\"ui://9leh0eyfrpmb6\"/>\n    </component>\n    <component id=\"n7\" name=\"n7\" src=\"rpmb12\" fileName=\"components/Button4.xml\" xy=\"278,298\"/>\n    <text id=\"n8\" name=\"n8\" xy=\"38,308\" size=\"168,26\" fontSize=\"22\" text=\"Transition Effect:\"/>\n    <component id=\"n11\" name=\"n11\" src=\"rpmb11\" fileName=\"components/Button3.xml\" xy=\"330,22\" size=\"88,40\">\n      <Button title=\"点我\" icon=\"ui://9leh0eyfrpmb6\"/>\n    </component>\n    <component id=\"n12\" name=\"n12\" src=\"rpmb16\" fileName=\"components/Button8.xml\" xy=\"281,129\">\n      <Button checked=\"true\"/>\n    </component>\n    <component id=\"n13\" name=\"n13\" src=\"rpmb13\" fileName=\"components/Button5.xml\" xy=\"489,20\" pivot=\"0.5,0.5\">\n      <Button icon=\"ui://9leh0eyfrpmbu\"/>\n    </component>\n    <component id=\"n15\" name=\"n15\" src=\"rpmb15\" fileName=\"components/Button7.xml\" xy=\"704,19\"/>\n    <component id=\"n16\" name=\"n16\" src=\"rpmb19\" fileName=\"components/OnOffButton.xml\" xy=\"473,300\">\n      <Button title=\"On\" selectedTitle=\"Off\"/>\n    </component>\n    <component id=\"n17\" name=\"n17\" src=\"rpmb17\" fileName=\"components/Button9.xml\" xy=\"627,289\">\n      <Button title=\"Fade In Out\"/>\n    </component>\n    <component id=\"n18\" name=\"n18\" src=\"rpmb1a\" fileName=\"components/RadioButton.xml\" xy=\"408,158\" size=\"86,19\">\n      <Button checked=\"true\" title=\"Option1\" controller=\"RadioGroup\" page=\"0\"/>\n    </component>\n    <component id=\"n19\" name=\"n19\" src=\"rpmb1a\" fileName=\"components/RadioButton.xml\" xy=\"408,190\" size=\"86,19\">\n      <Button title=\"Option2\" controller=\"RadioGroup\" page=\"1\"/>\n    </component>\n    <component id=\"n20\" name=\"n20\" src=\"rpmb1a\" fileName=\"components/RadioButton.xml\" xy=\"408,220\" size=\"86,19\">\n      <Button title=\"Option3\" controller=\"RadioGroup\" page=\"2\"/>\n    </component>\n    <text id=\"n21\" name=\"n21\" xy=\"410,125\" size=\"123,26\" fontSize=\"22\" text=\"RadioGroup\"/>\n    <text id=\"n22\" name=\"n22\" xy=\"728,123\" size=\"51,26\" fontSize=\"22\" text=\"Tabs\"/>\n    <component id=\"n23\" name=\"n23\" src=\"rpmb14\" fileName=\"components/Button6.xml\" xy=\"725,161\">\n      <Button checked=\"true\" title=\"Tab1\" controller=\"tab\" page=\"0\"/>\n    </component>\n    <component id=\"n24\" name=\"n24\" src=\"rpmb14\" fileName=\"components/Button6.xml\" xy=\"794,161\">\n      <Button title=\"Tab2\" controller=\"tab\" page=\"1\"/>\n    </component>\n    <component id=\"n25\" name=\"n25\" src=\"rpmb14\" fileName=\"components/Button6.xml\" xy=\"867,161\">\n      <Button title=\"Tab3\" controller=\"tab\" page=\"2\"/>\n    </component>\n    <image id=\"n29\" name=\"n29\" src=\"rpmb6\" fileName=\"images/angry_smile_png.png\" xy=\"815,221\">\n      <gearDisplay controller=\"tab\" pages=\"0\"/>\n    </image>\n    <image id=\"n30\" name=\"n30\" src=\"rpmbg\" fileName=\"images/long_dead_png.png\" xy=\"816,221\">\n      <gearDisplay controller=\"tab\" pages=\"1\"/>\n    </image>\n    <image id=\"n31\" name=\"n31\" src=\"rpmbh\" fileName=\"images/plus_smile_png.png\" xy=\"815,221\">\n      <gearDisplay controller=\"tab\" pages=\"2\"/>\n    </image>\n    <component id=\"n32\" name=\"n32\" src=\"rpmb13\" fileName=\"components/Button5.xml\" xy=\"48,413\" pivot=\"0.5,0.5\" touchable=\"false\" grayed=\"true\">\n      <Button icon=\"ui://9leh0eyfrpmbu\"/>\n    </component>\n    <text id=\"n33\" name=\"n33\" xy=\"38,373\" size=\"363,26\" fontSize=\"22\" text=\"Disable button: grayed+no touchable\"/>\n    <component id=\"n34\" name=\"n34\" src=\"poiq7e\" fileName=\"components/Button1.xml\" xy=\"832,28\" size=\"145,48\">\n      <Button title=\"简单按钮\"/>\n    </component>\n    <component id=\"n35\" name=\"n35\" src=\"dyz47i\" fileName=\"components/Button52.xml\" xy=\"469,437\" grayed=\"true\">\n      <Button icon=\"ui://9leh0eyfrpmbu\"/>\n    </component>\n    <text id=\"n36\" name=\"n36\" xy=\"451,374\" size=\"376,51\" fontSize=\"22\" autoSize=\"height\" text=\"Custom grayed&#xA;(Use a controller named 'grayed')\"/>\n    <text id=\"n37\" name=\"n37\" xy=\"849,369\" size=\"282,51\" fontSize=\"22\" autoSize=\"height\" text=\"Custom grayed&#xA;(Use disabled page)\"/>\n    <component id=\"n38\" name=\"n38\" src=\"iehu7x\" fileName=\"components/Button82.xml\" xy=\"870,437\" grayed=\"true\">\n      <Button checked=\"true\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Clip&Scroll.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <displayList>\n    <component id=\"n29\" name=\"n29\" src=\"gxip82\" xy=\"841,98\" group=\"n30\"/>\n    <text id=\"n28\" name=\"n28\" xy=\"856,59\" size=\"126,26\" group=\"n30\" fontSize=\"22\" text=\"Custom Mask\"/>\n    <group id=\"n30\" name=\"n30\" xy=\"841,59\" size=\"282,539\"/>\n    <component id=\"n0\" name=\"n0\" src=\"es412z\" xy=\"43,42\" group=\"n8\"/>\n    <text id=\"n7\" name=\"n7\" xy=\"67,8\" size=\"181,26\" group=\"n8\" fontSize=\"22\" text=\"Overflow: hidden\"/>\n    <group id=\"n8\" name=\"n8\" xy=\"43,8\" size=\"224,344\"/>\n    <graph id=\"n4\" name=\"n4\" xy=\"15,398\" size=\"341,151\" group=\"n12\" type=\"rect\" fillColor=\"#ff000000\"/>\n    <component id=\"n3\" name=\"n3\" src=\"smv73f\" xy=\"15,398\" group=\"n12\"/>\n    <group id=\"n12\" name=\"n12\" xy=\"15,398\" size=\"341,151\"/>\n    <component id=\"n2\" name=\"n2\" src=\"smv731\" xy=\"321,41\" group=\"n13\"/>\n    <text id=\"n9\" name=\"n9\" xy=\"313,10\" size=\"236,26\" group=\"n13\" fontSize=\"22\" text=\"Overflow: Free Scroll\"/>\n    <group id=\"n13\" name=\"n13\" xy=\"313,10\" size=\"236,341\"/>\n    <graph id=\"n17\" name=\"n17\" xy=\"594,35\" size=\"225,343\" group=\"n16\" type=\"rect\" fillColor=\"#ff000000\"/>\n    <component id=\"n14\" name=\"n14\" src=\"smv73g\" xy=\"594,35\" group=\"n16\"/>\n    <text id=\"n15\" name=\"n15\" xy=\"598,6\" size=\"412,26\" group=\"n16\" fontSize=\"22\" text=\"Overflow: Vertical scroll and margins\"/>\n    <group id=\"n16\" name=\"n16\" xy=\"594,6\" size=\"416,372\"/>\n    <graph id=\"n19\" name=\"n19\" xy=\"374,399\" size=\"341,151\" group=\"n21\" type=\"rect\" fillColor=\"#ff000000\"/>\n    <component id=\"n18\" name=\"n18\" src=\"smv73h\" xy=\"374,399\" group=\"n21\"/>\n    <group id=\"n21\" name=\"n21\" xy=\"374,399\" size=\"341,151\"/>\n    <graph id=\"n24\" name=\"n24\" xy=\"739,421\" size=\"387,120\" group=\"n26\" type=\"rect\" fillColor=\"#ff000000\"/>\n    <component id=\"n22\" name=\"n22\" src=\"smv73i\" xy=\"739,422\" size=\"387,120\" group=\"n26\"/>\n    <group id=\"n26\" name=\"n26\" xy=\"739,421\" size=\"387,121\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_ComboBox.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <displayList>\n    <component id=\"n1\" name=\"n1\" src=\"rt103t\" xy=\"83,64\">\n      <ComboBox visibleItemCount=\"10\">\n        <item title=\"Item 1\"/>\n        <item title=\"Item 2\"/>\n        <item title=\"Item 3\"/>\n        <item title=\"Item 4\"/>\n        <item title=\"Item 5\"/>\n        <item title=\"Item 6\"/>\n        <item title=\"Item 7\"/>\n        <item title=\"Item 8\"/>\n      </ComboBox>\n    </component>\n    <component id=\"n4\" name=\"n4\" src=\"zd9g41\" xy=\"258,137\">\n      <ComboBox visibleItemCount=\"5\">\n        <item title=\"Item 1\"/>\n        <item title=\"Item 2\"/>\n        <item title=\"Item 3\"/>\n        <item title=\"Item 4\"/>\n        <item title=\"Item 5\"/>\n        <item title=\"Item 6\"/>\n        <item title=\"Item 7\"/>\n      </ComboBox>\n    </component>\n    <component id=\"n5\" name=\"n5\" src=\"zd9g41\" xy=\"80,141\">\n      <ComboBox visibleItemCount=\"10\">\n        <item title=\"Item 1\"/>\n        <item title=\"Item 2\"/>\n        <item title=\"Item 3\"/>\n        <item title=\"Item 4\"/>\n        <item title=\"Item 5\"/>\n        <item title=\"Item 6\"/>\n        <item title=\"Item 7\"/>\n      </ComboBox>\n    </component>\n    <component id=\"n6\" name=\"n6\" src=\"rt103t\" xy=\"256,66\">\n      <ComboBox visibleItemCount=\"5\">\n        <item title=\"Item 1\"/>\n        <item title=\"Item 2\"/>\n        <item title=\"Item 3\"/>\n        <item title=\"Item 4\"/>\n        <item title=\"Item 5\"/>\n        <item title=\"Item 6\"/>\n        <item title=\"Item 7\"/>\n        <item title=\"Item 8\"/>\n      </ComboBox>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Component.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\" overflow=\"scroll\" scrollBar=\"hidden\">\n  <displayList>\n    <text id=\"n0\" name=\"n0\" xy=\"15,6\" size=\"1025,51\" fontSize=\"22\" autoSize=\"height\" text=\"Change the width or height of the component does not stretch the content by default.&#xA;改变组件的宽和高并不会直接拉伸组件内的内容\"/>\n    <component id=\"n12\" name=\"n12\" src=\"t24n7g\" xy=\"10,78\"/>\n    <component id=\"n13\" name=\"n13\" src=\"t24n7g\" xy=\"286,80\" size=\"327,322\"/>\n    <text id=\"n16\" name=\"n16\" xy=\"12,430\" size=\"437,51\" fontSize=\"22\" autoSize=\"height\" text=\"Use 'Relation' to adjust the content.&#xA;利用关联，可以使组件大小改变时调整内容\"/>\n    <component id=\"n17\" name=\"n17\" src=\"qa477h\" xy=\"18,501\"/>\n    <component id=\"n20\" name=\"n20\" src=\"qa477h\" xy=\"295,499\" size=\"330,324\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Controller.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <controller name=\"c1\" pages=\"0,,1,\" selected=\"0\"/>\n  <controller name=\"c2\" pages=\"0,,1,\" selected=\"0\"/>\n  <displayList>\n    <graph id=\"n3\" name=\"n3\" xy=\"181,271\" size=\"100,100\" type=\"rect\" fillColor=\"#ff666699\">\n      <gearXY controller=\"c1\" pages=\"0,1\" values=\"181,271|60,328\" tween=\"true\"/>\n      <gearSize controller=\"c1\" pages=\"1\" values=\"196,174,1,1\" default=\"100,100,1,1\" tween=\"true\"/>\n    </graph>\n    <text id=\"n0\" name=\"n0\" xy=\"18,21\" size=\"1086,105\" fontSize=\"23\" autoSize=\"height\" text=\"Controller is one of the key technologies of FairyGUI. Controller contains multiple pages. Elements can be in different status in different pages. Click the button below to observe the different effects.&#xA;控制器是FairyGUI核心特色功能之一。控制器包含多个页面，元件可以在不同页面中具有不同状态。点击下面的按钮，观察不同效果。\"/>\n    <graph id=\"n5\" name=\"n5\" xy=\"65,271\" size=\"100,100\" type=\"rect\">\n      <gearXY controller=\"c1\" pages=\"0,1\" values=\"65,271|252,190\" tween=\"true\"/>\n    </graph>\n    <text id=\"n6\" name=\"n6\" xy=\"191,341\" size=\"69,20\" fontSize=\"16\" color=\"#ffffff\" text=\"FairyGUI\">\n      <gearColor controller=\"c1\" pages=\"1\" values=\"#000000,#000000\" default=\"#ffffff,#000000\"/>\n    </text>\n    <image id=\"n7\" name=\"n7\" src=\"h5p722\" fileName=\"images/i256.png\" xy=\"133,393\" pivot=\"0.5,0.5\" size=\"90,90\" aspect=\"true\">\n      <gearXY controller=\"c1\" pages=\"0,1\" values=\"133,393|314,349\" tween=\"true\"/>\n      <gearSize controller=\"c1\" pages=\"1\" values=\"132,132,1,1\" default=\"90,90,1,1\" tween=\"true\"/>\n      <gearLook controller=\"c1\" pages=\"1\" values=\"0.54,180,0,0\" default=\"1,0,0,0\" tween=\"true\"/>\n    </image>\n    <image id=\"n8\" name=\"n8\" src=\"wa8u2t\" fileName=\"images/r3.png\" xy=\"256,194\">\n      <gearDisplay controller=\"c1\" pages=\"1\"/>\n    </image>\n    <image id=\"n9\" name=\"n9\" src=\"wa8u2u\" fileName=\"images/r4.png\" xy=\"65,276\">\n      <gearColor controller=\"c1\" pages=\"1\" values=\"#66ff99\" default=\"#ffffff\"/>\n    </image>\n    <movieclip id=\"n10\" name=\"n10\" src=\"hixt1v\" fileName=\"images/nlge1k.jta\" xy=\"422,285\">\n      <gearAni controller=\"c1\" pages=\"1\" values=\"0,s\" default=\"0,p\"/>\n    </movieclip>\n    <component id=\"n11\" name=\"n11\" src=\"rpmb12\" fileName=\"components/Button4.xml\" xy=\"89,195\">\n      <Button controller=\"c1\" page=\"1\"/>\n    </component>\n    <image id=\"n13\" name=\"n13\" src=\"h5p722\" fileName=\"images/i256.png\" xy=\"1383,450\" group=\"n16\"/>\n    <image id=\"n14\" name=\"n14\" src=\"h5p722\" fileName=\"images/i256.png\" xy=\"1265,450\" group=\"n16\"/>\n    <image id=\"n15\" name=\"n15\" src=\"h5p722\" fileName=\"images/i256.png\" xy=\"1154,450\" group=\"n16\"/>\n    <group id=\"n16\" name=\"n16\" xy=\"1154,450\" size=\"319,90\" advanced=\"true\">\n      <gearDisplay controller=\"c2\" pages=\"1\"/>\n      <gearXY controller=\"c2\" pages=\"0\" values=\"1154,450\" default=\"661,450\" tween=\"true\"/>\n      <relation target=\"\" sidePair=\"bottom-bottom,right-right\"/>\n    </group>\n    <component id=\"n12\" name=\"switchBtn\" src=\"gojg7s\" fileName=\"components/Button16.xml\" xy=\"1015,449\">\n      <relation target=\"\" sidePair=\"right-right,bottom-bottom\"/>\n      <Button controller=\"c2\" page=\"1\"/>\n    </component>\n    <text id=\"n17_s9ng\" name=\"n17\" xy=\"641,209\" size=\"357,78\" fontSize=\"74\" color=\"#336699\" text=\"Demo Text\">\n      <gearFontSize controller=\"c1\" pages=\"1\" values=\"74\" default=\"33\"/>\n    </text>\n    <graph id=\"n18_s9ng\" name=\"n18\" xy=\"783,312\" size=\"100,100\" type=\"eclipse\" fillColor=\"#ff00cccc\">\n      <gearDisplay controller=\"c1\" pages=\"1\"/>\n      <gearDisplay2 controller=\"c2\" pages=\"1\" condition=\"0\"/>\n    </graph>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Depth.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <displayList>\n    <text id=\"n20\" name=\"n20\" xy=\"18,22\" size=\"1077,76\" fontSize=\"22\" autoSize=\"height\" text=\"By default, children in component are arrange according to their index. You can use property 'sortingOrder' to customize the dept. This mechanism is useful in game, e.g. serveral modules who dont know each other trying to add objects to same container.\"/>\n    <component id=\"n22\" name=\"n22\" src=\"fou97r\" xy=\"38,144\"/>\n    <component id=\"n24\" name=\"btn0\" src=\"poiq7e\" xy=\"628,162\" size=\"167,45\">\n      <Button title=\"Add a child\"/>\n    </component>\n    <component id=\"n25\" name=\"btn1\" src=\"poiq7e\" xy=\"630,252\" size=\"454,53\">\n      <Button title=\"Add a child with bigger sortingOrder\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Drag&Drop.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <displayList>\n    <component id=\"n0\" name=\"a\" src=\"gx2b79\" fileName=\"components/BagGridSub2.xml\" xy=\"61,49\">\n      <Button title=\"A\" icon=\"ui://9leh0eyfwa8u2t\"/>\n    </component>\n    <component id=\"n1\" name=\"b\" src=\"gx2b79\" fileName=\"components/BagGridSub2.xml\" xy=\"67,270\">\n      <Button title=\"B\" icon=\"ui://9leh0eyfwa8u2t\"/>\n    </component>\n    <component id=\"n2\" name=\"c\" src=\"gx2b79\" fileName=\"components/BagGridSub2.xml\" xy=\"447,268\">\n      <Button title=\"C\"/>\n    </component>\n    <text id=\"n3\" name=\"n3\" xy=\"49,19\" size=\"291,26\" fontSize=\"22\" text=\"'A' can be dragged freely.\"/>\n    <text id=\"n4\" name=\"n4\" xy=\"53,178\" size=\"478,51\" fontSize=\"22\" text=\"Try drag B to C. B's icon will assign to C.&#xA;拖动B到C的位置可以将B的图标赋予C\"/>\n    <text id=\"n6\" name=\"n6\" xy=\"612,26\" size=\"368,26\" fontSize=\"22\" text=\"'D' can be dragged inside bounds.\"/>\n    <graph id=\"n7\" name=\"bounds\" xy=\"640,76\" size=\"440,413\" type=\"rect\" lineSize=\"3\" fillColor=\"#00ffffff\"/>\n    <component id=\"n5\" name=\"d\" src=\"gx2b79\" fileName=\"components/BagGridSub2.xml\" xy=\"819,231\">\n      <Button title=\"D\" icon=\"ui://9leh0eyfwa8u2t\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Graph.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <displayList>\n    <text id=\"n8\" name=\"n8\" xy=\"13,10\" size=\"659,26\" fontSize=\"22\" text=\"Simple graphics. (Empty graph is usually for place holder purpose.)\"/>\n    <graph id=\"n9_s9ng\" name=\"n9\" xy=\"187,62\" size=\"100,100\" type=\"rect\" lineSize=\"2\" corner=\"20\"/>\n    <graph id=\"n10_s9ng\" name=\"n10\" xy=\"43,62\" size=\"100,100\" type=\"rect\" lineSize=\"5\" lineColor=\"#ffffff66\" fillColor=\"#ffcc9933\"/>\n    <graph id=\"n11_s9ng\" name=\"n11\" xy=\"57,255\" pivot=\"0.5,0.5\" size=\"206,113\" skew=\"60,30\" rotation=\"-30\" type=\"rect\" lineSize=\"2\" fillColor=\"#ff006600\"/>\n    <graph id=\"n12_s9ng\" name=\"n12\" xy=\"323,62\" size=\"139,92\" type=\"rect\" lineSize=\"15\" lineColor=\"#ffff99ff\" fillColor=\"#00ff6600\"/>\n    <graph id=\"n13_s9ng\" name=\"polygon\" xy=\"493,243\" size=\"154,127\" type=\"polygon\" lineSize=\"2\" lineColor=\"#ff660033\" fillColor=\"#ff66cccc\" points=\"0,52,95,52,95,-2.5,154,64,95,127,94.5,81.5,0,82\"/>\n    <graph id=\"n14_s9ng\" name=\"polygon2\" xy=\"668,242\" size=\"144,145\" type=\"regular_polygon\" lineSize=\"3\" lineColor=\"#ffcc0066\" fillColor=\"#ffff9933\" sides=\"5\" startAngle=\"-18\"/>\n    <graph id=\"n15_s9ng\" name=\"n15\" xy=\"624,62\" size=\"100,100\" type=\"eclipse\" lineSize=\"2\" fillColor=\"#6866cc33\"/>\n    <graph id=\"n16_s9ng\" name=\"n16\" xy=\"895,62\" size=\"206,113\" type=\"eclipse\" lineSize=\"2\" fillColor=\"#ff336699\"/>\n    <graph id=\"n17_s9ng\" name=\"n17\" xy=\"758,62\" size=\"100,100\" type=\"eclipse\" lineSize=\"16\" lineColor=\"#ff003300\" fillColor=\"#0066cc33\"/>\n    <graph id=\"n18_s9ng\" name=\"pie\" xy=\"490,62\" size=\"100,100\" type=\"eclipse\" lineSize=\"2\" lineColor=\"#ff000099\" fillColor=\"#6800cccc\"/>\n    <image id=\"n19_s9ng\" name=\"n19\" src=\"s9ng8a\" fileName=\"images/radial.png\" xy=\"978,333\" pivot=\"0.5,0.5\" anchor=\"true\"/>\n    <graph id=\"n20_s9ng\" name=\"radial\" xy=\"979,333\" pivot=\"0.5,0.5\" anchor=\"true\" size=\"244,244\" type=\"regular_polygon\" lineSize=\"2\" lineColor=\"#ffff9900\" fillColor=\"#6999ff33\" sides=\"6\" distances=\"0.57,0.82,0.7,0.78,0.61,0.47\"/>\n    <graph id=\"n21_s9ng\" name=\"trapezoid\" xy=\"317,245\" size=\"144,145\" type=\"rect\" lineSize=\"0\" lineColor=\"#ffffffff\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Grid.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <displayList>\n    <graph id=\"n27\" name=\"n27\" xy=\"32,61\" size=\"528,337\" type=\"rect\" lineColor=\"#49959595\" fillColor=\"#ff233e43\"/>\n    <image id=\"n18\" name=\"n18\" src=\"a7vt7m\" xy=\"32,23\" size=\"527,39\"/>\n    <list id=\"n19\" name=\"list1\" xy=\"32,61\" size=\"527,336\" overflow=\"scroll\" margin=\"0,0,0,0\" clipSoftness=\"0,20\" defaultItem=\"ui://9leh0eyfa7vt7n\">\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n    </list>\n    <text id=\"n20\" name=\"n20\" xy=\"41,29\" size=\"60,26\" group=\"n25\" fontSize=\"22\" color=\"#ccffff\" text=\"Order\"/>\n    <text id=\"n21\" name=\"n21\" xy=\"432,29\" size=\"60,26\" group=\"n25\" fontSize=\"22\" color=\"#ccffff\" text=\"Stars\"/>\n    <text id=\"n23\" name=\"n23\" xy=\"338,29\" size=\"60,26\" group=\"n25\" fontSize=\"22\" color=\"#ccffff\" text=\"Color\"/>\n    <text id=\"n24\" name=\"n24\" xy=\"178,29\" size=\"49,26\" group=\"n25\" fontSize=\"22\" color=\"#ccffff\" text=\"Name\"/>\n    <group id=\"n25\" name=\"n25\" xy=\"41,29\" size=\"451,26\" advanced=\"true\"/>\n    <graph id=\"n28\" name=\"n28\" xy=\"585,59\" size=\"527,337\" type=\"rect\" lineColor=\"#49959595\" fillColor=\"#ff233e43\"/>\n    <image id=\"n29\" name=\"n29\" src=\"a7vt7m\" xy=\"585,21\" size=\"527,39\"/>\n    <list id=\"n30\" name=\"list2\" xy=\"585,59\" size=\"526,336\" selectionMode=\"none\" overflow=\"scroll\" margin=\"0,0,0,0\" clipSoftness=\"0,20\" defaultItem=\"ui://9leh0eyfatih7o\">\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n    </list>\n    <text id=\"n32\" name=\"n32\" xy=\"998,27\" size=\"60,26\" group=\"n35\" fontSize=\"22\" color=\"#ccffff\" text=\"Power\"/>\n    <text id=\"n33\" name=\"n33\" xy=\"887,27\" size=\"60,26\" group=\"n35\" fontSize=\"22\" color=\"#ccffff\" text=\"Color\"/>\n    <text id=\"n34\" name=\"n34\" xy=\"647,26\" size=\"49,26\" group=\"n35\" fontSize=\"22\" color=\"#ccffff\" text=\"Name\"/>\n    <group id=\"n35\" name=\"n35\" xy=\"647,26\" size=\"411,27\" advanced=\"true\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Image.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\" overflow=\"scroll\" scrollBar=\"hidden\">\n  <displayList>\n    <image id=\"n20_s9ng\" name=\"n20\" src=\"sner1h\" fileName=\"images/pic.png\" xy=\"19,37\"/>\n    <image id=\"n21_s9ng\" name=\"n21\" src=\"sner1h\" fileName=\"images/pic.png\" xy=\"228,37\" color=\"#66ff00\" flip=\"hz\"/>\n    <image id=\"n22_s9ng\" name=\"n22\" src=\"sner1h\" fileName=\"images/pic.png\" xy=\"718,41\" size=\"179,223\" alpha=\"0.62\" color=\"#707070\" flip=\"vt\"/>\n    <image id=\"n23_s9ng\" name=\"n23\" src=\"sner1h\" fileName=\"images/pic.png\" xy=\"443,154\" size=\"130,142\" rotation=\"-39\" color=\"#5e5e5e\"/>\n    <text id=\"n24_s9ng\" name=\"n24\" xy=\"19,303\" size=\"1028,26\" fontSize=\"22\" autoSize=\"height\" text=\"9 Grid and tile scale mode supported.Double click the image in library panel to change the settings.\"/>\n    <image id=\"n25_s9ng\" name=\"n25\" src=\"rt103m\" fileName=\"images/6_png.png\" xy=\"11,374\" size=\"294,173\"/>\n    <text id=\"n26_s9ng\" name=\"n26\" xy=\"123,342\" size=\"64,26\" fontSize=\"22\" text=\"9 Grid\"/>\n    <image id=\"n27_s9ng\" name=\"n27\" src=\"nz0z20\" fileName=\"images/long_dead2_png.png\" xy=\"625,376\" size=\"209,165\"/>\n    <text id=\"n28_s9ng\" name=\"n28\" xy=\"703,342\" size=\"39,26\" fontSize=\"22\" text=\"Tile\"/>\n    <image id=\"n29_s9ng\" name=\"n29\" src=\"nz0z20\" fileName=\"images/long_dead2_png.png\" xy=\"854,377\" size=\"209,165\" grayed=\"true\" flip=\"both\"/>\n    <image id=\"n30_s9ng\" name=\"n30\" src=\"rt103m\" fileName=\"images/6_png.png\" xy=\"310,375\" size=\"294,173\" grayed=\"true\" flip=\"vt\"/>\n    <text id=\"n31_s9ng\" name=\"n31\" xy=\"23,6\" size=\"403,26\" fontSize=\"22\" text=\"Image  properties: Color, Brightness, Flip\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Label.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <displayList>\n    <text id=\"n1\" name=\"n1\" xy=\"9,10\" size=\"918,51\" fontSize=\"22\" autoSize=\"height\" text=\"Label extention makes component have a title and icon property.&#xA;标签(Label)是对组件的一种扩展，使其具有标题和图标属性\"/>\n    <component id=\"n3\" name=\"frame\" src=\"rt103l\" xy=\"24,91\" size=\"223,226\">\n      <Label title=\"Bag\"/>\n    </component>\n    <component id=\"n4\" name=\"n4\" src=\"rt103r\" xy=\"270,118\">\n      <Label title=\"Hello world\" icon=\"ui://9leh0eyfrpmbg\"/>\n    </component>\n    <component id=\"n5\" name=\"n5\" src=\"rt103r\" xy=\"271,213\">\n      <Label title=\"Hello Unity\" titleColor=\"#ffcc33\" icon=\"ui://9leh0eyfhixt1v\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_List.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <displayList>\n    <list id=\"n0\" name=\"n0\" xy=\"34,89\" size=\"163,422\" overflow=\"scroll\" margin=\"0,0,0,0\" clipSoftness=\"0,20\" lineGap=\"6\" defaultItem=\"ui://9leh0eyfkpev60\">\n      <item title=\"100\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"1\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"2\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"99\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"4\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"5\" icon=\"ui://9leh0eyfkpev64\"/>\n    </list>\n    <text id=\"n1\" name=\"n1\" xy=\"7,7\" size=\"1072,29\" fontSize=\"22\" leading=\"6\" autoSize=\"height\" text=\"List provides four layouts. If the list supports selection, list item type must be radio button.\"/>\n    <text id=\"n2\" name=\"n2\" xy=\"40,54\" size=\"148,26\" fontSize=\"22\" text=\"Single Column\"/>\n    <list id=\"n4\" name=\"n4\" xy=\"534,110\" size=\"571,126\" layout=\"row\" overflow=\"scroll\" scroll=\"horizontal\" margin=\"0,0,0,0\" clipSoftness=\"0,20\" lineGap=\"6\" colGap=\"6\" defaultItem=\"ui://9leh0eyfkpev60\">\n      <item title=\"100\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"1\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"2\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"99\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"4\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"5\" icon=\"ui://9leh0eyfkpev64\"/>\n    </list>\n    <text id=\"n5\" name=\"n5\" xy=\"534,74\" size=\"115,26\" fontSize=\"22\" text=\"Single row\"/>\n    <list id=\"n7\" name=\"n7\" xy=\"534,300\" size=\"434,178\" layout=\"flow_hz\" overflow=\"scroll\" margin=\"0,0,0,0\" clipSoftness=\"0,20\" lineGap=\"6\" colGap=\"6\" defaultItem=\"ui://9leh0eyfkpev60\">\n      <item title=\"100\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"1\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"2\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"99\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"4\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"5\" icon=\"ui://9leh0eyfkpev64\"/>\n    </list>\n    <text id=\"n8\" name=\"n8\" xy=\"534,263\" size=\"170,26\" fontSize=\"22\" text=\"Flow horizontal\"/>\n    <list id=\"n9\" name=\"n9\" xy=\"238,89\" size=\"263,447\" layout=\"flow_vt\" overflow=\"scroll\" scroll=\"horizontal\" margin=\"0,0,0,0\" clipSoftness=\"0,20\" lineGap=\"6\" colGap=\"6\" defaultItem=\"ui://9leh0eyfkpev60\">\n      <item title=\"100\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"1\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"2\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"99\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"4\" icon=\"ui://9leh0eyfkpev64\"/>\n      <item title=\"5\" icon=\"ui://9leh0eyfkpev64\"/>\n    </list>\n    <text id=\"n10\" name=\"n10\" xy=\"305,54\" size=\"148,26\" fontSize=\"22\" text=\"Flow vertical\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Loader.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <displayList>\n    <text id=\"n0\" name=\"n0\" xy=\"14,10\" size=\"588,29\" fontSize=\"22\" leading=\"6\" text=\"Loader is for loading image or movieclip dynamically.\"/>\n    <loader id=\"n1\" name=\"n1\" xy=\"27,67\" size=\"90,90\" url=\"ui://9leh0eyfwa8u2t\"/>\n    <loader id=\"n2\" name=\"n2\" xy=\"142,65\" size=\"133,131\" url=\"ui://9leh0eyfwa8u2t\" fill=\"scale\"/>\n    <loader id=\"n3\" name=\"n3\" xy=\"295,66\" size=\"133,131\" scale=\"2.00,2.00\" url=\"ui://9leh0eyfwa8u2u\" align=\"center\" vAlign=\"middle\"/>\n    <loader id=\"n4\" name=\"n4\" xy=\"47,184\" size=\"60,60\" url=\"ui://9leh0eyfhixt1v\"/>\n    <loader id=\"n5\" name=\"n5\" xy=\"66,270\" size=\"183,121\" url=\"ui://9leh0eyft9fj5f\" align=\"center\" vAlign=\"middle\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_MovieClip.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <displayList>\n    <text id=\"n0\" name=\"n0\" xy=\"16,9\" size=\"605,71\" fontSize=\"22\" autoSize=\"none\" text=\"1. Import gif directly&#xA;2. Use builtin tool to create movieclip\"/>\n    <jta id=\"n8\" name=\"n8\" src=\"hixt1v\" xy=\"44,109\"/>\n    <jta id=\"n13\" name=\"n13\" src=\"hixt1v\" xy=\"52,243\" color=\"#0066cc\"/>\n    <jta id=\"n14\" name=\"n14\" src=\"hixt1v\" xy=\"70,416\" frame=\"1\" playing=\"false\"/>\n    <jta id=\"n15\" name=\"n15\" src=\"hixt1v\" xy=\"298,227\" pivot=\"0.5,0.5\" size=\"155,144\" alpha=\"0.33\" rotation=\"-49\" frame=\"1\"/>\n    <component id=\"n18\" name=\"n18\" src=\"rpmb10\" xy=\"170,426\" size=\"84,42\">\n      <Button title=\"点我\" icon=\"ui://9leh0eyfhixt1v\"/>\n    </component>\n    <jta id=\"n19\" name=\"n19\" src=\"t9fj5f\" xy=\"172,111\"/>\n    <jta id=\"n22\" name=\"n22\" src=\"hixt1v\" xy=\"176,243\" grayed=\"true\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Popup.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <displayList>\n    <component id=\"n0\" name=\"n0\" src=\"poiq7e\" xy=\"60,48\" size=\"158,48\">\n      <Button title=\"Popup Menu\"/>\n    </component>\n    <component id=\"n1\" name=\"n1\" src=\"poiq7e\" xy=\"342,48\" size=\"158,48\">\n      <Button title=\"Popup Any\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_ProgressBar.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <displayList>\n    <component id=\"n1\" name=\"n1\" src=\"t9fj50\" xy=\"55,37\">\n      <ProgressBar value=\"50\" max=\"100\"/>\n    </component>\n    <component id=\"n2\" name=\"n2\" src=\"t9fj53\" xy=\"228,32\">\n      <ProgressBar value=\"78\" max=\"100\"/>\n    </component>\n    <component id=\"n3\" name=\"n3\" src=\"t9fj57\" xy=\"48,118\">\n      <ProgressBar value=\"80\" max=\"100\"/>\n    </component>\n    <component id=\"n4\" name=\"n4\" src=\"t9fj5b\" xy=\"41,239\">\n      <ProgressBar value=\"75\" max=\"100\"/>\n    </component>\n    <component id=\"n6\" name=\"n6\" src=\"t9fj5g\" xy=\"354,116\">\n      <ProgressBar value=\"80\" max=\"100\"/>\n    </component>\n    <component id=\"n7\" name=\"n7\" src=\"fjqr7j\" xy=\"69,341\">\n      <ProgressBar value=\"67\" max=\"100\"/>\n    </component>\n    <component id=\"n9\" name=\"n9\" src=\"gzpr81\" xy=\"242,310\">\n      <ProgressBar value=\"30\" max=\"100\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Relation.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\" designImageLayer=\"1\">\n  <controller name=\"c1\" pages=\"0,,1,\" selected=\"0\"/>\n  <displayList>\n    <text id=\"n0\" name=\"n0\" xy=\"15,6\" size=\"964,76\" fontSize=\"22\" autoSize=\"height\" text=\"Relation is one of the key technologies of FairyGUI, which defines the position and size relation between the components&#xA;“关联”是FairyGUI核心特色功能之一。“关联”定义元件之间的位置和大小关系。\"/>\n    <graph id=\"n2\" name=\"n2\" xy=\"181,219\" size=\"100,100\" type=\"rect\" fillColor=\"#ff009900\">\n      <relation target=\"n1\" sidePair=\"left-left,top-top\"/>\n    </graph>\n    <graph id=\"n1\" name=\"n1\" xy=\"45,219\" size=\"100,100\" type=\"rect\">\n      <gearXY controller=\"c1\" pages=\"0,1\" values=\"45,219|336,224\" default=\"40,212\" tween=\"true\"/>\n    </graph>\n    <component id=\"n5\" name=\"n5\" src=\"rpmb12\" xy=\"37,108\">\n      <Button controller=\"c1\" page=\"1\"/>\n    </component>\n    <graph id=\"n7\" name=\"n7\" xy=\"278,380\" size=\"100,100\" type=\"rect\" fillColor=\"#ff009900\">\n      <relation target=\"n8\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <graph id=\"n8\" name=\"n8\" xy=\"48,380\" size=\"100,100\" type=\"rect\">\n      <gearSize controller=\"c1\" pages=\"0,1\" values=\"-|188,165,1.00,1.00\" default=\"100,100,1.00,1.00\" tween=\"true\"/>\n    </graph>\n    <graph id=\"n9\" name=\"n9\" xy=\"945,219\" size=\"99,100\" type=\"rect\" fillColor=\"#ff009900\">\n      <relation target=\"n10\" sidePair=\"leftext-right\"/>\n    </graph>\n    <graph id=\"n10\" name=\"n10\" xy=\"816,219\" size=\"100,100\" type=\"rect\">\n      <gearXY controller=\"c1\" pages=\"0,1\" values=\"816,219|635,224\" default=\"153,546\" tween=\"true\"/>\n    </graph>\n    <graph id=\"n12\" name=\"n12\" xy=\"950,399\" size=\"99,104\" type=\"rect\" fillColor=\"#ff009900\">\n      <gearSize controller=\"c1\" pages=\"0,1\" values=\"-|285,104,1.00,1.00\" default=\"99,104,1.00,1.00\" tween=\"true\"/>\n      <relation target=\"\" sidePair=\"right-right\"/>\n    </graph>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Slider.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <displayList>\n    <component id=\"n1\" name=\"n1\" src=\"suiz4i\" xy=\"84,63\">\n      <Slider value=\"50\" max=\"100\"/>\n    </component>\n    <component id=\"n2\" name=\"n2\" src=\"suiz4o\" xy=\"281,50\">\n      <Slider value=\"50\" max=\"100\"/>\n    </component>\n    <component id=\"n3\" name=\"n3\" src=\"eut94u\" xy=\"57,236\">\n      <Slider value=\"50\" max=\"100\"/>\n    </component>\n    <component id=\"n4\" name=\"n4\" src=\"srct87\" xy=\"114,389\">\n      <Slider value=\"50\" max=\"100\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Text.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,570\">\n  <displayList>\n    <graph id=\"n16\" name=\"n16\" xy=\"621,183\" size=\"471,211\" type=\"rect\" fillColor=\"#ff000000\"/>\n    <graph id=\"n15\" name=\"n15\" xy=\"33,123\" size=\"337,50\" type=\"rect\"/>\n    <text id=\"n2\" name=\"n2\" xy=\"33,123\" size=\"337,50\" fontSize=\"22\" color=\"#cc3300\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" text=\"Text Align\"/>\n    <graph id=\"n14\" name=\"n14\" xy=\"34,183\" size=\"459,160\" type=\"rect\" fillColor=\"#ff000000\"/>\n    <text id=\"n0\" name=\"n0\" xy=\"41,61\" size=\"159,26\" fontSize=\"22\" text=\"Auto Size text\"/>\n    <text id=\"n3\" name=\"n3\" xy=\"218,61\" size=\"125,26\" fontSize=\"22\" color=\"#993300\" align=\"center\" vAlign=\"middle\" underline=\"true\" bold=\"true\" italic=\"true\" text=\"Text Style\"/>\n    <text id=\"n4\" name=\"n4\" xy=\"476,61\" size=\"192,26\" fontSize=\"22\" color=\"#ffffff\" align=\"center\" vAlign=\"middle\" strokeColor=\"#000000\" text=\"Text with outline\"/>\n    <richtext id=\"n5\" name=\"n5\" xy=\"34,183\" size=\"459,160\" fontSize=\"22\" color=\"#ffffff\" leading=\"12\" ubb=\"true\" autoSize=\"none\" text=\"Support UBB grammer：&#xA;[color=#FF3300][b]FairyGUI Editor[/b][/color] is a [i]WYSWYG[/i][size=30] Game UI Editor[/size]，FairyGUI是一个所见即所得的[color=#FFFF00]游戏UI编辑器[/color]。\"/>\n    <text id=\"n7\" name=\"n7\" xy=\"171,382\" size=\"345,54\" font=\"ui://9leh0eyfduef6m\" fontSize=\"16\" color=\"#ffffff\" leading=\"12\" autoSize=\"height\" text=\"1234567890\"/>\n    <text id=\"n8\" name=\"n8\" xy=\"31,386\" size=\"126,26\" fontSize=\"22\" text=\"Bitmap Font\"/>\n    <text id=\"n10\" name=\"n10\" xy=\"26,462\" size=\"418,26\" fontSize=\"22\" ubb=\"true\" text=\"Support fnt files generated by [b]BMFont[/b]\"/>\n    <text id=\"n11\" name=\"n11\" xy=\"48,501\" size=\"225,36\" font=\"ui://9leh0eyfwa8u2r\" fontSize=\"16\" color=\"#993300\" text=\"如何使用UI编辑器\"/>\n    <richtext id=\"n12\" name=\"n12\" xy=\"621,183\" size=\"471,211\" fontSize=\"22\" color=\"#ccff00\" ubb=\"true\" autoSize=\"none\" text=\"RichText support click events, html tags(small set), support links and images. 多媒体文本支持点击/触摸事件，可以直接使用html标签（仅支持部分），可以带链接和图片。&#xA;[img]ui://9leh0eyfrpmb6[/img]I am image&#xA;[url=event:xx]I am link, click me[/url]\"/>\n    <text id=\"n17\" name=\"n17\" xy=\"39,12\" size=\"478,26\" fontSize=\"22\" color=\"#ccff00\" text=\"The quick brown fox jump sover the lazy dog\"/>\n    <text id=\"n18\" name=\"n18\" xy=\"361,61\" size=\"97,26\" fontSize=\"22\" color=\"#993300\" align=\"center\" vAlign=\"middle\" underline=\"true\" bold=\"true\" italic=\"true\" text=\"字体样式\"/>\n    <text id=\"n19\" name=\"n19\" xy=\"686,61\" size=\"93,26\" fontSize=\"22\" color=\"#ffffff\" align=\"center\" vAlign=\"middle\" strokeColor=\"#000000\" text=\"描边效果\"/>\n    <graph id=\"n21\" name=\"n21\" xy=\"688,430\" size=\"348,35\" type=\"rect\"/>\n    <text id=\"n22\" name=\"n22\" xy=\"692,432\" size=\"341,29\" input=\"true\" prompt=\"[i][color=#999999]Your Name Here[/color][/i]\" fontSize=\"22\" vAlign=\"middle\" autoSize=\"none\" singleLine=\"true\" text=\"\"/>\n    <text id=\"n23\" name=\"n23\" xy=\"563,435\" size=\"120,26\" fontSize=\"22\" autoSize=\"height\" text=\"Input Test\"/>\n    <text id=\"n24\" name=\"n24\" xy=\"690,485\" size=\"299,26\" fontSize=\"22\" color=\"#ff3300\" autoSize=\"height\" text=\"\"/>\n    <component id=\"n25\" name=\"n25\" src=\"poiq7e\" fileName=\"components/Button1.xml\" xy=\"999,480\" size=\"119,36\">\n      <Button title=\"Get Input\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Demo_Window.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"640,400\">\n  <displayList>\n    <component id=\"n0\" name=\"n0\" src=\"poiq7e\" xy=\"62,58\" size=\"121,36\">\n      <Button title=\"WindowA\"/>\n    </component>\n    <component id=\"n1\" name=\"n1\" src=\"poiq7e\" xy=\"223,58\" size=\"127,36\">\n      <Button title=\"WindowB\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\" overflow=\"hidden\">\n  <controller name=\"c1\" pages=\"0,,1,\" selected=\"0\"/>\n  <displayList>\n    <graph id=\"n26\" name=\"n26\" xy=\"0,70\" size=\"1136,570\" type=\"rect\" lineSize=\"0\" fillColor=\"#ff9f9f9f\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <component id=\"n25\" name=\"container\" src=\"f2ax74\" xy=\"-1143,70\" size=\"1136,570\">\n      <gearDisplay controller=\"c1\" pages=\"1\"/>\n      <gearXY controller=\"c1\" pages=\"0\" values=\"-1143,70\" default=\"0,70\" tween=\"true\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </component>\n    <graph id=\"n21\" name=\"n21\" xy=\"0,0\" size=\"1136,70\" type=\"rect\" fillColor=\"#ff006699\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </graph>\n    <component id=\"n22\" name=\"btn_Back\" src=\"hixt1j\" xy=\"963,-1\">\n      <relation target=\"\" sidePair=\"right-right\"/>\n      <Button title=\"&lt;&lt;Back\"/>\n    </component>\n    <component id=\"n2\" name=\"btn_Button\" src=\"hixt1j\" xy=\"462,298\" group=\"n23\">\n      <Button title=\"Button\"/>\n    </component>\n    <component id=\"n3\" name=\"btn_Image\" src=\"hixt1j\" xy=\"274,100\" group=\"n23\">\n      <Button title=\"Image\"/>\n    </component>\n    <component id=\"n4\" name=\"btn_Graph\" src=\"hixt1j\" xy=\"86,100\" group=\"n23\">\n      <Button title=\"Graph\"/>\n    </component>\n    <component id=\"n5\" name=\"btn_MovieClip\" src=\"hixt1j\" xy=\"462,100\" group=\"n23\">\n      <Button title=\"MovieClip\"/>\n    </component>\n    <component id=\"n6\" name=\"btn_Depth\" src=\"hixt1j\" xy=\"650,397\" group=\"n23\">\n      <Button title=\"Depth\"/>\n    </component>\n    <component id=\"n7\" name=\"btn_Loader\" src=\"hixt1j\" xy=\"838,100\" group=\"n23\">\n      <Button title=\"Loader\"/>\n    </component>\n    <component id=\"n8\" name=\"btn_List\" src=\"hixt1j\" xy=\"86,199\" group=\"n23\">\n      <Button title=\"List\"/>\n    </component>\n    <component id=\"n9\" name=\"btn_ProgressBar\" src=\"hixt1j\" xy=\"86,397\" group=\"n23\">\n      <Button title=\"ProgressBar\"/>\n    </component>\n    <component id=\"n10\" name=\"btn_Slider\" src=\"hixt1j\" xy=\"838,298\" group=\"n23\">\n      <Button title=\"Slider\"/>\n    </component>\n    <component id=\"n11\" name=\"btn_ComboBox\" src=\"hixt1j\" xy=\"650,298\" group=\"n23\">\n      <Button title=\"ComboBox\"/>\n    </component>\n    <component id=\"n12\" name=\"btn_Clip&amp;Scroll\" src=\"hixt1j\" xy=\"838,199\" size=\"163,69\" group=\"n23\">\n      <Button title=\"Clip&amp;Scroll\"/>\n    </component>\n    <component id=\"n13\" name=\"btn_Controller\" src=\"hixt1j\" xy=\"462,199\" group=\"n23\">\n      <Button title=\"Controller\"/>\n    </component>\n    <component id=\"n14\" name=\"btn_Relation\" src=\"hixt1j\" xy=\"650,199\" group=\"n23\">\n      <Button title=\"Relation\"/>\n    </component>\n    <component id=\"n17\" name=\"btn_Label\" src=\"hixt1j\" xy=\"274,298\" group=\"n23\">\n      <Button title=\"Label\"/>\n    </component>\n    <component id=\"n18\" name=\"btn_Popup\" src=\"hixt1j\" xy=\"274,397\" group=\"n23\">\n      <Button title=\"Popup\"/>\n    </component>\n    <component id=\"n19\" name=\"btn_Window\" src=\"hixt1j\" xy=\"462,397\" group=\"n23\">\n      <Button title=\"Window\"/>\n    </component>\n    <component id=\"n20\" name=\"btn_Drag&amp;Drop\" src=\"hixt1j\" xy=\"838,397\" group=\"n23\">\n      <Button title=\"Drag&amp;Drop\"/>\n    </component>\n    <component id=\"n27\" name=\"btn_Component\" src=\"hixt1j\" xy=\"86,298\" group=\"n23\">\n      <Button title=\"Component\"/>\n    </component>\n    <component id=\"n28\" name=\"btn_Grid\" src=\"hixt1j\" xy=\"274,199\" group=\"n23\">\n      <Button title=\"Grid\"/>\n    </component>\n    <component id=\"n29\" name=\"btn_Text\" src=\"hixt1j\" xy=\"650,100\" group=\"n23\">\n      <Button title=\"Text\"/>\n    </component>\n    <group id=\"n23\" name=\"btns\" xy=\"86,100\" size=\"915,366\" advanced=\"true\">\n      <gearDisplay controller=\"c1\" pages=\"0\"/>\n      <gearXY controller=\"c1\" pages=\"0,1\" values=\"86,100|1159,100\" tween=\"true\"/>\n    </group>\n    <text id=\"n24\" name=\"n24\" xy=\"13,12\" size=\"276,50\" font=\"微软雅黑\" fontSize=\"35\" color=\"#ff9900\" bold=\"true\" text=\"FairyGUI-Demo\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/WindowA.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"400,400\">\n  <displayList>\n    <component id=\"n0\" name=\"frame\" src=\"rt103l\" xy=\"0,0\" size=\"400,400\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n      <Label title=\"Window A\"/>\n    </component>\n    <component id=\"n2\" name=\"n2\" src=\"zd9g41\" xy=\"33,47\">\n      <ComboBox visibleItemCount=\"5\">\n        <item title=\"Item 1\"/>\n        <item title=\"Item 2\"/>\n        <item title=\"Item 3\"/>\n        <item title=\"Item 4\"/>\n        <item title=\"Item 5\"/>\n        <item title=\"Item 6\"/>\n        <item title=\"Item 7\"/>\n      </ComboBox>\n    </component>\n    <component id=\"n5\" name=\"n5\" src=\"rpmb13\" xy=\"108,320\" pivot=\"0.5,0.5\">\n      <Button icon=\"ui://9leh0eyfrpmbu\"/>\n    </component>\n    <list id=\"n6\" name=\"n6\" xy=\"39,98\" size=\"335,215\" layout=\"flow_hz\" overflow=\"scroll\" margin=\"0,0,0,0\" clipSoftness=\"0,20\" lineGap=\"6\" colGap=\"6\" defaultItem=\"ui://9leh0eyfkpev60\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/WindowB.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"400,203\">\n  <displayList>\n    <component id=\"n0\" name=\"frame\" src=\"niii7d\" fileName=\"components/WindowFrameB.xml\" xy=\"68,0\" size=\"332,203\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n      <Label title=\"窗口B\"/>\n    </component>\n    <image id=\"n7\" name=\"n7\" src=\"sner1h\" fileName=\"images/pic.png\" xy=\"-46,-37\"/>\n    <text id=\"n10\" name=\"n10\" xy=\"191,20\" size=\"156,42\" font=\"Comic Sans MS\" fontSize=\"27\" color=\"#ff3366\" text=\"Hello World\"/>\n    <component id=\"n12\" name=\"n12\" src=\"t9fj57\" fileName=\"components/ProgressBar3.xml\" xy=\"185,139\" scale=\"0.7,1\">\n      <ProgressBar value=\"80\" max=\"100\"/>\n    </component>\n  </displayList>\n  <transition name=\"t1\">\n    <item time=\"0\" type=\"XY\" target=\"n7\" tween=\"true\" startValue=\"-29,-\" endValue=\"-9,-\" duration=\"8\" repeat=\"11\" yoyo=\"true\"/>\n  </transition>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/BagGridSub.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"100,100\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n13\" name=\"n13\" src=\"kpev61\" xy=\"5,4\"/>\n    <loader id=\"n4\" name=\"icon\" xy=\"6,6\" size=\"88,88\" align=\"center\" vAlign=\"middle\" fill=\"scale\"/>\n    <image id=\"n12\" name=\"n12\" src=\"kpev62\" xy=\"0,0\"/>\n    <text id=\"n6\" name=\"title\" xy=\"9,66\" size=\"84,30\" fontSize=\"22\" color=\"#ff0000\" align=\"right\" vAlign=\"middle\" autoSize=\"none\" text=\"\"/>\n    <image id=\"n11\" name=\"n11\" src=\"kpev63\" xy=\"-4,-4\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n    </image>\n  </displayList>\n  <Button mode=\"Radio\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/BagGridSub2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"100,100\" extention=\"Button\">\n  <displayList>\n    <image id=\"n13\" name=\"n13\" src=\"kpev61\" xy=\"5,4\"/>\n    <loader id=\"n4\" name=\"icon\" xy=\"6,6\" size=\"88,88\" align=\"center\" vAlign=\"middle\" fill=\"scale\"/>\n    <image id=\"n12\" name=\"n12\" src=\"kpev62\" xy=\"0,0\"/>\n    <text id=\"n6\" name=\"title\" xy=\"9,66\" size=\"84,30\" fontSize=\"22\" color=\"#ff0000\" align=\"right\" vAlign=\"middle\" autoSize=\"none\" text=\"\"/>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button.xml",
    "content": "<component size=\"85,25\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"rpmbf\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"rpmbd\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"rpmbe\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <text id=\"n4\" name=\"title\" xy=\"0,2\" size=\"85,22\" fontSize=\"12\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" singleLine=\"true\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"100,36\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <graph id=\"n1\" name=\"n1\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#fff0f0f0\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <graph id=\"n2\" name=\"n2\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#fffafafa\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <graph id=\"n3\" name=\"n3\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#ffcccccc\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <text id=\"n4\" name=\"title\" xy=\"0,0\" size=\"100,36\" fontSize=\"22\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" singleLine=\"true\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button10.xml",
    "content": "<component size=\"163,69\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n5\" name=\"n5\" src=\"hixt1k\" xy=\"-5,-2\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n1\" name=\"n1\" src=\"hixt1l\" xy=\"-3,-1\" size=\"169,72\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0,2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <loader id=\"n4\" name=\"icon\" xy=\"0,4\" size=\"163,61\" align=\"center\" vAlign=\"middle\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </loader>\n    <text id=\"n3\" name=\"title\" xy=\"0,3\" size=\"163,63\" fontSize=\"22\" color=\"#ffffff\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" bold=\"true\" strokeColor=\"#003c49\" demoText=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button13.xml",
    "content": "<component size=\"50,50\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"1\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"eut94y\" xy=\"12,14\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0,2\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"eut94z\" xy=\"12,14\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button14.xml",
    "content": "<component size=\"102,40\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"zd9g4a\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"zd9g4b\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"zd9g4c\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n4\" name=\"n4\" src=\"zd9g4d\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <text id=\"n5\" name=\"title\" xy=\"0,0\" size=\"102,40\" fontSize=\"15\" color=\"#ffff00\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" demoText=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button15.xml",
    "content": "<component size=\"132,40\" extention=\"Button\" idnum=\"5\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\"/>\n  <displayList>\n    <image id=\"n1\" src=\"zd9g43\" name=\"n1\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width,height\"/>\n    </image>\n    <image id=\"n2\" src=\"zd9g44\" name=\"n2\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1\"/>\n      <relation target=\"\" sidePair=\"width,height\"/>\n    </image>\n    <image id=\"n3\" src=\"zd9g45\" name=\"n3\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width,height\"/>\n    </image>\n    <image id=\"n4\" src=\"zd9g46\" name=\"n4\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"3\"/>\n      <relation target=\"\" sidePair=\"width,height\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button16.xml",
    "content": "<component size=\"100,100\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"gojg7t\" xy=\"1,1\" pivot=\"0.5,0.5\" aspect=\"true\">\n      <gearLook controller=\"button\" pages=\"0,1,2,3\" values=\"-|1,180,0|-|1,180,0\" default=\"1,0,0\" tween=\"true\" ease=\"Sine.Out\"/>\n    </image>\n  </displayList>\n  <Button mode=\"Check\" sound=\"ui://9leh0eyfgojg7u\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"85,40\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"rpmbf\" xy=\"0,0\" size=\"85,40\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"rpmbd\" xy=\"0,0\" size=\"85,40\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"rpmbe\" xy=\"0,0\" size=\"85,40\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <text id=\"n4\" name=\"title\" xy=\"41,3\" size=\"40,34\" fontSize=\"12\" vAlign=\"middle\" autoSize=\"none\" singleLine=\"true\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n    <loader id=\"n5\" name=\"icon\" xy=\"3,3\" size=\"32,32\" align=\"center\" vAlign=\"middle\" fill=\"scale\"/>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button3.xml",
    "content": "<component size=\"85,40\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"rpmbf\" xy=\"0,0\" size=\"85,40\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"rpmbd\" xy=\"0,0\" size=\"85,40\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"rpmbe\" xy=\"0,0\" size=\"85,40\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <text id=\"n4\" name=\"title\" xy=\"4,3\" size=\"40,34\" fontSize=\"12\" align=\"right\" vAlign=\"middle\" autoSize=\"none\" singleLine=\"true\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n    <loader id=\"n5\" name=\"icon\" xy=\"48,3\" size=\"32,32\" align=\"center\" vAlign=\"middle\">\n      <relation target=\"\" sidePair=\"right-right\"/>\n    </loader>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button4.xml",
    "content": "<component size=\"131,45\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"rpmbv\" xy=\"0,0\"/>\n    <image id=\"n2\" name=\"n2\" src=\"rpmbx\" xy=\"79,12\"/>\n    <image id=\"n3\" name=\"n3\" src=\"rpmbw\" xy=\"14,13\"/>\n    <image id=\"n1\" name=\"n1\" src=\"rpmbi\" xy=\"-5,-1\">\n      <gearXY controller=\"button\" pages=\"0,1,2,3\" values=\"-|64,-1|-|64,-1\" default=\"-5,-1\" tween=\"true\"/>\n    </image>\n  </displayList>\n  <Button mode=\"Check\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button5.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"180,70\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n0\" name=\"bg\" src=\"rpmb1\" xy=\"2,3\" size=\"181,70\" aspect=\"true\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <text id=\"n1\" name=\"title\" xy=\"10,10\" size=\"157,46\" fontSize=\"22\" color=\"#ffff00\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n    <loader id=\"n2\" name=\"icon\" xy=\"10,7\" size=\"160,49\" align=\"center\" vAlign=\"middle\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </loader>\n  </displayList>\n  <Button downEffect=\"scale\" downEffectValue=\"0.80\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button52.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"180,70\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <controller name=\"grayed\" pages=\"0,,1,\" selected=\"1\"/>\n  <displayList>\n    <image id=\"n0\" name=\"bg\" src=\"rpmb1\" xy=\"0,-1\" size=\"181,70\" aspect=\"true\">\n      <gearXY controller=\"button\" pages=\"0,1,2,3\" values=\"0,-1|1,1|0,0|1,1\" default=\"1,5\"/>\n      <gearSize controller=\"button\" pages=\"0,1,2,3\" values=\"181,70,1.00,1.00|178,68,1.00,1.00|-|178,68,1.00,1.00\" default=\"181,70,1.00,1.00\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <text id=\"n1\" name=\"title\" xy=\"9,7\" size=\"157,46\" fontSize=\"22\" color=\"#ffff00\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n    <loader id=\"n2\" name=\"icon\" xy=\"8,4\" size=\"160,49\" grayed=\"true\" align=\"center\" vAlign=\"middle\">\n      <gearLook controller=\"grayed\" pages=\"0,1\" values=\"1.00,0,0|-\" default=\"1.00,0,1\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </loader>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button6.xml",
    "content": "<component size=\"66,44\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"2\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"rpmbl\" xy=\"0,0\" size=\"66,44\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"rpmbj\" xy=\"0,0\" size=\"66,37\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"rpmbm\" xy=\"0,0\" size=\"66,44\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n4\" name=\"n4\" src=\"rpmbk\" xy=\"0,0\" size=\"66,44\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <loader id=\"n6\" name=\"icon\" xy=\"0,0\" size=\"66,30\" align=\"center\" vAlign=\"middle\"/>\n    <text id=\"n5\" name=\"title\" xy=\"0,0\" size=\"66,25\" fontSize=\"16\" color=\"#ffffff\" align=\"center\" leading=\"0\" autoSize=\"none\" strokeColor=\"#000000\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n      <gearColor controller=\"button\" pages=\"0,1,2,3\" values=\"#ffffff|-|#ffffff|-\" default=\"#dfb536\"/>\n    </text>\n  </displayList>\n  <Button mode=\"Radio\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button7.xml",
    "content": "<component size=\"69,62\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\"/>\n  <displayList>\n    <image id=\"n1\" src=\"rpmbo\" name=\"n1\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0,2\"/>\n      <relation target=\"\" sidePair=\"width,height\"/>\n    </image>\n    <image id=\"n2\" src=\"rpmbn\" name=\"n2\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width,height\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button8.xml",
    "content": "<component size=\"52,49\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"rpmbq\" xy=\"0,0\" size=\"52,49\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0,1,2,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"rpmbp\" xy=\"3,-3\" size=\"58,48\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n  </displayList>\n  <Button mode=\"Check\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button82.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"52,49\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver,4,disabled,5,selectedDisabled\" selected=\"1\"/>\n  <displayList>\n    <image id=\"n4\" name=\"n4\" src=\"iehu7y\" xy=\"1,0\">\n      <gearDisplay controller=\"button\" pages=\"4,5\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"iehu7z\" xy=\"4,-1\">\n      <gearDisplay controller=\"button\" pages=\"5\"/>\n    </image>\n    <image id=\"n1\" name=\"n1\" src=\"rpmbq\" xy=\"0,0\" size=\"52,49\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0,1,2,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"rpmbp\" xy=\"3,-3\" size=\"58,48\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n  </displayList>\n  <Button mode=\"Check\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Button9.xml",
    "content": "<component size=\"159,52\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"1\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"rpmbs\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <gearLook controller=\"button\" pages=\"0,2\" values=\"1.00,0,0|0.00,0,0\" default=\"1.00,0,0\" tween=\"true\" ease=\"Quad.Out\" duration=\"0.5\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"rpmbr\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"rpmbt\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <gearLook controller=\"button\" pages=\"0,2\" values=\"0.00,0,0|1.00,0,0\" default=\"1.00,0,0\" tween=\"true\" ease=\"Quad.Out\" duration=\"0.5\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <text id=\"n5\" name=\"title\" xy=\"0,7\" size=\"159,45\" fontSize=\"18\" color=\"#dfb536\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" strokeColor=\"#000000\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Checkbox.xml",
    "content": "<component size=\"20,19\" idnum=\"6\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"rpmbc\" xy=\"0,2\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"rpmb7\" xy=\"0,2\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"rpmbb\" xy=\"0,2\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n    </image>\n    <image id=\"n4\" name=\"n4\" src=\"rpmba\" xy=\"0,2\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"3\"/>\n    </image>\n    <text id=\"n5\" name=\"title\" xy=\"13,1\" size=\"10,19\" fontSize=\"12\" autoSize=\"none\" demoText=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n  </displayList>\n  <Button mode=\"Check\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/CloseButton.xml",
    "content": "<component size=\"40,43\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"2\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"niii7c\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"niii7c\" xy=\"0,0\" aspect=\"true\" alpha=\"0.75\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"niii7c\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/ComboBox.xml",
    "content": "<component size=\"100,20\" extention=\"ComboBox\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"rt103u\" xy=\"0,0\" size=\"100,20\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"rt103v\" xy=\"0,0\" size=\"100,20\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"rt103w\" xy=\"0,0\" size=\"100,20\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <text id=\"n4\" name=\"title\" xy=\"2,2\" size=\"78,16\" fontSize=\"12\" color=\"#ffcc00\" autoSize=\"none\" demoText=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n    <image id=\"n5\" name=\"n5\" src=\"rt103x\" xy=\"83,2\"/>\n  </displayList>\n  <ComboBox dropdown=\"ui://9leh0eyfrt103y\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/ComboBoxItem.xml",
    "content": "<component size=\"100,19\" idnum=\"3\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <graph id=\"n2\" name=\"n2\" xy=\"0,0\" size=\"100,19\" type=\"rect\" lineSize=\"0\" lineColor=\"#00ff9966\" fillColor=\"#ff3399ff\">\n      <gearDisplay controller=\"button\" pages=\"1,2,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <text id=\"n1\" name=\"title\" xy=\"1,1\" size=\"100,17\" fontSize=\"12\" vAlign=\"middle\" autoSize=\"none\" singleLine=\"true\" demoText=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n      <gearColor controller=\"button\" pages=\"0,1,2,3\" values=\"-|#ffffff|#ffffff|#ffffff\" default=\"#000000\"/>\n    </text>\n  </displayList>\n  <Button mode=\"Radio\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/ComboBoxPopup.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"158,58\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"rt103z\" xy=\"0,0\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <list id=\"n1\" name=\"list\" xy=\"0,1\" size=\"157,56\" overflow=\"scroll\" scrollBarFlags=\"4\" margin=\"0,0,0,0\" defaultItem=\"ui://9leh0eyfrt1040\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Component1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"224,310\" overflow=\"hidden\">\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"es4130\" xy=\"0,0\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Component10.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"425,120\" overflow=\"scroll\" scroll=\"horizontal\" scrollBarMargin=\"0,0,100,0\">\n  <displayList>\n    <text id=\"n0\" name=\"n0\" xy=\"0,0\" size=\"914,93\" fontSize=\"14\" color=\"#cccccc\" leading=\"11\" autoSize=\"height\" text=\"三体人在利用魔法般的科技锁死了地球人的科学之后，庞大的宇宙舰队直扑太阳系，意欲清除地球文明。&#xA;面对前所未有的危局，经历过无数磨难的地球人组建起同样庞大的太空舰队，同时，利用三体人思维透明的致命缺陷，制订了神秘莫测的“面壁计划”，精选出四位“面壁者”。秘密展开对三体人的反击。&#xA;三体人自身虽然无法识破人类的诡谲计谋，却依靠由地球人中的背叛者挑选出的“破壁人”，与“面壁者”展开智慧博弈。[9] \"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Component11.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"90,23\" extention=\"ProgressBar\">\n  <displayList>\n    <image id=\"n0\" name=\"bar\" src=\"fjqr7k\" xy=\"0,0\"/>\n  </displayList>\n  <ProgressBar/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Component12.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"400,297\">\n  <displayList>\n    <image id=\"n9\" name=\"n9\" src=\"rt103z\" xy=\"0,0\" size=\"400,297\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n10\" name=\"n10\" src=\"rpmbh\" xy=\"67,117\"/>\n    <image id=\"n11\" name=\"n11\" src=\"rpmbh\" xy=\"188,117\"/>\n    <image id=\"n12\" name=\"n12\" src=\"rpmbh\" xy=\"300,117\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Component13.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"400,400\">\n  <displayList>\n    <graph id=\"n0\" name=\"n0\" xy=\"15,14\" size=\"150,150\" type=\"rect\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Component14.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"320,480\" mask=\"n28\">\n  <displayList>\n    <image id=\"n27\" name=\"n27\" src=\"es4130\" fileName=\"images/change.png\" xy=\"0,0\"/>\n    <graph id=\"n28\" name=\"n28\" xy=\"72,43\" size=\"167,171\" type=\"eclipse\" lineSize=\"0\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Component2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"341,151\" overflow=\"scroll\">\n  <displayList>\n    <text id=\"n0\" name=\"n0\" xy=\"0,0\" size=\"308,268\" fontSize=\"14\" color=\"#cccccc\" leading=\"11\" autoSize=\"height\" text=\"三体人在利用魔法般的科技锁死了地球人的科学之后，庞大的宇宙舰队直扑太阳系，意欲清除地球文明。&#xA;面对前所未有的危局，经历过无数磨难的地球人组建起同样庞大的太空舰队，同时，利用三体人思维透明的致命缺陷，制订了神秘莫测的“面壁计划”，精选出四位“面壁者”。秘密展开对三体人的反击。&#xA;三体人自身虽然无法识破人类的诡谲计谋，却依靠由地球人中的背叛者挑选出的“破壁人”，与“面壁者”展开智慧博弈。[9] \"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Component3.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"348,62\" extention=\"Label\">\n  <displayList>\n    <graph id=\"n2\" name=\"n2\" xy=\"0,0\" size=\"348,62\" type=\"rect\" fillColor=\"#ff003333\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <loader id=\"n0\" name=\"icon\" xy=\"6,5\" size=\"54,50\" align=\"center\" vAlign=\"middle\"/>\n    <text id=\"n1\" name=\"title\" xy=\"66,21\" size=\"274,20\" fontSize=\"16\" color=\"#ffffff\" autoSize=\"none\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </text>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Component4.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"640,890\">\n  <displayList/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Component5.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"250,250\">\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"rt103m\" xy=\"0,0\" size=\"250,250\"/>\n    <text id=\"n2\" name=\"n2\" xy=\"70,110\" size=\"109,30\" fontSize=\"26\" color=\"#ffffff\" strokeColor=\"#000000\" text=\"居中文字\"/>\n    <image id=\"n4\" name=\"n4\" src=\"rpmbx\" xy=\"199,213\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Component6.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"250,250\">\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"rt103m\" xy=\"0,0\" size=\"250,250\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <text id=\"n2\" name=\"n2\" xy=\"70,110\" size=\"109,30\" fontSize=\"26\" color=\"#ffffff\" strokeColor=\"#000000\" text=\"居中文字\">\n      <relation target=\"\" sidePair=\"center-center,middle-middle\"/>\n    </text>\n    <image id=\"n3\" name=\"n3\" src=\"rpmbx\" xy=\"198,212\">\n      <relation target=\"\" sidePair=\"right-right,bottom-bottom\"/>\n    </image>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Component7.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"225,310\" overflow=\"scroll\" scroll=\"both\">\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"es4130\" xy=\"0,0\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Component8.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"225,343\" overflow=\"scroll\" scroll=\"both\" margin=\"30,30,30,30\">\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"es4130\" xy=\"0,0\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Component9.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"341,151\" overflow=\"scroll\" scrollBarFlags=\"1\">\n  <displayList>\n    <text id=\"n0\" name=\"n0\" xy=\"0,0\" size=\"318,268\" fontSize=\"14\" color=\"#cccccc\" leading=\"11\" autoSize=\"height\" text=\"三体人在利用魔法般的科技锁死了地球人的科学之后，庞大的宇宙舰队直扑太阳系，意欲清除地球文明。&#xA;面对前所未有的危局，经历过无数磨难的地球人组建起同样庞大的太空舰队，同时，利用三体人思维透明的致命缺陷，制订了神秘莫测的“面壁计划”，精选出四位“面壁者”。秘密展开对三体人的反击。&#xA;三体人自身虽然无法识破人类的诡谲计谋，却依靠由地球人中的背叛者挑选出的“破壁人”，与“面壁者”展开智慧博弈。[9] \"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Dropdown.xml",
    "content": "<component size=\"132,40\" extention=\"ComboBox\">\n  <displayList>\n    <component id=\"n0\" name=\"button\" src=\"zd9g42\" xy=\"0,0\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </component>\n    <text id=\"n1\" name=\"title\" xy=\"5,8\" size=\"87,25\" fontSize=\"15\" color=\"#ffcc00\" align=\"center\" autoSize=\"none\" strokeColor=\"#000000\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </text>\n  </displayList>\n  <ComboBox dropdown=\"ui://9leh0eyfzd9g47\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Dropdown2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"100,100\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"zd9g48\" xy=\"0,0\" size=\"100,100\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <list id=\"n1\" name=\"list\" xy=\"3,3\" size=\"94,94\" overflow=\"scroll\" scrollBarFlags=\"4\" margin=\"0,0,0,0\" defaultItem=\"ui://9leh0eyfzd9g49\"/>\n  </displayList>\n  <relation target=\"n1\" sidePair=\"width-width,height-height\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/GridItem.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"505,35\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <graph id=\"n2\" name=\"n2\" xy=\"0,0\" size=\"505,33\" type=\"rect\" lineColor=\"#ffccffff\" fillColor=\"#0026498b\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <graph id=\"n3\" name=\"n3\" xy=\"0,0\" size=\"505,35\" type=\"rect\" lineColor=\"#ff7b98ac\" fillColor=\"#b548797e\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <text id=\"n0\" name=\"t0\" xy=\"1,3\" size=\"47,28\" fontSize=\"22\" color=\"#ffffff\" align=\"center\" autoSize=\"none\" singleLine=\"true\" text=\"1\"/>\n    <graph id=\"n4\" name=\"n4\" xy=\"0,34\" size=\"505,1\" type=\"rect\" lineSize=\"0\" fillColor=\"#ff325b62\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </graph>\n    <text id=\"n5\" name=\"t1\" xy=\"53,3\" size=\"229,28\" fontSize=\"22\" color=\"#ffffff\" align=\"center\" autoSize=\"none\" singleLine=\"true\" text=\"Name\"/>\n    <text id=\"n6\" name=\"t2\" xy=\"289,3\" size=\"94,28\" fontSize=\"22\" color=\"#ffffff\" align=\"center\" autoSize=\"none\" singleLine=\"true\" text=\"Fairy\"/>\n    <component id=\"n7\" name=\"star\" src=\"fjqr7j\" xy=\"402,5\">\n      <ProgressBar value=\"67\" max=\"100\"/>\n    </component>\n  </displayList>\n  <Button mode=\"Radio\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/GridItem2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"505,50\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <graph id=\"n2\" name=\"n2\" xy=\"0,0\" size=\"505,48\" type=\"rect\" lineColor=\"#ffccffff\" fillColor=\"#0026498b\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <graph id=\"n3\" name=\"n3\" xy=\"0,0\" size=\"505,50\" type=\"rect\" lineColor=\"#ff7b98ac\" fillColor=\"#b548797e\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <text id=\"n1\" name=\"t3\" xy=\"387,11\" size=\"115,28\" fontSize=\"22\" color=\"#ffffff\" align=\"center\" autoSize=\"none\" singleLine=\"true\" text=\"100000\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </text>\n    <graph id=\"n4\" name=\"n4\" xy=\"0,49\" size=\"505,1\" type=\"rect\" lineSize=\"0\" fillColor=\"#ff325b62\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </graph>\n    <text id=\"n5\" name=\"t1\" xy=\"62,11\" size=\"220,28\" fontSize=\"22\" color=\"#ffffff\" autoSize=\"none\" singleLine=\"true\" text=\"Name\"/>\n    <component id=\"n7\" name=\"cb\" src=\"rpmb16\" xy=\"1,0\">\n      <Button checked=\"true\"/>\n    </component>\n    <jta id=\"n8\" name=\"mc\" src=\"iwqq89\" xy=\"317,13\"/>\n  </displayList>\n  <Button mode=\"Radio\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/OnOffButton.xml",
    "content": "<component size=\"100,40\" overflow=\"hidden\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"1\"/>\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"rpmb8\" xy=\"-100,0\">\n      <gearDisplay controller=\"button\" pages=\"0,2\"/>\n      <gearXY controller=\"button\" pages=\"0,1,2,3\" values=\"-|-100,0|-|-100,0\" default=\"0,0\" tween=\"true\" ease=\"Quad.Out\"/>\n    </image>\n    <image id=\"n1\" name=\"n1\" src=\"rpmb9\" xy=\"0,0\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <gearXY controller=\"button\" pages=\"0,1,2,3\" values=\"-|0,0|-|0,0\" default=\"100,0\" tween=\"true\" ease=\"Quad.Out\"/>\n    </image>\n    <text id=\"n4\" name=\"title\" xy=\"0,0\" size=\"64,40\" fontSize=\"24\" color=\"#ffffff\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" text=\"\">\n      <gearXY controller=\"button\" pages=\"0,1,2,3\" values=\"37,0|0,0|37,0|0,0\" default=\"14,6\"/>\n    </text>\n  </displayList>\n  <Button mode=\"Check\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/ProgressBar.xml",
    "content": "<component size=\"145,12\" idnum=\"3\" extention=\"ProgressBar\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"t9fj51\" xy=\"0,0\" aspect=\"true\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </image>\n    <image id=\"n1\" name=\"bar\" src=\"t9fj52\" xy=\"2,3\" size=\"140,6\"/>\n  </displayList>\n  <ProgressBar/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/ProgressBar1.xml",
    "content": "<component size=\"227,30\" overflow=\"hidden\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"t9fj5a\" xy=\"0,0\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/ProgressBar2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"227,30\" overflow=\"hidden\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"t9fj5a\" xy=\"0,0\">\n      <relation target=\"\" sidePair=\"right-right\"/>\n    </image>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/ProgressBar3.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"277,32\" extention=\"ProgressBar\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"t9fj58\" xy=\"0,0\"/>\n    <component id=\"n2\" name=\"bar\" src=\"t9fj59\" xy=\"23,-1\"/>\n  </displayList>\n  <ProgressBar titleType=\"valueAndmax\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/ProgressBar4.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"277,32\" extention=\"ProgressBar\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"t9fj58\" xy=\"0,0\"/>\n    <component id=\"n2\" name=\"bar\" src=\"t9fj5h\" xy=\"23,-1\"/>\n  </displayList>\n  <ProgressBar titleType=\"valueAndmax\" reverse=\"true\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/ProgressBar5.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"577,53\" extention=\"ProgressBar\">\n  <displayList>\n    <image id=\"n1\" name=\"n0\" src=\"t9fj5c\" fileName=\"images/loading.png.jpg\" xy=\"53,17\" size=\"470,16\" grayed=\"true\"/>\n    <image id=\"n4\" name=\"bar\" src=\"t9fj5c\" fileName=\"images/loading.png.jpg\" xy=\"53,17\" size=\"470,16\"/>\n    <image id=\"n6\" name=\"n6\" src=\"t9fj5d\" fileName=\"images/huawen1_png.png\" xy=\"3,-4\"/>\n    <image id=\"n7\" name=\"n7\" src=\"t9fj5e\" fileName=\"images/huawen2_png.png\" xy=\"485,-4\"/>\n    <loader id=\"n8\" name=\"n8\" xy=\"455,-30\" size=\"100,100\" url=\"ui://9leh0eyft9fj5f\">\n      <relation target=\"n4\" sidePair=\"right-right\"/>\n    </loader>\n  </displayList>\n  <ProgressBar titleType=\"valueAndmax\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/ProgressBar6.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"105,21\" overflow=\"hidden\" extention=\"ProgressBar\" designImageAlpha=\"51\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"t9fj54\" xy=\"0,0\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </image>\n    <image id=\"n2\" name=\"bar\" src=\"t9fj55\" xy=\"13,5\" size=\"79,11\"/>\n    <image id=\"n3\" name=\"n3\" src=\"t9fj56\" xy=\"8,-2\">\n      <relation target=\"n2\" sidePair=\"right-right\"/>\n    </image>\n    <text id=\"n1\" name=\"title\" xy=\"15,3\" size=\"72,16\" fontSize=\"12\" color=\"#cccccc\" align=\"center\" vAlign=\"middle\" autoSize=\"height\" strokeColor=\"#000000\" singleLine=\"true\" text=\"1/1\">\n      <relation target=\"\" sidePair=\"width-width,center-center\"/>\n    </text>\n  </displayList>\n  <ProgressBar titleType=\"valueAndmax\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/RadioButton.xml",
    "content": "<component size=\"29,19\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"rpmb2\" xy=\"0,3\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"rpmb4\" xy=\"0,3\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"rpmb3\" xy=\"0,3\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n    </image>\n    <image id=\"n4\" name=\"n4\" src=\"rpmb5\" xy=\"0,3\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"3\"/>\n    </image>\n    <text id=\"n5\" name=\"title\" xy=\"13,1\" size=\"10,19\" fontSize=\"12\" autoSize=\"none\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n  </displayList>\n  <Button mode=\"Radio\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Slider1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"480,45\" extention=\"Slider\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"eut94v\" xy=\"0,0\"/>\n    <image id=\"n1\" name=\"bar\" src=\"eut94w\" xy=\"30,3\"/>\n    <component id=\"n2\" name=\"grip\" src=\"eut94x\" xy=\"425,-32\">\n      <relation target=\"n1\" sidePair=\"right-right\"/>\n    </component>\n    <text id=\"n3\" name=\"title\" xy=\"220,25\" size=\"40,16\" fontSize=\"12\" color=\"#ff9900\" strokeColor=\"#000000\" text=\"\"/>\n  </displayList>\n  <Slider/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Slider2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"361,23\" extention=\"Slider\">\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"srct85\" xy=\"0,0\" size=\"361,23\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"bar\" src=\"srct84\" xy=\"0,1\" size=\"362,21\"/>\n    <component id=\"n3\" name=\"grip\" src=\"srct86\" xy=\"328,-13\">\n      <relation target=\"n2\" sidePair=\"right-right\"/>\n    </component>\n  </displayList>\n  <Slider/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Slider2_grip.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"56,57\" extention=\"Button\">\n  <Button/>\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\"/>\n  <displayList>\n    <image id=\"n1\" src=\"srct83\" name=\"n1\" xy=\"0,0\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/SliderArrow_HZ.xml",
    "content": "<component size=\"10,19\" extention=\"Button\" idnum=\"3\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\"/>\n  <displayList>\n    <image id=\"n1\" src=\"suiz4m\" name=\"n1\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0,2\"/>\n      <relation target=\"\" sidePair=\"width,height\"/>\n    </image>\n    <image id=\"n2\" src=\"suiz4n\" name=\"n2\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width,height\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/SliderArrow_VT.xml",
    "content": "<component size=\"19,10\" extention=\"Button\" idnum=\"3\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\"/>\n  <displayList>\n    <image id=\"n1\" src=\"suiz4s\" name=\"n1\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0,2\"/>\n      <relation target=\"\" sidePair=\"width,height\"/>\n    </image>\n    <image id=\"n2\" src=\"suiz4t\" name=\"n2\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width,height\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Slider_HZ.xml",
    "content": "<component size=\"112,23\" idnum=\"3\" extention=\"Slider\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"suiz4j\" xy=\"0,0\" aspect=\"true\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </image>\n    <image id=\"n2\" name=\"bar\" src=\"suiz4k\" xy=\"5,9\" size=\"100,6\">\n      <relation target=\"n0\" sidePair=\"width-width\"/>\n    </image>\n    <component id=\"n1\" name=\"grip\" src=\"suiz4l\" xy=\"101,2\">\n      <relation target=\"n2\" sidePair=\"right-right\"/>\n    </component>\n  </displayList>\n  <Slider/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/Slider_VT.xml",
    "content": "<component size=\"23,112\" idnum=\"7\" extention=\"Slider\">\n  <displayList>\n    <image id=\"n5\" name=\"n5\" src=\"suiz4p\" xy=\"0,0\" locked=\"true\" aspect=\"true\">\n      <relation target=\"\" sidePair=\"height-height\"/>\n    </image>\n    <image id=\"n6\" name=\"bar_v\" src=\"suiz4q\" xy=\"8,7\" size=\"6,100\">\n      <relation target=\"\" sidePair=\"height-height\"/>\n    </image>\n    <component id=\"n1\" name=\"grip\" src=\"suiz4r\" xy=\"3,102\">\n      <relation target=\"n6\" sidePair=\"bottom-bottom\"/>\n    </component>\n  </displayList>\n  <Slider/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/WindowCloseButton.xml",
    "content": "<component size=\"19,19\" extention=\"Button\" idnum=\"4\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\"/>\n  <displayList>\n    <image id=\"n1\" src=\"rt103o\" name=\"n1\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width,height\"/>\n    </image>\n    <image id=\"n2\" src=\"rt103p\" name=\"n2\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width,height\"/>\n    </image>\n    <image id=\"n3\" src=\"rt103q\" name=\"n3\" xy=\"0,0\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width,height\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/WindowFrame.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"157,202\" extention=\"Label\" initName=\"frame\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"rt103m\" xy=\"0,0\" aspect=\"true\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <component id=\"n1\" name=\"closeButton\" src=\"rt103n\" xy=\"133,5\" aspect=\"true\">\n      <relation target=\"\" sidePair=\"right-right\"/>\n    </component>\n    <graph id=\"n3\" name=\"dragArea\" xy=\"6,4\" size=\"123,22\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </graph>\n    <text id=\"n2\" name=\"title\" xy=\"36,6\" size=\"83,18\" fontSize=\"12\" color=\"#ffffff\" align=\"center\" autoSize=\"none\" text=\"窗口标题\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </text>\n    <graph id=\"n4\" name=\"contentArea\" xy=\"4,27\" size=\"150,172\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/components/WindowFrameB.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"388,272\" extention=\"Label\">\n  <displayList>\n    <graph id=\"n0\" name=\"n0\" xy=\"0,0\" size=\"388,272\" type=\"rect\" lineSize=\"0\" fillColor=\"#ff003300\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <graph id=\"n3\" name=\"dragArea\" xy=\"4,7\" size=\"383,256\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <component id=\"n2\" name=\"closeButton\" src=\"niii7b\" xy=\"363,-15\">\n      <relation target=\"\" sidePair=\"right-right\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/font/BMFontTest.fnt",
    "content": "info face=\"ÃÔÄã¼ò¿¨ͨ\" size=32 bold=0 italic=0 charset=\"\" unicode=1 stretchH=100 smooth=1 aa=1 padding=0,0,0,0 spacing=1,1 outline=0\r\ncommon lineHeight=32 base=26 scaleW=256 scaleH=256 pages=1 packed=0 alphaChnl=1 redChnl=0 greenChnl=0 blueChnl=0\r\npage id=0 file=\"11_0.png\"\r\nchars count=15\r\nchar id=0    x=0     y=0     width=22    height=36    xoffset=0     yoffset=0     xadvance=22    page=0  chnl=15\r\nchar id=35   x=22    y=37    width=15    height=20    xoffset=0     yoffset=6     xadvance=14    page=0  chnl=15\r\nchar id=73   x=59    y=25    width=5     height=17    xoffset=0     yoffset=9     xadvance=5     page=0  chnl=15\r\nchar id=85   x=38    y=25    width=20    height=19    xoffset=0     yoffset=7     xadvance=20    page=0  chnl=15\r\nchar id=20307 x=23    y=0     width=24    height=24    xoffset=2     yoffset=4     xadvance=28    page=0  chnl=15\r\nchar id=20309 x=166   y=0     width=24    height=22    xoffset=1     yoffset=6     xadvance=28    page=0  chnl=15\r\nchar id=20351 x=48    y=0     width=23    height=24    xoffset=2     yoffset=5     xadvance=28    page=0  chnl=15\r\nchar id=20837 x=0     y=37    width=21    height=20    xoffset=3     yoffset=7     xadvance=28    page=0  chnl=15\r\nchar id=22120 x=191   y=0     width=21    height=22    xoffset=3     yoffset=6     xadvance=28    page=0  chnl=15\r\nchar id=22914 x=213   y=0     width=21    height=22    xoffset=3     yoffset=6     xadvance=28    page=0  chnl=15\r\nchar id=23383 x=96    y=0     width=21    height=24    xoffset=3     yoffset=4     xadvance=28    page=0  chnl=15\r\nchar id=23884 x=72    y=0     width=23    height=24    xoffset=2     yoffset=5     xadvance=28    page=0  chnl=15\r\nchar id=29992 x=235   y=0     width=19    height=21    xoffset=4     yoffset=6     xadvance=28    page=0  chnl=15\r\nchar id=32534 x=118   y=0     width=23    height=23    xoffset=2     yoffset=5     xadvance=28    page=0  chnl=15\r\nchar id=36753 x=142   y=0     width=23    height=23    xoffset=2     yoffset=5     xadvance=28    page=0  chnl=15\r\n"
  },
  {
    "path": "demo/UIProject/assets/Basics/font/HitNumber.fnt",
    "content": "info creator=UIBuilder\ncommon lineHeight=0\nchar id=48 img=duef6n xoffset=0 yoffset=0 xadvance=33\nchar id=49 img=duef6o xoffset=0 yoffset=0 xadvance=33\nchar id=50 img=duef6p xoffset=0 yoffset=0 xadvance=32\nchar id=51 img=duef6q xoffset=0 yoffset=0 xadvance=33\nchar id=52 img=duef6r xoffset=0 yoffset=0 xadvance=33\nchar id=53 img=duef6s xoffset=0 yoffset=0 xadvance=32\nchar id=54 img=duef6t xoffset=0 yoffset=0 xadvance=32\nchar id=55 img=duef6u xoffset=0 yoffset=0 xadvance=33\nchar id=56 img=duef6v xoffset=0 yoffset=0 xadvance=33\nchar id=57 img=duef6w xoffset=0 yoffset=0 xadvance=33\n"
  },
  {
    "path": "demo/UIProject/assets/Basics/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"9leh0eyf\">\n  <resources>\n    <image id=\"rpmb1\" name=\"VIP_png.png\" path=\"/images/\"/>\n    <image id=\"rpmb2\" name=\"a1_png.png\" path=\"/images/\"/>\n    <image id=\"rpmb3\" name=\"a2_png.png\" path=\"/images/\"/>\n    <image id=\"rpmb4\" name=\"a3_png.png\" path=\"/images/\"/>\n    <image id=\"rpmb5\" name=\"a4_png.png\" path=\"/images/\"/>\n    <image id=\"rpmb6\" name=\"angry_smile_png.png\" path=\"/images/\"/>\n    <image id=\"rpmb7\" name=\"b1.png.jpg\" path=\"/images/\"/>\n    <image id=\"rpmb8\" name=\"b12_png.png\" path=\"/images/\"/>\n    <image id=\"rpmb9\" name=\"b13_png.png\" path=\"/images/\"/>\n    <image id=\"rpmba\" name=\"b2.png.jpg\" path=\"/images/\"/>\n    <image id=\"rpmbb\" name=\"b3.png.jpg\" path=\"/images/\"/>\n    <image id=\"rpmbc\" name=\"b4.png.jpg\" path=\"/images/\"/>\n    <image id=\"rpmbd\" name=\"b5_png.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"12,7,61,14\"/>\n    <image id=\"rpmbe\" name=\"b6_png.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"9,5,66,16\"/>\n    <image id=\"rpmbf\" name=\"b7_png.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"8,7,66,14\"/>\n    <image id=\"rpmbg\" name=\"long_dead_png.png\" path=\"/images/\"/>\n    <image id=\"rpmbh\" name=\"plus_smile_png.png\" path=\"/images/\"/>\n    <image id=\"rpmbi\" name=\"b1.png\" path=\"/images/\"/>\n    <image id=\"rpmbj\" name=\"k3.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"16,9,32,6\"/>\n    <image id=\"rpmbk\" name=\"k4.png\" path=\"/images/\"/>\n    <image id=\"rpmbl\" name=\"k5.png\" path=\"/images/\"/>\n    <image id=\"rpmbm\" name=\"k6.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"16,11,32,7\"/>\n    <image id=\"rpmbn\" name=\"k8.png\" path=\"/images/\"/>\n    <image id=\"rpmbo\" name=\"k9.png\" path=\"/images/\"/>\n    <image id=\"rpmbp\" name=\"k10.png\" path=\"/images/\"/>\n    <image id=\"rpmbq\" name=\"k11.png\" path=\"/images/\"/>\n    <image id=\"rpmbr\" name=\"k12.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"40,19,80,18\"/>\n    <image id=\"rpmbs\" name=\"k14.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"40,13,80,26\"/>\n    <image id=\"rpmbt\" name=\"k13.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"40,13,80,26\"/>\n    <image id=\"rpmbu\" name=\"k18.png\" path=\"/images/\"/>\n    <image id=\"rpmbv\" name=\"k20.png\" path=\"/images/\"/>\n    <image id=\"rpmbw\" name=\"k25.png\" path=\"/images/\"/>\n    <image id=\"rpmbx\" name=\"k26.png\" path=\"/images/\"/>\n    <component id=\"rpmbz\" name=\"Button.xml\" path=\"/components/\"/>\n    <component id=\"rpmb10\" name=\"Button2.xml\" path=\"/components/\"/>\n    <component id=\"rpmb11\" name=\"Button3.xml\" path=\"/components/\"/>\n    <component id=\"rpmb12\" name=\"Button4.xml\" path=\"/components/\"/>\n    <component id=\"rpmb13\" name=\"Button5.xml\" path=\"/components/\"/>\n    <component id=\"rpmb14\" name=\"Button6.xml\" path=\"/components/\"/>\n    <component id=\"rpmb15\" name=\"Button7.xml\" path=\"/components/\"/>\n    <component id=\"rpmb16\" name=\"Button8.xml\" path=\"/components/\"/>\n    <component id=\"rpmb17\" name=\"Button9.xml\" path=\"/components/\"/>\n    <component id=\"rpmb18\" name=\"Checkbox.xml\" path=\"/components/\"/>\n    <component id=\"rpmb19\" name=\"OnOffButton.xml\" path=\"/components/\"/>\n    <component id=\"rpmb1a\" name=\"RadioButton.xml\" path=\"/components/\"/>\n    <component id=\"rpmb1b\" name=\"Demo_Button.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"rpmb1c\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"sner1h\" name=\"pic.png\" path=\"/images/\"/>\n    <component id=\"sner1i\" name=\"Demo_Image.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"hixt1j\" name=\"Button10.xml\" path=\"/components/\"/>\n    <image id=\"hixt1k\" name=\"b4.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"40,17,80,34\"/>\n    <image id=\"hixt1l\" name=\"b5.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"40,17,80,34\"/>\n    <component id=\"hixt1m\" name=\"Demo_Graph.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"hixt1n\" name=\"Demo_MovieClip.xml\" path=\"/\" exported=\"true\"/>\n    <movieclip id=\"hixt1v\" name=\"nlge1k.jta\" path=\"/images/\"/>\n    <component id=\"nz0z1z\" name=\"Demo_Text.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"nz0z20\" name=\"long_dead2_png.png\" path=\"/images/\" scale=\"tile\"/>\n    <image id=\"h5p722\" name=\"i256.png\" path=\"/images/\"/>\n    <image id=\"wa8u2q\" name=\"k27.png\" path=\"/images/\"/>\n    <font id=\"wa8u2r\" name=\"BMFontTest.fnt\" path=\"/font/\" exported=\"true\" texture=\"jb800\"/>\n    <image id=\"jb800\" name=\"BMFontTest_atlas.png\" path=\"/font/\"/>\n    <component id=\"wa8u2s\" name=\"Demo_Loader.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"wa8u2t\" name=\"r3.png\" path=\"/images/\" exported=\"true\"/>\n    <image id=\"wa8u2u\" name=\"r4.png\" path=\"/images/\" exported=\"true\"/>\n    <component id=\"wa8u2v\" name=\"Demo_Controller.xml\" path=\"/\" exported=\"true\"/>\n    <swf id=\"wa8u2w\" name=\"qtm01d.swf\" path=\"/images/\"/>\n    <component id=\"wa8u2x\" name=\"Demo_Relation.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"es412y\" name=\"Demo_Clip&amp;Scroll.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"es412z\" name=\"Component1.xml\" path=\"/components/\"/>\n    <image id=\"es4130\" name=\"change.png\" path=\"/images/\" scale9grid=\"71,125,142,250\"/>\n    <component id=\"smv731\" name=\"Component7.xml\" path=\"/components/\"/>\n    <component id=\"smv73f\" name=\"Component2.xml\" path=\"/components/\"/>\n    <component id=\"smv73g\" name=\"Component8.xml\" path=\"/components/\"/>\n    <component id=\"smv73h\" name=\"Component9.xml\" path=\"/components/\"/>\n    <component id=\"smv73i\" name=\"Component10.xml\" path=\"/components/\"/>\n    <component id=\"w42o3j\" name=\"Demo_Label.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"rt103l\" name=\"WindowFrame.xml\" path=\"/components/\"/>\n    <image id=\"rt103m\" name=\"6_png.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"40,40,80,142\"/>\n    <component id=\"rt103n\" name=\"WindowCloseButton.xml\" path=\"/components/\"/>\n    <image id=\"rt103o\" name=\"10_png.png\" path=\"/images/\"/>\n    <image id=\"rt103p\" name=\"9_png.png\" path=\"/images/\"/>\n    <image id=\"rt103q\" name=\"8_png.png\" path=\"/images/\"/>\n    <component id=\"rt103r\" name=\"Component3.xml\" path=\"/components/\"/>\n    <component id=\"rt103s\" name=\"Demo_ComboBox.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"rt103t\" name=\"ComboBox.xml\" path=\"/components/\"/>\n    <image id=\"rt103u\" name=\"c1_png.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"7,5,73,10\"/>\n    <image id=\"rt103v\" name=\"c3_png.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"11,5,71,10\"/>\n    <image id=\"rt103w\" name=\"c2_png.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"8,5,73,10\"/>\n    <image id=\"rt103x\" name=\"b7(2)_png.png\" path=\"/images/\"/>\n    <component id=\"rt103y\" name=\"ComboBoxPopup.xml\" path=\"/components/\"/>\n    <image id=\"rt103z\" name=\"p1_png.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"7,4,144,49\"/>\n    <component id=\"rt1040\" name=\"ComboBoxItem.xml\" path=\"/components/\"/>\n    <component id=\"zd9g41\" name=\"Dropdown.xml\" path=\"/components/\"/>\n    <component id=\"zd9g42\" name=\"Button15.xml\" path=\"/components/\"/>\n    <image id=\"zd9g43\" name=\"k30.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"33,10,57,20\"/>\n    <image id=\"zd9g44\" name=\"k28.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"33,10,55,20\"/>\n    <image id=\"zd9g45\" name=\"k31.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"33,10,55,20\"/>\n    <image id=\"zd9g46\" name=\"k29.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"33,10,53,20\"/>\n    <component id=\"zd9g47\" name=\"Dropdown2.xml\" path=\"/components/\"/>\n    <image id=\"zd9g48\" name=\"k32.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"26,11,52,22\"/>\n    <component id=\"zd9g49\" name=\"Button14.xml\" path=\"/components/\"/>\n    <image id=\"zd9g4a\" name=\"k23.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"26,10,52,20\"/>\n    <image id=\"zd9g4b\" name=\"k21.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"11,7,82,26\"/>\n    <image id=\"zd9g4c\" name=\"k24.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"26,10,52,20\"/>\n    <image id=\"zd9g4d\" name=\"k22.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"26,10,52,20\"/>\n    <component id=\"zd9g4e\" name=\"Demo_Slider.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"zd9g4f\" name=\"Demo_ProgressBar.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"zd9g4g\" name=\"Demo_List.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"suiz4i\" name=\"Slider_HZ.xml\" path=\"/components/\"/>\n    <image id=\"suiz4j\" name=\"p10_png.png\" path=\"/images/\"/>\n    <image id=\"suiz4k\" name=\"p11_png.png\" path=\"/images/\"/>\n    <component id=\"suiz4l\" name=\"SliderArrow_HZ.xml\" path=\"/components/\"/>\n    <image id=\"suiz4m\" name=\"p14_png.png\" path=\"/images/\"/>\n    <image id=\"suiz4n\" name=\"p15_png.png\" path=\"/images/\"/>\n    <component id=\"suiz4o\" name=\"Slider_VT.xml\" path=\"/components/\"/>\n    <image id=\"suiz4p\" name=\"p13_png.png\" path=\"/images/\"/>\n    <image id=\"suiz4q\" name=\"p12_png.png\" path=\"/images/\"/>\n    <component id=\"suiz4r\" name=\"SliderArrow_VT.xml\" path=\"/components/\"/>\n    <image id=\"suiz4s\" name=\"p8_png.png\" path=\"/images/\"/>\n    <image id=\"suiz4t\" name=\"p9_png.png\" path=\"/images/\"/>\n    <component id=\"eut94u\" name=\"Slider1.xml\" path=\"/components/\"/>\n    <image id=\"eut94v\" name=\"k33.png\" path=\"/images/\"/>\n    <image id=\"eut94w\" name=\"k34.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"41,4,342,5\"/>\n    <component id=\"eut94x\" name=\"Button13.xml\" path=\"/components/\"/>\n    <image id=\"eut94y\" name=\"b3.png\" path=\"/images/\"/>\n    <image id=\"eut94z\" name=\"b2.png\" path=\"/images/\"/>\n    <component id=\"t9fj50\" name=\"ProgressBar.xml\" path=\"/components/\"/>\n    <image id=\"t9fj51\" name=\"p2_png.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"10,4,121,4\"/>\n    <image id=\"t9fj52\" name=\"p3_png.png\" path=\"/images/\"/>\n    <component id=\"t9fj53\" name=\"ProgressBar6.xml\" path=\"/components/\"/>\n    <image id=\"t9fj54\" name=\"k17.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"27,9,54,2\"/>\n    <image id=\"t9fj55\" name=\"k16.jpg\" path=\"/images/\" scale=\"9grid\" scale9grid=\"8,5,16,2\"/>\n    <image id=\"t9fj56\" name=\"k7.png\" path=\"/images/\"/>\n    <component id=\"t9fj57\" name=\"ProgressBar3.xml\" path=\"/components/\"/>\n    <image id=\"t9fj58\" name=\"caiji.png\" path=\"/images/\"/>\n    <component id=\"t9fj59\" name=\"ProgressBar1.xml\" path=\"/components/\"/>\n    <image id=\"t9fj5a\" name=\"caiji2.png\" path=\"/images/\"/>\n    <component id=\"t9fj5b\" name=\"ProgressBar5.xml\" path=\"/components/\"/>\n    <image id=\"t9fj5c\" name=\"loading.png.jpg\" path=\"/images/\" duplicatePadding=\"true\"/>\n    <image id=\"t9fj5d\" name=\"huawen1_png.png\" path=\"/images/\"/>\n    <image id=\"t9fj5e\" name=\"huawen2_png.png\" path=\"/images/\"/>\n    <movieclip id=\"t9fj5f\" name=\"pet.jta\" path=\"/images/\"/>\n    <component id=\"t9fj5g\" name=\"ProgressBar4.xml\" path=\"/components/\"/>\n    <component id=\"t9fj5h\" name=\"ProgressBar2.xml\" path=\"/components/\"/>\n    <component id=\"i3s65i\" name=\"ScrollBar_HZ.xml\" path=\"/scrollbars/\" exported=\"true\"/>\n    <image id=\"i3s65j\" name=\"s10.png.jpg\" path=\"/images/\" duplicatePadding=\"true\"/>\n    <component id=\"i3s65k\" name=\"ScrollUpButton.xml\" path=\"/scrollbars/\"/>\n    <image id=\"i3s65l\" name=\"s6.png.jpg\" path=\"/images/\" duplicatePadding=\"true\"/>\n    <image id=\"i3s65m\" name=\"s4.png.jpg\" path=\"/images/\" duplicatePadding=\"true\"/>\n    <image id=\"i3s65n\" name=\"s5.png.jpg\" path=\"/images/\" duplicatePadding=\"true\"/>\n    <component id=\"i3s65o\" name=\"ScrollDownButton.xml\" path=\"/scrollbars/\"/>\n    <image id=\"i3s65p\" name=\"s9.png.jpg\" path=\"/images/\" duplicatePadding=\"true\"/>\n    <image id=\"i3s65q\" name=\"s7.png.jpg\" path=\"/images/\" duplicatePadding=\"true\"/>\n    <image id=\"i3s65r\" name=\"s8.png.jpg\" path=\"/images/\" duplicatePadding=\"true\"/>\n    <component id=\"i3s65s\" name=\"GripButton_HZ.xml\" path=\"/scrollbars/\"/>\n    <image id=\"i3s65t\" name=\"s1.png.jpg\" path=\"/images/\" duplicatePadding=\"true\"/>\n    <image id=\"i3s65u\" name=\"s2.png.jpg\" path=\"/images/\" duplicatePadding=\"true\"/>\n    <image id=\"i3s65v\" name=\"s3.png.jpg\" path=\"/images/\" duplicatePadding=\"true\"/>\n    <component id=\"i3s65w\" name=\"ScrollBar_VT.xml\" path=\"/scrollbars/\" exported=\"true\"/>\n    <component id=\"i3s65x\" name=\"GripButton_VT.xml\" path=\"/scrollbars/\"/>\n    <component id=\"kpev60\" name=\"BagGridSub.xml\" path=\"/components/\"/>\n    <image id=\"kpev61\" name=\"k0.png\" path=\"/images/\"/>\n    <image id=\"kpev62\" name=\"k2.png\" path=\"/images/\"/>\n    <image id=\"kpev63\" name=\"k1.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"17,16,74,73\"/>\n    <image id=\"kpev64\" name=\"k19.png\" path=\"/images/\"/>\n    <font id=\"duef6m\" name=\"HitNumber.fnt\" path=\"/font/\" exported=\"true\"/>\n    <image id=\"duef6n\" name=\"h0.png\" path=\"/images/\"/>\n    <image id=\"duef6o\" name=\"h1.png\" path=\"/images/\"/>\n    <image id=\"duef6p\" name=\"h2.png\" path=\"/images/\"/>\n    <image id=\"duef6q\" name=\"h3.png\" path=\"/images/\"/>\n    <image id=\"duef6r\" name=\"h4.png\" path=\"/images/\"/>\n    <image id=\"duef6s\" name=\"h5.png\" path=\"/images/\"/>\n    <image id=\"duef6t\" name=\"h6.png\" path=\"/images/\"/>\n    <image id=\"duef6u\" name=\"h7.png\" path=\"/images/\"/>\n    <image id=\"duef6v\" name=\"h8.png\" path=\"/images/\"/>\n    <image id=\"duef6w\" name=\"h9.png\" path=\"/images/\"/>\n    <component id=\"l6f46x\" name=\"PopupMenu.xml\" path=\"/popupmenu/\" exported=\"true\"/>\n    <image id=\"l6f46y\" name=\"p16_png.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"7,4,144,49\"/>\n    <component id=\"l6f46z\" name=\"PopupMenuItem.xml\" path=\"/popupmenu/\"/>\n    <image id=\"l6f470\" name=\"a8_png.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"8,5,70,10\"/>\n    <image id=\"l6f471\" name=\"VtSeperator.jpg\" path=\"/images/\"/>\n    <image id=\"l6f472\" name=\"a18_png.png\" path=\"/images/\"/>\n    <component id=\"l6f473\" name=\"WindowA.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"f2ax74\" name=\"Component4.xml\" path=\"/components/\"/>\n    <component id=\"gx2b76\" name=\"Demo_Popup.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"gx2b77\" name=\"Demo_Window.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"gx2b78\" name=\"Demo_Drag&amp;Drop.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"gx2b79\" name=\"BagGridSub2.xml\" path=\"/components/\"/>\n    <component id=\"796x7a\" name=\"WindowB.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"niii7b\" name=\"CloseButton.xml\" path=\"/components/\"/>\n    <image id=\"niii7c\" name=\"close_png.png\" path=\"/images/\"/>\n    <component id=\"niii7d\" name=\"WindowFrameB.xml\" path=\"/components/\"/>\n    <component id=\"poiq7e\" name=\"Button1.xml\" path=\"/components/\"/>\n    <component id=\"t24n7f\" name=\"Demo_Component.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"t24n7g\" name=\"Component5.xml\" path=\"/components/\"/>\n    <component id=\"qa477h\" name=\"Component6.xml\" path=\"/components/\"/>\n    <component id=\"dyz47i\" name=\"Button52.xml\" path=\"/components/\"/>\n    <component id=\"fjqr7j\" name=\"Component11.xml\" path=\"/components/\"/>\n    <image id=\"fjqr7k\" name=\"start.png\" path=\"/images/\" scale=\"tile\"/>\n    <component id=\"c2z47l\" name=\"Demo_Grid.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"a7vt7m\" name=\"grid_header_png.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"50,5,100,10\"/>\n    <component id=\"a7vt7n\" name=\"GridItem.xml\" path=\"/components/\"/>\n    <component id=\"atih7o\" name=\"GridItem2.xml\" path=\"/components/\"/>\n    <component id=\"mulj7p\" name=\"Component12.xml\" path=\"/components/\" exported=\"true\"/>\n    <component id=\"fou97q\" name=\"Demo_Depth.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"fou97r\" name=\"Component13.xml\" path=\"/components/\"/>\n    <component id=\"gojg7s\" name=\"Button16.xml\" path=\"/components/\"/>\n    <image id=\"gojg7t\" name=\"22.png\" path=\"/images/\"/>\n    <sound id=\"gojg7u\" name=\"tabswitch.wav\" path=\"/sound/\" exported=\"true\"/>\n    <sound id=\"o4lt7w\" name=\"click.wav\" path=\"/sound/\" exported=\"true\"/>\n    <component id=\"iehu7x\" name=\"Button82.xml\" path=\"/components/\"/>\n    <image id=\"iehu7y\" name=\"k36.png\" path=\"/images/\"/>\n    <image id=\"iehu7z\" name=\"k35.png\" path=\"/images/\"/>\n    <image id=\"gzpr80\" name=\"Shape 1 copy 4.png\" path=\"/images/\"/>\n    <component id=\"gzpr81\" name=\"CircleProgress.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"gxip82\" name=\"Component14.xml\" path=\"/components/\"/>\n    <image id=\"srct83\" name=\"back btn.png\" path=\"/images/\"/>\n    <image id=\"srct84\" name=\"full bar.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"15,6,109,12\"/>\n    <image id=\"srct85\" name=\"background.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"24,6,319,13\"/>\n    <component id=\"srct86\" name=\"Slider2_grip.xml\" path=\"/components/\"/>\n    <component id=\"srct87\" name=\"Slider2.xml\" path=\"/components/\"/>\n    <movieclip id=\"iwqq89\" name=\"gz.jta\" path=\"/images/\"/>\n    <image id=\"s9ng8a\" name=\"radial.png\" path=\"/images/\" scale=\"\"/>\n  </resources>\n  <publish name=\"Basics\">\n    <atlas name=\"Default\" index=\"0\"/>\n  </publish>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/Basics/popupmenu/PopupMenu.xml",
    "content": "<component size=\"160,60\" idnum=\"2\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"l6f46y\" xy=\"0,0\" aspect=\"true\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <list id=\"n1\" name=\"list\" xy=\"1,1\" size=\"156,56\" defaultItem=\"ui://9leh0eyfl6f46z\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/popupmenu/PopupMenuItem.xml",
    "content": "<component size=\"80,22\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"2\"/>\n  <controller name=\"checked\" pages=\"0,,1,,2,\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n14\" name=\"n14\" src=\"l6f470\" xy=\"0,0\" size=\"80,22\">\n      <gearDisplay controller=\"button\" pages=\"1,2,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n6\" name=\"n6\" src=\"l6f471\" xy=\"18,0\" aspect=\"true\">\n      <relation target=\"\" sidePair=\"height-height\"/>\n    </image>\n    <text id=\"n1\" name=\"title\" xy=\"22,3\" size=\"50,16\" fontSize=\"12\" autoSize=\"none\" singleLine=\"true\" demoText=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n    <loader id=\"n3\" name=\"icon\" xy=\"1,1\" size=\"16,20\" align=\"center\" vAlign=\"middle\"/>\n    <image id=\"n13\" name=\"n13\" src=\"l6f472\" xy=\"3,7\" aspect=\"true\">\n      <gearDisplay controller=\"checked\" pages=\"2\"/>\n    </image>\n  </displayList>\n  <Button mode=\"Radio\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/scrollbars/GripButton_HZ.xml",
    "content": "<component size=\"20,17\" idnum=\"5\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"i3s65t\" xy=\"0,4\" size=\"20,9\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"i3s65u\" xy=\"0,4\" size=\"20,9\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"i3s65v\" xy=\"0,4\" size=\"20,9\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/scrollbars/GripButton_VT.xml",
    "content": "<component size=\"17,20\" idnum=\"5\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"i3s65t\" xy=\"4,0\" size=\"9,20\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"i3s65u\" xy=\"4,0\" size=\"9,20\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"i3s65v\" xy=\"4,0\" size=\"9,20\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/scrollbars/ScrollBar_HZ.xml",
    "content": "<component size=\"200,17\" idnum=\"5\" extention=\"ScrollBar\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"i3s65j\" xy=\"0,0\" size=\"200,17\" locked=\"true\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </image>\n    <graph id=\"n5\" name=\"bar\" xy=\"20,0\" size=\"160,17\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </graph>\n    <component id=\"n2\" name=\"arrow1\" src=\"i3s65k\" xy=\"0,17\" rotation=\"-90\"/>\n    <component id=\"n3\" name=\"arrow2\" src=\"i3s65o\" xy=\"180,17\" rotation=\"-90\">\n      <relation target=\"\" sidePair=\"right-right\"/>\n    </component>\n    <component id=\"n4\" name=\"grip\" src=\"i3s65s\" xy=\"36,0\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/scrollbars/ScrollBar_VT.xml",
    "content": "<component size=\"17,200\" idnum=\"6\" extention=\"ScrollBar\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"i3s65j\" xy=\"0,0\" size=\"17,200\" locked=\"true\">\n      <relation target=\"\" sidePair=\"height-height\"/>\n    </image>\n    <component id=\"n1\" name=\"arrow1\" src=\"i3s65k\" xy=\"0,0\"/>\n    <component id=\"n2\" name=\"arrow2\" src=\"i3s65o\" xy=\"0,180\">\n      <relation target=\"\" sidePair=\"bottom-bottom\"/>\n    </component>\n    <graph id=\"n5\" name=\"bar\" xy=\"0,20\" size=\"17,160\">\n      <relation target=\"\" sidePair=\"height-height\"/>\n    </graph>\n    <component id=\"n4\" name=\"grip\" src=\"i3s65x\" xy=\"0,33\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/scrollbars/ScrollDownButton.xml",
    "content": "<component size=\"17,20\" idnum=\"4\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"i3s65p\" xy=\"3,6\" size=\"11,7\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"i3s65q\" xy=\"3,6\" size=\"11,7\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"i3s65r\" xy=\"3,6\" size=\"11,7\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Basics/scrollbars/ScrollUpButton.xml",
    "content": "<component size=\"17,20\" idnum=\"5\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"i3s65l\" xy=\"3,6\" size=\"11,7\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"i3s65m\" xy=\"3,6\" size=\"11,7\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"i3s65n\" xy=\"3,6\" size=\"11,7\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Chat/Button.xml",
    "content": "<component size=\"163,69\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n5\" name=\"n5\" src=\"fymi1c\" xy=\"-5,-2\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n1\" name=\"n1\" src=\"fymi1d\" xy=\"-3,-1\" size=\"169,72\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0,2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <loader id=\"n4\" name=\"icon\" xy=\"0,4\" size=\"163,61\" align=\"center\" vAlign=\"middle\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </loader>\n    <text id=\"n3\" name=\"title\" xy=\"0,3\" size=\"163,63\" fontSize=\"22\" color=\"#ffffff\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" bold=\"true\" strokeColor=\"#003c49\" demoText=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Chat/Button2.xml",
    "content": "<component size=\"84,84\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"3\"/>\n  <displayList>\n    <image id=\"n3\" name=\"n3\" src=\"fymi1a\" xy=\"9,9\" size=\"65,65\">\n      <gearXY controller=\"button\" pages=\"0,1,2,3\" values=\"-|9,9|-|9,9\" default=\"6,6\"/>\n      <gearSize controller=\"button\" pages=\"0,1,2,3\" values=\"-|65,65|-|65,65\" default=\"71,71\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Chat/EmojiSelectUI.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"538,168\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"fymi17\" fileName=\"images/3.png\" xy=\"0,0\" size=\"538,168\"/>\n    <list id=\"n1\" name=\"list\" xy=\"10,13\" size=\"520,146\" layout=\"flow_hz\" lineGap=\"15\" colGap=\"15\" defaultItem=\"ui://y768eypaiy2u1n\">\n      <item title=\"88\" icon=\"ui://y768eypam2by3b\"/>\n      <item title=\"am\" icon=\"ui://y768eypam2by3c\"/>\n      <item title=\"bs\" icon=\"ui://y768eypam2by3d\"/>\n      <item title=\"bz\" icon=\"ui://y768eypam2by3e\"/>\n      <item title=\"ch\" icon=\"ui://y768eypam2by3f\"/>\n      <item title=\"cool\" icon=\"ui://y768eypam2by3g\"/>\n      <item title=\"dhq\" icon=\"ui://y768eypam2by3h\"/>\n      <item title=\"dn\" icon=\"ui://y768eypam2by3i\"/>\n      <item title=\"fd\" icon=\"ui://y768eypam2by3j\"/>\n      <item title=\"gz\" icon=\"ui://y768eypam2by3k\"/>\n      <item title=\"han\" icon=\"ui://y768eypam2by3l\"/>\n      <item title=\"hx\" icon=\"ui://y768eypam2by3m\"/>\n      <item title=\"hxiao\" icon=\"ui://y768eypam2by3n\"/>\n      <item title=\"hxiu\" icon=\"ui://y768eypam2by3o\"/>\n    </list>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Chat/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\">\n  <displayList>\n    <image id=\"n5\" name=\"n5\" src=\"fymi17\" fileName=\"images/3.png\" xy=\"90,37\" size=\"936,405\"/>\n    <list id=\"n10\" name=\"list\" xy=\"104,49\" size=\"910,376\" overflow=\"scroll\" scrollBarFlags=\"4\" scrollBar=\"auto\" scrollBarRes=\"ui://y768eypakfcb1e,\" defaultItem=\"ui://y768eypakfcb1j\" autoItemSize=\"false\">\n      <item url=\"ui://y768eypakfcb1h\"/>\n      <item/>\n    </list>\n    <image id=\"n6\" name=\"n6\" src=\"fymi18\" fileName=\"images/9.png\" xy=\"93,467\" size=\"660,59\" group=\"n11\"/>\n    <text id=\"n7\" name=\"input1\" xy=\"104,472\" size=\"637,48\" group=\"n11\" input=\"true\" fontSize=\"26\" vAlign=\"middle\" autoSize=\"none\" singleLine=\"true\" text=\"\"/>\n    <component id=\"n8\" name=\"btnSend1\" src=\"fymi1b\" fileName=\"Button.xml\" xy=\"869,460\" group=\"n11\">\n      <Button title=\"Send\"/>\n    </component>\n    <component id=\"n9\" name=\"btnEmoji1\" src=\"fymi19\" fileName=\"Button2.xml\" xy=\"771,456\" group=\"n11\"/>\n    <group id=\"n11\" name=\"n11\" xy=\"93,456\" size=\"939,84\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Chat/ScrollBar_VT.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"2,376\" extention=\"ScrollBar\">\n  <displayList>\n    <graph id=\"n5\" name=\"bar\" xy=\"-7,0\" size=\"9,376\">\n      <relation target=\"\" sidePair=\"height-height\"/>\n    </graph>\n    <image id=\"n8\" name=\"grip\" src=\"kfcb1g\" xy=\"-7,0\" alpha=\"0.34\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Chat/chatLeft.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"900,94\" extention=\"Button\">\n  <displayList>\n    <image id=\"n7\" name=\"n7\" src=\"fymi18\" fileName=\"images/9.png\" xy=\"1,2\" size=\"86,86\"/>\n    <image id=\"n0\" name=\"n0\" src=\"kfcb1i\" fileName=\"images/6.png\" xy=\"88,33\" size=\"700,55\">\n      <relation target=\"n3\" sidePair=\"height-height,width-width\"/>\n    </image>\n    <loader id=\"n1\" name=\"icon\" xy=\"4,5\" size=\"80,80\" align=\"center\" vAlign=\"middle\" fill=\"scale\"/>\n    <richtext id=\"n3\" name=\"msg\" xy=\"112,46\" size=\"663,28\" fontSize=\"24\" leading=\"5\" autoSize=\"height\" text=\"\"/>\n    <text id=\"n8\" name=\"name\" xy=\"94,4\" size=\"40,26\" fontSize=\"22\" singleLine=\"true\" text=\"\"/>\n  </displayList>\n  <Button/>\n  <relation target=\"n0\" sidePair=\"height-height\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Chat/chatRight.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"900,90\" extention=\"Button\">\n  <displayList>\n    <image id=\"n13\" name=\"n13\" src=\"fymi18\" fileName=\"images/9.png\" xy=\"811,1\" size=\"86,86\"/>\n    <image id=\"n9\" name=\"n9\" src=\"kfcb1k\" fileName=\"images/7.png\" xy=\"111,5\" size=\"700,55\">\n      <relation target=\"n11\" sidePair=\"height-height,width-width\"/>\n      <relation target=\"\" sidePair=\"right-right\"/>\n    </image>\n    <loader id=\"n10\" name=\"icon\" xy=\"814,5\" size=\"80,80\" align=\"center\" vAlign=\"middle\" fill=\"scale\"/>\n    <richtext id=\"n11\" name=\"msg\" xy=\"122,18\" size=\"663,28\" fontSize=\"24\" leading=\"5\" autoSize=\"height\" text=\"\">\n      <relation target=\"\" sidePair=\"right-right\"/>\n    </richtext>\n  </displayList>\n  <Button/>\n  <relation target=\"n9\" sidePair=\"height-height\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Chat/faceSub.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"60,60\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"1\"/>\n  <displayList>\n    <graph id=\"n3\" name=\"n3\" xy=\"0,0\" size=\"60,60\" type=\"rect\" lineColor=\"#ff999999\" fillColor=\"#5effffff\"/>\n    <loader id=\"n2\" name=\"icon\" xy=\"4,4\" size=\"52,52\" align=\"center\" vAlign=\"middle\" fill=\"scale\"/>\n  </displayList>\n  <Button mode=\"Radio\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Chat/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"y768eypa\" jpegQuality=\"80\" compressPNG=\"true\">\n  <resources>\n    <component id=\"fvaib\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"fymi17\" name=\"3.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"10,15,28,32\"/>\n    <image id=\"fymi18\" name=\"9.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"12,10,24,20\"/>\n    <component id=\"fymi19\" name=\"Button2.xml\" path=\"/\"/>\n    <image id=\"fymi1a\" name=\"8.png\" path=\"/images/\"/>\n    <component id=\"fymi1b\" name=\"Button.xml\" path=\"/\"/>\n    <image id=\"fymi1c\" name=\"0.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"40,17,80,34\"/>\n    <image id=\"fymi1d\" name=\"1.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"40,17,80,34\"/>\n    <component id=\"kfcb1e\" name=\"ScrollBar_VT.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"kfcb1f\" name=\"5.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"3,9,2,360\"/>\n    <image id=\"kfcb1g\" name=\"4.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"2,6,4,193\"/>\n    <component id=\"kfcb1h\" name=\"chatLeft.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"kfcb1i\" name=\"6.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"27,21,334,18\"/>\n    <component id=\"kfcb1j\" name=\"chatRight.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"kfcb1k\" name=\"7.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"19,23,229,37\"/>\n    <image id=\"l7d51l\" name=\"r1.png\" path=\"/images/\" exported=\"true\"/>\n    <image id=\"l7d51m\" name=\"r0.png\" path=\"/images/\" exported=\"true\"/>\n    <component id=\"iy2u1n\" name=\"faceSub.xml\" path=\"/\"/>\n    <image id=\"iy2u1o\" name=\"2.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"17,16,74,73\"/>\n    <image id=\"mwdy25\" name=\"1f626.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy26\" name=\"1f625.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy27\" name=\"1f624.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy28\" name=\"1f623.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy29\" name=\"1f622.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2a\" name=\"1f621.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2b\" name=\"1f620.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2c\" name=\"1f619.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2d\" name=\"1f618.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2e\" name=\"1f617.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2f\" name=\"1f616.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2g\" name=\"1f615.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2h\" name=\"1f614.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2i\" name=\"1f613.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2j\" name=\"1f612.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2k\" name=\"1f611.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2l\" name=\"1f610.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2m\" name=\"1f609.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2n\" name=\"1f608.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2o\" name=\"1f607.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2p\" name=\"1f606.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2q\" name=\"1f605.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2r\" name=\"1f604.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2s\" name=\"1f603.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2t\" name=\"1f602.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2u\" name=\"1f601.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2v\" name=\"1f600.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2w\" name=\"1f637.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2x\" name=\"1f636.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2y\" name=\"1f635.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy2z\" name=\"1f634.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy30\" name=\"1f633.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy31\" name=\"1f632.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy32\" name=\"1f631.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy33\" name=\"1f630.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy34\" name=\"1f629.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy35\" name=\"1f628.png\" path=\"/emoji/\" exported=\"true\"/>\n    <image id=\"mwdy36\" name=\"1f627.png\" path=\"/emoji/\" exported=\"true\"/>\n    <component id=\"m2by3a\" name=\"EmojiSelectUI.xml\" path=\"/\" exported=\"true\"/>\n    <movieclip id=\"m2by3b\" name=\"88.jta\" path=\"/emoji/\" exported=\"true\"/>\n    <movieclip id=\"m2by3c\" name=\"am.jta\" path=\"/emoji/\" exported=\"true\"/>\n    <movieclip id=\"m2by3d\" name=\"bs.jta\" path=\"/emoji/\" exported=\"true\"/>\n    <movieclip id=\"m2by3e\" name=\"bz.jta\" path=\"/emoji/\" exported=\"true\"/>\n    <movieclip id=\"m2by3f\" name=\"ch.jta\" path=\"/emoji/\" exported=\"true\"/>\n    <movieclip id=\"m2by3g\" name=\"cool.jta\" path=\"/emoji/\" exported=\"true\"/>\n    <movieclip id=\"m2by3h\" name=\"dhq.jta\" path=\"/emoji/\" exported=\"true\"/>\n    <movieclip id=\"m2by3i\" name=\"dn.jta\" path=\"/emoji/\" exported=\"true\"/>\n    <movieclip id=\"m2by3j\" name=\"fd.jta\" path=\"/emoji/\" exported=\"true\"/>\n    <movieclip id=\"m2by3k\" name=\"gz.jta\" path=\"/emoji/\" exported=\"true\"/>\n    <movieclip id=\"m2by3l\" name=\"han.jta\" path=\"/emoji/\" exported=\"true\"/>\n    <movieclip id=\"m2by3m\" name=\"hx.jta\" path=\"/emoji/\" exported=\"true\"/>\n    <movieclip id=\"m2by3n\" name=\"hxiao.jta\" path=\"/emoji/\" exported=\"true\"/>\n    <movieclip id=\"m2by3o\" name=\"hxiu.jta\" path=\"/emoji/\" exported=\"true\"/>\n  </resources>\n  <publish name=\"Chat\">\n    <atlas name=\"默认\" index=\"0\"/>\n  </publish>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/Cooldown/Button1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"60,60\" extention=\"ProgressBar\">\n  <displayList>\n    <image id=\"n5\" name=\"n5\" src=\"ltiqo\" fileName=\"images/14.png\" xy=\"0,0\" size=\"60,60\" visible=\"false\"/>\n    <loader id=\"n6\" name=\"icon\" xy=\"0,0\" size=\"60,60\" fill=\"scaleFree\"/>\n    <image id=\"n9\" name=\"n9\" src=\"ltiqo\" fileName=\"images/14.png\" xy=\"0,0\" size=\"60,60\"/>\n    <image id=\"n10\" name=\"bar\" src=\"uo8117\" fileName=\"images/mask0.png\" xy=\"3,3\" size=\"54,54\" alpha=\"0.6\" fillMethod=\"radial360\" fillClockwise=\"false\"/>\n  </displayList>\n  <ProgressBar/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Cooldown/Button2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"100,100\" extention=\"ProgressBar\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n5\" name=\"n5\" src=\"p3yaq\" fileName=\"images/11.png\" xy=\"-13,-13\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n    </image>\n    <image id=\"n6\" name=\"n6\" src=\"p3yar\" fileName=\"images/13.png\" xy=\"-13,-13\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n    </image>\n    <loader id=\"n2\" name=\"icon\" xy=\"9,10\" size=\"80,80\" fill=\"scaleFree\"/>\n    <image id=\"n0\" name=\"btn\" src=\"p3yau\" fileName=\"images/12.png\" xy=\"9,9\"/>\n    <text id=\"n3\" name=\"title\" xy=\"8,23\" size=\"81,60\" font=\"ui://y768eypfp3yav\" fontSize=\"24\" align=\"center\" autoSize=\"none\" singleLine=\"true\" text=\"5\"/>\n    <image id=\"n7\" name=\"bar\" src=\"uo8118\" fileName=\"images/mask1.png\" xy=\"10,11\" alpha=\"0.6\" fillMethod=\"radial360\" fillClockwise=\"false\"/>\n  </displayList>\n  <ProgressBar titleType=\"value\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Cooldown/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\">\n  <displayList>\n    <component id=\"n2\" name=\"b0\" src=\"ltiql\" fileName=\"Button1.xml\" xy=\"308,287\" size=\"60,60\">\n      <ProgressBar value=\"63\" max=\"100\"/>\n    </component>\n    <component id=\"n4\" name=\"b1\" src=\"p3yap\" fileName=\"Button2.xml\" xy=\"452,264\">\n      <ProgressBar value=\"9\" max=\"10\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Cooldown/cdtime.fnt",
    "content": "info creator=UIBuilder\ncommon lineHeight=0\nchar id=48 img=p3yaw xoffset=0 yoffset=0 xadvance=35\nchar id=49 img=p3yax xoffset=0 yoffset=0 xadvance=35\nchar id=50 img=p3yay xoffset=0 yoffset=0 xadvance=35\nchar id=51 img=p3yaz xoffset=0 yoffset=0 xadvance=35\nchar id=52 img=p3ya10 xoffset=0 yoffset=0 xadvance=35\nchar id=53 img=p3ya11 xoffset=0 yoffset=0 xadvance=35\nchar id=54 img=p3ya12 xoffset=0 yoffset=0 xadvance=35\nchar id=55 img=p3ya13 xoffset=0 yoffset=0 xadvance=35\nchar id=56 img=p3ya14 xoffset=0 yoffset=0 xadvance=35\nchar id=57 img=p3ya15 xoffset=0 yoffset=0 xadvance=35\n"
  },
  {
    "path": "demo/UIProject/assets/Cooldown/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"y768eypf\" jpegQuality=\"80\" compressPNG=\"true\">\n  <resources>\n    <component id=\"fvaib\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"ltiql\" name=\"Button1.xml\" path=\"/\"/>\n    <image id=\"ltiqn\" name=\"15.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"10,10,20,20\"/>\n    <image id=\"ltiqo\" name=\"14.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"10,10,20,20\"/>\n    <component id=\"p3yap\" name=\"Button2.xml\" path=\"/\"/>\n    <image id=\"p3yaq\" name=\"11.png\" path=\"/images/\"/>\n    <image id=\"p3yar\" name=\"13.png\" path=\"/images/\"/>\n    <image id=\"p3yau\" name=\"12.png\" path=\"/images/\"/>\n    <font id=\"p3yav\" name=\"cdtime.fnt\" path=\"/\" exported=\"true\"/>\n    <image id=\"p3yaw\" name=\"0(4)_png.png\" path=\"/images/\"/>\n    <image id=\"p3yax\" name=\"1(4)_png.png\" path=\"/images/\"/>\n    <image id=\"p3yay\" name=\"2(4)_png.png\" path=\"/images/\"/>\n    <image id=\"p3yaz\" name=\"3(4)_png.png\" path=\"/images/\"/>\n    <image id=\"p3ya10\" name=\"4(4)_png.png\" path=\"/images/\"/>\n    <image id=\"p3ya11\" name=\"5(4)_png.png\" path=\"/images/\"/>\n    <image id=\"p3ya12\" name=\"6(4)_png.png\" path=\"/images/\"/>\n    <image id=\"p3ya13\" name=\"7(4)_png.png\" path=\"/images/\"/>\n    <image id=\"p3ya14\" name=\"8(4)_png.png\" path=\"/images/\"/>\n    <image id=\"p3ya15\" name=\"9(4)_png.png\" path=\"/images/\"/>\n    <image id=\"uo8117\" name=\"mask0.png\" path=\"/images/\"/>\n    <image id=\"uo8118\" name=\"mask1.png\" path=\"/images/\"/>\n  </resources>\n  <publish name=\"Cooldown\">\n    <atlas name=\"默认\" index=\"0\"/>\n  </publish>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/Guide/BagButton.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"90,100\" pivot=\"0.5,0.5\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"rpol2\" fileName=\"btnimage.png\" xy=\"2,0\" aspect=\"true\">\n      <gearColor controller=\"button\" pages=\"1,3\" values=\"#aeaeae|#aeaeae\" default=\"#ffffff\"/>\n    </image>\n    <movieclip id=\"n2\" name=\"n2\" src=\"rpol3\" fileName=\"quan.jta\" xy=\"-13,-6\"/>\n  </displayList>\n  <Button downEffect=\"scale\" downEffectValue=\"0.80\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Guide/Button1.xml",
    "content": "<component size=\"100,36\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <graph id=\"n1\" name=\"n1\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#fff0f0f0\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <graph id=\"n2\" name=\"n2\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#fffafafa\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <graph id=\"n3\" name=\"n3\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#ffcccccc\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <text id=\"n4\" name=\"title\" xy=\"0,0\" size=\"100,36\" fontSize=\"22\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" singleLine=\"true\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Guide/GuideLayer.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\" mask=\"n11\" reversedMask=\"true\">\n  <displayList>\n    <graph id=\"n0\" name=\"n0\" xy=\"0,0\" size=\"1136,640\" type=\"rect\" lineSize=\"0\" fillColor=\"#5c000000\">\n      <relation target=\"\" sidePair=\"height-height,width-width\"/>\n    </graph>\n    <movieclip id=\"n12\" name=\"n12\" src=\"xcfj6\" fileName=\"rswcfhd.jta\" xy=\"330,297\">\n      <relation target=\"n11\" sidePair=\"left-left,middle-middle\"/>\n    </movieclip>\n    <graph id=\"n11\" name=\"window\" xy=\"409,221\" size=\"200,200\" touchable=\"false\" type=\"eclipse\" lineSize=\"0\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Guide/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\">\n  <displayList>\n    <component id=\"n0\" name=\"bagBtn\" src=\"rpol1\" xy=\"743,522\" group=\"n1\"/>\n    <group id=\"n1\" name=\"n1\" xy=\"743,522\" size=\"90,100\" advanced=\"true\">\n      <relation target=\"\" sidePair=\"bottom-bottom,center-center\"/>\n    </group>\n    <component id=\"n2\" name=\"n2\" src=\"rpol5\" xy=\"460,253\" size=\"183,48\">\n      <relation target=\"\" sidePair=\"center-center,middle-middle\"/>\n      <Button title=\"Start Guide\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Guide/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"q3l7vvj0\" jpegQuality=\"80\" compressPNG=\"true\">\n  <resources>\n    <component id=\"rpol0\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"rpol1\" name=\"BagButton.xml\" path=\"/\"/>\n    <image id=\"rpol2\" name=\"btnimage.png\" path=\"/\"/>\n    <movieclip id=\"rpol3\" name=\"quan.jta\" path=\"/\"/>\n    <component id=\"rpol4\" name=\"GuideLayer.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"rpol5\" name=\"Button1.xml\" path=\"/\"/>\n    <movieclip id=\"xcfj6\" name=\"rswcfhd.jta\" path=\"/\"/>\n  </resources>\n  <publish name=\"Guide\">\n    <atlas name=\"默认\" index=\"0\"/>\n  </publish>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/HitTest/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\" opaque=\"false\">\n  <displayList>\n    <text id=\"n26\" name=\"n26\" xy=\"98,50\" size=\"212,40\" fontSize=\"36\" color=\"#ffffff\" strokeColor=\"#000000\" text=\"Pixel Hit Test\"/>\n    <component id=\"n30\" name=\"n30\" src=\"g40je\" fileName=\"button1.xml\" xy=\"202,244\"/>\n    <component id=\"n31\" name=\"n31\" src=\"g40jf\" fileName=\"button2.xml\" xy=\"100,179\"/>\n    <component id=\"n32\" name=\"n32\" src=\"g40jg\" fileName=\"button3.xml\" xy=\"174,138\"/>\n    <text id=\"n34_qz1h\" name=\"n34\" xy=\"541,45\" size=\"238,40\" fontSize=\"36\" color=\"#ffffff\" strokeColor=\"#000000\" text=\"Shape Hit Test\"/>\n    <component id=\"n35_qz1h\" name=\"n35\" src=\"qz1hi\" fileName=\"button4.xml\" xy=\"575,185\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/HitTest/button1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"121,169\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"2\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"g40ja\" xy=\"0,0\" color=\"#a0a0a0\" forHitTest=\"true\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n      <gearColor controller=\"button\" pages=\"0,1,2,3\" values=\"#ffffff|#a0a0a0|#a0a0a0|#a0a0a0\" default=\"#ffffff\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/HitTest/button2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"131,168\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"2\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"g40j9\" xy=\"0,0\" color=\"#a0a0a0\" forHitTest=\"true\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n      <gearColor controller=\"button\" pages=\"0,1,2,3\" values=\"#ffffff|#a0a0a0|#a0a0a0|#a0a0a0\" default=\"#ffffff\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/HitTest/button3.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"190,144\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"2\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"g40j8\" xy=\"0,0\" color=\"#a0a0a0\" forHitTest=\"true\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n      <gearColor controller=\"button\" pages=\"0,1,2,3\" values=\"#ffffff|#a0a0a0|#a0a0a0|#a0a0a0\" default=\"#ffffff\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/HitTest/button4.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"190,144\" extention=\"Button\" hitTest=\"n36_qz1h\">\n  <displayList>\n    <image id=\"n35_qz1h\" name=\"n35\" src=\"g40j8\" fileName=\"2.png\" xy=\"0,0\"/>\n    <graph id=\"n36_qz1h\" name=\"n36\" xy=\"2,4\" size=\"185,137\" visible=\"false\" type=\"polygon\" lineSize=\"0\" fillColor=\"#57000000\" points=\"35,45,0,27,34,0,90,10,87.5,23,43.5,25.5,65.5,41,125.5,15,185,22,160.5,49,127.5,60,165,96,184,129.5,151.5,137.5,109.5,89.5,70.5,93.5,83.5,117.5,52.5,106,33,82\"/>\n  </displayList>\n  <Button downEffect=\"dark\" downEffectValue=\"0.80\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/HitTest/component1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"282,500\">\n  <displayList>\n    <image id=\"n22\" name=\"n22\" src=\"zis77\" xy=\"0,0\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/HitTest/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"ezq9a8mh\">\n  <resources>\n    <component id=\"d7yq0\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"g40j8\" name=\"2.png\" path=\"/\"/>\n    <image id=\"g40j9\" name=\"1.png\" path=\"/\"/>\n    <image id=\"g40ja\" name=\"0.png\" path=\"/\"/>\n    <component id=\"g40je\" name=\"button1.xml\" path=\"/\"/>\n    <component id=\"g40jf\" name=\"button2.xml\" path=\"/\"/>\n    <component id=\"g40jg\" name=\"button3.xml\" path=\"/\"/>\n    <component id=\"g40jh\" name=\"component1.xml\" path=\"/\"/>\n    <component id=\"qz1hi\" name=\"button4.xml\" path=\"/\"/>\n  </resources>\n  <publish name=\"HitTest\">\n    <atlas name=\"默认\" index=\"0\"/>\n  </publish>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/Joystick/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\">\n  <displayList>\n    <image id=\"n7\" name=\"joystick_center\" src=\"q9do1a\" xy=\"179,422\">\n      <relation target=\"\" sidePair=\"bottom-bottom\"/>\n    </image>\n    <component id=\"n4\" name=\"joystick\" src=\"q9do18\" xy=\"109,351\">\n      <relation target=\"\" sidePair=\"bottom-bottom\"/>\n    </component>\n    <graph id=\"n2\" name=\"joystick_touch\" xy=\"29,330\" size=\"374,254\" type=\"rect\" lineSize=\"0\" fillColor=\"#00ffffff\">\n      <relation target=\"\" sidePair=\"bottom-bottom\"/>\n    </graph>\n    <text id=\"n8\" name=\"n8\" xy=\"642,113\" size=\"89,28\" fontSize=\"24\" color=\"#ffffff\" strokeColor=\"#000000\" text=\"Degree:\"/>\n    <text id=\"n9\" name=\"n9\" xy=\"732,113\" size=\"302,28\" fontSize=\"24\" color=\"#ffffff\" autoSize=\"height\" strokeColor=\"#000000\" text=\"\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Joystick/circle.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"212,212\" scroll=\"both\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"1\"/>\n  <displayList>\n    <image id=\"n1\" name=\"thumb\" src=\"q9do19\" xy=\"17,26\" pivot=\"0.5,0.5\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n    </image>\n  </displayList>\n  <Button mode=\"Radio\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Joystick/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"rbw1tvvv\" jpegQuality=\"80\" compressPNG=\"true\">\n  <resources>\n    <component id=\"iitt1\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"q9do18\" name=\"circle.xml\" path=\"/\"/>\n    <image id=\"q9do19\" name=\"1.png\" path=\"/images/\"/>\n    <image id=\"q9do1a\" name=\"0.png\" path=\"/images/\"/>\n  </resources>\n  <publish name=\"Joystick\" packageCount=\"1\">\n    <atlas name=\"默认\" index=\"0\"/>\n  </publish>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/ListEffect/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"gsia1\" fileName=\"images/1.png\" xy=\"73,18\" size=\"404,562\"/>\n    <image id=\"n1\" name=\"n1\" src=\"gsia2\" fileName=\"images/3.png\" xy=\"85,32\" size=\"384,63\"/>\n    <image id=\"n2\" name=\"n2\" src=\"gsia3\" fileName=\"images/4.png\" xy=\"203,44\"/>\n    <list id=\"n3\" name=\"mailList\" xy=\"85,92\" size=\"380,473\" overflow=\"scroll\" scrollBarFlags=\"2\" scrollBar=\"hidden\" clipSoftness=\"0,20\" defaultItem=\"ui://jou4kj6pgsia7\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/ListEffect/mailItem.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"380,125\" extention=\"Button\">\n  <controller name=\"IsRead\" pages=\"0,未读,1,已读\" selected=\"0\"/>\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <controller name=\"c1\" pages=\"0,未领,1,已领\" selected=\"1\"/>\n  <displayList>\n    <image id=\"n10\" name=\"n10\" src=\"gsia8\" xy=\"3,2\" size=\"375,122\"/>\n    <image id=\"n13\" name=\"n13\" src=\"gsia9\" xy=\"-2,-3\" size=\"386,131\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n    </image>\n    <image id=\"n14\" name=\"n14\" src=\"gsiac\" xy=\"30,26\"/>\n    <image id=\"n15\" name=\"n15\" src=\"gsiad\" xy=\"40,29\">\n      <gearDisplay controller=\"IsRead\" pages=\"1\"/>\n    </image>\n    <image id=\"n16\" name=\"n16\" src=\"gsiae\" xy=\"40,42\">\n      <gearDisplay controller=\"IsRead\" pages=\"0\"/>\n    </image>\n    <text id=\"n4\" name=\"timeText\" xy=\"113,67\" size=\"239,39\" fontSize=\"20\" color=\"#075747\" vAlign=\"middle\" leading=\"0\" autoSize=\"none\" text=\"\"/>\n    <text id=\"n9\" name=\"title\" xy=\"114,28\" size=\"240,28\" fontSize=\"22\" color=\"#3333ff\" vAlign=\"middle\" autoSize=\"none\" text=\"\"/>\n    <image id=\"n17\" name=\"n17\" src=\"gsiaf\" xy=\"234,2\">\n      <gearDisplay controller=\"c1\" pages=\"1\"/>\n    </image>\n  </displayList>\n  <Button mode=\"Radio\"/>\n  <transition name=\"t0\">\n    <item time=\"0\" type=\"Visible\" value=\"true\"/>\n    <item time=\"0\" type=\"XY\" tween=\"true\" startValue=\"391,-\" endValue=\"0,0\" duration=\"9\"/>\n  </transition>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/ListEffect/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"jou4kj6p\" jpegQuality=\"80\" compressPNG=\"true\">\n  <resources>\n    <component id=\"eeyy0\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"gsia1\" name=\"1.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"10,15,28,32\"/>\n    <image id=\"gsia2\" name=\"3.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"110,16,33,32\"/>\n    <image id=\"gsia3\" name=\"4.png\" path=\"/images/\"/>\n    <component id=\"gsia7\" name=\"mailItem.xml\" path=\"/\"/>\n    <image id=\"gsia8\" name=\"2.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"25,26,26,90\"/>\n    <image id=\"gsia9\" name=\"0.png\" path=\"/images/\" scale=\"9grid\" scale9grid=\"17,16,74,73\"/>\n    <image id=\"gsiac\" name=\"7.png\" path=\"/images/\"/>\n    <image id=\"gsiad\" name=\"9.png\" path=\"/images/\"/>\n    <image id=\"gsiae\" name=\"6.png\" path=\"/images/\"/>\n    <image id=\"gsiaf\" name=\"8.png\" path=\"/images/\"/>\n  </resources>\n  <publish name=\"ListEffect\" packageCount=\"1\">\n    <atlas name=\"Default\" index=\"0\"/>\n  </publish>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/LoopList/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\">\n  <displayList>\n    <list id=\"n0\" name=\"list\" xy=\"176,70\" size=\"784,450\" layout=\"row\" overflow=\"scroll\" scroll=\"horizontal\" scrollBarFlags=\"2\" scrollBar=\"hidden\" margin=\"0,0,0,0\" clipSoftness=\"20,0\" colGap=\"20\" defaultItem=\"ui://qf88jb5nrpol1\">\n      <item icon=\"ui://qf88jb5nrpol3\"/>\n      <item icon=\"ui://qf88jb5nrpol4\"/>\n      <item icon=\"ui://qf88jb5nrpol5\"/>\n    </list>\n    <text id=\"n2\" name=\"n2\" xy=\"286,548\" size=\"327,32\" fontSize=\"28\" color=\"#ffffff\" text=\"Index of the middle is:\"/>\n    <text id=\"n3\" name=\"n3\" xy=\"616,547\" size=\"145,32\" fontSize=\"28\" color=\"#ffffff\" autoSize=\"height\" text=\"\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/LoopList/item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"248,460\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <loader id=\"n0\" name=\"icon\" xy=\"0,41\" size=\"248,378\"/>\n  </displayList>\n  <Button mode=\"Radio\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/LoopList/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"qf88jb5n\" jpegQuality=\"80\" compressPNG=\"true\">\n  <resources>\n    <component id=\"rpol0\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"rpol1\" name=\"item.xml\" path=\"/\"/>\n    <image id=\"rpol3\" name=\"n1.png\" path=\"/\" exported=\"true\"/>\n    <image id=\"rpol4\" name=\"n2.png\" path=\"/\" exported=\"true\"/>\n    <image id=\"rpol5\" name=\"n3.png\" path=\"/\" exported=\"true\"/>\n    <image id=\"rpol6\" name=\"n4.png\" path=\"/\" exported=\"true\"/>\n    <image id=\"rpol7\" name=\"n5.png\" path=\"/\" exported=\"true\"/>\n  </resources>\n  <publish name=\"LoopList\" packageCount=\"1\">\n    <atlas name=\"默认\" index=\"0\"/>\n  </publish>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/MainMenu/Button.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"85,32\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"rftu5\" xy=\"0,0\" size=\"85,32\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"rftu6\" xy=\"0,0\" size=\"85,32\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"rftu7\" xy=\"0,0\" size=\"85,32\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <text id=\"n4\" name=\"title\" xy=\"0,2\" size=\"85,29\" fontSize=\"22\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" singleLine=\"true\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/MainMenu/CloseButton.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"60,60\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"rftu2\" xy=\"0,0\" size=\"60,60\">\n      <gearDisplay controller=\"button\" pages=\"0,2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"rftu1\" xy=\"0,0\" size=\"60,60\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/MainMenu/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\">\n  <displayList>\n    <graph id=\"n3_txxc\" name=\"n3\" xy=\"0,0\" size=\"1136,640\" locked=\"true\" type=\"rect\" lineSize=\"0\" fillColor=\"#ff333333\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <component id=\"n1_rftu\" name=\"n1\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"104,75\" size=\"235,51\">\n      <Button title=\"基础功能展示\"/>\n    </component>\n    <component id=\"n2_rftu\" name=\"n2\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"104,146\" size=\"235,51\">\n      <Button title=\"动效展示\"/>\n    </component>\n    <component id=\"n4_oarg\" name=\"n4\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"104,217\" size=\"235,51\">\n      <Button title=\"虚拟列表\"/>\n    </component>\n    <component id=\"n5_oarg\" name=\"n5\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"104,288\" size=\"235,51\">\n      <Button title=\"循环列表\"/>\n    </component>\n    <component id=\"n6_oarg\" name=\"n6\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"104,359\" size=\"235,51\">\n      <Button title=\"点击测试\"/>\n    </component>\n    <component id=\"n7_oarg\" name=\"n7\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"104,430\" size=\"235,51\">\n      <Button title=\"下拉刷新\"/>\n    </component>\n    <component id=\"n8_oarg\" name=\"n8\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"450,75\" size=\"235,51\">\n      <Button title=\"模式等待\"/>\n    </component>\n    <component id=\"n9_oarg\" name=\"n9\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"450,146\" size=\"235,51\">\n      <Button title=\"摇杆\"/>\n    </component>\n    <component id=\"n10_szln\" name=\"n10\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"450,217\" size=\"235,51\">\n      <Button title=\"背包\"/>\n    </component>\n    <component id=\"n11_szln\" name=\"n11\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"450,288\" size=\"235,51\">\n      <Button title=\"聊天\"/>\n    </component>\n    <component id=\"n12_szln\" name=\"n12\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"450,359\" size=\"235,51\">\n      <Button title=\"列表效果\"/>\n    </component>\n    <component id=\"n13_szln\" name=\"n13\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"450,430\" size=\"235,51\">\n      <Button title=\"双向滚动\"/>\n    </component>\n    <component id=\"n14_vu0y\" name=\"n14\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"796,75\" size=\"235,51\">\n      <Button title=\"树形列表\"/>\n    </component>\n    <component id=\"n15_x869\" name=\"n15\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"796,146\" size=\"235,51\">\n      <Button title=\"新手向导\"/>\n    </component>\n    <component id=\"n16_gfio\" name=\"n16\" src=\"rftu4\" fileName=\"Button.xml\" xy=\"796,217\" size=\"235,51\">\n      <Button title=\"圆形进度\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/MainMenu/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"58oxr1hs\" jpegQuality=\"80\" compressPNG=\"true\">\n  <resources>\n    <component id=\"rftu0\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"rftu1\" name=\"CloseSelected.png\" path=\"/\"/>\n    <image id=\"rftu2\" name=\"CloseNormal.png\" path=\"/\"/>\n    <component id=\"rftu3\" name=\"CloseButton.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"rftu4\" name=\"Button.xml\" path=\"/\"/>\n    <image id=\"rftu5\" name=\"b7_png.png\" path=\"/\" scale=\"9grid\" scale9grid=\"8,7,66,14\"/>\n    <image id=\"rftu6\" name=\"b5_png.png\" path=\"/\" scale=\"9grid\" scale9grid=\"12,7,61,14\"/>\n    <image id=\"rftu7\" name=\"b6_png.png\" path=\"/\" scale=\"9grid\" scale9grid=\"9,5,66,16\"/>\n  </resources>\n  <publish name=\"MainMenu\"/>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/ModalWaiting/Button1.xml",
    "content": "<component size=\"100,36\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <graph id=\"n1\" name=\"n1\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#fff0f0f0\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <graph id=\"n2\" name=\"n2\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#fffafafa\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <graph id=\"n3\" name=\"n3\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#ffcccccc\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <text id=\"n4\" name=\"title\" xy=\"0,0\" size=\"100,36\" fontSize=\"22\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" singleLine=\"true\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/ModalWaiting/CloseButton.xml",
    "content": "<component size=\"60,74\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"3\"/>\n  <controller name=\"c1\" pages=\"0,,1,\" selected=\"1\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"jtds1\" xy=\"0,0\" size=\"61,74\" aspect=\"true\">\n      <gearDisplay controller=\"c1\" pages=\"0\"/>\n    </image>\n    <image id=\"n3\" name=\"n3\" src=\"jtds1\" xy=\"0,0\" size=\"60,74\">\n      <gearDisplay controller=\"c1\" pages=\"0\"/>\n      <gearSize controller=\"button\" pages=\"0,1,2,3\" values=\"-|64,80|-|-\" default=\"60,74\"/>\n    </image>\n    <image id=\"n4\" name=\"n4\" src=\"jtds4\" xy=\"2,13\" size=\"55,47\" aspect=\"true\">\n      <gearDisplay controller=\"c1\" pages=\"1\"/>\n      <gearXY controller=\"button\" pages=\"0,1,2,3\" values=\"0,10|2,13|0,10|2,13\" default=\"0,8\"/>\n      <gearSize controller=\"button\" pages=\"0,1,2,3\" values=\"61,53|-|61,53|-\" default=\"55,47\"/>\n    </image>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/ModalWaiting/GlobalModalWaiting.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"300,300\">\n  <displayList>\n    <image id=\"n5_s9ng\" name=\"n5\" src=\"s9nge\" fileName=\"icon_zzz.png\" xy=\"100,100\" pivot=\"0.5,0.5\">\n      <relation target=\"\" sidePair=\"center-center,middle-middle\"/>\n    </image>\n  </displayList>\n  <transition name=\"t0\" autoPlay=\"true\" autoPlayRepeat=\"-1\">\n    <item time=\"0\" type=\"Rotation\" target=\"n5_s9ng\" tween=\"true\" startValue=\"0\" endValue=\"360\" duration=\"36\" ease=\"Linear\"/>\n  </transition>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/ModalWaiting/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"640,960\">\n  <displayList>\n    <component id=\"n0\" name=\"n0\" src=\"jtds6\" xy=\"166,437\" size=\"230,36\">\n      <Button title=\"Open Window\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/ModalWaiting/TestWin.xml",
    "content": "<component size=\"500,500\">\n  <displayList>\n    <component id=\"n0\" name=\"frame\" src=\"jtdsb\" xy=\"0,0\" size=\"500,500\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </component>\n    <component id=\"n1\" name=\"n1\" src=\"jtds6\" xy=\"179,334\" size=\"145,48\">\n      <Button title=\"Refresh\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/ModalWaiting/WindowFrame.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"615,387\" extention=\"Label\" initName=\"frame\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"jtds5\" xy=\"0,0\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </image>\n    <graph id=\"n3\" name=\"dragArea\" xy=\"10,1\" size=\"500,40\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </graph>\n    <text id=\"n1\" name=\"title\" xy=\"74,11\" size=\"437,29\" fontSize=\"22\" color=\"#ffffff\" align=\"center\" autoSize=\"none\" strokeColor=\"#000000\" text=\"Window Title\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </text>\n    <component id=\"n2\" name=\"closeButton\" src=\"jtds7\" xy=\"509,-16\">\n      <relation target=\"\" sidePair=\"left-right\"/>\n    </component>\n    <graph id=\"n4\" name=\"contentArea\" xy=\"50,50\" size=\"502,309\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/ModalWaiting/WindowModalWaiting.xml",
    "content": "<component size=\"200,200\">\n  <displayList>\n    <graph id=\"n0\" name=\"n0\" xy=\"0,0\" size=\"200,200\" type=\"rect\" lineSize=\"0\" fillColor=\"#70000000\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <image id=\"n1\" name=\"n1\" src=\"jtds3\" xy=\"55,60\" size=\"90,80\" group=\"n4\"/>\n    <jta id=\"n3\" name=\"n3\" src=\"jtdsd\" xy=\"77,86\" group=\"n4\"/>\n    <group id=\"n4\" name=\"n4\" xy=\"55,60\" size=\"90,80\" advanced=\"true\">\n      <relation target=\"\" sidePair=\"center-center,middle-middle\"/>\n    </group>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/ModalWaiting/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"16eoroa8\">\n  <resources>\n    <image id=\"jtds0\" name=\"0.png\" path=\"/\"/>\n    <image id=\"jtds1\" name=\"02.png\" path=\"/\"/>\n    <image id=\"jtds2\" name=\"1.png\" path=\"/\"/>\n    <image id=\"jtds3\" name=\"2.png\" path=\"/\" scale=\"9grid\" scale9grid=\"18,18,36,36\"/>\n    <image id=\"jtds4\" name=\"4.png\" path=\"/\"/>\n    <image id=\"jtds5\" name=\"5.png\" path=\"/\" scale=\"9grid\" scale9grid=\"64,54,484,303\"/>\n    <component id=\"jtds6\" name=\"Button1.xml\" path=\"/\"/>\n    <component id=\"jtds7\" name=\"CloseButton.xml\" path=\"/\"/>\n    <component id=\"jtds8\" name=\"GlobalModalWaiting.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"jtds9\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"jtdsa\" name=\"TestWin.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"jtdsb\" name=\"WindowFrame.xml\" path=\"/\"/>\n    <component id=\"jtdsc\" name=\"WindowModalWaiting.xml\" path=\"/\" exported=\"true\"/>\n    <movieclip id=\"jtdsd\" name=\"qtm011.jta\" path=\"/\"/>\n    <image id=\"s9nge\" name=\"icon_zzz.png\" path=\"/\"/>\n  </resources>\n  <publish name=\"ModalWaiting\">\n    <atlas name=\"Default\" index=\"0\"/>\n  </publish>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/PullToRefresh/Footer.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"400,71\" overflow=\"hidden\" bgColorEnabled=\"true\">\n  <controller name=\"c1\" pages=\"0,,2,\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n0_n3qd\" name=\"n0\" src=\"ca4w5\" xy=\"65,19\" pivot=\"0.5,0.5\" group=\"n2_n3qd\">\n      <gearDisplay controller=\"c1\" pages=\"2\"/>\n    </image>\n    <text id=\"n1_n3qd\" name=\"n1\" xy=\"68,22\" size=\"282,32\" group=\"n2_n3qd\" fontSize=\"22\" color=\"#999999\" align=\"center\" autoSize=\"none\" bold=\"true\" singleLine=\"true\" text=\"Pull up to load more\">\n      <gearText controller=\"c1\" pages=\"0,2\" values=\"Pull up to load more|Loading\"/>\n    </text>\n    <group id=\"n2_n3qd\" name=\"n2\" xy=\"65,19\" size=\"285,35\" advanced=\"true\">\n      <gearDisplay controller=\"c1\" pages=\"0,1,2\"/>\n      <relation target=\"\" sidePair=\"center-center,bottom-bottom\"/>\n    </group>\n  </displayList>\n  <transition name=\"t0\" autoPlay=\"true\" autoPlayRepeat=\"-1\">\n    <item time=\"0\" type=\"Rotation\" target=\"n0_n3qd\" tween=\"true\" startValue=\"0\" endValue=\"360\" duration=\"24\" ease=\"Linear\"/>\n  </transition>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/PullToRefresh/Header.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"400,71\" overflow=\"hidden\" bgColorEnabled=\"true\">\n  <controller name=\"c1\" pages=\"0,,1,,2,,3,\" selected=\"2\"/>\n  <displayList>\n    <image id=\"n0_n3qd\" name=\"n0\" src=\"ca4w5\" xy=\"54,20\" pivot=\"0.5,0.5\" group=\"n2_n3qd\">\n      <gearDisplay controller=\"c1\" pages=\"2\"/>\n    </image>\n    <text id=\"n1_n3qd\" name=\"n1\" xy=\"106,23\" size=\"242,33\" group=\"n2_n3qd\" fontSize=\"22\" color=\"#999999\" align=\"center\" autoSize=\"none\" bold=\"true\" singleLine=\"true\" text=\"Loading\">\n      <gearText controller=\"c1\" pages=\"0,1,2\" values=\"Pull down to refresh|Release to refresh|Loading\" default=\"Pull down to refrsh\"/>\n    </text>\n    <image id=\"n3_n3qd\" name=\"n3\" src=\"ca4w6\" xy=\"52,14\" pivot=\"0.5,0.5\" group=\"n2_n3qd\">\n      <gearDisplay controller=\"c1\" pages=\"0,1\"/>\n      <gearLook controller=\"c1\" pages=\"0\" values=\"1,180,0,1\" default=\"1,0,0,1\"/>\n    </image>\n    <group id=\"n2_n3qd\" name=\"n2\" xy=\"52,14\" size=\"296,46\" advanced=\"true\">\n      <gearDisplay controller=\"c1\" pages=\"0,1,2\"/>\n      <relation target=\"\" sidePair=\"center-center,bottom-bottom\"/>\n    </group>\n    <graph id=\"n4_9sfl\" name=\"n4\" xy=\"0,0\" size=\"400,35\" group=\"n6_9sfl\" type=\"rect\" lineSize=\"0\" fillColor=\"#ff3399ff\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </graph>\n    <text id=\"n5_9sfl\" name=\"n5\" xy=\"104,4\" size=\"192,26\" group=\"n6_9sfl\" fontSize=\"22\" color=\"#ffffff\" text=\"Refresh completed\">\n      <relation target=\"\" sidePair=\"center-center\"/>\n    </text>\n    <group id=\"n6_9sfl\" name=\"n6\" xy=\"0,0\" size=\"400,35\" advanced=\"true\">\n      <gearDisplay controller=\"c1\" pages=\"3\"/>\n    </group>\n  </displayList>\n  <transition name=\"t0\" autoPlay=\"true\" autoPlayRepeat=\"-1\">\n    <item time=\"0\" type=\"Rotation\" target=\"n0_n3qd\" tween=\"true\" startValue=\"0\" endValue=\"360\" duration=\"24\" ease=\"Linear\"/>\n  </transition>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/PullToRefresh/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\">\n  <displayList>\n    <graph id=\"n19_n3qd\" name=\"n19\" xy=\"61,48\" size=\"474,561\" type=\"rect\" lineSize=\"2\" lineColor=\"#ff999999\">\n      <relation target=\"\" sidePair=\"height-height\"/>\n    </graph>\n    <list id=\"n20_n3qd\" name=\"list1\" xy=\"62,49\" size=\"472,559\" overflow=\"scroll\" ptrRes=\"ui://0jgb9xgyca4w4,\" defaultItem=\"ui://0jgb9xgyca4w1\">\n      <relation target=\"\" sidePair=\"height-height\"/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n    </list>\n    <graph id=\"n21_9sfl\" name=\"n21\" xy=\"594,48\" size=\"474,561\" type=\"rect\" lineSize=\"2\" lineColor=\"#ff999999\">\n      <relation target=\"\" sidePair=\"height-height\"/>\n    </graph>\n    <list id=\"n22_9sfl\" name=\"list2\" xy=\"595,49\" size=\"472,559\" overflow=\"scroll\" ptrRes=\",ui://0jgb9xgyca4w7\" defaultItem=\"ui://0jgb9xgyca4w1\">\n      <relation target=\"\" sidePair=\"height-height\"/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n    </list>\n    <text id=\"n23_9sfl\" name=\"n23\" xy=\"141,9\" size=\"265,30\" fontSize=\"26\" color=\"#ffffff\" text=\"Pull Down to Refresh\"/>\n    <text id=\"n24_9sfl\" name=\"n24\" xy=\"715,9\" size=\"239,30\" fontSize=\"26\" color=\"#ffffff\" text=\"Pull Up to Refresh\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/PullToRefresh/item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"720,88\" scroll=\"horizontal\" extention=\"Button\">\n  <displayList>\n    <loader id=\"n0\" name=\"icon\" xy=\"7,8\" size=\"64,64\" url=\"ui://0jgb9xgyca4w2\" align=\"center\" vAlign=\"middle\" fill=\"scaleFree\"/>\n    <image id=\"n3\" name=\"n3\" src=\"ca4w3\" xy=\"0,86\" size=\"720,2\">\n      <relation target=\"\" sidePair=\"width-width,bottom-bottom\"/>\n    </image>\n    <text id=\"n4\" name=\"title\" xy=\"80,7\" size=\"530,28\" fontSize=\"24\" autoSize=\"height\" singleLine=\"true\" text=\"Item\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </text>\n    <text id=\"n5\" name=\"desc\" xy=\"80,44\" size=\"553,28\" fontSize=\"24\" color=\"#babcbf\" autoSize=\"height\" singleLine=\"true\" text=\"Message\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </text>\n    <text id=\"n6\" name=\"time\" xy=\"626,7\" size=\"83,28\" fontSize=\"24\" color=\"#babcbf\" align=\"right\" autoSize=\"none\" singleLine=\"true\" text=\"21:03\">\n      <relation target=\"\" sidePair=\"right-right\"/>\n    </text>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/PullToRefresh/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"0jgb9xgy\" jpegQuality=\"80\" compressPNG=\"true\">\n  <resources>\n    <component id=\"ca4w0\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"ca4w1\" name=\"item.xml\" path=\"/\"/>\n    <image id=\"ca4w2\" name=\"logo.jpg\" path=\"/\"/>\n    <image id=\"ca4w3\" name=\"Seperator1.png\" path=\"/\"/>\n    <component id=\"ca4w4\" name=\"Header.xml\" path=\"/\"/>\n    <image id=\"ca4w5\" name=\"refresh.png\" path=\"/\"/>\n    <image id=\"ca4w6\" name=\"arrow.png\" path=\"/\"/>\n    <component id=\"ca4w7\" name=\"Footer.xml\" path=\"/\"/>\n  </resources>\n  <publish name=\"PullToRefresh\"/>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/ScrollPane/Box.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"350,191\">\n  <displayList>\n    <graph id=\"n3\" name=\"box\" xy=\"0,0\" size=\"350,191\" type=\"rect\" fillColor=\"#ff006633\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/ScrollPane/Button1.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"140,85\" extention=\"Button\">\n  <displayList>\n    <graph id=\"n7\" name=\"n7\" xy=\"0,0\" size=\"140,87\" type=\"rect\" lineSize=\"0\" fillColor=\"#ff666666\"/>\n    <text id=\"n8\" name=\"title\" xy=\"0,26\" size=\"140,32\" fontSize=\"28\" color=\"#ffffff\" align=\"center\" autoSize=\"none\" text=\"Stick\"/>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/ScrollPane/Button2.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"140,86\" extention=\"Button\">\n  <displayList>\n    <graph id=\"n7\" name=\"n7\" xy=\"0,0\" size=\"140,87\" type=\"rect\" lineSize=\"0\" fillColor=\"#ffff3300\"/>\n    <text id=\"n8\" name=\"title\" xy=\"0,26\" size=\"140,32\" fontSize=\"28\" color=\"#ffffff\" align=\"center\" autoSize=\"none\" text=\"Delete\"/>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/ScrollPane/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\">\n  <displayList>\n    <graph id=\"n0\" name=\"n0\" xy=\"0,0\" size=\"474,640\" type=\"rect\" lineSize=\"2\" lineColor=\"#ff999999\">\n      <relation target=\"\" sidePair=\"height-height\"/>\n    </graph>\n    <list id=\"n1\" name=\"list\" xy=\"1,1\" size=\"472,638\" overflow=\"scroll\" scrollBar=\"hidden\" defaultItem=\"ui://8rugjhhlqujq2\">\n      <relation target=\"\" sidePair=\"height-height\"/>\n      <item/>\n      <item/>\n      <item/>\n      <item/>\n    </list>\n    <component id=\"n7\" name=\"box\" src=\"c5529\" fileName=\"Box.xml\" xy=\"652,354\"/>\n    <text id=\"n5\" name=\"n5\" xy=\"518,32\" size=\"557,111\" fontSize=\"24\" color=\"#ffffff\" autoSize=\"none\" strokeColor=\"#000000\" text=\"* Drag vertically to scroll the whole list.&#xA;* Drag horizontally to scroll single item.\"/>\n    <text id=\"n6\" name=\"txt\" xy=\"705,411\" size=\"252,28\" fontSize=\"24\" color=\"#ffffff\" autoSize=\"height\" strokeColor=\"#000000\" text=\"\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/ScrollPane/item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"720,88\" overflow=\"scroll\" scroll=\"horizontal\" scrollBarFlags=\"648\" scrollBar=\"hidden\" extention=\"Button\">\n  <displayList>\n    <loader id=\"n0\" name=\"icon\" xy=\"7,8\" size=\"64,64\" url=\"ui://8rugjhhldliz8\" align=\"center\" vAlign=\"middle\" fill=\"scaleFree\"/>\n    <image id=\"n3\" name=\"n3\" src=\"qujq4\" xy=\"0,86\" size=\"1000,2\">\n      <relation target=\"\" sidePair=\"width-width,bottom-bottom\"/>\n    </image>\n    <component id=\"n9\" name=\"b0\" src=\"qujq5\" xy=\"720,0\">\n      <relation target=\"\" sidePair=\"left-right\"/>\n    </component>\n    <component id=\"n10\" name=\"b1\" src=\"qujq7\" xy=\"860,0\">\n      <relation target=\"\" sidePair=\"left-right\"/>\n    </component>\n    <text id=\"n4\" name=\"title\" xy=\"80,7\" size=\"530,28\" fontSize=\"24\" autoSize=\"height\" singleLine=\"true\" text=\"Item\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </text>\n    <text id=\"n5\" name=\"desc\" xy=\"80,44\" size=\"553,28\" fontSize=\"24\" color=\"#babcbf\" autoSize=\"height\" singleLine=\"true\" text=\"Message\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n    </text>\n    <text id=\"n6\" name=\"time\" xy=\"626,7\" size=\"83,28\" fontSize=\"24\" color=\"#babcbf\" align=\"right\" autoSize=\"none\" singleLine=\"true\" text=\"21:03\">\n      <relation target=\"\" sidePair=\"right-right\"/>\n    </text>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/ScrollPane/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"8rugjhhl\" jpegQuality=\"80\" compressPNG=\"true\">\n  <resources>\n    <component id=\"n38w0\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"qujq2\" name=\"item.xml\" path=\"/\"/>\n    <image id=\"qujq4\" name=\"Seperator1.png\" path=\"/\" scale=\"\"/>\n    <component id=\"qujq5\" name=\"Button1.xml\" path=\"/\"/>\n    <component id=\"qujq7\" name=\"Button2.xml\" path=\"/\"/>\n    <image id=\"dliz8\" name=\"logo.jpg\" path=\"/\"/>\n    <component id=\"c5529\" name=\"Box.xml\" path=\"/\"/>\n  </resources>\n  <publish name=\"ScrollPane\"/>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/Transition/BOSS.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\">\n  <displayList>\n    <image id=\"n4\" name=\"n4\" src=\"lvxrp\" fileName=\"images/2.png\" xy=\"279,103\">\n      <relation target=\"\" sidePair=\"center-center,middle-middle\"/>\n    </image>\n    <image id=\"n5\" name=\"n5\" src=\"lvxrq\" fileName=\"images/3.png\" xy=\"533,292\">\n      <relation target=\"\" sidePair=\"center-center,middle-middle\"/>\n    </image>\n  </displayList>\n  <transition name=\"t0\">\n    <item time=\"0\" type=\"Sound\" value=\"ui://c0hnre6olvxrs,100\"/>\n    <item time=\"0\" type=\"XY\" target=\"n4\" tween=\"true\" startValue=\"-275,-\" endValue=\"273,-\" duration=\"12\" ease=\"Expo.Out\"/>\n    <item time=\"0\" type=\"XY\" target=\"n5\" tween=\"true\" startValue=\"1183,-\" endValue=\"533,-\" duration=\"12\" ease=\"Expo.Out\"/>\n    <item time=\"36\" type=\"XY\" target=\"n4\" tween=\"true\" startValue=\"279,-\" endValue=\"1132,-\" duration=\"9\" ease=\"Expo.Out\"/>\n    <item time=\"36\" type=\"XY\" target=\"n5\" tween=\"true\" startValue=\"533,-\" endValue=\"-399,-\" duration=\"9\" ease=\"Expo.Out\"/>\n  </transition>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Transition/BOSS_SKILL.xml",
    "content": "<component size=\"1136,640\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"lvxr2\" xy=\"0,60\" size=\"1136,81\">\n      <relation target=\"\" sidePair=\"center-center\"/>\n    </image>\n    <loader id=\"n4\" name=\"icon\" xy=\"99,62\" size=\"938,68\" url=\"ui://c0hnre6olvxro\" align=\"center\">\n      <relation target=\"\" sidePair=\"center-center\"/>\n    </loader>\n  </displayList>\n  <transition name=\"t0\">\n    <item time=\"0\" type=\"Alpha\" target=\"n0\" value=\"1.00\"/>\n    <item time=\"0\" type=\"XY\" target=\"n4\" tween=\"true\" startValue=\"1180,-\" endValue=\"167,-\" duration=\"12\"/>\n    <item time=\"12\" type=\"XY\" target=\"n4\" tween=\"true\" startValue=\"167,-\" endValue=\"99,62\" duration=\"36\" ease=\"Linear\"/>\n    <item time=\"48\" type=\"Alpha\" target=\"n0\" tween=\"true\" startValue=\"1.00\" endValue=\"0.00\" duration=\"12\"/>\n    <item time=\"48\" type=\"XY\" target=\"n4\" tween=\"true\" startValue=\"99,62\" endValue=\"-948,-\" duration=\"12\"/>\n  </transition>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Transition/Button1.xml",
    "content": "<component size=\"100,36\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <graph id=\"n1\" name=\"n1\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#fff0f0f0\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <graph id=\"n2\" name=\"n2\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#fffafafa\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <graph id=\"n3\" name=\"n3\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#ffcccccc\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <text id=\"n4\" name=\"title\" xy=\"0,0\" size=\"100,36\" fontSize=\"22\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" singleLine=\"true\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Transition/GoodHit.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"250,205\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"lvxrv\" xy=\"22,45\"/>\n    <loader id=\"n2\" name=\"word\" xy=\"8,1\" size=\"238,105\" url=\"ui://c0hnre6olvxru\" align=\"right\" vAlign=\"bottom\"/>\n    <text id=\"n3\" name=\"t0\" xy=\"85,112\" size=\"47,54\" font=\"ui://c0hnre6olvxr12\" fontSize=\"24\" autoSize=\"height\" text=\"8\"/>\n    <text id=\"n4\" name=\"t1\" xy=\"121,102\" size=\"52,54\" font=\"ui://c0hnre6olvxr12\" fontSize=\"24\" autoSize=\"none\" text=\"5\"/>\n    <text id=\"n5\" name=\"t2\" xy=\"158,93\" size=\"52,54\" font=\"ui://c0hnre6olvxr12\" fontSize=\"24\" autoSize=\"none\" text=\"8\"/>\n  </displayList>\n  <transition name=\"t0\">\n    <item time=\"0\" type=\"Pivot\" value=\"1,0\"/>\n    <item time=\"0\" type=\"Scale\" tween=\"true\" startValue=\"1.5,1.5\" endValue=\"1,1\" duration=\"7\" ease=\"Bounce.Out\"/>\n    <item time=\"7\" type=\"Shake\" value=\"3,0.5\"/>\n  </transition>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Transition/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\">\n  <displayList>\n    <component id=\"n6_s9ng\" name=\"btn0\" src=\"lvxr10\" fileName=\"Button1.xml\" xy=\"85,64\" size=\"121,42\" group=\"n12_s9ng\">\n      <Button title=\"Play1\"/>\n    </component>\n    <component id=\"n7_s9ng\" name=\"btn1\" src=\"lvxr10\" fileName=\"Button1.xml\" xy=\"246,64\" size=\"121,42\" group=\"n12_s9ng\">\n      <Button title=\"Play2\"/>\n    </component>\n    <component id=\"n8_s9ng\" name=\"btn2\" src=\"lvxr10\" fileName=\"Button1.xml\" xy=\"407,64\" size=\"121,42\" group=\"n12_s9ng\">\n      <Button title=\"Play3\"/>\n    </component>\n    <component id=\"n9_s9ng\" name=\"btn3\" src=\"lvxr10\" fileName=\"Button1.xml\" xy=\"568,64\" size=\"121,42\" group=\"n12_s9ng\">\n      <Button title=\"Play4\"/>\n    </component>\n    <component id=\"n10_s9ng\" name=\"btn4\" src=\"lvxr10\" fileName=\"Button1.xml\" xy=\"729,64\" size=\"121,42\" group=\"n12_s9ng\">\n      <Button title=\"Play5\"/>\n    </component>\n    <component id=\"n11_s9ng\" name=\"btn5\" src=\"lvxr10\" fileName=\"Button1.xml\" xy=\"890,64\" size=\"121,42\" group=\"n12_s9ng\">\n      <Button title=\"Play6\"/>\n    </component>\n    <group id=\"n12_s9ng\" name=\"g0\" xy=\"85,64\" size=\"926,42\" advanced=\"true\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Transition/PathDemo.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\">\n  <displayList>\n    <image id=\"n3_ujnc\" name=\"n3\" src=\"s9ng1i\" fileName=\"glz.jpg\" xy=\"85,0\"/>\n    <image id=\"n2_ujnc\" name=\"n2\" src=\"s9ng1j\" fileName=\"r1.png\" xy=\"152,574\" pivot=\"0.5,0.5\" anchor=\"true\" size=\"66,68\"/>\n    <image id=\"n4_ujnc\" name=\"n4\" src=\"s9ng1j\" fileName=\"r1.png\" xy=\"802,103\" pivot=\"0.5,0.5\" anchor=\"true\"/>\n  </displayList>\n  <transition name=\"t0\">\n    <item time=\"0\" type=\"Transition\" value=\"t1\"/>\n    <item time=\"0\" type=\"XY\" target=\"n2_ujnc\" tween=\"true\" startValue=\"166,577.5\" endValue=\"220,205.5\" duration=\"120\" ease=\"Linear\" repeat=\"-1\" path=\"2,0,0,12,48,-37.72471024986493,-39.25088999407748,1,2,-17.549999999999955,-85,2.4098176530136186,-130.26180957230767,46.57205291308698,-112.714729226271,1,2,90.35000000000002,-138.60000000000002,135.50521366705695,-165.2996287033929,205.06733535639967,-198.08185613135998,1,2,280.5,-225.64999999999998,250.2463155228188,-247.27863511341855,240.8432655822097,-254.857979870787,0,2,220.95000000000005,-268.85,215.40449181619368,-314.0100452535792,129,-342,0,2,54,-372,-582.6000691394213,-626.6400276557686,0,0,1\"/>\n    <item time=\"0\" type=\"XY\" target=\"n4_ujnc\" tween=\"true\" startValue=\"802,104\" endValue=\"802,103\" duration=\"96\" ease=\"Linear\" repeat=\"-1\" path=\"2,0,0,104,-5,154.28433798184315,47.82762820713789,1,2,156.14999999999998,144.15,157.50785245484752,214.25464260021278,105.79697972482026,292.2223518401492,1,2,10.25,292.4,-78.73432634674877,292.56544637911725,-134.90212532397348,216.33034016434195,1,2,-135.60000000000002,141.89999999999998,-136.2369015530618,73.97261866056849,-101,-1,1,2,0,-1,70.72481884034768,-1,0,0,1\"/>\n  </transition>\n  <transition name=\"t1\">\n    <item time=\"0\" type=\"ColorFilter\" target=\"n2_ujnc\" tween=\"true\" startValue=\"0.38,0.00,0.00,0.00\" endValue=\"0.00,0.00,0.00,0.00\" duration=\"9\" repeat=\"-1\" yoyo=\"true\"/>\n    <item time=\"0\" type=\"Scale\" target=\"n2_ujnc\" tween=\"true\" startValue=\"0.8,0.8\" endValue=\"1.1,1.1\" duration=\"9\" repeat=\"-1\" yoyo=\"true\"/>\n  </transition>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Transition/PowerUp.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"500,120\">\n  <displayList>\n    <image id=\"n3\" name=\"n3\" src=\"lvxrx\" fileName=\"images/red.png\" xy=\"4,38\" group=\"n6\"/>\n    <image id=\"n0\" name=\"n0\" src=\"lvxrw\" fileName=\"images/power.png\" xy=\"9,36\" group=\"n6\"/>\n    <text id=\"n1\" name=\"value\" xy=\"187,43\" size=\"172,50\" group=\"n6\" font=\"ui://c0hnre6olvxr1e\" fontSize=\"24\" autoSize=\"none\" text=\"1234567\"/>\n    <text id=\"n2\" name=\"add_value\" xy=\"196,3\" size=\"149,40\" group=\"n6\" font=\"ui://c0hnre6olvxr1f\" fontSize=\"24\" text=\"+12345\"/>\n    <movieclip id=\"n5\" name=\"powEffect\" src=\"lvxrt\" fileName=\"images/U1UIT17.jta\" xy=\"42,-13\" group=\"n6\" visible=\"false\" playing=\"false\"/>\n    <group id=\"n6\" name=\"n6\" xy=\"4,-13\" size=\"462,146\" advanced=\"true\"/>\n  </displayList>\n  <transition name=\"t0\">\n    <item time=\"0\" type=\"Alpha\" value=\"1\"/>\n    <item time=\"0\" type=\"XY\" value=\"0,0\"/>\n    <item time=\"0\" type=\"XY\" target=\"n6\" tween=\"true\" startValue=\"-471,-\" endValue=\"56,-\" duration=\"12\" label2=\"play_num_now\" ease=\"Expo.Out\"/>\n    <item time=\"12\" type=\"XY\" target=\"n6\" label=\"play_num_now\" tween=\"true\" startValue=\"56,-\" endValue=\"66,-\" duration=\"15\" ease=\"Linear\"/>\n    <item time=\"21\" type=\"Animation\" target=\"n5\" value=\"0,p\"/>\n    <item time=\"21\" type=\"Visible\" target=\"n5\" value=\"true\"/>\n    <item time=\"30\" type=\"Visible\" target=\"n5\" value=\"false\"/>\n    <item time=\"36\" type=\"Alpha\" tween=\"true\" startValue=\"1\" endValue=\"0\" duration=\"12\"/>\n    <item time=\"36\" type=\"XY\" tween=\"true\" startValue=\"0,0\" endValue=\"-40,-400\" duration=\"12\" label2=\"end\"/>\n  </transition>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Transition/TRAP.xml",
    "content": "<component size=\"1136,640\">\n  <displayList>\n    <graph id=\"n1\" name=\"n1\" xy=\"0,200\" size=\"1136,154\" type=\"rect\" lineSize=\"0\" fillColor=\"#681c0000\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <image id=\"n3\" name=\"n3\" src=\"lvxrr\" xy=\"389,88\" pivot=\"0.5,0\" size=\"358,367\" aspect=\"true\">\n      <relation target=\"\" sidePair=\"center-center\"/>\n    </image>\n  </displayList>\n  <transition name=\"t0\">\n    <item time=\"0\" type=\"Sound\" value=\"ui://c0hnre6olvxrs\"/>\n    <item time=\"0\" type=\"XY\" target=\"n3\" tween=\"true\" startValue=\"-,-398\" endValue=\"-,88\" duration=\"12\" ease=\"Back.Out\"/>\n    <item time=\"12\" type=\"Rotation\" target=\"n3\" tween=\"true\" startValue=\"0\" endValue=\"8\" duration=\"6\"/>\n    <item time=\"18\" type=\"Rotation\" target=\"n3\" tween=\"true\" startValue=\"8\" endValue=\"-8\" duration=\"6\" ease=\"Back.Out\"/>\n    <item time=\"24\" type=\"Rotation\" target=\"n3\" tween=\"true\" startValue=\"-8\" endValue=\"5\" duration=\"6\" ease=\"Back.Out\"/>\n    <item time=\"30\" type=\"Rotation\" target=\"n3\" tween=\"true\" startValue=\"5\" endValue=\"-5\" duration=\"6\" ease=\"Back.Out\"/>\n    <item time=\"36\" type=\"Rotation\" target=\"n3\" tween=\"true\" startValue=\"-5\" endValue=\"0\" duration=\"6\" ease=\"Back.Out\"/>\n  </transition>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/Transition/number1.fnt",
    "content": "info creator=UIBuilder\ncommon lineHeight=0\nchar id=57 img=lvxr4 xoffset=0 yoffset=0 xadvance=24\nchar id=56 img=lvxr5 xoffset=0 yoffset=0 xadvance=24\nchar id=55 img=lvxr7 xoffset=0 yoffset=0 xadvance=24\nchar id=54 img=lvxr9 xoffset=0 yoffset=0 xadvance=24\nchar id=53 img=lvxrb xoffset=0 yoffset=0 xadvance=24\nchar id=52 img=lvxrd xoffset=0 yoffset=0 xadvance=24\nchar id=51 img=lvxrf xoffset=0 yoffset=0 xadvance=24\nchar id=50 img=lvxrh xoffset=0 yoffset=0 xadvance=24\nchar id=49 img=lvxrj xoffset=0 yoffset=0 xadvance=24\nchar id=48 img=lvxrl xoffset=0 yoffset=0 xadvance=24\n"
  },
  {
    "path": "demo/UIProject/assets/Transition/number2.fnt",
    "content": "info creator=UIBuilder\ncommon lineHeight=0\nchar id=43 img=lvxr3 xoffset=0 yoffset=0 xadvance=25\nchar id=57 img=lvxr6 xoffset=0 yoffset=0 xadvance=25\nchar id=56 img=lvxr8 xoffset=0 yoffset=0 xadvance=25\nchar id=55 img=lvxra xoffset=0 yoffset=0 xadvance=25\nchar id=54 img=lvxrc xoffset=0 yoffset=0 xadvance=25\nchar id=53 img=lvxre xoffset=0 yoffset=0 xadvance=25\nchar id=52 img=lvxrg xoffset=0 yoffset=0 xadvance=25\nchar id=51 img=lvxri xoffset=0 yoffset=0 xadvance=25\nchar id=50 img=lvxrk xoffset=0 yoffset=0 xadvance=25\nchar id=49 img=lvxrm xoffset=-2 yoffset=0 xadvance=20\nchar id=48 img=lvxrn xoffset=0 yoffset=0 xadvance=25\n"
  },
  {
    "path": "demo/UIProject/assets/Transition/number3.fnt",
    "content": "info creator=UIBuilder\ncommon lineHeight=0\nchar id=48 img=lvxr13 xoffset=0 yoffset=0 xadvance=33\nchar id=49 img=lvxr14 xoffset=0 yoffset=0 xadvance=33\nchar id=50 img=lvxr15 xoffset=0 yoffset=0 xadvance=32\nchar id=51 img=lvxr16 xoffset=0 yoffset=0 xadvance=33\nchar id=52 img=lvxr17 xoffset=0 yoffset=0 xadvance=33\nchar id=53 img=lvxr18 xoffset=0 yoffset=0 xadvance=32\nchar id=54 img=lvxr19 xoffset=0 yoffset=0 xadvance=32\nchar id=55 img=lvxr1a xoffset=0 yoffset=0 xadvance=33\nchar id=56 img=lvxr1b xoffset=0 yoffset=0 xadvance=33\nchar id=57 img=lvxr1c xoffset=0 yoffset=0 xadvance=33\n"
  },
  {
    "path": "demo/UIProject/assets/Transition/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"c0hnre6o\">\n  <resources>\n    <component id=\"lvxr0\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"lvxr2\" name=\"0.png\" path=\"/images/\"/>\n    <image id=\"lvxr3\" name=\"0000_+.png\" path=\"/images/\"/>\n    <image id=\"lvxr4\" name=\"0000_9_png.png\" path=\"/images/\"/>\n    <image id=\"lvxr5\" name=\"0001_8_png.png\" path=\"/images/\"/>\n    <image id=\"lvxr6\" name=\"0001_9.png\" path=\"/images/\"/>\n    <image id=\"lvxr7\" name=\"0002_7_png.png\" path=\"/images/\"/>\n    <image id=\"lvxr8\" name=\"0002_8.png\" path=\"/images/\"/>\n    <image id=\"lvxr9\" name=\"0003_6_png.png\" path=\"/images/\"/>\n    <image id=\"lvxra\" name=\"0003_7.png\" path=\"/images/\"/>\n    <image id=\"lvxrb\" name=\"0004_5_png.png\" path=\"/images/\"/>\n    <image id=\"lvxrc\" name=\"0004_6.png\" path=\"/images/\"/>\n    <image id=\"lvxrd\" name=\"0005_4_png.png\" path=\"/images/\"/>\n    <image id=\"lvxre\" name=\"0005_5.png\" path=\"/images/\"/>\n    <image id=\"lvxrf\" name=\"0006_3_png.png\" path=\"/images/\"/>\n    <image id=\"lvxrg\" name=\"0006_4.png\" path=\"/images/\"/>\n    <image id=\"lvxrh\" name=\"0007_2_png.png\" path=\"/images/\"/>\n    <image id=\"lvxri\" name=\"0007_3.png\" path=\"/images/\"/>\n    <image id=\"lvxrj\" name=\"0008_1_png.png\" path=\"/images/\"/>\n    <image id=\"lvxrk\" name=\"0008_2.png\" path=\"/images/\"/>\n    <image id=\"lvxrl\" name=\"0009_0-_png.png\" path=\"/images/\"/>\n    <image id=\"lvxrm\" name=\"0009_1.png\" path=\"/images/\"/>\n    <image id=\"lvxrn\" name=\"0010_0.png\" path=\"/images/\"/>\n    <image id=\"lvxro\" name=\"1.png\" path=\"/images/\"/>\n    <image id=\"lvxrp\" name=\"2.png\" path=\"/images/\"/>\n    <image id=\"lvxrq\" name=\"3.png\" path=\"/images/\"/>\n    <image id=\"lvxrr\" name=\"4.png\" path=\"/images/\"/>\n    <sound id=\"lvxrs\" name=\"BUZZ4.mp3\" path=\"/images/\"/>\n    <movieclip id=\"lvxrt\" name=\"U1UIT17.jta\" path=\"/images/\"/>\n    <image id=\"lvxru\" name=\"bangjile.png\" path=\"/images/\"/>\n    <image id=\"lvxrv\" name=\"blood.png\" path=\"/images/\"/>\n    <image id=\"lvxrw\" name=\"power.png\" path=\"/images/\"/>\n    <image id=\"lvxrx\" name=\"red.png\" path=\"/images/\"/>\n    <component id=\"lvxry\" name=\"BOSS.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"lvxrz\" name=\"BOSS_SKILL.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"lvxr10\" name=\"Button1.xml\" path=\"/\"/>\n    <component id=\"lvxr11\" name=\"GoodHit.xml\" path=\"/\" exported=\"true\"/>\n    <font id=\"lvxr12\" name=\"number3.fnt\" path=\"/\" exported=\"true\"/>\n    <image id=\"lvxr13\" name=\"h0.png\" path=\"/\"/>\n    <image id=\"lvxr14\" name=\"h1.png\" path=\"/\"/>\n    <image id=\"lvxr15\" name=\"h2.png\" path=\"/\"/>\n    <image id=\"lvxr16\" name=\"h3.png\" path=\"/\"/>\n    <image id=\"lvxr17\" name=\"h4.png\" path=\"/\"/>\n    <image id=\"lvxr18\" name=\"h5.png\" path=\"/\"/>\n    <image id=\"lvxr19\" name=\"h6.png\" path=\"/\"/>\n    <image id=\"lvxr1a\" name=\"h7.png\" path=\"/\"/>\n    <image id=\"lvxr1b\" name=\"h8.png\" path=\"/\"/>\n    <image id=\"lvxr1c\" name=\"h9.png\" path=\"/\"/>\n    <component id=\"lvxr1d\" name=\"PowerUp.xml\" path=\"/\" exported=\"true\"/>\n    <font id=\"lvxr1e\" name=\"number1.fnt\" path=\"/\" exported=\"true\"/>\n    <font id=\"lvxr1f\" name=\"number2.fnt\" path=\"/\" exported=\"true\"/>\n    <component id=\"lvxr1g\" name=\"TRAP.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"s9ng1h\" name=\"PathDemo.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"s9ng1i\" name=\"glz.jpg\" path=\"/\"/>\n    <image id=\"s9ng1j\" name=\"r1.png\" path=\"/\"/>\n  </resources>\n  <publish name=\"Transition\">\n    <atlas name=\"Default\" index=\"0\"/>\n  </publish>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/TreeView/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\" bgColor=\"#3f3f3f\">\n  <displayList>\n    <graph id=\"n3_s9ng\" name=\"n3\" xy=\"43,16\" size=\"424,594\" type=\"rect\" lineSize=\"2\"/>\n    <list id=\"n4_s9ng\" name=\"tree\" xy=\"45,18\" size=\"419,589\" overflow=\"scroll\" scrollBarFlags=\"128\" defaultItem=\"ui://5nx1f8vzpmk31\" treeView=\"true\" indent=\"15\" clickToExpand=\"1\">\n      <item title=\"Folder 1\" level=\"0\"/>\n      <item title=\"Leaf 1\" icon=\"ui://5nx1f8vzua5o8\" level=\"1\"/>\n      <item title=\"Leaf 2\" icon=\"ui://5nx1f8vzua5o8\" level=\"1\"/>\n      <item title=\"Leaf 3\" icon=\"ui://5nx1f8vzua5o8\" level=\"1\"/>\n      <item title=\"Leaf 4\" icon=\"ui://5nx1f8vzua5o8\" level=\"1\"/>\n      <item title=\"Folder 2\" level=\"0\"/>\n      <item title=\"Leaf 1\" icon=\"ui://5nx1f8vzua5o7\" level=\"1\"/>\n    </list>\n    <graph id=\"n5_s9ng\" name=\"n5\" xy=\"624,16\" size=\"424,594\" type=\"rect\" lineSize=\"2\"/>\n    <list id=\"n6_s9ng\" name=\"tree2\" xy=\"626,18\" size=\"419,589\" overflow=\"scroll\" scrollBarFlags=\"128\" defaultItem=\"ui://5nx1f8vzpmk31\" treeView=\"true\" indent=\"15\" clickToExpand=\"1\"/>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/TreeView/TreeExpandButton.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"38,31\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"1\"/>\n  <displayList>\n    <image id=\"n1\" name=\"n1\" src=\"pmk34\" xy=\"9,1\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"0,2\"/>\n    </image>\n    <image id=\"n2\" name=\"n2\" src=\"pmk35\" xy=\"3,5\" aspect=\"true\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n    </image>\n  </displayList>\n  <Button mode=\"Check\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/TreeView/TreeItem.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"240,48\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <controller name=\"expanded\" pages=\"0,,1,\" selected=\"1\"/>\n  <controller name=\"leaf\" pages=\"0,,1,\" selected=\"0\"/>\n  <displayList>\n    <graph id=\"n10\" name=\"n10\" xy=\"0,0\" size=\"240,48\" type=\"rect\" lineSize=\"0\" fillColor=\"#7a0066cc\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <text id=\"n2\" name=\"title\" xy=\"105,8\" size=\"134,32\" fontSize=\"28\" autoSize=\"none\" singleLine=\"true\" text=\"Title\">\n      <relation target=\"\" sidePair=\"width-width\"/>\n      <relation target=\"n6\" sidePair=\"leftext-right\"/>\n    </text>\n    <graph id=\"n3\" name=\"indent\" xy=\"0,0\" size=\"16,48\"/>\n    <loader id=\"n6\" name=\"icon\" xy=\"55,0\" size=\"50,48\" url=\"ui://5nx1f8vzua5o6\" align=\"center\" vAlign=\"middle\">\n      <gearIcon controller=\"expanded\" pages=\"1\" values=\"ui://5nx1f8vzua5o6\" default=\"ui://5nx1f8vzpmk32\"/>\n      <relation target=\"n3\" sidePair=\"left-right\"/>\n    </loader>\n    <component id=\"n7\" name=\"expandButton\" src=\"pmk33\" fileName=\"TreeExpandButton.xml\" xy=\"15,9\">\n      <gearDisplay controller=\"leaf\" pages=\"0\"/>\n      <relation target=\"n3\" sidePair=\"left-right\"/>\n      <Button checked=\"true\" controller=\"expanded\" page=\"1\"/>\n    </component>\n  </displayList>\n  <Button mode=\"Radio\"/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/TreeView/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"5nx1f8vz\" jpegQuality=\"80\" compressPNG=\"true\">\n  <resources>\n    <component id=\"pmk30\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <component id=\"pmk31\" name=\"TreeItem.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"pmk32\" name=\"folder_closed.png\" path=\"/Icons/\" exported=\"true\"/>\n    <component id=\"pmk33\" name=\"TreeExpandButton.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"pmk34\" name=\"i3.png.png\" path=\"/Images/\" exported=\"true\"/>\n    <image id=\"pmk35\" name=\"i4.png.png\" path=\"/Images/\" exported=\"true\"/>\n    <image id=\"ua5o6\" name=\"folder_opened.png\" path=\"/Icons/\" exported=\"true\"/>\n    <movieclip id=\"ua5o7\" name=\"heart.jta\" path=\"/Icons/\" exported=\"true\"/>\n    <image id=\"ua5o8\" name=\"file.png\" path=\"/Icons/\" exported=\"true\"/>\n  </resources>\n  <publish name=\"TreeView\"/>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/assets/VirtualList/Button1.xml",
    "content": "<component size=\"100,36\" extention=\"Button\">\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <displayList>\n    <graph id=\"n1\" name=\"n1\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#fff0f0f0\">\n      <gearDisplay controller=\"button\" pages=\"0\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <graph id=\"n2\" name=\"n2\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#fffafafa\">\n      <gearDisplay controller=\"button\" pages=\"2\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <graph id=\"n3\" name=\"n3\" xy=\"0,0\" size=\"100,36\" touchable=\"false\" type=\"rect\" lineSize=\"0\" fillColor=\"#ffcccccc\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </graph>\n    <text id=\"n4\" name=\"title\" xy=\"0,0\" size=\"100,36\" fontSize=\"22\" align=\"center\" vAlign=\"middle\" autoSize=\"none\" singleLine=\"true\" text=\"\">\n      <relation target=\"\" sidePair=\"width-width,height-height\"/>\n    </text>\n  </displayList>\n  <Button/>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/VirtualList/Main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"1136,640\">\n  <displayList>\n    <image id=\"n0\" name=\"n0\" src=\"c8s21\" fileName=\"1.png\" xy=\"185,56\" size=\"404,562\"/>\n    <image id=\"n1\" name=\"n1\" src=\"c8s22\" fileName=\"3.png\" xy=\"197,70\" size=\"384,63\"/>\n    <image id=\"n2\" name=\"n2\" src=\"c8s23\" fileName=\"4.png\" xy=\"315,82\"/>\n    <list id=\"n3\" name=\"mailList\" xy=\"197,130\" size=\"380,473\" overflow=\"scroll\" scrollBarFlags=\"2\" scrollBar=\"hidden\" clipSoftness=\"0,20\" defaultItem=\"ui://qkteqwfpc8s24\"/>\n    <text id=\"n4\" name=\"n4\" xy=\"171,15\" size=\"425,28\" fontSize=\"24\" text=\"The below list contains 1000 items.\"/>\n    <component id=\"n6\" name=\"n6\" src=\"rpolb\" fileName=\"Button1.xml\" xy=\"693,153\" size=\"183,48\">\n      <Button title=\"Select 500th\"/>\n    </component>\n    <component id=\"n7\" name=\"n7\" src=\"rpolb\" fileName=\"Button1.xml\" xy=\"693,224\" size=\"183,48\">\n      <Button title=\"Top\"/>\n    </component>\n    <component id=\"n8\" name=\"n8\" src=\"rpolb\" fileName=\"Button1.xml\" xy=\"693,300\" size=\"183,48\">\n      <Button title=\"Bottom\"/>\n    </component>\n  </displayList>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/VirtualList/mailItem.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<component size=\"380,125\" extention=\"Button\">\n  <controller name=\"IsRead\" pages=\"0,未读,1,已读\" selected=\"0\"/>\n  <controller name=\"button\" pages=\"0,up,1,down,2,over,3,selectedOver\" selected=\"0\"/>\n  <controller name=\"c1\" pages=\"0,未领,1,已领\" selected=\"0\"/>\n  <displayList>\n    <image id=\"n10\" name=\"n10\" src=\"c8s25\" xy=\"3,2\" size=\"375,122\"/>\n    <image id=\"n13\" name=\"n13\" src=\"c8s26\" xy=\"-2,-3\" size=\"386,131\">\n      <gearDisplay controller=\"button\" pages=\"1,3\"/>\n    </image>\n    <image id=\"n14\" name=\"n14\" src=\"c8s27\" xy=\"30,26\"/>\n    <image id=\"n15\" name=\"n15\" src=\"c8s28\" xy=\"40,29\">\n      <gearDisplay controller=\"IsRead\" pages=\"1\"/>\n    </image>\n    <image id=\"n16\" name=\"n16\" src=\"c8s29\" xy=\"40,42\">\n      <gearDisplay controller=\"IsRead\" pages=\"0\"/>\n    </image>\n    <text id=\"n4\" name=\"timeText\" xy=\"113,67\" size=\"239,39\" fontSize=\"20\" color=\"#075747\" vAlign=\"middle\" leading=\"0\" autoSize=\"none\" text=\"\"/>\n    <text id=\"n9\" name=\"title\" xy=\"114,28\" size=\"240,28\" fontSize=\"22\" color=\"#3333ff\" vAlign=\"middle\" autoSize=\"none\" text=\"\"/>\n    <image id=\"n17\" name=\"n17\" src=\"c8s2a\" xy=\"234,2\">\n      <gearDisplay controller=\"c1\" pages=\"1\"/>\n    </image>\n  </displayList>\n  <Button mode=\"Radio\"/>\n  <transition name=\"t0\">\n    <item time=\"0\" type=\"Visible\" value=\"true\"/>\n    <item time=\"0\" type=\"XY\" tween=\"true\" startValue=\"391,-\" endValue=\"0,0\" duration=\"9\"/>\n  </transition>\n</component>"
  },
  {
    "path": "demo/UIProject/assets/VirtualList/package.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packageDescription id=\"qkteqwfp\" jpegQuality=\"80\" compressPNG=\"true\">\n  <resources>\n    <component id=\"c8s20\" name=\"Main.xml\" path=\"/\" exported=\"true\"/>\n    <image id=\"c8s21\" name=\"1.png\" path=\"/\" scale=\"9grid\" scale9grid=\"10,15,28,32\"/>\n    <image id=\"c8s22\" name=\"3.png\" path=\"/\" scale=\"9grid\" scale9grid=\"110,16,33,32\"/>\n    <image id=\"c8s23\" name=\"4.png\" path=\"/\"/>\n    <component id=\"c8s24\" name=\"mailItem.xml\" path=\"/\"/>\n    <image id=\"c8s25\" name=\"2.png\" path=\"/\" scale=\"9grid\" scale9grid=\"25,26,26,90\"/>\n    <image id=\"c8s26\" name=\"0.png\" path=\"/\" scale=\"9grid\" scale9grid=\"17,16,74,73\"/>\n    <image id=\"c8s27\" name=\"7.png\" path=\"/\"/>\n    <image id=\"c8s28\" name=\"9.png\" path=\"/\"/>\n    <image id=\"c8s29\" name=\"6.png\" path=\"/\"/>\n    <image id=\"c8s2a\" name=\"8.png\" path=\"/\"/>\n    <component id=\"rpolb\" name=\"Button1.xml\" path=\"/\"/>\n  </resources>\n  <publish name=\"VirtualList\" packageCount=\"1\">\n    <atlas name=\"默认\" index=\"0\"/>\n  </publish>\n</packageDescription>"
  },
  {
    "path": "demo/UIProject/settings/Adaptation.json",
    "content": "{\n\t\"designResolutionX\":0,\n\t\"designResolutionY\":0,\n\t\"devices\":[],\n\t\"scaleMode\":\"ConstantPixelSize\",\n\t\"screenMathMode\":\"MatchWidthOrHeight\"\n}"
  },
  {
    "path": "demo/UIProject/settings/Common.json",
    "content": "{\n\t\"buttonClickSound\":\"\",\n\t\"colorScheme\":[\"自定义颜色 #FF0000\"],\n\t\"font\":\"宋体\",\n\t\"fontScheme\":[\"Default font\"],\n\t\"fontSize\":12,\n\t\"fontSizeScheme\":[\"自定义字体大小 30\"],\n\t\"pivot\":\"default\",\n\t\"scrollBars\":{\n\t\t\"defaultDisplay\":\"visible\",\n\t\t\"horizontal\":\"ui://9leh0eyfi3s65i\",\n\t\t\"vertical\":\"ui://9leh0eyfi3s65w\"\n\t},\n\t\"textColor\":\"#000000\",\n\t\"tipsRes\":\"\"\n}"
  },
  {
    "path": "demo/UIProject/settings/CustomProperties.json",
    "content": "{\n\n}"
  },
  {
    "path": "demo/UIProject/settings/Publish.json",
    "content": "{\n\t\"atlasSetting\":{\n\t\t\"paging\":true,\n\t\t\"sizeOption\":\"pot\",\n\t\t\"trimImage\":true\n\t},\n\t\"binaryFormat\":true,\n\t\"branchProcessing\":1,\n\t\"codeGeneration\":{\n\t\t\"classNamePrefix\":\"\",\n\t\t\"codePath\":\"\",\n\t\t\"codeType\":\"\",\n\t\t\"getMemberByName\":false,\n\t\t\"ignoreNoname\":true,\n\t\t\"memberNamePrefix\":\"m_\",\n\t\t\"packageName\":\"\"\n\t},\n\t\"compressDesc\":false,\n\t\"fileExtension\":\"fui\",\n\t\"packageCount\":2,\n\t\"path\":\"../resource/assets/UI\"\n}"
  },
  {
    "path": "demo/UIProject/settings/i18n.json",
    "content": "{\n\t\"langFiles\":[]\n}"
  },
  {
    "path": "demo/egretProperties.json",
    "content": "{\n  \"engineVersion\": \"5.2.30\",\n  \"compilerVersion\": \"5.2.30\",\n  \"template\": {},\n  \"target\": {\n    \"current\": \"web\"\n  },\n  \"modules\": [\n    {\n      \"name\": \"egret\"\n    },\n    {\n      \"name\": \"assetsmanager\"\n    },\n    {\n      \"name\": \"game\"\n    },\n    {\n      \"name\": \"tween\"\n    },\n    {\n      \"name\": \"promise\"\n    },\n    {\n      \"name\": \"rawinflate\",\n      \"path\": \"./libs/rawinflate\"\n    },\n    {\n      \"name\": \"fairygui\",\n      \"path\": \"./libs/fairygui\"\n    }\n  ]\n}"
  },
  {
    "path": "demo/index.html",
    "content": "<!DOCTYPE HTML>\n<html>\n\n<head>\n    <meta charset=\"utf-8\">\n    <title>Egret</title>\n    <meta name=\"viewport\" content=\"width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no\" />\n    <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n    <meta name=\"full-screen\" content=\"true\" />\n    <meta name=\"screen-orientation\" content=\"portrait\" />\n    <meta name=\"x5-fullscreen\" content=\"true\" />\n    <meta name=\"360-fullscreen\" content=\"true\" />\n    <style>\n        html, body {\n            -ms-touch-action: none;\n            background: #333333;\n            padding: 0;\n            border: 0;\n            margin: 0;\n            height: 100%;\n        }\n    </style>\n</head>\n\n<body>\n    <div style=\"margin: auto;width: 100%;height: 100%;\" class=\"egret-player\"\n         data-entry-class=\"Main\"\n         data-orientation=\"landscape\"\n         data-scale-mode=\"fixedNarrow\"\n         data-frame-rate=\"30\"\n         data-content-width=\"1136\"\n         data-content-height=\"640\"\n         data-multi-fingered=\"2\"\n         data-show-fps=\"false\" data-show-log=\"false\"\n         data-show-fps-style=\"x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9\">\n    </div>\n<script>\n    var loadScript = function (list, callback) {\n        var loaded = 0;\n        var loadNext = function () {\n            loadSingleScript(list[loaded], function () {\n                loaded++;\n                if (loaded >= list.length) {\n                    callback();\n                }\n                else {\n                    loadNext();\n                }\n            })\n        };\n        loadNext();\n    };\n\n    var loadSingleScript = function (src, callback) {\n        var s = document.createElement('script');\n        s.async = false;\n        s.src = src;\n        s.addEventListener('load', function () {\n            s.parentNode.removeChild(s);\n            s.removeEventListener('load', arguments.callee, false);\n            callback();\n        }, false);\n        document.body.appendChild(s);\n    };\n\n    var xhr = new XMLHttpRequest();\n    xhr.open('GET', './manifest.json?v=' + Math.random(), true);\n    xhr.addEventListener(\"load\", function () {\n        var manifest = JSON.parse(xhr.response);\n        var list = manifest.initial.concat(manifest.game);\n        loadScript(list, function () {\n            /**\n             * {\n             * \"renderMode\":, //Engine rendering mode, \"canvas\" or \"webgl\"\n             * \"audioType\": 0 //Use the audio type, 0: default, 2: web audio, 3: audio\n             * \"antialias\": //Whether the anti-aliasing is enabled in WebGL mode, true: on, false: off, defaults to false\n             * \"calculateCanvasScaleFactor\": //a function return canvas scale factor\n             * }\n             **/\n            egret.runEgret({ renderMode: \"webgl\", audioType: 0, calculateCanvasScaleFactor:function(context) {\n                var backingStore = context.backingStorePixelRatio ||\n                    context.webkitBackingStorePixelRatio ||\n                    context.mozBackingStorePixelRatio ||\n                    context.msBackingStorePixelRatio ||\n                    context.oBackingStorePixelRatio ||\n                    context.backingStorePixelRatio || 1;\n                return (window.devicePixelRatio || 1) / backingStore;\n            }});\n        });\n    });\n    xhr.send(null);\n</script>\n</body>\n\n</html>"
  },
  {
    "path": "demo/libs/fairygui/fairygui.d.ts",
    "content": "declare module fgui {\n    class AsyncOperation {\n        callback: (obj: GObject) => void;\n        callbackObj: any;\n        private _itemList;\n        private _objectPool;\n        private _index;\n        constructor();\n        createObject(pkgName: string, resName: string): void;\n        createObjectFromURL(url: string): void;\n        cancel(): void;\n        private internalCreateObject;\n        private collectComponentChildren;\n        private collectListChildren;\n        private run;\n    }\n}\ndeclare module fgui {\n    class Controller extends egret.EventDispatcher {\n        private _selectedIndex;\n        private _previousIndex;\n        private _pageIds;\n        private _pageNames;\n        private _actions?;\n        name: string;\n        parent: GComponent;\n        autoRadioGroupDepth?: boolean;\n        changing: boolean;\n        constructor();\n        dispose(): void;\n        selectedIndex: number;\n        setSelectedIndex(value: number): void;\n        readonly previsousIndex: number;\n        selectedPage: string;\n        setSelectedPage(value: string): void;\n        readonly previousPage: string;\n        readonly pageCount: number;\n        getPageName(index: number): string;\n        addPage(name?: string): void;\n        addPageAt(name: string, index: number): void;\n        removePage(name: string): void;\n        removePageAt(index?: number): void;\n        clearPages(): void;\n        hasPage(aName: string): boolean;\n        getPageIndexById(aId: string): number;\n        getPageIdByName(aName: string): string;\n        getPageNameById(aId: string): string;\n        getPageId(index?: number): string;\n        selectedPageId: string;\n        oppositePageId: string;\n        readonly previousPageId: string;\n        runActions(): void;\n        setup(buffer: ByteBuffer): void;\n    }\n}\ndeclare module fgui {\n    class DragDropManager {\n        private _agent;\n        private _sourceData;\n        private static _inst;\n        static readonly inst: DragDropManager;\n        constructor();\n        readonly dragAgent: GObject;\n        readonly dragging: boolean;\n        startDrag(source: GObject, icon: string, sourceData?: any, touchPointID?: number): void;\n        cancel(): void;\n        private __dragEnd;\n    }\n}\ndeclare module fgui {\n    enum ButtonMode {\n        Common = 0,\n        Check = 1,\n        Radio = 2\n    }\n    enum AutoSizeType {\n        None = 0,\n        Both = 1,\n        Height = 2\n    }\n    enum AlignType {\n        Left = 0,\n        Center = 1,\n        Right = 2\n    }\n    enum VertAlignType {\n        Top = 0,\n        Middle = 1,\n        Bottom = 2\n    }\n    enum LoaderFillType {\n        None = 0,\n        Scale = 1,\n        ScaleMatchHeight = 2,\n        ScaleMatchWidth = 3,\n        ScaleFree = 4,\n        ScaleNoBorder = 5\n    }\n    enum ListLayoutType {\n        SingleColumn = 0,\n        SingleRow = 1,\n        FlowHorizontal = 2,\n        FlowVertical = 3,\n        Pagination = 4\n    }\n    enum ListSelectionMode {\n        Single = 0,\n        Multiple = 1,\n        Multiple_SingleClick = 2,\n        None = 3\n    }\n    enum OverflowType {\n        Visible = 0,\n        Hidden = 1,\n        Scroll = 2\n    }\n    enum PackageItemType {\n        Image = 0,\n        MovieClip = 1,\n        Sound = 2,\n        Component = 3,\n        Atlas = 4,\n        Font = 5,\n        Swf = 6,\n        Misc = 7,\n        Unknown = 8,\n        Spine = 9,\n        DragonBones = 10\n    }\n    enum ObjectType {\n        Image = 0,\n        MovieClip = 1,\n        Swf = 2,\n        Graph = 3,\n        Loader = 4,\n        Group = 5,\n        Text = 6,\n        RichText = 7,\n        InputText = 8,\n        Component = 9,\n        List = 10,\n        Label = 11,\n        Button = 12,\n        ComboBox = 13,\n        ProgressBar = 14,\n        Slider = 15,\n        ScrollBar = 16,\n        Tree = 17,\n        Loader3D = 18\n    }\n    enum ProgressTitleType {\n        Percent = 0,\n        ValueAndMax = 1,\n        Value = 2,\n        Max = 3\n    }\n    enum ScrollBarDisplayType {\n        Default = 0,\n        Visible = 1,\n        Auto = 2,\n        Hidden = 3\n    }\n    enum ScrollType {\n        Horizontal = 0,\n        Vertical = 1,\n        Both = 2\n    }\n    enum FlipType {\n        None = 0,\n        Horizontal = 1,\n        Vertical = 2,\n        Both = 3\n    }\n    enum ChildrenRenderOrder {\n        Ascent = 0,\n        Descent = 1,\n        Arch = 2\n    }\n    enum GroupLayoutType {\n        None = 0,\n        Horizontal = 1,\n        Vertical = 2\n    }\n    enum PopupDirection {\n        Auto = 0,\n        Up = 1,\n        Down = 2\n    }\n    enum RelationType {\n        Left_Left = 0,\n        Left_Center = 1,\n        Left_Right = 2,\n        Center_Center = 3,\n        Right_Left = 4,\n        Right_Center = 5,\n        Right_Right = 6,\n        Top_Top = 7,\n        Top_Middle = 8,\n        Top_Bottom = 9,\n        Middle_Middle = 10,\n        Bottom_Top = 11,\n        Bottom_Middle = 12,\n        Bottom_Bottom = 13,\n        Width = 14,\n        Height = 15,\n        LeftExt_Left = 16,\n        LeftExt_Right = 17,\n        RightExt_Left = 18,\n        RightExt_Right = 19,\n        TopExt_Top = 20,\n        TopExt_Bottom = 21,\n        BottomExt_Top = 22,\n        BottomExt_Bottom = 23,\n        Size = 24\n    }\n    enum FillMethod {\n        None = 0,\n        Horizontal = 1,\n        Vertical = 2,\n        Radial90 = 3,\n        Radial180 = 4,\n        Radial360 = 5\n    }\n    enum FillOrigin {\n        Top = 0,\n        Bottom = 1,\n        Left = 2,\n        Right = 3,\n        TopLeft = 0,\n        TopRight = 1,\n        BottomLeft = 2,\n        BottomRight = 3\n    }\n    enum FillOrigin90 {\n        TopLeft = 0,\n        TopRight = 1,\n        BottomLeft = 2,\n        BottomRight = 3\n    }\n    enum ObjectPropID {\n        Text = 0,\n        Icon = 1,\n        Color = 2,\n        OutlineColor = 3,\n        Playing = 4,\n        Frame = 5,\n        DeltaTime = 6,\n        TimeScale = 7,\n        FontSize = 8,\n        Selected = 9\n    }\n}\ndeclare module fgui {\n    class GObject extends egret.EventDispatcher {\n        data: any;\n        packageItem: PackageItem;\n        static draggingObject: GObject;\n        private _x;\n        private _y;\n        private _alpha;\n        private _rotation;\n        private _visible;\n        private _touchable;\n        private _grayed;\n        private _draggable;\n        private _scaleX;\n        private _scaleY;\n        private _skewX;\n        private _skewY;\n        private _pivotX;\n        private _pivotY;\n        private _pivotAsAnchor;\n        private _pivotOffsetX;\n        private _pivotOffsetY;\n        private _sortingOrder;\n        private _internalVisible;\n        private _handlingController?;\n        private _tooltips?;\n        private _pixelSnapping?;\n        private _disposed?;\n        private _dragTesting?;\n        private _dragStartPos?;\n        private _relations;\n        private _group?;\n        private _gears;\n        private _displayObject;\n        private _dragBounds?;\n        sourceWidth: number;\n        sourceHeight: number;\n        initWidth: number;\n        initHeight: number;\n        minWidth: number;\n        minHeight: number;\n        maxWidth: number;\n        maxHeight: number;\n        _parent: GComponent;\n        _width: number;\n        _height: number;\n        _rawWidth: number;\n        _rawHeight: number;\n        _id: string;\n        _name: string;\n        _underConstruct: boolean;\n        _gearLocked?: boolean;\n        _sizePercentInGroup: number;\n        _treeNode?: GTreeNode;\n        static XY_CHANGED: string;\n        static SIZE_CHANGED: string;\n        static SIZE_DELAY_CHANGE: string;\n        static GEAR_STOP: string;\n        constructor();\n        readonly id: string;\n        name: string;\n        x: number;\n        y: number;\n        setXY(xv: number, yv: number): void;\n        xMin: number;\n        yMin: number;\n        pixelSnapping: boolean;\n        center(restraint?: boolean): void;\n        width: number;\n        height: number;\n        setSize(wv: number, hv: number, ignorePivot?: boolean): void;\n        makeFullScreen(): void;\n        ensureSizeCorrect(): void;\n        readonly actualWidth: number;\n        readonly actualHeight: number;\n        scaleX: number;\n        scaleY: number;\n        setScale(sx: number, sy: number): void;\n        skewX: number;\n        skewY: number;\n        setSkew(xv: number, yv: number): void;\n        pivotX: number;\n        pivotY: number;\n        setPivot(xv: number, yv: number, asAnchor?: boolean): void;\n        readonly pivotAsAnchor: boolean;\n        protected internalSetPivot(xv: number, yv: number, asAnchor: boolean): void;\n        private updatePivotOffset;\n        private applyPivot;\n        touchable: boolean;\n        grayed: boolean;\n        enabled: boolean;\n        rotation: number;\n        readonly normalizeRotation: number;\n        alpha: number;\n        visible: boolean;\n        readonly internalVisible: boolean;\n        readonly internalVisible2: boolean;\n        readonly internalVisible3: boolean;\n        sortingOrder: number;\n        readonly focused: boolean;\n        requestFocus(): void;\n        tooltips: string;\n        blendMode: string;\n        filters: egret.Filter[];\n        readonly inContainer: boolean;\n        readonly onStage: boolean;\n        readonly resourceURL: string;\n        group: GGroup;\n        getGear(index: number): GearBase;\n        protected updateGear(index: number): void;\n        checkGearController(index: number, c: Controller): boolean;\n        updateGearFromRelations(index: number, dx: number, dy: number): void;\n        addDisplayLock(): number;\n        releaseDisplayLock(token: number): void;\n        private checkGearDisplay;\n        readonly gearXY: GearXY;\n        readonly gearSize: GearSize;\n        readonly gearLook: GearLook;\n        readonly relations: Relations;\n        addRelation(target: GObject, relationType: number, usePercent?: boolean): void;\n        removeRelation(target: GObject, relationType?: number): void;\n        readonly displayObject: egret.DisplayObject;\n        protected setDisplayObject(value: egret.DisplayObject): void;\n        parent: GComponent;\n        removeFromParent(): void;\n        readonly root: GRoot;\n        readonly asCom: GComponent;\n        readonly asButton: GButton;\n        readonly asLabel: GLabel;\n        readonly asProgress: GProgressBar;\n        readonly asTextField: GTextField;\n        readonly asRichTextField: GRichTextField;\n        readonly asTextInput: GTextInput;\n        readonly asLoader: GLoader;\n        readonly asList: GList;\n        readonly asTree: GTree;\n        readonly asGraph: GGraph;\n        readonly asGroup: GGroup;\n        readonly asSlider: GSlider;\n        readonly asComboBox: GComboBox;\n        readonly asImage: GImage;\n        readonly asMovieClip: GMovieClip;\n        static cast(obj: egret.DisplayObject): GObject;\n        text: string;\n        icon: string;\n        readonly isDisposed: boolean;\n        readonly treeNode: GTreeNode;\n        dispose(): void;\n        addClickListener(listener: Function, thisObj?: any): void;\n        removeClickListener(listener: Function, thisObj?: any): void;\n        hasClickListener(): boolean;\n        addEventListener(type: string, listener: Function, thisObject?: any): void;\n        removeEventListener(type: string, listener: Function, thisObject?: any): void;\n        private _reDispatch;\n        draggable: boolean;\n        dragBounds: egret.Rectangle;\n        startDrag(touchPointID?: number, stageX?: number, stageY?: number): void;\n        stopDrag(): void;\n        readonly dragging: boolean;\n        localToGlobal(ax?: number, ay?: number, result?: egret.Point): egret.Point;\n        globalToLocal(ax?: number, ay?: number, result?: egret.Point): egret.Point;\n        localToRoot(ax?: number, ay?: number, result?: egret.Point): egret.Point;\n        rootToLocal(ax?: number, ay?: number, resultPoint?: egret.Point): egret.Point;\n        localToGlobalRect(ax?: number, ay?: number, aw?: number, ah?: number, result?: egret.Rectangle): egret.Rectangle;\n        globalToLocalRect(ax?: number, ay?: number, aw?: number, ah?: number, result?: egret.Rectangle): egret.Rectangle;\n        handleControllerChanged(c: Controller): void;\n        protected createDisplayObject(): void;\n        protected switchDisplayObject(newObj: egret.DisplayObject): void;\n        protected handleXYChanged(): void;\n        protected handleSizeChanged(): void;\n        protected handleScaleChanged(): void;\n        protected handleGrayedChanged(): void;\n        protected handleAlphaChanged(): void;\n        handleVisibleChanged(): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        constructFromResource(): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n        private initDrag;\n        private dragBegin;\n        private dragEnd;\n        private reset;\n        private __begin;\n        private __moving;\n        private __end;\n    }\n}\ndeclare module fgui {\n    class GComponent extends GObject {\n        private _sortingChildCount;\n        private _applyingController?;\n        protected _margin: Margin;\n        protected _trackBounds: boolean;\n        protected _boundsChanged: boolean;\n        protected _childrenRenderOrder: ChildrenRenderOrder;\n        protected _apexIndex: number;\n        _buildingDisplayList: boolean;\n        _children: Array<GObject>;\n        _controllers: Array<Controller>;\n        _transitions: Array<Transition>;\n        _rootContainer: UIContainer;\n        _container: egret.DisplayObjectContainer;\n        _scrollPane?: ScrollPane;\n        _alignOffset: egret.Point;\n        constructor();\n        protected createDisplayObject(): void;\n        dispose(): void;\n        readonly displayListContainer: egret.DisplayObjectContainer;\n        addChild(child: GObject): GObject;\n        addChildAt(child: GObject, index?: number): GObject;\n        private getInsertPosForSortingChild;\n        removeChild(child: GObject, dispose?: boolean): GObject;\n        removeChildAt(index: number, dispose?: boolean): GObject;\n        removeChildren(beginIndex?: number, endIndex?: number, dispose?: boolean): void;\n        getChildAt(index: number): GObject;\n        getChild(name: string): GObject;\n        getChildByPath(path: String): GObject;\n        getVisibleChild(name: string): GObject;\n        getChildInGroup(name: string, group: GGroup): GObject;\n        getChildById(id: string): GObject;\n        getChildIndex(child: GObject): number;\n        setChildIndex(child: GObject, index: number): void;\n        setChildIndexBefore(child: GObject, index: number): number;\n        private _setChildIndex;\n        swapChildren(child1: GObject, child2: GObject): void;\n        swapChildrenAt(index1: number, index2: number): void;\n        readonly numChildren: number;\n        isAncestorOf(child: GObject): boolean;\n        addController(controller: Controller): void;\n        getControllerAt(index: number): Controller;\n        getController(name: string): Controller;\n        removeController(c: Controller): void;\n        readonly controllers: Array<Controller>;\n        childStateChanged(child: GObject): void;\n        private buildNativeDisplayList;\n        applyController(c: Controller): void;\n        applyAllControllers(): void;\n        adjustRadioGroupDepth(obj: GObject, c: Controller): void;\n        getTransitionAt(index: number): Transition;\n        getTransition(transName: string): Transition;\n        isChildInView(child: GObject): boolean;\n        getFirstChildInView(): number;\n        readonly scrollPane: ScrollPane;\n        opaque: boolean;\n        margin: Margin;\n        childrenRenderOrder: ChildrenRenderOrder;\n        apexIndex: number;\n        mask: egret.DisplayObject | egret.Rectangle;\n        readonly baseUserData: string;\n        protected updateScrollRect(): void;\n        protected setupScroll(buffer: ByteBuffer): void;\n        protected setupOverflow(overflow: OverflowType): void;\n        protected handleSizeChanged(): void;\n        protected handleGrayedChanged(): void;\n        handleControllerChanged(c: Controller): void;\n        setBoundsChangedFlag(): void;\n        private __render;\n        ensureBoundsCorrect(): void;\n        protected updateBounds(): void;\n        setBounds(ax: number, ay: number, aw: number, ah?: number): void;\n        viewWidth: number;\n        viewHeight: number;\n        getSnappingPosition(xValue: number, yValue: number, resultPoint?: egret.Point): egret.Point;\n        childSortingOrderChanged(child: GObject, oldValue: number, newValue?: number): void;\n        constructFromResource(): void;\n        constructFromResource2(objectPool: Array<GObject>, poolIndex: number): void;\n        protected onConstruct(): void;\n        protected constructExtension(buffer: ByteBuffer): void;\n        protected constructFromXML(xml: any): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n        private ___added;\n        private ___removed;\n    }\n}\ndeclare module fgui {\n    class GButton extends GComponent {\n        protected _titleObject: GObject;\n        protected _iconObject: GObject;\n        private _mode;\n        private _selected;\n        private _title;\n        private _selectedTitle;\n        private _icon;\n        private _selectedIcon;\n        private _sound;\n        private _soundVolumeScale;\n        private _buttonController;\n        private _relatedController?;\n        private _relatedPageId;\n        private _changeStateOnClick;\n        private _linkedPopup?;\n        private _downEffect;\n        private _downEffectValue;\n        private _downScaled?;\n        private _down;\n        private _over;\n        static UP: string;\n        static DOWN: string;\n        static OVER: string;\n        static SELECTED_OVER: string;\n        static DISABLED: string;\n        static SELECTED_DISABLED: string;\n        constructor();\n        icon: string;\n        selectedIcon: string;\n        title: string;\n        text: string;\n        selectedTitle: string;\n        titleColor: number;\n        titleFontSize: number;\n        sound: string;\n        soundVolumeScale: number;\n        selected: boolean;\n        mode: ButtonMode;\n        relatedController: Controller;\n        relatedPageId: string;\n        changeStateOnClick: boolean;\n        linkedPopup: GObject;\n        getTextField(): GTextField;\n        addStateListener(listener: Function, thisObj: any): void;\n        removeStateListener(listener: Function, thisObj: any): void;\n        fireClick(downEffect?: boolean): void;\n        protected setState(val: string): void;\n        handleControllerChanged(c: Controller): void;\n        protected handleGrayedChanged(): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        protected constructExtension(buffer: ByteBuffer): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n        private __mousedown;\n        private __mouseup;\n        private __click;\n    }\n}\ndeclare module fgui {\n    class GComboBox extends GComponent {\n        dropdown: GComponent;\n        protected _titleObject: GObject;\n        protected _iconObject: GObject;\n        protected _list: GList;\n        private _items;\n        private _values;\n        private _icons?;\n        private _visibleItemCount;\n        private _itemsUpdated;\n        private _selectedIndex;\n        private _buttonController;\n        private _popupDirection;\n        private _selectionController?;\n        private _over;\n        private _down;\n        constructor();\n        text: string;\n        icon: string;\n        titleColor: number;\n        titleFontSize: number;\n        visibleItemCount: number;\n        popupDirection: PopupDirection;\n        items: Array<string>;\n        icons: Array<string>;\n        values: Array<string>;\n        selectedIndex: number;\n        value: string;\n        selectionController: Controller;\n        getTextField(): GTextField;\n        protected setState(val: string): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        protected constructExtension(buffer: ByteBuffer): void;\n        handleControllerChanged(c: Controller): void;\n        private updateSelectionController;\n        dispose(): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n        protected showDropdown(): void;\n        private __popupWinClosed;\n        private __clickItem;\n        private __clickItem2;\n        private __mousedown;\n        private __mouseup;\n    }\n}\ndeclare module fgui {\n    class GGraph extends GObject {\n        private _graphics;\n        private _type;\n        private _lineSize;\n        private _lineColor;\n        private _lineAlpha;\n        private _fillColor;\n        private _fillAlpha;\n        private _cornerRadius?;\n        private _sides?;\n        private _startAngle?;\n        private _polygonPoints?;\n        private _distances?;\n        constructor();\n        readonly graphics: egret.Graphics;\n        drawRect(lineSize: number, lineColor: number, lineAlpha: number, fillColor: number, fillAlpha: number, corner?: Array<number>): void;\n        drawEllipse(lineSize: number, lineColor: number, lineAlpha: number, fillColor: number, fillAlpha: number): void;\n        drawRegularPolygon(lineSize: number, lineColor: number, lineAlpha: number, fillColor: number, fillAlpha: number, sides: number, startAngle?: number, distances?: number[]): void;\n        drawPolygon(lineSize: number, lineColor: number, lineAlpha: number, fillColor: number, fillAlpha: number, points: number[]): void;\n        distances: number[];\n        clearGraphics(): void;\n        color: number;\n        private updateGraph;\n        replaceMe(target: GObject): void;\n        addBeforeMe(target: GObject): void;\n        addAfterMe(target: GObject): void;\n        setNativeObject(obj: egret.DisplayObject): void;\n        protected createDisplayObject(): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        protected handleSizeChanged(): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare namespace fgui {\n    class GGroup extends GObject {\n        private _layout;\n        private _lineGap;\n        private _columnGap;\n        private _excludeInvisibles?;\n        private _autoSizeDisabled?;\n        private _mainGridIndex;\n        private _mainGridMinSize;\n        private _boundsChanged;\n        private _percentReady;\n        private _mainChildIndex;\n        private _totalSize;\n        private _numChildren;\n        _updating: number;\n        constructor();\n        dispose(): void;\n        layout: number;\n        lineGap: number;\n        columnGap: number;\n        excludeInvisibles: boolean;\n        autoSizeDisabled: boolean;\n        mainGridMinSize: number;\n        mainGridIndex: number;\n        setBoundsChangedFlag(positionChangedOnly?: boolean): void;\n        ensureSizeCorrect(): void;\n        ensureBoundsCorrect(): void;\n        private updateBounds;\n        private handleLayout;\n        moveChildren(dx: number, dy: number): void;\n        resizeChildren(dw: number, dh: number): void;\n        handleAlphaChanged(): void;\n        handleVisibleChanged(): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare module fgui {\n    class GImage extends GObject {\n        private _content;\n        private _flip;\n        constructor();\n        color: number;\n        flip: FlipType;\n        fillMethod: number;\n        fillOrigin: number;\n        fillClockwise: boolean;\n        fillAmount: number;\n        texture: egret.Texture;\n        protected createDisplayObject(): void;\n        constructFromResource(): void;\n        protected handleXYChanged(): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare module fgui {\n    class GLabel extends GComponent {\n        protected _titleObject: GObject;\n        protected _iconObject: GObject;\n        constructor();\n        icon: string;\n        title: string;\n        text: string;\n        titleColor: number;\n        titleFontSize: number;\n        editable: boolean;\n        getTextField(): GTextField;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        protected constructExtension(buffer: ByteBuffer): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare module fgui {\n    class GList extends GComponent {\n        itemRenderer: (index: number, item: GObject) => void;\n        itemProvider: (index: number) => string;\n        callbackThisObj: any;\n        scrollItemToViewOnClick: boolean;\n        foldInvisibleItems: boolean;\n        private _layout;\n        private _lineCount;\n        private _columnCount;\n        private _lineGap;\n        private _columnGap;\n        private _defaultItem;\n        private _autoResizeItem;\n        private _selectionMode;\n        private _align;\n        private _verticalAlign;\n        private _selectionController?;\n        private _lastSelectedIndex;\n        private _pool;\n        private _virtual?;\n        private _loop?;\n        private _numItems;\n        private _realNumItems;\n        private _firstIndex;\n        private _curLineItemCount;\n        private _curLineItemCount2;\n        private _itemSize?;\n        private _virtualListChanged;\n        private _virtualItems?;\n        private _eventLocked?;\n        private itemInfoVer;\n        constructor();\n        dispose(): void;\n        layout: ListLayoutType;\n        lineCount: number;\n        columnCount: number;\n        lineGap: number;\n        columnGap: number;\n        align: AlignType;\n        verticalAlign: VertAlignType;\n        virtualItemSize: egret.Point;\n        defaultItem: string;\n        autoResizeItem: boolean;\n        selectionMode: ListSelectionMode;\n        selectionController: Controller;\n        readonly itemPool: GObjectPool;\n        getFromPool(url?: string): GObject;\n        returnToPool(obj: GObject): void;\n        addChildAt(child: GObject, index: number): GObject;\n        addItem(url?: string): GObject;\n        addItemFromPool(url?: string): GObject;\n        removeChildAt(index: number, dispose?: boolean): GObject;\n        removeChildToPoolAt(index: number): void;\n        removeChildToPool(child: GObject): void;\n        removeChildrenToPool(beginIndex?: number, endIndex?: number): void;\n        selectedIndex: number;\n        getSelection(result?: number[]): number[];\n        addSelection(index: number, scrollItToView?: boolean): void;\n        removeSelection(index: number): void;\n        clearSelection(): void;\n        private clearSelectionExcept;\n        selectAll(): void;\n        selectNone(): void;\n        selectReverse(): void;\n        handleArrowKey(dir: number): void;\n        private __clickItem;\n        protected dispatchItemEvent(evt: ItemEvent): void;\n        private setSelectionOnEvent;\n        resizeToFit(itemCount?: number, minSize?: number): void;\n        getMaxItemWidth(): number;\n        protected handleSizeChanged(): void;\n        handleControllerChanged(c: Controller): void;\n        private updateSelectionController;\n        getSnappingPosition(xValue: number, yValue: number, result?: egret.Point): egret.Point;\n        scrollToView(index: number, ani?: boolean, setFirst?: boolean): void;\n        getFirstChildInView(): number;\n        childIndexToItemIndex(index: number): number;\n        itemIndexToChildIndex(index: number): number;\n        setVirtual(): void;\n        setVirtualAndLoop(): void;\n        private _setVirtual;\n        numItems: number;\n        refreshVirtualList(): void;\n        private checkVirtualList;\n        private setVirtualListChangedFlag;\n        private _refreshVirtualList;\n        private __scrolled;\n        private getIndexOnPos1;\n        private getIndexOnPos2;\n        private getIndexOnPos3;\n        private handleScroll;\n        private handleScroll1;\n        private handleScroll2;\n        private handleScroll3;\n        private handleArchOrder1;\n        private handleArchOrder2;\n        private handleAlign;\n        protected updateBounds(): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n        protected readItems(buffer: ByteBuffer): void;\n        protected setupItem(buffer: ByteBuffer, obj: GObject): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare module fgui {\n    class GObjectPool {\n        private _pool;\n        private _count;\n        constructor();\n        clear(): void;\n        readonly count: number;\n        getObject(url: string): GObject;\n        returnObject(obj: GObject): void;\n    }\n}\ndeclare module fgui {\n    class GLoader extends GObject {\n        private _url;\n        private _align;\n        private _verticalAlign;\n        private _autoSize;\n        private _fill;\n        private _shrinkOnly;\n        private _showErrorSign;\n        private _contentItem;\n        private _container;\n        private _content;\n        private _errorSign?;\n        private _content2?;\n        private _updatingLayout;\n        private static _errorSignPool;\n        constructor();\n        protected createDisplayObject(): void;\n        dispose(): void;\n        url: string;\n        icon: string;\n        align: AlignType;\n        verticalAlign: VertAlignType;\n        fill: LoaderFillType;\n        shrinkOnly: boolean;\n        autoSize: boolean;\n        playing: boolean;\n        frame: number;\n        color: number;\n        showErrorSign: boolean;\n        readonly content: MovieClip;\n        readonly component: GComponent;\n        texture: egret.Texture;\n        fillMethod: number;\n        fillOrigin: number;\n        fillClockwise: boolean;\n        fillAmount: number;\n        protected loadContent(): void;\n        protected loadFromPackage(itemURL: string): void;\n        protected loadExternal(): void;\n        protected freeExternal(texture: egret.Texture): void;\n        protected onExternalLoadSuccess(texture: egret.Texture): void;\n        protected onExternalLoadFailed(): void;\n        private __getResCompleted;\n        private setErrorState;\n        private clearErrorState;\n        private updateLayout;\n        private clearContent;\n        protected handleSizeChanged(): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare namespace fgui {\n    class GLoader3D extends GObject {\n        private _url;\n        private _align;\n        private _verticalAlign;\n        private _autoSize;\n        private _fill;\n        private _shrinkOnly;\n        private _playing;\n        private _frame;\n        private _loop;\n        private _animationName;\n        private _skinName;\n        private _color;\n        private _contentItem;\n        private _container;\n        private _content;\n        private _updatingLayout;\n        constructor();\n        protected createDisplayObject(): void;\n        dispose(): void;\n        url: string;\n        icon: string;\n        align: AlignType;\n        verticalAlign: VertAlignType;\n        fill: LoaderFillType;\n        shrinkOnly: boolean;\n        autoSize: boolean;\n        playing: boolean;\n        frame: number;\n        animationName: string;\n        skinName: string;\n        loop: boolean;\n        color: number;\n        readonly content: egret.DisplayObject;\n        protected loadContent(): void;\n        protected loadFromPackage(itemURL: string): void;\n        private onLoaded;\n        setDragonBones(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string, anchor?: egret.Point): void;\n        private onChange;\n        private onChangeDragonBones;\n        protected loadExternal(): void;\n        private updateLayout;\n        private clearContent;\n        protected handleSizeChanged(): void;\n        protected handleGrayedChanged(): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare module fgui {\n    class GMovieClip extends GObject {\n        private _content;\n        constructor();\n        color: number;\n        protected createDisplayObject(): void;\n        playing: boolean;\n        frame: number;\n        timeScale: number;\n        rewind(): void;\n        syncStatus(anotherMc: GMovieClip): void;\n        advance(timeInMiniseconds: number): void;\n        setPlaySettings(start?: number, end?: number, times?: number, endAt?: number, endCallback?: Function, callbackObj?: any): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        constructFromResource(): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare module fgui {\n    class GProgressBar extends GComponent {\n        private _min;\n        private _max;\n        private _value;\n        private _titleType;\n        private _reverse;\n        private _titleObject;\n        private _aniObject;\n        private _barObjectH;\n        private _barObjectV;\n        private _barMaxWidth;\n        private _barMaxHeight;\n        private _barMaxWidthDelta;\n        private _barMaxHeightDelta;\n        private _barStartX;\n        private _barStartY;\n        constructor();\n        titleType: ProgressTitleType;\n        min: number;\n        max: number;\n        value: number;\n        tweenValue(value: number, duration: number): GTweener;\n        update(newValue: number): void;\n        private setFillAmount;\n        protected constructExtension(buffer: ByteBuffer): void;\n        protected handleSizeChanged(): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare module fgui {\n    class GTextField extends GObject {\n        protected _textField: egret.TextField;\n        protected _bitmapContainer?: egret.DisplayObjectContainer;\n        protected _font: string;\n        protected _fontSize: number;\n        protected _align: AlignType;\n        protected _verticalAlign: VertAlignType;\n        protected _color: number;\n        protected _leading: number;\n        protected _letterSpacing: number;\n        protected _underline: boolean;\n        protected _text: string;\n        protected _ubbEnabled: boolean;\n        protected _templateVars?: {\n            [index: string]: string;\n        };\n        protected _autoSize: AutoSizeType;\n        protected _widthAutoSize: boolean;\n        protected _heightAutoSize: boolean;\n        protected _updatingSize: boolean;\n        protected _sizeDirty: boolean;\n        protected _textWidth: number;\n        protected _textHeight: number;\n        protected _requireRender: boolean;\n        protected _bitmapFont?: BitmapFont;\n        protected _lines?: Array<LineInfo>;\n        protected _bitmapPool?: Array<egret.Bitmap>;\n        protected static _htmlParser: egret.HtmlTextParser;\n        constructor();\n        protected createDisplayObject(): void;\n        private switchBitmapMode;\n        dispose(): void;\n        text: string;\n        protected updateTextFieldText(): void;\n        font: string;\n        fontSize: number;\n        color: number;\n        align: AlignType;\n        verticalAlign: VertAlignType;\n        private getAlignTypeString;\n        private getVertAlignTypeString;\n        leading: number;\n        letterSpacing: number;\n        underline: boolean;\n        bold: boolean;\n        italic: boolean;\n        singleLine: boolean;\n        stroke: number;\n        strokeColor: number;\n        ubbEnabled: boolean;\n        autoSize: AutoSizeType;\n        readonly textWidth: number;\n        ensureSizeCorrect(): void;\n        protected updateTextFormat(): void;\n        protected render(): void;\n        private __render;\n        protected renderNow(updateBounds?: boolean): void;\n        private renderWithBitmapFont;\n        protected handleSizeChanged(): void;\n        protected parseTemplate(template: string): string;\n        templateVars: {\n            [index: string]: string;\n        };\n        setVar(name: string, value: string): GTextField;\n        flushVars(): void;\n        protected handleGrayedChanged(): void;\n        private doAlign;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n    interface LineInfo {\n        width: number;\n        height: number;\n        textHeight: number;\n        text: string;\n        y: number;\n    }\n}\ndeclare module fgui {\n    class GRichTextField extends GTextField {\n        constructor();\n        protected updateTextFieldText(): void;\n    }\n}\ndeclare module fgui {\n    class GRoot extends GComponent {\n        static contentScaleLevel: number;\n        private _nativeStage;\n        private _modalLayer;\n        private _popupStack;\n        private _justClosedPopups;\n        private _modalWaitPane;\n        private _tooltipWin;\n        private _defaultTooltipWin;\n        private _volumeScale;\n        private static _inst;\n        static touchScreen: boolean;\n        static contentScaleFactor: number;\n        static touchDown: boolean;\n        static ctrlKeyDown: boolean;\n        static shiftKeyDown: boolean;\n        static mouseX: number;\n        static mouseY: number;\n        static readonly inst: GRoot;\n        constructor();\n        readonly nativeStage: egret.Stage;\n        showWindow(win: Window): void;\n        hideWindow(win: Window): void;\n        hideWindowImmediately(win: Window): void;\n        bringToFront(win: Window): void;\n        showModalWait(msg?: string): void;\n        closeModalWait(): void;\n        closeAllExceptModals(): void;\n        closeAllWindows(): void;\n        getTopWindow(): Window;\n        readonly modalLayer: GGraph;\n        readonly hasModalWindow: boolean;\n        readonly modalWaiting: boolean;\n        showPopup(popup: GObject, target?: GObject, dir?: PopupDirection | boolean): void;\n        togglePopup(popup: GObject, target?: GObject, dir?: PopupDirection | boolean): void;\n        hidePopup(popup?: GObject): void;\n        readonly hasAnyPopup: boolean;\n        private closePopup;\n        showTooltips(msg: string): void;\n        showTooltipsWin(tooltipWin: GObject, position?: egret.Point): void;\n        hideTooltips(): void;\n        getObjectUnderPoint(globalX: number, globalY: number): GObject;\n        focus: GObject;\n        private setFocus;\n        volumeScale: number;\n        playOneShotSound(sound: egret.Sound, volumeScale?: number): void;\n        private adjustModalLayer;\n        private __addedToStage;\n        private __stageMouseDownCapture;\n        private __stageMouseMoveCapture;\n        private __stageMouseUpCapture;\n        private __winResize;\n        private updateContentScaleLevel;\n    }\n}\ndeclare module fgui {\n    class GScrollBar extends GComponent {\n        private _grip;\n        private _arrowButton1;\n        private _arrowButton2;\n        private _bar;\n        private _target;\n        private _vertical;\n        private _scrollPerc;\n        private _fixedGripSize;\n        private _dragOffset;\n        private _gripDragging;\n        constructor();\n        setScrollPane(target: ScrollPane, vertical: boolean): void;\n        setDisplayPerc(value: number): void;\n        setScrollPerc(val: number): void;\n        readonly minSize: number;\n        readonly gripDragging: boolean;\n        protected constructExtension(buffer: ByteBuffer): void;\n        private __gripMouseDown;\n        private __gripMouseMove;\n        private __gripMouseUp;\n        private __arrowButton1Click;\n        private __arrowButton2Click;\n        private __barMouseDown;\n    }\n}\ndeclare module fgui {\n    class GSlider extends GComponent {\n        private _min;\n        private _max;\n        private _value;\n        private _titleType;\n        private _reverse;\n        private _wholeNumbers;\n        private _titleObject;\n        private _barObjectH;\n        private _barObjectV;\n        private _barMaxWidth;\n        private _barMaxHeight;\n        private _barMaxWidthDelta;\n        private _barMaxHeightDelta;\n        private _gripObject;\n        private _clickPos;\n        private _clickPercent;\n        private _barStartX;\n        private _barStartY;\n        changeOnClick: boolean;\n        canDrag: boolean;\n        constructor();\n        titleType: ProgressTitleType;\n        wholeNumbers: boolean;\n        min: number;\n        max: number;\n        value: number;\n        update(): void;\n        private updateWithPercent;\n        protected constructExtension(buffer: ByteBuffer): void;\n        protected handleSizeChanged(): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n        private __gripMouseDown;\n        private __gripMouseMove;\n        private __gripMouseUp;\n        private __barMouseDown;\n    }\n}\ndeclare module fgui {\n    class GTextInput extends GTextField {\n        private _promptText;\n        private _password;\n        constructor();\n        dispose(): void;\n        editable: boolean;\n        maxLength: number;\n        promptText: string;\n        restrict: string;\n        password: boolean;\n        verticalAlign: VertAlignType;\n        private updateVertAlign;\n        protected updateTextFieldText(): void;\n        protected handleSizeChanged(): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n        private __textChanged;\n        private __focusIn;\n        private __focusOut;\n    }\n}\ndeclare namespace fgui {\n    class GTree extends GList {\n        treeNodeRender: (node: GTreeNode, obj: GComponent) => void;\n        treeNodeWillExpand: (node: GTreeNode, expanded: boolean) => void;\n        private _indent;\n        private _clickToExpand;\n        private _rootNode;\n        private _expandedStatusInEvt;\n        constructor();\n        readonly rootNode: GTreeNode;\n        indent: number;\n        clickToExpand: number;\n        getSelectedNode(): GTreeNode;\n        getSelectedNodes(result?: Array<GTreeNode>): Array<GTreeNode>;\n        selectNode(node: GTreeNode, scrollItToView?: boolean): void;\n        unselectNode(node: GTreeNode): void;\n        expandAll(folderNode?: GTreeNode): void;\n        collapseAll(folderNode?: GTreeNode): void;\n        private createCell;\n        _afterInserted(node: GTreeNode): void;\n        private getInsertIndexForNode;\n        _afterRemoved(node: GTreeNode): void;\n        _afterExpanded(node: GTreeNode): void;\n        _afterCollapsed(node: GTreeNode): void;\n        _afterMoved(node: GTreeNode): void;\n        private getFolderEndIndex;\n        private checkChildren;\n        private hideFolderNode;\n        private removeNode;\n        private __cellMouseDown;\n        private __expandedStateChanged;\n        protected dispatchItemEvent(evt: ItemEvent): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n        protected readItems(buffer: ByteBuffer): void;\n    }\n}\ndeclare namespace fgui {\n    class GTreeNode {\n        data: any;\n        private _parent;\n        private _children;\n        private _expanded;\n        private _level;\n        private _tree;\n        _cell: GComponent;\n        _resURL?: string;\n        constructor(hasChild: boolean, resURL?: string);\n        expanded: boolean;\n        readonly isFolder: boolean;\n        readonly parent: GTreeNode;\n        text: string;\n        icon: string;\n        readonly cell: GComponent;\n        readonly level: number;\n        _setLevel(value: number): void;\n        addChild(child: GTreeNode): GTreeNode;\n        addChildAt(child: GTreeNode, index: number): GTreeNode;\n        removeChild(child: GTreeNode): GTreeNode;\n        removeChildAt(index: number): GTreeNode;\n        removeChildren(beginIndex?: number, endIndex?: number): void;\n        getChildAt(index: number): GTreeNode;\n        getChildIndex(child: GTreeNode): number;\n        getPrevSibling(): GTreeNode;\n        getNextSibling(): GTreeNode;\n        setChildIndex(child: GTreeNode, index: number): void;\n        swapChildren(child1: GTreeNode, child2: GTreeNode): void;\n        swapChildrenAt(index1: number, index2: number): void;\n        readonly numChildren: number;\n        expandToRoot(): void;\n        readonly tree: GTree;\n        _setTree(value: GTree): void;\n    }\n}\ndeclare module fgui {\n    interface IUISource {\n        fileName: string;\n        loaded: boolean;\n        load(callback: Function, thisObj: any): void;\n    }\n}\ndeclare module fgui {\n    class Margin {\n        left: number;\n        right: number;\n        top: number;\n        bottom: number;\n        constructor();\n        copy(source: Margin): void;\n    }\n}\ndeclare namespace fgui {\n    class PixelHitTest {\n        private _data;\n        offsetX: number;\n        offsetY: number;\n        scaleX: number;\n        scaleY: number;\n        constructor(data: PixelHitTestData, offsetX: number, offsetY: number);\n        contains(x: number, y: number): boolean;\n    }\n    class PixelHitTestData {\n        pixelWidth: number;\n        scale: number;\n        pixels: number[];\n        constructor();\n        load(ba: ByteBuffer): void;\n    }\n}\ndeclare module fgui {\n    class PackageItem {\n        owner: UIPackage;\n        type: PackageItemType;\n        objectType?: ObjectType;\n        id: string;\n        name: string;\n        width: number;\n        height: number;\n        file: string;\n        decoded?: boolean;\n        loading?: Array<Function>;\n        rawData?: ByteBuffer;\n        asset?: egret.Texture | egret.Sound | any;\n        highResolution?: Array<string>;\n        branches?: Array<string>;\n        scale9Grid?: egret.Rectangle;\n        scaleByTile?: boolean;\n        tileGridIndice?: number;\n        smoothing?: boolean;\n        pixelHitTestData?: PixelHitTestData;\n        interval?: number;\n        repeatDelay?: number;\n        swing?: boolean;\n        frames?: Array<Frame>;\n        extensionType?: any;\n        bitmapFont?: BitmapFont;\n        skeletonAnchor?: egret.Point;\n        armatureName?: string;\n        constructor();\n        load(): Object;\n        getBranch(): PackageItem;\n        getHighResolution(): PackageItem;\n        toString(): string;\n    }\n}\ndeclare module fgui {\n    class PopupMenu {\n        protected _contentPane: GComponent;\n        protected _list: GList;\n        constructor(resourceURL?: string);\n        dispose(): void;\n        addItem(caption: string, callback?: (item?: ItemEvent) => void): GButton;\n        addItemAt(caption: string, index: number, callback?: (item?: ItemEvent) => void): GButton;\n        addSeperator(): void;\n        getItemName(index: number): string;\n        setItemText(name: string, caption: string): void;\n        setItemVisible(name: string, visible: boolean): void;\n        setItemGrayed(name: string, grayed: boolean): void;\n        setItemCheckable(name: string, checkable: boolean): void;\n        setItemChecked(name: string, checked: boolean): void;\n        isItemChecked(name: string): boolean;\n        removeItem(name: string): boolean;\n        clearItems(): void;\n        readonly itemCount: number;\n        readonly contentPane: GComponent;\n        readonly list: GList;\n        show(target?: GObject, dir?: PopupDirection | boolean): void;\n        private __clickItem;\n        private __clickItem2;\n        private __addedToStage;\n    }\n}\ndeclare module fgui {\n    class RelationItem {\n        private _owner;\n        private _target;\n        private _defs;\n        private _targetX;\n        private _targetY;\n        private _targetWidth;\n        private _targetHeight;\n        constructor(owner: GObject);\n        readonly owner: GObject;\n        target: GObject;\n        add(relationType: number, usePercent: boolean): void;\n        internalAdd(relationType: number, usePercent: boolean): void;\n        remove(relationType?: number): void;\n        copyFrom(source: RelationItem): void;\n        dispose(): void;\n        readonly isEmpty: boolean;\n        applyOnSelfResized(dWidth: number, dHeight: number, applyPivot: boolean): void;\n        private applyOnXYChanged;\n        private applyOnSizeChanged;\n        private addRefTarget;\n        private releaseRefTarget;\n        private __targetXYChanged;\n        private __targetSizeChanged;\n        private __targetSizeWillChange;\n    }\n    class RelationDef {\n        percent: boolean;\n        type: number;\n        axis: number;\n        constructor();\n        copyFrom(source: RelationDef): void;\n    }\n}\ndeclare module fgui {\n    class Relations {\n        private _owner;\n        private _items;\n        handling: GObject;\n        sizeDirty: boolean;\n        constructor(owner: GObject);\n        add(target: GObject, relationType: number, usePercent?: boolean): void;\n        remove(target: GObject, relationType?: number): void;\n        contains(target: GObject): boolean;\n        clearFor(target: GObject): void;\n        clearAll(): void;\n        copyFrom(source: Relations): void;\n        dispose(): void;\n        onOwnerSizeChanged(dWidth: number, dHeight: number, applyPivot: boolean): void;\n        ensureRelationsSizeCorrect(): void;\n        readonly empty: boolean;\n        setup(buffer: ByteBuffer, parentToChild: boolean): void;\n    }\n}\ndeclare module fgui {\n    class ScrollPane extends egret.EventDispatcher {\n        private _owner;\n        private _container;\n        private _maskContainer;\n        private _alignContainer?;\n        private _scrollType;\n        private _scrollStep;\n        private _decelerationRate;\n        private _scrollBarMargin;\n        private _bouncebackEffect;\n        private _touchEffect;\n        private _scrollBarDisplayAuto?;\n        private _vScrollNone;\n        private _hScrollNone;\n        private _needRefresh;\n        private _refreshBarAxis;\n        private _displayOnLeft?;\n        private _snapToItem?;\n        _displayInDemand?: boolean;\n        private _pageMode?;\n        private _inertiaDisabled?;\n        private _floating?;\n        private _dontClipMargin?;\n        private _xPos;\n        private _yPos;\n        private _viewSize;\n        private _contentSize;\n        private _overlapSize;\n        private _pageSize;\n        private _containerPos;\n        private _beginTouchPos;\n        private _lastTouchPos;\n        private _lastTouchGlobalPos;\n        private _velocity;\n        private _velocityScale;\n        private _lastMoveTime;\n        private _isHoldAreaDone;\n        private _aniFlag;\n        _loop: number;\n        private _headerLockedSize;\n        private _footerLockedSize;\n        private _refreshEventDispatching;\n        private _dragged;\n        private _tweening;\n        private _tweenTime;\n        private _tweenDuration;\n        private _tweenStart;\n        private _tweenChange;\n        private _pageController?;\n        private _hzScrollBar?;\n        private _vtScrollBar?;\n        private _header?;\n        private _footer?;\n        static draggingPane: ScrollPane;\n        static SCROLL: string;\n        static SCROLL_END: string;\n        static PULL_DOWN_RELEASE: string;\n        static PULL_UP_RELEASE: string;\n        constructor(owner: GComponent);\n        setup(buffer: ByteBuffer): void;\n        dispose(): void;\n        readonly owner: GComponent;\n        readonly hzScrollBar: GScrollBar;\n        readonly vtScrollBar: GScrollBar;\n        readonly header: GComponent;\n        readonly footer: GComponent;\n        bouncebackEffect: boolean;\n        touchEffect: boolean;\n        scrollStep: number;\n        decelerationRate: number;\n        snapToItem: boolean;\n        readonly isDragged: boolean;\n        percX: number;\n        setPercX(value: number, ani?: boolean): void;\n        percY: number;\n        setPercY(value: number, ani?: boolean): void;\n        posX: number;\n        setPosX(value: number, ani?: boolean): void;\n        posY: number;\n        setPosY(value: number, ani?: boolean): void;\n        readonly contentWidth: number;\n        readonly contentHeight: number;\n        viewWidth: number;\n        viewHeight: number;\n        currentPageX: number;\n        currentPageY: number;\n        setCurrentPageX(value: number, ani?: boolean): void;\n        setCurrentPageY(value: number, ani?: boolean): void;\n        readonly isBottomMost: boolean;\n        readonly isRightMost: boolean;\n        pageController: Controller;\n        readonly scrollingPosX: number;\n        readonly scrollingPosY: number;\n        scrollTop(ani?: boolean): void;\n        scrollBottom(ani?: boolean): void;\n        scrollUp(ratio?: number, ani?: boolean): void;\n        scrollDown(ratio?: number, ani?: boolean): void;\n        scrollLeft(ratio?: number, ani?: boolean): void;\n        scrollRight(ratio?: number, ani?: boolean): void;\n        scrollToView(target: egret.Rectangle | GObject, ani?: boolean, setFirst?: boolean): void;\n        isChildInView(obj: GObject): boolean;\n        cancelDragging(): void;\n        lockHeader(size: number): void;\n        lockFooter(size: number): void;\n        onOwnerSizeChanged(): void;\n        handleControllerChanged(c: Controller): void;\n        private updatePageController;\n        adjustMaskContainer(): void;\n        setSize(aWidth: number, aHeight: number): void;\n        setContentSize(aWidth: number, aHeight: number): void;\n        changeContentSizeOnScrolling(deltaWidth: number, deltaHeight: number, deltaPosX: number, deltaPosY: number): void;\n        private handleSizeChanged;\n        private posChanged;\n        private refresh;\n        private refresh2;\n        private __touchBegin;\n        private __touchMove;\n        private __touchEnd;\n        private __touchTap;\n        private updateScrollBarPos;\n        updateScrollBarVisible(): void;\n        private updateScrollBarVisible2;\n        private __barTweenComplete;\n        private getLoopPartSize;\n        private loopCheckingCurrent;\n        private loopCheckingTarget;\n        private loopCheckingTarget2;\n        private loopCheckingNewPos;\n        private alignPosition;\n        private alignByPage;\n        private updateTargetAndDuration;\n        private updateTargetAndDuration2;\n        private fixDuration;\n        private startTween;\n        private killTween;\n        private checkRefreshBar;\n        private tweenUpdate;\n        private runTween;\n    }\n}\ndeclare module fgui {\n    class Transition {\n        name: string;\n        private _owner;\n        private _ownerBaseX;\n        private _ownerBaseY;\n        private _items;\n        private _totalTimes;\n        private _totalTasks;\n        private _playing;\n        private _paused;\n        private _onComplete;\n        private _onCompleteCaller;\n        private _onCompleteParam;\n        private _options;\n        private _reversed;\n        private _totalDuration;\n        private _autoPlay;\n        private _autoPlayTimes;\n        private _autoPlayDelay;\n        private _timeScale;\n        private _startTime;\n        private _endTime;\n        constructor(owner: GComponent);\n        play(onComplete?: () => void, onCompleteObj?: any, onCompleteParam?: any, times?: number, delay?: number, startTime?: number, endTime?: number): void;\n        playReverse(onComplete?: () => void, onCompleteObj?: any, onCompleteParam?: any, times?: number, delay?: number): void;\n        changePlayTimes(value: number): void;\n        setAutoPlay(value: boolean, times?: number, delay?: number): void;\n        private _play;\n        stop(setToComplete?: boolean, processCallback?: boolean): void;\n        private stopItem;\n        setPaused(paused: boolean): void;\n        dispose(): void;\n        readonly playing: boolean;\n        setValue(label: string, ...args: any[]): void;\n        setHook(label: string, callback: Function, caller?: any): void;\n        clearHooks(): void;\n        setTarget(label: string, newTarget: GObject): void;\n        setDuration(label: string, value: number): void;\n        getLabelTime(label: string): number;\n        timeScale: number;\n        updateFromRelations(targetId: string, dx: number, dy: number): void;\n        onOwnerAddedToStage(): void;\n        onOwnerRemovedFromStage(): void;\n        private onDelayedPlay;\n        private internalPlay;\n        private playItem;\n        private skipAnimations;\n        private onDelayedPlayItem;\n        private onTweenStart;\n        private onTweenUpdate;\n        private onTweenComplete;\n        private onPlayTransCompleted;\n        private callHook;\n        private checkAllComplete;\n        private applyValue;\n        setup(buffer: ByteBuffer): void;\n        private decodeValue;\n    }\n}\ndeclare module fgui {\n    class TranslationHelper {\n        static strings: {\n            [index: string]: {\n                [index: string]: string;\n            };\n        };\n        static loadFromXML(source: string): void;\n        static translateComponent(item: PackageItem): void;\n    }\n}\ndeclare module fgui {\n    class UIConfig {\n        constructor();\n        static defaultFont: string;\n        static windowModalWaiting: string;\n        static globalModalWaiting: string;\n        static modalLayerColor: number;\n        static modalLayerAlpha: number;\n        static buttonSound: string;\n        static buttonSoundVolumeScale: number;\n        static horizontalScrollBar: string;\n        static verticalScrollBar: string;\n        static defaultScrollStep: number;\n        static defaultScrollDecelerationRate: number;\n        static defaultScrollBarDisplay: number;\n        static defaultScrollTouchEffect: boolean;\n        static defaultScrollBounceEffect: boolean;\n        static popupMenu: string;\n        static popupMenu_seperator: string;\n        static loaderErrorSign: string;\n        static tooltipsWin: string;\n        static defaultComboBoxVisibleItemCount: number;\n        static touchScrollSensitivity: number;\n        static touchDragSensitivity: number;\n        static clickDragSensitivity: number;\n        static bringWindowToFrontOnClick: boolean;\n        static frameTimeForAsyncUIConstruction: number;\n    }\n}\ndeclare module fgui {\n    class UIObjectFactory {\n        static extensions: {\n            [index: string]: new () => GComponent;\n        };\n        static loaderType: new () => GLoader;\n        constructor();\n        static setExtension(url: string, type: new () => GComponent): void;\n        static setPackageItemExtension(url: string, type: new () => GComponent): void;\n        static setLoaderExtension(type: new () => GLoader): void;\n        static resolvePackageItemExtension(pi: PackageItem): void;\n        static newObject(type: number | PackageItem, userClass?: new () => GObject): GObject;\n    }\n}\ndeclare module fgui {\n    class UIPackage {\n        private _id;\n        private _name;\n        private _items;\n        private _itemsById;\n        private _itemsByName;\n        private _resKey;\n        private _customId;\n        private _sprites;\n        private _dependencies;\n        private _branches;\n        _branchIndex: number;\n        static _constructing: number;\n        private static _instById;\n        private static _instByName;\n        private static _branch;\n        private static _vars;\n        constructor();\n        static branch: string;\n        static getVar(key: string): string;\n        static setVar(key: string, value: string): void;\n        static getById(id: string): UIPackage;\n        static getByName(name: string): UIPackage;\n        static loadPackage(resKey: string): Promise<UIPackage>;\n        static addPackage(resKey: string, descData?: ArrayBuffer): UIPackage;\n        static removePackage(packageIdOrName: string): void;\n        static createObject(pkgName: string, resName: string, userClass?: new () => GObject): GObject;\n        static createObjectFromURL(url: string, userClass?: new () => GObject): GObject;\n        static getItemURL(pkgName: string, resName: string): string;\n        static getItemByURL(url: string): PackageItem;\n        static normalizeURL(url: string): string;\n        static setStringsSource(source: string): void;\n        private loadPackage;\n        dispose(): void;\n        readonly id: string;\n        readonly name: string;\n        customId: string;\n        createObject(resName: string, userClass?: new () => GObject): GObject;\n        internalCreateObject(item: PackageItem, userClass?: new () => GObject): GObject;\n        getItemById(itemId: string): PackageItem;\n        getItemByName(resName: string): PackageItem;\n        getItemAssetByName(resName: string): Object;\n        getItemAsset(item: PackageItem): Object;\n        getItemAssetAsync(item: PackageItem, onComplete?: (err: any, item: PackageItem) => void): void;\n        private loadMovieClip;\n        private loadFont;\n        private loadDragonBones;\n    }\n}\ndeclare module fgui {\n    class Window extends GComponent {\n        private _contentPane;\n        private _modalWaitPane;\n        private _closeButton;\n        private _dragArea;\n        private _contentArea;\n        private _frame;\n        private _modal;\n        private _uiSources?;\n        private _inited?;\n        private _loading?;\n        protected _requestingCmd: number;\n        bringToFontOnClick: boolean;\n        constructor();\n        addUISource(source: IUISource): void;\n        contentPane: GComponent;\n        readonly frame: GComponent;\n        closeButton: GObject;\n        dragArea: GObject;\n        contentArea: GObject;\n        show(): void;\n        showOn(root: GRoot): void;\n        hide(): void;\n        hideImmediately(): void;\n        centerOn(r: GRoot, restraint?: boolean): void;\n        toggleStatus(): void;\n        readonly isShowing: boolean;\n        readonly isTop: boolean;\n        modal: boolean;\n        bringToFront(): void;\n        showModalWait(requestingCmd?: number): void;\n        protected layoutModalWaitPane(): void;\n        closeModalWait(requestingCmd?: number): boolean;\n        readonly modalWaiting: boolean;\n        init(): void;\n        protected onInit(): void;\n        protected onShown(): void;\n        protected onHide(): void;\n        protected doShowAnimation(): void;\n        protected doHideAnimation(): void;\n        private __uiLoadComplete;\n        private _init;\n        dispose(): void;\n        protected closeEventHandler(evt: egret.Event): void;\n        private __onShown;\n        private __onHidden;\n        private __mouseDown;\n        private __dragStart;\n    }\n}\ndeclare module fgui {\n    class ControllerAction {\n        fromPage: string[];\n        toPage: string[];\n        static createAction(type: number): ControllerAction;\n        constructor();\n        run(controller: Controller, prevPage: string, curPage: string): void;\n        protected enter(controller: Controller): void;\n        protected leave(controller: Controller): void;\n        setup(buffer: ByteBuffer): void;\n    }\n}\ndeclare module fgui {\n    class ChangePageAction extends ControllerAction {\n        objectId: string;\n        controllerName: string;\n        targetPage: string;\n        constructor();\n        protected enter(controller: Controller): void;\n        setup(buffer: ByteBuffer): void;\n    }\n}\ndeclare module fgui {\n    class PlayTransitionAction extends ControllerAction {\n        transitionName: string;\n        playTimes: number;\n        delay: number;\n        stopOnExit: boolean;\n        private _currentTransition;\n        constructor();\n        protected enter(controller: Controller): void;\n        protected leave(controller: Controller): void;\n        setup(buffer: ByteBuffer): void;\n    }\n}\ndeclare module fgui {\n    class BitmapFont {\n        id: string;\n        size: number;\n        ttf: boolean;\n        glyphs: {\n            [index: string]: BMGlyph;\n        };\n        resizable: boolean;\n        tint: boolean;\n        constructor();\n    }\n    interface BMGlyph {\n        x?: number;\n        y?: number;\n        width?: number;\n        height?: number;\n        advance?: number;\n        lineHeight?: number;\n        channel?: number;\n        texture?: egret.Texture;\n    }\n}\ndeclare namespace fgui {\n    function fillImage(w: number, h: number, method: number, origin: number, clockwise: boolean, amount: number): Array<number>;\n}\ndeclare module fgui {\n    class Image extends egret.Bitmap {\n        private _fillMethod;\n        private _fillOrigin;\n        private _fillAmount;\n        private _fillClockwise?;\n        private _mask?;\n        private _maskDirtyFlag?;\n        private _color;\n        constructor();\n        color: number;\n        $setX(value: number): boolean;\n        $setY(value: number): boolean;\n        fillMethod: FillMethod;\n        fillOrigin: number;\n        fillClockwise: boolean;\n        fillAmount: number;\n        private markChanged;\n        private doFill;\n    }\n}\ndeclare module fgui {\n    interface Frame {\n        addDelay?: number;\n        texture?: egret.Texture;\n    }\n    class MovieClip extends Image {\n        interval: number;\n        swing: boolean;\n        repeatDelay: number;\n        timeScale: number;\n        private _playing;\n        private _frameCount;\n        private _frames;\n        private _frame;\n        private _start;\n        private _end;\n        private _times;\n        private _endAt;\n        private _status;\n        private _callback;\n        private _callbackObj;\n        private _smoothing;\n        private _frameElapsed;\n        private _reversed;\n        private _repeatedCount;\n        constructor();\n        frames: Array<Frame>;\n        readonly frameCount: number;\n        frame: number;\n        playing: boolean;\n        smoothing: boolean;\n        rewind(): void;\n        syncStatus(anotherMc: MovieClip): void;\n        advance(timeInMiniseconds: number): void;\n        setPlaySettings(start?: number, end?: number, times?: number, endAt?: number, endCallback?: Function, callbackObj?: any): void;\n        private update;\n        private drawFrame;\n        private checkTimer;\n        $onAddToStage(stage: egret.Stage, nestLevel: number): void;\n        $onRemoveFromStage(): void;\n    }\n}\ndeclare module fgui {\n    class UIContainer extends egret.DisplayObjectContainer {\n        private _hitArea?;\n        private _cachedMatrix?;\n        private _cachedHitArea?;\n        private _opaque?;\n        constructor();\n        cacheHitArea(value: boolean): void;\n        hitArea: PixelHitTest | egret.DisplayObject;\n        opaque: boolean;\n        $hitTest(stageX: number, stageY: number): egret.DisplayObject;\n    }\n}\ndeclare module fgui {\n    class DragEvent extends egret.Event {\n        stageX: number;\n        stageY: number;\n        touchPointID: number;\n        private _prevented;\n        static DRAG_START: string;\n        static DRAG_END: string;\n        static DRAG_MOVING: string;\n        constructor(type: string, stageX?: number, stageY?: number, touchPointID?: number);\n        preventDefault(): void;\n        isDefaultPrevented(): boolean;\n    }\n}\ndeclare module fgui {\n    class DropEvent extends egret.Event {\n        source: any;\n        static DROP: string;\n        constructor(type: string, source?: any);\n    }\n}\ndeclare module fgui {\n    class ItemEvent extends egret.Event {\n        itemObject: GObject;\n        stageX: number;\n        stageY: number;\n        static CLICK: string;\n        constructor(type: string, itemObject?: GObject, stageX?: number, stageY?: number);\n    }\n}\ndeclare module fgui {\n    class StateChangeEvent extends egret.Event {\n        static CHANGED: string;\n        constructor(type: string);\n    }\n}\ndeclare namespace fgui {\n    class GearBase {\n        static disableAllTweenEffect: boolean;\n        protected _owner: GObject;\n        protected _controller: Controller;\n        protected _tweenConfig?: GearTweenConfig;\n        static create(owner: GObject, index: number): GearBase;\n        constructor(owner: GObject);\n        dispose(): void;\n        controller: Controller;\n        readonly tweenConfig: GearTweenConfig;\n        setup(buffer: ByteBuffer): void;\n        updateFromRelations(dx: number, dy: number): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        protected init(): void;\n        apply(): void;\n        updateState(): void;\n    }\n    class GearTweenConfig {\n        tween: boolean;\n        easeType: number;\n        duration: number;\n        delay: number;\n        _displayLockToken: number;\n        _tweener: GTweener;\n        constructor();\n    }\n}\ndeclare namespace fgui {\n    class GearAnimation extends GearBase {\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        updateState(): void;\n    }\n}\ndeclare namespace fgui {\n    class GearColor extends GearBase {\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        updateState(): void;\n    }\n}\ndeclare namespace fgui {\n    class GearDisplay extends GearBase {\n        pages: string[];\n        private _visible;\n        private _displayLockToken;\n        constructor(owner: GObject);\n        protected init(): void;\n        apply(): void;\n        addLock(): number;\n        releaseLock(token: number): void;\n        readonly connected: boolean;\n    }\n}\ndeclare namespace fgui {\n    class GearDisplay2 extends GearBase {\n        pages: string[];\n        condition: number;\n        private _visible;\n        constructor(owner: GObject);\n        protected init(): void;\n        apply(): void;\n        evaluate(connected: boolean): boolean;\n    }\n}\ndeclare namespace fgui {\n    class GearFontSize extends GearBase {\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        updateState(): void;\n    }\n}\ndeclare namespace fgui {\n    class GearIcon extends GearBase {\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        updateState(): void;\n    }\n}\ndeclare namespace fgui {\n    class GearLook extends GearBase {\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        private __tweenUpdate;\n        private __tweenComplete;\n        updateState(): void;\n    }\n}\ndeclare namespace fgui {\n    class GearSize extends GearBase {\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        private __tweenUpdate;\n        private __tweenComplete;\n        updateState(): void;\n        updateFromRelations(dx: number, dy: number): void;\n    }\n}\ndeclare namespace fgui {\n    class GearText extends GearBase {\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        updateState(): void;\n    }\n}\ndeclare namespace fgui {\n    class GearXY extends GearBase {\n        positionsInPercent: boolean;\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        addExtStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        private __tweenUpdate;\n        private __tweenComplete;\n        updateState(): void;\n        updateFromRelations(dx: number, dy: number): void;\n    }\n}\ndeclare namespace fgui {\n    function evaluateEase(easeType: number, time: number, duration: number, overshootOrAmplitude: number, period: number): number;\n}\ndeclare namespace fgui {\n    class EaseType {\n        static Linear: number;\n        static SineIn: number;\n        static SineOut: number;\n        static SineInOut: number;\n        static QuadIn: number;\n        static QuadOut: number;\n        static QuadInOut: number;\n        static CubicIn: number;\n        static CubicOut: number;\n        static CubicInOut: number;\n        static QuartIn: number;\n        static QuartOut: number;\n        static QuartInOut: number;\n        static QuintIn: number;\n        static QuintOut: number;\n        static QuintInOut: number;\n        static ExpoIn: number;\n        static ExpoOut: number;\n        static ExpoInOut: number;\n        static CircIn: number;\n        static CircOut: number;\n        static CircInOut: number;\n        static ElasticIn: number;\n        static ElasticOut: number;\n        static ElasticInOut: number;\n        static BackIn: number;\n        static BackOut: number;\n        static BackInOut: number;\n        static BounceIn: number;\n        static BounceOut: number;\n        static BounceInOut: number;\n        static Custom: number;\n    }\n}\ndeclare namespace fgui {\n    class GPath {\n        private _segments;\n        private _points;\n        private _fullLength;\n        constructor();\n        readonly length: number;\n        create(pt1: Array<GPathPoint> | GPathPoint, pt2?: GPathPoint, pt3?: GPathPoint, pt4?: GPathPoint): void;\n        private createSplineSegment;\n        clear(): void;\n        getPointAt(t: number, result?: egret.Point): egret.Point;\n        readonly segmentCount: number;\n        getAnchorsInSegment(segmentIndex: number, points?: Array<egret.Point>): Array<egret.Point>;\n        getPointsInSegment(segmentIndex: number, t0: number, t1: number, points?: Array<egret.Point>, ts?: Array<number>, pointDensity?: number): Array<egret.Point>;\n        getAllPoints(points?: Array<egret.Point>, ts?: Array<number>, pointDensity?: number): Array<egret.Point>;\n        private onCRSplineCurve;\n        private onBezierCurve;\n    }\n}\ndeclare namespace fgui {\n    enum CurveType {\n        CRSpline = 0,\n        Bezier = 1,\n        CubicBezier = 2,\n        Straight = 3\n    }\n    class GPathPoint {\n        x: number;\n        y: number;\n        control1_x: number;\n        control1_y: number;\n        control2_x: number;\n        control2_y: number;\n        curveType: number;\n        constructor();\n        static newPoint(x?: number, y?: number, curveType?: number): GPathPoint;\n        static newBezierPoint(x?: number, y?: number, control1_x?: number, control1_y?: number): GPathPoint;\n        static newCubicBezierPoint(x?: number, y?: number, control1_x?: number, control1_y?: number, control2_x?: number, control2_y?: number): GPathPoint;\n        clone(): GPathPoint;\n    }\n}\ndeclare namespace fgui {\n    class GTween {\n        static catchCallbackExceptions: boolean;\n        static to(start: number, end: number, duration: number): GTweener;\n        static to2(start: number, start2: number, end: number, end2: number, duration: number): GTweener;\n        static to3(start: number, start2: number, start3: number, end: number, end2: number, end3: number, duration: number): GTweener;\n        static to4(start: number, start2: number, start3: number, start4: number, end: number, end2: number, end3: number, end4: number, duration: number): GTweener;\n        static toColor(start: number, end: number, duration: number): GTweener;\n        static delayedCall(delay: number): GTweener;\n        static shake(startX: number, startY: number, amplitude: number, duration: number): GTweener;\n        static isTweening(target: any, propType?: any): Boolean;\n        static kill(target: any, complete?: boolean, propType?: any): void;\n        static getTween(target: any, propType?: any): GTweener;\n    }\n}\ndeclare module fgui {\n    class GTweener {\n        _target: any;\n        _propType: any;\n        _killed: boolean;\n        _paused: boolean;\n        private _delay;\n        private _duration;\n        private _breakpoint;\n        private _easeType;\n        private _easeOvershootOrAmplitude;\n        private _easePeriod;\n        private _repeat;\n        private _yoyo;\n        private _timeScale;\n        private _snapping;\n        private _userData;\n        private _path;\n        private _onUpdate;\n        private _onStart;\n        private _onComplete;\n        private _onUpdateCaller;\n        private _onStartCaller;\n        private _onCompleteCaller;\n        private _startValue;\n        private _endValue;\n        private _value;\n        private _deltaValue;\n        private _valueSize;\n        private _started;\n        private _ended;\n        private _elapsedTime;\n        private _normalizedTime;\n        constructor();\n        setDelay(value: number): GTweener;\n        readonly delay: number;\n        setDuration(value: number): GTweener;\n        readonly duration: number;\n        setBreakpoint(value: number): GTweener;\n        setEase(value: number): GTweener;\n        setEasePeriod(value: number): GTweener;\n        setEaseOvershootOrAmplitude(value: number): GTweener;\n        setRepeat(repeat: number, yoyo?: boolean): GTweener;\n        readonly repeat: number;\n        setTimeScale(value: number): GTweener;\n        setSnapping(value: boolean): GTweener;\n        setTarget(value: any, propType?: any): GTweener;\n        readonly target: any;\n        setUserData(value: any): GTweener;\n        readonly userData: any;\n        setPath(value: GPath): GTweener;\n        onUpdate(callback: Function, caller?: any): GTweener;\n        onStart(callback: Function, caller?: any): GTweener;\n        onComplete(callback: Function, caller?: any): GTweener;\n        readonly startValue: TweenValue;\n        readonly endValue: TweenValue;\n        readonly value: TweenValue;\n        readonly deltaValue: TweenValue;\n        readonly normalizedTime: number;\n        readonly completed: boolean;\n        readonly allCompleted: boolean;\n        setPaused(paused: boolean): GTweener;\n        seek(time: number): void;\n        kill(complete?: boolean): void;\n        _to(start: number, end: number, duration: number): GTweener;\n        _to2(start: number, start2: number, end: number, end2: number, duration: number): GTweener;\n        _to3(start: number, start2: number, start3: number, end: number, end2: number, end3: number, duration: number): GTweener;\n        _to4(start: number, start2: number, start3: number, start4: number, end: number, end2: number, end3: number, end4: number, duration: number): GTweener;\n        _toColor(start: number, end: number, duration: number): GTweener;\n        _shake(startX: number, startY: number, amplitude: number, duration: number): GTweener;\n        _init(): void;\n        _reset(): void;\n        _update(dt: number): void;\n        private update;\n        private callStartCallback;\n        private callUpdateCallback;\n        private callCompleteCallback;\n    }\n}\ndeclare module fgui {\n    class TweenManager {\n        static createTween(): GTweener;\n        static isTweening(target: any, propType?: any): boolean;\n        static killTweens(target: any, completed?: boolean, propType?: any): boolean;\n        static getTween(target: any, propType?: any): GTweener;\n        private static update;\n    }\n}\ndeclare namespace fgui {\n    class TweenValue {\n        x: number;\n        y: number;\n        z: number;\n        w: number;\n        constructor();\n        color: number;\n        getField(index: number): number;\n        setField(index: number, value: number): void;\n        setZero(): void;\n    }\n}\ndeclare module fgui {\n    class ByteBuffer extends egret.ByteArray {\n        stringTable?: Array<string>;\n        version: number;\n        constructor(buffer?: ArrayBuffer | Uint8Array, bufferExtSize?: number);\n        skip(count: number): void;\n        readBool(): boolean;\n        readS(): string;\n        readSArray(cnt: number): Array<string>;\n        writeS(value: string): void;\n        readColor(hasAlpha?: boolean): number;\n        readChar(): string;\n        readBuffer(): ByteBuffer;\n        seek(indexTablePos: number, blockIndex: number): boolean;\n    }\n}\ndeclare namespace fgui {\n    class ColorMatrix {\n        readonly matrix: Array<number>;\n        constructor(p_brightness?: number, p_contrast?: number, p_saturation?: number, p_hue?: number);\n        reset(): void;\n        invert(): void;\n        adjustColor(p_brightness: number, p_contrast: number, p_saturation: number, p_hue: number): void;\n        adjustBrightness(p_val: number): void;\n        adjustContrast(p_val: number): void;\n        adjustSaturation(p_val: number): void;\n        adjustHue(p_val: number): void;\n        concat(p_matrix: Array<number>): void;\n        clone(): ColorMatrix;\n        protected copyMatrix(p_matrix: Array<number>): void;\n        protected multiplyMatrix(p_matrix: Array<number>): void;\n        protected cleanValue(p_val: number, p_limit: number): number;\n    }\n}\ndeclare module fgui {\n    class GTimers {\n        private _items;\n        private _itemPool;\n        private _enumI;\n        private _enumCount;\n        private _lastTime;\n        static deltaTime: number;\n        static time: number;\n        static readonly inst: GTimers;\n        constructor();\n        private getItem;\n        private findItem;\n        add(delayInMiniseconds: number, repeat: number, callback: Function, thisObj?: any, callbackParam?: any): void;\n        callLater(callback: Function, thisObj?: any, callbackParam?: any): void;\n        callDelay(delay: number, callback: Function, thisObj?: any, callbackParam?: any): void;\n        exists(callback: Function, thisObj?: any): boolean;\n        remove(callback: Function, thisObj?: any): void;\n        private __timer;\n    }\n}\ndeclare module fgui {\n    class UBBParser {\n        private _text;\n        private _readPos;\n        protected _handlers: {\n            [index: string]: (tagName: string, end: boolean, attr: string) => string;\n        };\n        smallFontSize: number;\n        normalFontSize: number;\n        largeFontSize: number;\n        defaultImgWidth: number;\n        defaultImgHeight: number;\n        static inst: UBBParser;\n        constructor();\n        protected onTag_URL(tagName: string, end: boolean, attr: string): string;\n        protected onTag_IMG(tagName: string, end: boolean, attr: string): string;\n        protected onTag_Simple(tagName: string, end: boolean, attr: string): string;\n        protected onTag_COLOR(tagName: string, end: boolean, attr: string): string;\n        protected onTag_FONT(tagName: string, end: boolean, attr: string): string;\n        protected onTag_SIZE(tagName: string, end: boolean, attr: string): string;\n        protected getTagText(remove?: boolean): string;\n        parse(text: string, remove?: boolean): string;\n    }\n}\ndeclare module fgui {\n    class ToolSet {\n        static startsWith(source: string, str: string, ignoreCase?: boolean): boolean;\n        static trimRight(targetString: string): string;\n        static convertToHtmlColor(argb: number, hasAlpha?: boolean): string;\n        static convertFromHtmlColor(str: string, hasAlpha?: boolean): number;\n        static displayObjectToGObject(obj: egret.DisplayObject): GObject;\n        static encodeHTML(str: string): string;\n        static clamp(value: number, min: number, max: number): number;\n        static clamp01(value: number): number;\n        static lerp(start: number, end: number, percent: number): number;\n        static repeat(t: number, length: number): number;\n        static distance(x1: number, y1: number, x2: number, y2: number): number;\n        static fillPath(ctx: egret.Graphics, points: number[], px: number, py: number): void;\n        static setColorFilter(obj: egret.DisplayObject, color?: number | number[] | boolean): void;\n    }\n}\nimport fairygui = fgui;"
  },
  {
    "path": "demo/libs/fairygui/fairygui.js",
    "content": "window.fgui = {};\nwindow.fairygui = window.fgui;\nwindow.__extends = (this && this.__extends) || (function () {\n    var extendStatics = Object.setPrototypeOf ||\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n    return function (d, b) {\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n    return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n    function verb(n) { return function (v) { return step([n, v]); }; }\n    function step(op) {\n        if (f) throw new TypeError(\"Generator is already executing.\");\n        while (_) try {\n            if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n            if (y = 0, t) op = [op[0] & 2, t.value];\n            switch (op[0]) {\n                case 0: case 1: t = op; break;\n                case 4: _.label++; return { value: op[1], done: false };\n                case 5: _.label++; y = op[1]; op = [0]; continue;\n                case 7: op = _.ops.pop(); _.trys.pop(); continue;\n                default:\n                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n                    if (t[2]) _.ops.pop();\n                    _.trys.pop(); continue;\n            }\n            op = body.call(thisArg, _);\n        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n    }\n};\n\n(function (fgui) {\n    var AsyncOperation = (function () {\n        function AsyncOperation() {\n            this._itemList = new Array();\n            this._objectPool = new Array();\n        }\n        AsyncOperation.prototype.createObject = function (pkgName, resName) {\n            var pkg = fgui.UIPackage.getByName(pkgName);\n            if (pkg) {\n                var pi = pkg.getItemByName(resName);\n                if (!pi)\n                    throw new Error(\"resource not found: \" + resName);\n                this.internalCreateObject(pi);\n            }\n            else\n                throw new Error(\"package not found: \" + pkgName);\n        };\n        AsyncOperation.prototype.createObjectFromURL = function (url) {\n            var pi = fgui.UIPackage.getItemByURL(url);\n            if (pi)\n                this.internalCreateObject(pi);\n            else\n                throw new Error(\"resource not found: \" + url);\n        };\n        AsyncOperation.prototype.cancel = function () {\n            fgui.GTimers.inst.remove(this.run, this);\n            this._itemList.length = 0;\n            var cnt = this._objectPool.length;\n            if (cnt > 0) {\n                for (var i = 0; i < cnt; i++)\n                    this._objectPool[i].dispose();\n                this._objectPool.length = 0;\n            }\n        };\n        AsyncOperation.prototype.internalCreateObject = function (item) {\n            this._itemList.length = 0;\n            this._objectPool.length = 0;\n            var di = { pi: item, type: item.objectType };\n            di.childCount = this.collectComponentChildren(item);\n            this._itemList.push(di);\n            this._index = 0;\n            fgui.GTimers.inst.add(1, 0, this.run, this);\n        };\n        AsyncOperation.prototype.collectComponentChildren = function (item) {\n            var buffer = item.rawData;\n            buffer.seek(0, 2);\n            var di;\n            var pi;\n            var i;\n            var dataLen;\n            var curPos;\n            var pkg;\n            var dcnt = buffer.readShort();\n            for (i = 0; i < dcnt; i++) {\n                dataLen = buffer.readShort();\n                curPos = buffer.position;\n                buffer.seek(curPos, 0);\n                var type = buffer.readByte();\n                var src = buffer.readS();\n                var pkgId = buffer.readS();\n                buffer.position = curPos;\n                if (src != null) {\n                    if (pkgId != null)\n                        pkg = fgui.UIPackage.getById(pkgId);\n                    else\n                        pkg = item.owner;\n                    pi = pkg != null ? pkg.getItemById(src) : null;\n                    di = { pi: pi, type: type };\n                    if (pi != null && pi.type == fgui.PackageItemType.Component)\n                        di.childCount = this.collectComponentChildren(pi);\n                }\n                else {\n                    di = { type: type };\n                    if (type == fgui.ObjectType.List)\n                        di.listItemCount = this.collectListChildren(buffer);\n                }\n                this._itemList.push(di);\n                buffer.position = curPos + dataLen;\n            }\n            return dcnt;\n        };\n        AsyncOperation.prototype.collectListChildren = function (buffer) {\n            buffer.seek(buffer.position, 8);\n            var listItemCount = 0;\n            var i;\n            var nextPos;\n            var url;\n            var pi;\n            var di;\n            var defaultItem = buffer.readS();\n            var itemCount = buffer.readShort();\n            for (i = 0; i < itemCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                url = buffer.readS();\n                if (url == null)\n                    url = defaultItem;\n                if (url) {\n                    pi = fgui.UIPackage.getItemByURL(url);\n                    if (pi) {\n                        di = { pi: pi, type: pi.objectType };\n                        if (pi.type == fgui.PackageItemType.Component)\n                            di.childCount = this.collectComponentChildren(pi);\n                        this._itemList.push(di);\n                        listItemCount++;\n                    }\n                }\n                buffer.position = nextPos;\n            }\n            return listItemCount;\n        };\n        AsyncOperation.prototype.run = function () {\n            var obj;\n            var di;\n            var poolStart;\n            var k;\n            var t = egret.getTimer();\n            var frameTime = fgui.UIConfig.frameTimeForAsyncUIConstruction;\n            var totalItems = this._itemList.length;\n            while (this._index < totalItems) {\n                di = this._itemList[this._index];\n                if (di.pi) {\n                    obj = fgui.UIObjectFactory.newObject(di.pi);\n                    this._objectPool.push(obj);\n                    fgui.UIPackage._constructing++;\n                    if (di.pi.type == fgui.PackageItemType.Component) {\n                        poolStart = this._objectPool.length - di.childCount - 1;\n                        obj.constructFromResource2(this._objectPool, poolStart);\n                        this._objectPool.splice(poolStart, di.childCount);\n                    }\n                    else {\n                        obj.constructFromResource();\n                    }\n                    fgui.UIPackage._constructing--;\n                }\n                else {\n                    obj = fgui.UIObjectFactory.newObject(di.type);\n                    this._objectPool.push(obj);\n                    if (di.type == fgui.ObjectType.List && di.listItemCount > 0) {\n                        poolStart = this._objectPool.length - di.listItemCount - 1;\n                        for (k = 0; k < di.listItemCount; k++)\n                            obj.itemPool.returnObject(this._objectPool[k + poolStart]);\n                        this._objectPool.splice(poolStart, di.listItemCount);\n                    }\n                }\n                this._index++;\n                if ((this._index % 5 == 0) && egret.getTimer() - t >= frameTime)\n                    return;\n            }\n            fgui.GTimers.inst.remove(this.run, this);\n            var result = this._objectPool[0];\n            this._itemList.length = 0;\n            this._objectPool.length = 0;\n            if (this.callback != null)\n                this.callback.call(this.callbackObj, result);\n        };\n        return AsyncOperation;\n    }());\n    fgui.AsyncOperation = AsyncOperation;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var _nextPageId = 0;\n    var Controller = (function (_super_1) {\n        __extends(Controller, _super_1);\n        function Controller() {\n            var _this = _super_1.call(this) || this;\n            _this._pageIds = [];\n            _this._pageNames = [];\n            _this._selectedIndex = -1;\n            _this._previousIndex = -1;\n            return _this;\n        }\n        Controller.prototype.dispose = function () {\n        };\n        Object.defineProperty(Controller.prototype, \"selectedIndex\", {\n            get: function () {\n                return this._selectedIndex;\n            },\n            set: function (value) {\n                if (this._selectedIndex != value) {\n                    if (value > this._pageIds.length - 1)\n                        throw \"index out of bounds: \" + value;\n                    this.changing = true;\n                    this._previousIndex = this._selectedIndex;\n                    this._selectedIndex = value;\n                    this.parent.applyController(this);\n                    this.dispatchEvent(new fgui.StateChangeEvent(fgui.StateChangeEvent.CHANGED));\n                    this.changing = false;\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Controller.prototype.setSelectedIndex = function (value) {\n            if (this._selectedIndex != value) {\n                if (value > this._pageIds.length - 1)\n                    throw \"index out of bounds: \" + value;\n                this.changing = true;\n                this._previousIndex = this._selectedIndex;\n                this._selectedIndex = value;\n                this.parent.applyController(this);\n                this.changing = false;\n            }\n        };\n        Object.defineProperty(Controller.prototype, \"previsousIndex\", {\n            get: function () {\n                return this._previousIndex;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Controller.prototype, \"selectedPage\", {\n            get: function () {\n                if (this._selectedIndex == -1)\n                    return null;\n                else\n                    return this._pageNames[this._selectedIndex];\n            },\n            set: function (val) {\n                var i = this._pageNames.indexOf(val);\n                if (i == -1)\n                    i = 0;\n                this.selectedIndex = i;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Controller.prototype.setSelectedPage = function (value) {\n            var i = this._pageNames.indexOf(value);\n            if (i == -1)\n                i = 0;\n            this.setSelectedIndex(i);\n        };\n        Object.defineProperty(Controller.prototype, \"previousPage\", {\n            get: function () {\n                if (this._previousIndex == -1)\n                    return null;\n                else\n                    return this._pageNames[this._previousIndex];\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Controller.prototype, \"pageCount\", {\n            get: function () {\n                return this._pageIds.length;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Controller.prototype.getPageName = function (index) {\n            return this._pageNames[index];\n        };\n        Controller.prototype.addPage = function (name) {\n            this.addPageAt(name || \"\", this._pageIds.length);\n        };\n        Controller.prototype.addPageAt = function (name, index) {\n            var nid = \"\" + (_nextPageId++);\n            if (index == this._pageIds.length) {\n                this._pageIds.push(nid);\n                this._pageNames.push(name);\n            }\n            else {\n                this._pageIds.splice(index, 0, nid);\n                this._pageNames.splice(index, 0, name);\n            }\n        };\n        Controller.prototype.removePage = function (name) {\n            var i = this._pageNames.indexOf(name);\n            if (i != -1) {\n                this._pageIds.splice(i, 1);\n                this._pageNames.splice(i, 1);\n                if (this._selectedIndex >= this._pageIds.length)\n                    this.selectedIndex = this._selectedIndex - 1;\n                else\n                    this.parent.applyController(this);\n            }\n        };\n        Controller.prototype.removePageAt = function (index) {\n            if (index === void 0) { index = 0; }\n            this._pageIds.splice(index, 1);\n            this._pageNames.splice(index, 1);\n            if (this._selectedIndex >= this._pageIds.length)\n                this.selectedIndex = this._selectedIndex - 1;\n            else\n                this.parent.applyController(this);\n        };\n        Controller.prototype.clearPages = function () {\n            this._pageIds.length = 0;\n            this._pageNames.length = 0;\n            if (this._selectedIndex != -1)\n                this.selectedIndex = -1;\n            else\n                this.parent.applyController(this);\n        };\n        Controller.prototype.hasPage = function (aName) {\n            return this._pageNames.indexOf(aName) != -1;\n        };\n        Controller.prototype.getPageIndexById = function (aId) {\n            return this._pageIds.indexOf(aId);\n        };\n        Controller.prototype.getPageIdByName = function (aName) {\n            var i = this._pageNames.indexOf(aName);\n            if (i != -1)\n                return this._pageIds[i];\n            else\n                return null;\n        };\n        Controller.prototype.getPageNameById = function (aId) {\n            var i = this._pageIds.indexOf(aId);\n            if (i != -1)\n                return this._pageNames[i];\n            else\n                return null;\n        };\n        Controller.prototype.getPageId = function (index) {\n            if (index === void 0) { index = 0; }\n            return this._pageIds[index];\n        };\n        Object.defineProperty(Controller.prototype, \"selectedPageId\", {\n            get: function () {\n                if (this._selectedIndex == -1)\n                    return null;\n                else\n                    return this._pageIds[this._selectedIndex];\n            },\n            set: function (val) {\n                var i = this._pageIds.indexOf(val);\n                this.selectedIndex = i;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Controller.prototype, \"oppositePageId\", {\n            set: function (val) {\n                var i = this._pageIds.indexOf(val);\n                if (i > 0)\n                    this.selectedIndex = 0;\n                else if (this._pageIds.length > 1)\n                    this.selectedIndex = 1;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Controller.prototype, \"previousPageId\", {\n            get: function () {\n                if (this._previousIndex == -1)\n                    return null;\n                else\n                    return this._pageIds[this._previousIndex];\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Controller.prototype.runActions = function () {\n            if (this._actions) {\n                var cnt = this._actions.length;\n                for (var i = 0; i < cnt; i++)\n                    this._actions[i].run(this, this.previousPageId, this.selectedPageId);\n            }\n        };\n        Controller.prototype.setup = function (buffer) {\n            var beginPos = buffer.position;\n            buffer.seek(beginPos, 0);\n            this.name = buffer.readS();\n            if (buffer.readBool())\n                this.autoRadioGroupDepth = true;\n            buffer.seek(beginPos, 1);\n            var i;\n            var nextPos;\n            var cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++) {\n                this._pageIds.push(buffer.readS());\n                this._pageNames.push(buffer.readS());\n            }\n            var homePageIndex = 0;\n            if (buffer.version >= 2) {\n                var homePageType = buffer.readByte();\n                switch (homePageType) {\n                    case 1:\n                        homePageIndex = buffer.readShort();\n                        break;\n                    case 2:\n                        homePageIndex = this._pageNames.indexOf(fgui.UIPackage.branch);\n                        if (homePageIndex == -1)\n                            homePageIndex = 0;\n                        break;\n                    case 3:\n                        homePageIndex = this._pageNames.indexOf(fgui.UIPackage.getVar(buffer.readS()));\n                        if (homePageIndex == -1)\n                            homePageIndex = 0;\n                        break;\n                }\n            }\n            buffer.seek(beginPos, 2);\n            cnt = buffer.readShort();\n            if (cnt > 0) {\n                if (!this._actions)\n                    this._actions = new Array();\n                for (i = 0; i < cnt; i++) {\n                    nextPos = buffer.readShort();\n                    nextPos += buffer.position;\n                    var action = fgui.ControllerAction.createAction(buffer.readByte());\n                    action.setup(buffer);\n                    this._actions.push(action);\n                    buffer.position = nextPos;\n                }\n            }\n            if (this.parent && this._pageIds.length > 0)\n                this._selectedIndex = homePageIndex;\n            else\n                this._selectedIndex = -1;\n        };\n        return Controller;\n    }(egret.EventDispatcher));\n    fgui.Controller = Controller;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var DragDropManager = (function () {\n        function DragDropManager() {\n            this._agent = new fgui.GLoader();\n            this._agent.draggable = true;\n            this._agent.touchable = false;\n            this._agent.setSize(100, 100);\n            this._agent.setPivot(0.5, 0.5, true);\n            this._agent.align = fgui.AlignType.Center;\n            this._agent.verticalAlign = fgui.VertAlignType.Middle;\n            this._agent.sortingOrder = 1000000;\n            this._agent.addEventListener(fgui.DragEvent.DRAG_END, this.__dragEnd, this);\n        }\n        Object.defineProperty(DragDropManager, \"inst\", {\n            get: function () {\n                if (DragDropManager._inst == null)\n                    DragDropManager._inst = new DragDropManager();\n                return DragDropManager._inst;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(DragDropManager.prototype, \"dragAgent\", {\n            get: function () {\n                return this._agent;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(DragDropManager.prototype, \"dragging\", {\n            get: function () {\n                return this._agent.parent != null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        DragDropManager.prototype.startDrag = function (source, icon, sourceData, touchPointID) {\n            if (this._agent.parent)\n                return;\n            this._sourceData = sourceData;\n            this._agent.url = icon;\n            fgui.GRoot.inst.addChild(this._agent);\n            var pt = fgui.GRoot.inst.globalToLocal(fgui.GRoot.mouseX, fgui.GRoot.mouseY);\n            this._agent.setXY(pt.x, pt.y);\n            this._agent.startDrag(touchPointID);\n        };\n        DragDropManager.prototype.cancel = function () {\n            if (this._agent.parent) {\n                this._agent.stopDrag();\n                fgui.GRoot.inst.removeChild(this._agent);\n                this._sourceData = null;\n            }\n        };\n        DragDropManager.prototype.__dragEnd = function (evt) {\n            if (this._agent.parent == null)\n                return;\n            fgui.GRoot.inst.removeChild(this._agent);\n            var sourceData = this._sourceData;\n            this._sourceData = null;\n            var obj = fgui.GRoot.inst.getObjectUnderPoint(evt.stageX, evt.stageY);\n            while (obj) {\n                if (obj.hasEventListener(fgui.DropEvent.DROP)) {\n                    var dropEvt = new fgui.DropEvent(fgui.DropEvent.DROP, sourceData);\n                    obj.requestFocus();\n                    obj.dispatchEvent(dropEvt);\n                    return;\n                }\n                obj = obj.parent;\n            }\n        };\n        return DragDropManager;\n    }());\n    fgui.DragDropManager = DragDropManager;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ButtonMode;\n    (function (ButtonMode) {\n        ButtonMode[ButtonMode[\"Common\"] = 0] = \"Common\";\n        ButtonMode[ButtonMode[\"Check\"] = 1] = \"Check\";\n        ButtonMode[ButtonMode[\"Radio\"] = 2] = \"Radio\";\n    })(ButtonMode = fgui.ButtonMode || (fgui.ButtonMode = {}));\n    var AutoSizeType;\n    (function (AutoSizeType) {\n        AutoSizeType[AutoSizeType[\"None\"] = 0] = \"None\";\n        AutoSizeType[AutoSizeType[\"Both\"] = 1] = \"Both\";\n        AutoSizeType[AutoSizeType[\"Height\"] = 2] = \"Height\";\n    })(AutoSizeType = fgui.AutoSizeType || (fgui.AutoSizeType = {}));\n    var AlignType;\n    (function (AlignType) {\n        AlignType[AlignType[\"Left\"] = 0] = \"Left\";\n        AlignType[AlignType[\"Center\"] = 1] = \"Center\";\n        AlignType[AlignType[\"Right\"] = 2] = \"Right\";\n    })(AlignType = fgui.AlignType || (fgui.AlignType = {}));\n    var VertAlignType;\n    (function (VertAlignType) {\n        VertAlignType[VertAlignType[\"Top\"] = 0] = \"Top\";\n        VertAlignType[VertAlignType[\"Middle\"] = 1] = \"Middle\";\n        VertAlignType[VertAlignType[\"Bottom\"] = 2] = \"Bottom\";\n    })(VertAlignType = fgui.VertAlignType || (fgui.VertAlignType = {}));\n    var LoaderFillType;\n    (function (LoaderFillType) {\n        LoaderFillType[LoaderFillType[\"None\"] = 0] = \"None\";\n        LoaderFillType[LoaderFillType[\"Scale\"] = 1] = \"Scale\";\n        LoaderFillType[LoaderFillType[\"ScaleMatchHeight\"] = 2] = \"ScaleMatchHeight\";\n        LoaderFillType[LoaderFillType[\"ScaleMatchWidth\"] = 3] = \"ScaleMatchWidth\";\n        LoaderFillType[LoaderFillType[\"ScaleFree\"] = 4] = \"ScaleFree\";\n        LoaderFillType[LoaderFillType[\"ScaleNoBorder\"] = 5] = \"ScaleNoBorder\";\n    })(LoaderFillType = fgui.LoaderFillType || (fgui.LoaderFillType = {}));\n    var ListLayoutType;\n    (function (ListLayoutType) {\n        ListLayoutType[ListLayoutType[\"SingleColumn\"] = 0] = \"SingleColumn\";\n        ListLayoutType[ListLayoutType[\"SingleRow\"] = 1] = \"SingleRow\";\n        ListLayoutType[ListLayoutType[\"FlowHorizontal\"] = 2] = \"FlowHorizontal\";\n        ListLayoutType[ListLayoutType[\"FlowVertical\"] = 3] = \"FlowVertical\";\n        ListLayoutType[ListLayoutType[\"Pagination\"] = 4] = \"Pagination\";\n    })(ListLayoutType = fgui.ListLayoutType || (fgui.ListLayoutType = {}));\n    var ListSelectionMode;\n    (function (ListSelectionMode) {\n        ListSelectionMode[ListSelectionMode[\"Single\"] = 0] = \"Single\";\n        ListSelectionMode[ListSelectionMode[\"Multiple\"] = 1] = \"Multiple\";\n        ListSelectionMode[ListSelectionMode[\"Multiple_SingleClick\"] = 2] = \"Multiple_SingleClick\";\n        ListSelectionMode[ListSelectionMode[\"None\"] = 3] = \"None\";\n    })(ListSelectionMode = fgui.ListSelectionMode || (fgui.ListSelectionMode = {}));\n    var OverflowType;\n    (function (OverflowType) {\n        OverflowType[OverflowType[\"Visible\"] = 0] = \"Visible\";\n        OverflowType[OverflowType[\"Hidden\"] = 1] = \"Hidden\";\n        OverflowType[OverflowType[\"Scroll\"] = 2] = \"Scroll\";\n    })(OverflowType = fgui.OverflowType || (fgui.OverflowType = {}));\n    var PackageItemType;\n    (function (PackageItemType) {\n        PackageItemType[PackageItemType[\"Image\"] = 0] = \"Image\";\n        PackageItemType[PackageItemType[\"MovieClip\"] = 1] = \"MovieClip\";\n        PackageItemType[PackageItemType[\"Sound\"] = 2] = \"Sound\";\n        PackageItemType[PackageItemType[\"Component\"] = 3] = \"Component\";\n        PackageItemType[PackageItemType[\"Atlas\"] = 4] = \"Atlas\";\n        PackageItemType[PackageItemType[\"Font\"] = 5] = \"Font\";\n        PackageItemType[PackageItemType[\"Swf\"] = 6] = \"Swf\";\n        PackageItemType[PackageItemType[\"Misc\"] = 7] = \"Misc\";\n        PackageItemType[PackageItemType[\"Unknown\"] = 8] = \"Unknown\";\n        PackageItemType[PackageItemType[\"Spine\"] = 9] = \"Spine\";\n        PackageItemType[PackageItemType[\"DragonBones\"] = 10] = \"DragonBones\";\n    })(PackageItemType = fgui.PackageItemType || (fgui.PackageItemType = {}));\n    ;\n    var ObjectType;\n    (function (ObjectType) {\n        ObjectType[ObjectType[\"Image\"] = 0] = \"Image\";\n        ObjectType[ObjectType[\"MovieClip\"] = 1] = \"MovieClip\";\n        ObjectType[ObjectType[\"Swf\"] = 2] = \"Swf\";\n        ObjectType[ObjectType[\"Graph\"] = 3] = \"Graph\";\n        ObjectType[ObjectType[\"Loader\"] = 4] = \"Loader\";\n        ObjectType[ObjectType[\"Group\"] = 5] = \"Group\";\n        ObjectType[ObjectType[\"Text\"] = 6] = \"Text\";\n        ObjectType[ObjectType[\"RichText\"] = 7] = \"RichText\";\n        ObjectType[ObjectType[\"InputText\"] = 8] = \"InputText\";\n        ObjectType[ObjectType[\"Component\"] = 9] = \"Component\";\n        ObjectType[ObjectType[\"List\"] = 10] = \"List\";\n        ObjectType[ObjectType[\"Label\"] = 11] = \"Label\";\n        ObjectType[ObjectType[\"Button\"] = 12] = \"Button\";\n        ObjectType[ObjectType[\"ComboBox\"] = 13] = \"ComboBox\";\n        ObjectType[ObjectType[\"ProgressBar\"] = 14] = \"ProgressBar\";\n        ObjectType[ObjectType[\"Slider\"] = 15] = \"Slider\";\n        ObjectType[ObjectType[\"ScrollBar\"] = 16] = \"ScrollBar\";\n        ObjectType[ObjectType[\"Tree\"] = 17] = \"Tree\";\n        ObjectType[ObjectType[\"Loader3D\"] = 18] = \"Loader3D\";\n    })(ObjectType = fgui.ObjectType || (fgui.ObjectType = {}));\n    var ProgressTitleType;\n    (function (ProgressTitleType) {\n        ProgressTitleType[ProgressTitleType[\"Percent\"] = 0] = \"Percent\";\n        ProgressTitleType[ProgressTitleType[\"ValueAndMax\"] = 1] = \"ValueAndMax\";\n        ProgressTitleType[ProgressTitleType[\"Value\"] = 2] = \"Value\";\n        ProgressTitleType[ProgressTitleType[\"Max\"] = 3] = \"Max\";\n    })(ProgressTitleType = fgui.ProgressTitleType || (fgui.ProgressTitleType = {}));\n    var ScrollBarDisplayType;\n    (function (ScrollBarDisplayType) {\n        ScrollBarDisplayType[ScrollBarDisplayType[\"Default\"] = 0] = \"Default\";\n        ScrollBarDisplayType[ScrollBarDisplayType[\"Visible\"] = 1] = \"Visible\";\n        ScrollBarDisplayType[ScrollBarDisplayType[\"Auto\"] = 2] = \"Auto\";\n        ScrollBarDisplayType[ScrollBarDisplayType[\"Hidden\"] = 3] = \"Hidden\";\n    })(ScrollBarDisplayType = fgui.ScrollBarDisplayType || (fgui.ScrollBarDisplayType = {}));\n    ;\n    var ScrollType;\n    (function (ScrollType) {\n        ScrollType[ScrollType[\"Horizontal\"] = 0] = \"Horizontal\";\n        ScrollType[ScrollType[\"Vertical\"] = 1] = \"Vertical\";\n        ScrollType[ScrollType[\"Both\"] = 2] = \"Both\";\n    })(ScrollType = fgui.ScrollType || (fgui.ScrollType = {}));\n    ;\n    var FlipType;\n    (function (FlipType) {\n        FlipType[FlipType[\"None\"] = 0] = \"None\";\n        FlipType[FlipType[\"Horizontal\"] = 1] = \"Horizontal\";\n        FlipType[FlipType[\"Vertical\"] = 2] = \"Vertical\";\n        FlipType[FlipType[\"Both\"] = 3] = \"Both\";\n    })(FlipType = fgui.FlipType || (fgui.FlipType = {}));\n    var ChildrenRenderOrder;\n    (function (ChildrenRenderOrder) {\n        ChildrenRenderOrder[ChildrenRenderOrder[\"Ascent\"] = 0] = \"Ascent\";\n        ChildrenRenderOrder[ChildrenRenderOrder[\"Descent\"] = 1] = \"Descent\";\n        ChildrenRenderOrder[ChildrenRenderOrder[\"Arch\"] = 2] = \"Arch\";\n    })(ChildrenRenderOrder = fgui.ChildrenRenderOrder || (fgui.ChildrenRenderOrder = {}));\n    var GroupLayoutType;\n    (function (GroupLayoutType) {\n        GroupLayoutType[GroupLayoutType[\"None\"] = 0] = \"None\";\n        GroupLayoutType[GroupLayoutType[\"Horizontal\"] = 1] = \"Horizontal\";\n        GroupLayoutType[GroupLayoutType[\"Vertical\"] = 2] = \"Vertical\";\n    })(GroupLayoutType = fgui.GroupLayoutType || (fgui.GroupLayoutType = {}));\n    var PopupDirection;\n    (function (PopupDirection) {\n        PopupDirection[PopupDirection[\"Auto\"] = 0] = \"Auto\";\n        PopupDirection[PopupDirection[\"Up\"] = 1] = \"Up\";\n        PopupDirection[PopupDirection[\"Down\"] = 2] = \"Down\";\n    })(PopupDirection = fgui.PopupDirection || (fgui.PopupDirection = {}));\n    var RelationType;\n    (function (RelationType) {\n        RelationType[RelationType[\"Left_Left\"] = 0] = \"Left_Left\";\n        RelationType[RelationType[\"Left_Center\"] = 1] = \"Left_Center\";\n        RelationType[RelationType[\"Left_Right\"] = 2] = \"Left_Right\";\n        RelationType[RelationType[\"Center_Center\"] = 3] = \"Center_Center\";\n        RelationType[RelationType[\"Right_Left\"] = 4] = \"Right_Left\";\n        RelationType[RelationType[\"Right_Center\"] = 5] = \"Right_Center\";\n        RelationType[RelationType[\"Right_Right\"] = 6] = \"Right_Right\";\n        RelationType[RelationType[\"Top_Top\"] = 7] = \"Top_Top\";\n        RelationType[RelationType[\"Top_Middle\"] = 8] = \"Top_Middle\";\n        RelationType[RelationType[\"Top_Bottom\"] = 9] = \"Top_Bottom\";\n        RelationType[RelationType[\"Middle_Middle\"] = 10] = \"Middle_Middle\";\n        RelationType[RelationType[\"Bottom_Top\"] = 11] = \"Bottom_Top\";\n        RelationType[RelationType[\"Bottom_Middle\"] = 12] = \"Bottom_Middle\";\n        RelationType[RelationType[\"Bottom_Bottom\"] = 13] = \"Bottom_Bottom\";\n        RelationType[RelationType[\"Width\"] = 14] = \"Width\";\n        RelationType[RelationType[\"Height\"] = 15] = \"Height\";\n        RelationType[RelationType[\"LeftExt_Left\"] = 16] = \"LeftExt_Left\";\n        RelationType[RelationType[\"LeftExt_Right\"] = 17] = \"LeftExt_Right\";\n        RelationType[RelationType[\"RightExt_Left\"] = 18] = \"RightExt_Left\";\n        RelationType[RelationType[\"RightExt_Right\"] = 19] = \"RightExt_Right\";\n        RelationType[RelationType[\"TopExt_Top\"] = 20] = \"TopExt_Top\";\n        RelationType[RelationType[\"TopExt_Bottom\"] = 21] = \"TopExt_Bottom\";\n        RelationType[RelationType[\"BottomExt_Top\"] = 22] = \"BottomExt_Top\";\n        RelationType[RelationType[\"BottomExt_Bottom\"] = 23] = \"BottomExt_Bottom\";\n        RelationType[RelationType[\"Size\"] = 24] = \"Size\";\n    })(RelationType = fgui.RelationType || (fgui.RelationType = {}));\n    var FillMethod;\n    (function (FillMethod) {\n        FillMethod[FillMethod[\"None\"] = 0] = \"None\";\n        FillMethod[FillMethod[\"Horizontal\"] = 1] = \"Horizontal\";\n        FillMethod[FillMethod[\"Vertical\"] = 2] = \"Vertical\";\n        FillMethod[FillMethod[\"Radial90\"] = 3] = \"Radial90\";\n        FillMethod[FillMethod[\"Radial180\"] = 4] = \"Radial180\";\n        FillMethod[FillMethod[\"Radial360\"] = 5] = \"Radial360\";\n    })(FillMethod = fgui.FillMethod || (fgui.FillMethod = {}));\n    var FillOrigin;\n    (function (FillOrigin) {\n        FillOrigin[FillOrigin[\"Top\"] = 0] = \"Top\";\n        FillOrigin[FillOrigin[\"Bottom\"] = 1] = \"Bottom\";\n        FillOrigin[FillOrigin[\"Left\"] = 2] = \"Left\";\n        FillOrigin[FillOrigin[\"Right\"] = 3] = \"Right\";\n        FillOrigin[FillOrigin[\"TopLeft\"] = 0] = \"TopLeft\";\n        FillOrigin[FillOrigin[\"TopRight\"] = 1] = \"TopRight\";\n        FillOrigin[FillOrigin[\"BottomLeft\"] = 2] = \"BottomLeft\";\n        FillOrigin[FillOrigin[\"BottomRight\"] = 3] = \"BottomRight\";\n    })(FillOrigin = fgui.FillOrigin || (fgui.FillOrigin = {}));\n    var FillOrigin90;\n    (function (FillOrigin90) {\n        FillOrigin90[FillOrigin90[\"TopLeft\"] = 0] = \"TopLeft\";\n        FillOrigin90[FillOrigin90[\"TopRight\"] = 1] = \"TopRight\";\n        FillOrigin90[FillOrigin90[\"BottomLeft\"] = 2] = \"BottomLeft\";\n        FillOrigin90[FillOrigin90[\"BottomRight\"] = 3] = \"BottomRight\";\n    })(FillOrigin90 = fgui.FillOrigin90 || (fgui.FillOrigin90 = {}));\n    var ObjectPropID;\n    (function (ObjectPropID) {\n        ObjectPropID[ObjectPropID[\"Text\"] = 0] = \"Text\";\n        ObjectPropID[ObjectPropID[\"Icon\"] = 1] = \"Icon\";\n        ObjectPropID[ObjectPropID[\"Color\"] = 2] = \"Color\";\n        ObjectPropID[ObjectPropID[\"OutlineColor\"] = 3] = \"OutlineColor\";\n        ObjectPropID[ObjectPropID[\"Playing\"] = 4] = \"Playing\";\n        ObjectPropID[ObjectPropID[\"Frame\"] = 5] = \"Frame\";\n        ObjectPropID[ObjectPropID[\"DeltaTime\"] = 6] = \"DeltaTime\";\n        ObjectPropID[ObjectPropID[\"TimeScale\"] = 7] = \"TimeScale\";\n        ObjectPropID[ObjectPropID[\"FontSize\"] = 8] = \"FontSize\";\n        ObjectPropID[ObjectPropID[\"Selected\"] = 9] = \"Selected\";\n    })(ObjectPropID = fgui.ObjectPropID || (fgui.ObjectPropID = {}));\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GObject = (function (_super_1) {\n        __extends(GObject, _super_1);\n        function GObject() {\n            var _this = _super_1.call(this) || this;\n            _this._x = 0;\n            _this._y = 0;\n            _this._alpha = 1;\n            _this._rotation = 0;\n            _this._visible = true;\n            _this._touchable = true;\n            _this._scaleX = 1;\n            _this._scaleY = 1;\n            _this._skewX = 0;\n            _this._skewY = 0;\n            _this._pivotX = 0;\n            _this._pivotY = 0;\n            _this._pivotOffsetX = 0;\n            _this._pivotOffsetY = 0;\n            _this._sortingOrder = 0;\n            _this._internalVisible = true;\n            _this._disposed = false;\n            _this.sourceWidth = 0;\n            _this.sourceHeight = 0;\n            _this.initWidth = 0;\n            _this.initHeight = 0;\n            _this.minWidth = 0;\n            _this.minHeight = 0;\n            _this.maxWidth = 0;\n            _this.maxHeight = 0;\n            _this._width = 0;\n            _this._height = 0;\n            _this._rawWidth = 0;\n            _this._rawHeight = 0;\n            _this._sizePercentInGroup = 0;\n            _this._id = \"\" + _gInstanceCounter++;\n            _this._name = \"\";\n            _this.createDisplayObject();\n            _this._relations = new fgui.Relations(_this);\n            _this._gears = new Array(10);\n            return _this;\n        }\n        Object.defineProperty(GObject.prototype, \"id\", {\n            get: function () {\n                return this._id;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"name\", {\n            get: function () {\n                return this._name;\n            },\n            set: function (value) {\n                this._name = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"x\", {\n            get: function () {\n                return this._x;\n            },\n            set: function (value) {\n                this.setXY(value, this._y);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"y\", {\n            get: function () {\n                return this._y;\n            },\n            set: function (value) {\n                this.setXY(this._x, value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.setXY = function (xv, yv) {\n            if (this._x != xv || this._y != yv) {\n                var dx = xv - this._x;\n                var dy = yv - this._y;\n                this._x = xv;\n                this._y = yv;\n                this.handleXYChanged();\n                if (this instanceof fgui.GGroup)\n                    this.moveChildren(dx, dy);\n                this.updateGear(1);\n                if (this._parent && !(this._parent instanceof fgui.GList)) {\n                    this._parent.setBoundsChangedFlag();\n                    if (this._group)\n                        this._group.setBoundsChangedFlag(true);\n                    this.dispatchEventWith(GObject.XY_CHANGED);\n                }\n                if (GObject.draggingObject == this && !sUpdateInDragging)\n                    this.localToGlobalRect(0, 0, this._width, this._height, sGlobalRect);\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"xMin\", {\n            get: function () {\n                return this._pivotAsAnchor ? (this._x - this._width * this._pivotX) : this._x;\n            },\n            set: function (value) {\n                if (this._pivotAsAnchor)\n                    this.setXY(value + this._width * this._pivotX, this._y);\n                else\n                    this.setXY(value, this._y);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"yMin\", {\n            get: function () {\n                return this._pivotAsAnchor ? (this._y - this._height * this._pivotY) : this._y;\n            },\n            set: function (value) {\n                if (this._pivotAsAnchor)\n                    this.setXY(this._x, value + this._height * this._pivotY);\n                else\n                    this.setXY(this._x, value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"pixelSnapping\", {\n            get: function () {\n                return this._pixelSnapping;\n            },\n            set: function (value) {\n                if (this._pixelSnapping != value) {\n                    this._pixelSnapping = value;\n                    this.handleXYChanged();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.center = function (restraint) {\n            var r;\n            if (this._parent)\n                r = this.parent;\n            else\n                r = this.root;\n            this.setXY((r.width - this._width) / 2, (r.height - this._height) / 2);\n            if (restraint) {\n                this.addRelation(r, fgui.RelationType.Center_Center);\n                this.addRelation(r, fgui.RelationType.Middle_Middle);\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"width\", {\n            get: function () {\n                this.ensureSizeCorrect();\n                if (this._relations.sizeDirty)\n                    this._relations.ensureRelationsSizeCorrect();\n                return this._width;\n            },\n            set: function (value) {\n                this.setSize(value, this._rawHeight);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"height\", {\n            get: function () {\n                this.ensureSizeCorrect();\n                if (this._relations.sizeDirty)\n                    this._relations.ensureRelationsSizeCorrect();\n                return this._height;\n            },\n            set: function (value) {\n                this.setSize(this._rawWidth, value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.setSize = function (wv, hv, ignorePivot) {\n            if (this._rawWidth != wv || this._rawHeight != hv) {\n                this._rawWidth = wv;\n                this._rawHeight = hv;\n                if (wv < this.minWidth)\n                    wv = this.minWidth;\n                if (hv < this.minHeight)\n                    hv = this.minHeight;\n                if (this.maxWidth > 0 && wv > this.maxWidth)\n                    wv = this.maxWidth;\n                if (this.maxHeight > 0 && hv > this.maxHeight)\n                    hv = this.maxHeight;\n                var dWidth = wv - this._width;\n                var dHeight = hv - this._height;\n                this._width = wv;\n                this._height = hv;\n                this.handleSizeChanged();\n                if (this._pivotX != 0 || this._pivotY != 0) {\n                    if (!this._pivotAsAnchor) {\n                        if (!ignorePivot)\n                            this.setXY(this.x - this._pivotX * dWidth, this.y - this._pivotY * dHeight);\n                        this.updatePivotOffset();\n                    }\n                    else {\n                        this.applyPivot();\n                    }\n                }\n                if (this instanceof fgui.GGroup)\n                    this.resizeChildren(dWidth, dHeight);\n                this.updateGear(2);\n                if (this._parent) {\n                    this._relations.onOwnerSizeChanged(dWidth, dHeight, this._pivotAsAnchor || !ignorePivot);\n                    this._parent.setBoundsChangedFlag();\n                    if (this._group)\n                        this._group.setBoundsChangedFlag();\n                }\n                this.dispatchEventWith(GObject.SIZE_CHANGED);\n            }\n        };\n        GObject.prototype.makeFullScreen = function () {\n            this.setSize(fgui.GRoot.inst.width, fgui.GRoot.inst.height);\n        };\n        GObject.prototype.ensureSizeCorrect = function () {\n        };\n        Object.defineProperty(GObject.prototype, \"actualWidth\", {\n            get: function () {\n                return this.width * Math.abs(this._scaleX);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"actualHeight\", {\n            get: function () {\n                return this.height * Math.abs(this._scaleY);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"scaleX\", {\n            get: function () {\n                return this._scaleX;\n            },\n            set: function (value) {\n                this.setScale(value, this._scaleY);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"scaleY\", {\n            get: function () {\n                return this._scaleY;\n            },\n            set: function (value) {\n                this.setScale(this._scaleX, value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.setScale = function (sx, sy) {\n            if (this._scaleX != sx || this._scaleY != sy) {\n                this._scaleX = sx;\n                this._scaleY = sy;\n                this.handleScaleChanged();\n                this.applyPivot();\n                this.updateGear(2);\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"skewX\", {\n            get: function () {\n                return this._skewX;\n            },\n            set: function (value) {\n                this.setSkew(value, this._skewY);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"skewY\", {\n            get: function () {\n                return this._skewY;\n            },\n            set: function (value) {\n                this.setSkew(this._skewX, value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.setSkew = function (xv, yv) {\n            if (this._skewX != xv || this._skewY != yv) {\n                this._skewX = xv;\n                this._skewY = yv;\n                if (this._displayObject) {\n                    this._displayObject.skewX = xv;\n                    this._displayObject.skewY = yv;\n                }\n                this.applyPivot();\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"pivotX\", {\n            get: function () {\n                return this._pivotX;\n            },\n            set: function (value) {\n                this.setPivot(value, this._pivotY);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"pivotY\", {\n            get: function () {\n                return this._pivotY;\n            },\n            set: function (value) {\n                this.setPivot(this._pivotX, value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.setPivot = function (xv, yv, asAnchor) {\n            if (this._pivotX != xv || this._pivotY != yv || this._pivotAsAnchor != asAnchor) {\n                this._pivotX = xv;\n                this._pivotY = yv;\n                this._pivotAsAnchor = asAnchor;\n                this.updatePivotOffset();\n                this.handleXYChanged();\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"pivotAsAnchor\", {\n            get: function () {\n                return this._pivotAsAnchor;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.internalSetPivot = function (xv, yv, asAnchor) {\n            this._pivotX = xv;\n            this._pivotY = yv;\n            this._pivotAsAnchor = asAnchor;\n            if (asAnchor)\n                this.handleXYChanged();\n        };\n        GObject.prototype.updatePivotOffset = function () {\n            if (this._displayObject) {\n                if (this._pivotX != 0 || this._pivotY != 0) {\n                    var px = this._pivotX * this._width;\n                    var py = this._pivotY * this._height;\n                    var pt = this._displayObject.matrix.transformPoint(px, py, sHelperPoint);\n                    this._pivotOffsetX = this._pivotX * this._width - (pt.x - this._displayObject.x);\n                    this._pivotOffsetY = this._pivotY * this._height - (pt.y - this._displayObject.y);\n                }\n                else {\n                    this._pivotOffsetX = 0;\n                    this._pivotOffsetY = 0;\n                }\n            }\n        };\n        GObject.prototype.applyPivot = function () {\n            if (this._pivotX != 0 || this._pivotY != 0) {\n                this.updatePivotOffset();\n                this.handleXYChanged();\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"touchable\", {\n            get: function () {\n                return this._touchable;\n            },\n            set: function (value) {\n                if (this._touchable != value) {\n                    this._touchable = value;\n                    this.updateGear(3);\n                    if ((this instanceof fgui.GImage) || (this instanceof fgui.GMovieClip)\n                        || (this instanceof fgui.GTextField) && !(this instanceof fgui.GTextInput) && !(this instanceof fgui.GRichTextField))\n                        return;\n                    if (this._displayObject) {\n                        this._displayObject.touchEnabled = this._touchable;\n                        if (this._displayObject instanceof egret.DisplayObjectContainer)\n                            this._displayObject.touchChildren = this._touchable;\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"grayed\", {\n            get: function () {\n                return this._grayed;\n            },\n            set: function (value) {\n                if (this._grayed != value) {\n                    this._grayed = value;\n                    this.handleGrayedChanged();\n                    this.updateGear(3);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"enabled\", {\n            get: function () {\n                return !this._grayed && this._touchable;\n            },\n            set: function (value) {\n                this.grayed = !value;\n                this.touchable = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"rotation\", {\n            get: function () {\n                return this._rotation;\n            },\n            set: function (value) {\n                if (this._rotation != value) {\n                    this._rotation = value;\n                    if (this._displayObject)\n                        this._displayObject.rotation = this.normalizeRotation;\n                    this.applyPivot();\n                    this.updateGear(3);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"normalizeRotation\", {\n            get: function () {\n                var rot = this._rotation % 360;\n                if (rot > 180)\n                    rot -= 360;\n                else if (rot < -180)\n                    rot += 360;\n                return rot;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"alpha\", {\n            get: function () {\n                return this._alpha;\n            },\n            set: function (value) {\n                if (this._alpha != value) {\n                    this._alpha = value;\n                    this.handleAlphaChanged();\n                    this.updateGear(3);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"visible\", {\n            get: function () {\n                return this._visible;\n            },\n            set: function (value) {\n                if (this._visible != value) {\n                    this._visible = value;\n                    this.handleVisibleChanged();\n                    if (this._parent)\n                        this._parent.setBoundsChangedFlag();\n                    if (this._group && this._group.excludeInvisibles)\n                        this._group.setBoundsChangedFlag();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"internalVisible\", {\n            get: function () {\n                return this._internalVisible && (!this._group || this._group.internalVisible);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"internalVisible2\", {\n            get: function () {\n                return this._visible && (!this._group || this._group.internalVisible2);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"internalVisible3\", {\n            get: function () {\n                return this._visible && this._internalVisible;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"sortingOrder\", {\n            get: function () {\n                return this._sortingOrder;\n            },\n            set: function (value) {\n                if (value < 0)\n                    value = 0;\n                if (this._sortingOrder != value) {\n                    var old = this._sortingOrder;\n                    this._sortingOrder = value;\n                    if (this._parent)\n                        this._parent.childSortingOrderChanged(this, old, this._sortingOrder);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"focused\", {\n            get: function () {\n                return this.root.focus == this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.requestFocus = function () {\n            this.root.focus = this;\n        };\n        Object.defineProperty(GObject.prototype, \"tooltips\", {\n            get: function () {\n                return this._tooltips;\n            },\n            set: function (value) {\n                this._tooltips = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"blendMode\", {\n            get: function () {\n                return this._displayObject.blendMode;\n            },\n            set: function (value) {\n                this._displayObject.blendMode = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"filters\", {\n            get: function () {\n                return this._displayObject.filters;\n            },\n            set: function (value) {\n                this._displayObject.filters = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"inContainer\", {\n            get: function () {\n                return this._displayObject != null && this._displayObject.parent != null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"onStage\", {\n            get: function () {\n                return this._displayObject != null && this._displayObject.stage != null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"resourceURL\", {\n            get: function () {\n                if (this.packageItem)\n                    return \"ui://\" + this.packageItem.owner.id + this.packageItem.id;\n                else\n                    return null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"group\", {\n            get: function () {\n                return this._group;\n            },\n            set: function (value) {\n                if (this._group != value) {\n                    if (this._group)\n                        this._group.setBoundsChangedFlag();\n                    this._group = value;\n                    if (this._group)\n                        this._group.setBoundsChangedFlag();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.getGear = function (index) {\n            var gear = this._gears[index];\n            if (gear == null)\n                this._gears[index] = gear = fgui.GearBase.create(this, index);\n            return gear;\n        };\n        GObject.prototype.updateGear = function (index) {\n            if (this._underConstruct || this._gearLocked)\n                return;\n            var gear = this._gears[index];\n            if (gear && gear.controller)\n                gear.updateState();\n        };\n        GObject.prototype.checkGearController = function (index, c) {\n            return this._gears[index] != null && this._gears[index].controller == c;\n        };\n        GObject.prototype.updateGearFromRelations = function (index, dx, dy) {\n            if (this._gears[index])\n                this._gears[index].updateFromRelations(dx, dy);\n        };\n        GObject.prototype.addDisplayLock = function () {\n            var gearDisplay = this._gears[0];\n            if (gearDisplay && gearDisplay.controller) {\n                var ret = gearDisplay.addLock();\n                this.checkGearDisplay();\n                return ret;\n            }\n            else\n                return 0;\n        };\n        GObject.prototype.releaseDisplayLock = function (token) {\n            var gearDisplay = this._gears[0];\n            if (gearDisplay && gearDisplay.controller) {\n                gearDisplay.releaseLock(token);\n                this.checkGearDisplay();\n            }\n        };\n        GObject.prototype.checkGearDisplay = function () {\n            if (this._handlingController)\n                return;\n            var connected = this._gears[0] == null || this._gears[0].connected;\n            if (this._gears[8])\n                connected = this._gears[8].evaluate(connected);\n            if (connected != this._internalVisible) {\n                this._internalVisible = connected;\n                if (this._parent)\n                    this._parent.childStateChanged(this);\n                if (this._group && this._group.excludeInvisibles)\n                    this._group.setBoundsChangedFlag();\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"gearXY\", {\n            get: function () {\n                return this.getGear(1);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"gearSize\", {\n            get: function () {\n                return this.getGear(2);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"gearLook\", {\n            get: function () {\n                return this.getGear(3);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"relations\", {\n            get: function () {\n                return this._relations;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.addRelation = function (target, relationType, usePercent) {\n            this._relations.add(target, relationType, usePercent);\n        };\n        GObject.prototype.removeRelation = function (target, relationType) {\n            this._relations.remove(target, relationType || 0);\n        };\n        Object.defineProperty(GObject.prototype, \"displayObject\", {\n            get: function () {\n                return this._displayObject;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.setDisplayObject = function (value) {\n            if (this._displayObject != value) {\n                if (this._displayObject)\n                    delete this._displayObject[\"$owner\"];\n                this._displayObject = value;\n                this._displayObject[\"$owner\"] = this;\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"parent\", {\n            get: function () {\n                return this._parent;\n            },\n            set: function (val) {\n                this._parent = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.removeFromParent = function () {\n            if (this._parent)\n                this._parent.removeChild(this);\n        };\n        Object.defineProperty(GObject.prototype, \"root\", {\n            get: function () {\n                if (this instanceof fgui.GRoot)\n                    return this;\n                var p = this._parent;\n                while (p) {\n                    if (p instanceof fgui.GRoot)\n                        return p;\n                    p = p.parent;\n                }\n                return fgui.GRoot.inst;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asCom\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asButton\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asLabel\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asProgress\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asTextField\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asRichTextField\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asTextInput\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asLoader\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asList\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asTree\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asGraph\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asGroup\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asSlider\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asComboBox\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asImage\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asMovieClip\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.cast = function (obj) {\n            return obj[\"$owner\"];\n        };\n        Object.defineProperty(GObject.prototype, \"text\", {\n            get: function () {\n                return null;\n            },\n            set: function (value) {\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"icon\", {\n            get: function () {\n                return null;\n            },\n            set: function (value) {\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"isDisposed\", {\n            get: function () {\n                return this._disposed;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"treeNode\", {\n            get: function () {\n                return this._treeNode;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.dispose = function () {\n            if (this._disposed)\n                return;\n            this._disposed = true;\n            this.removeFromParent();\n            this._relations.dispose();\n            this._displayObject = null;\n            for (var i = 0; i < 10; i++) {\n                var gear = this._gears[i];\n                if (gear)\n                    gear.dispose();\n            }\n        };\n        GObject.prototype.addClickListener = function (listener, thisObj) {\n            this.addEventListener(egret.TouchEvent.TOUCH_TAP, listener, thisObj);\n        };\n        GObject.prototype.removeClickListener = function (listener, thisObj) {\n            this.removeEventListener(egret.TouchEvent.TOUCH_TAP, listener, thisObj);\n        };\n        GObject.prototype.hasClickListener = function () {\n            return this.hasEventListener(egret.TouchEvent.TOUCH_TAP);\n        };\n        GObject.prototype.addEventListener = function (type, listener, thisObject) {\n            _super_1.prototype.addEventListener.call(this, type, listener, thisObject);\n            if (this._displayObject) {\n                this._displayObject.addEventListener(type, this._reDispatch, this);\n            }\n        };\n        GObject.prototype.removeEventListener = function (type, listener, thisObject) {\n            _super_1.prototype.removeEventListener.call(this, type, listener, thisObject);\n            if (this._displayObject && !this.hasEventListener(type)) {\n                this._displayObject.removeEventListener(type, this._reDispatch, this);\n            }\n        };\n        GObject.prototype._reDispatch = function (evt) {\n            this.dispatchEvent(evt);\n        };\n        Object.defineProperty(GObject.prototype, \"draggable\", {\n            get: function () {\n                return this._draggable;\n            },\n            set: function (value) {\n                if (this._draggable != value) {\n                    this._draggable = value;\n                    this.initDrag();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"dragBounds\", {\n            get: function () {\n                return this._dragBounds;\n            },\n            set: function (value) {\n                this._dragBounds = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.startDrag = function (touchPointID, stageX, stageY) {\n            if (this._displayObject.stage == null)\n                return;\n            this.dragBegin(touchPointID, stageX, stageY);\n        };\n        GObject.prototype.stopDrag = function () {\n            this.dragEnd();\n        };\n        Object.defineProperty(GObject.prototype, \"dragging\", {\n            get: function () {\n                return GObject.draggingObject == this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.localToGlobal = function (ax, ay, result) {\n            ax = ax || 0;\n            ay = ay || 0;\n            if (this._pivotAsAnchor) {\n                ax += this._pivotX * this._width;\n                ay += this._pivotY * this._height;\n            }\n            return this._displayObject.localToGlobal(ax, ay, result);\n        };\n        GObject.prototype.globalToLocal = function (ax, ay, result) {\n            ax = ax || 0;\n            ay = ay || 0;\n            var pt = this._displayObject.globalToLocal(ax, ay, result);\n            if (this._pivotAsAnchor) {\n                pt.x -= this._pivotX * this._width;\n                pt.y -= this._pivotY * this._height;\n            }\n            return pt;\n        };\n        GObject.prototype.localToRoot = function (ax, ay, result) {\n            ax = ax || 0;\n            ay = ay || 0;\n            var pt = this._displayObject.localToGlobal(ax, ay, result);\n            pt.x /= fgui.GRoot.contentScaleFactor;\n            pt.y /= fgui.GRoot.contentScaleFactor;\n            return pt;\n        };\n        GObject.prototype.rootToLocal = function (ax, ay, resultPoint) {\n            ax = ax || 0;\n            ay = ay || 0;\n            ax *= fgui.GRoot.contentScaleFactor;\n            ay *= fgui.GRoot.contentScaleFactor;\n            return this._displayObject.globalToLocal(ax, ay, resultPoint);\n        };\n        GObject.prototype.localToGlobalRect = function (ax, ay, aw, ah, result) {\n            ax = ax || 0;\n            ay = ay || 0;\n            aw = aw || 0;\n            ah = ah || 0;\n            result = result || new egret.Rectangle();\n            var pt = this.localToGlobal(ax, ay);\n            result.x = pt.x;\n            result.y = pt.y;\n            pt = this.localToGlobal(ax + aw, ay + ah);\n            result.right = pt.x;\n            result.bottom = pt.y;\n            return result;\n        };\n        GObject.prototype.globalToLocalRect = function (ax, ay, aw, ah, result) {\n            ax = ax || 0;\n            ay = ay || 0;\n            aw = aw || 0;\n            ah = ah || 0;\n            result = result || new egret.Rectangle();\n            var pt = this.globalToLocal(ax, ay);\n            result.x = pt.x;\n            result.y = pt.y;\n            pt = this.globalToLocal(ax + aw, ay + ah);\n            result.right = pt.x;\n            result.bottom = pt.y;\n            return result;\n        };\n        GObject.prototype.handleControllerChanged = function (c) {\n            this._handlingController = true;\n            for (var i = 0; i < 10; i++) {\n                var gear = this._gears[i];\n                if (gear && gear.controller == c)\n                    gear.apply();\n            }\n            this._handlingController = false;\n            this.checkGearDisplay();\n        };\n        GObject.prototype.createDisplayObject = function () {\n        };\n        GObject.prototype.switchDisplayObject = function (newObj) {\n            if (newObj == this._displayObject)\n                return;\n            var old = this._displayObject;\n            if (this._displayObject && this._displayObject.parent) {\n                var i = this._displayObject.parent.getChildIndex(this._displayObject);\n                this._displayObject.parent.addChildAt(newObj, i);\n                this._displayObject.parent.removeChild(this._displayObject);\n            }\n            this._displayObject = newObj;\n            this._displayObject.x = old.x;\n            this._displayObject.y = old.y;\n            this._displayObject.rotation = old.rotation;\n            this._displayObject.alpha = old.alpha;\n            this._displayObject.visible = old.visible;\n            this._displayObject.touchEnabled = old.touchEnabled;\n            this._displayObject.scaleX = old.scaleX;\n            this._displayObject.scaleY = old.scaleY;\n            fgui.ToolSet.setColorFilter(this._displayObject, this._grayed);\n            if (this._displayObject instanceof egret.DisplayObjectContainer)\n                this._displayObject.touchChildren = this._touchable;\n        };\n        GObject.prototype.handleXYChanged = function () {\n            if (this._displayObject) {\n                var xv = this._x;\n                var yv = this._y;\n                if (this._pivotAsAnchor) {\n                    xv -= this._pivotX * this._width;\n                    yv -= this._pivotY * this._height;\n                }\n                if (this._pixelSnapping) {\n                    xv = Math.round(xv);\n                    yv = Math.round(yv);\n                }\n                this._displayObject.x = xv + this._pivotOffsetX;\n                this._displayObject.y = yv + this._pivotOffsetY;\n            }\n        };\n        GObject.prototype.handleSizeChanged = function () {\n            if (this._displayObject) {\n                this._displayObject.width = this._width;\n                this._displayObject.height = this._height;\n            }\n        };\n        GObject.prototype.handleScaleChanged = function () {\n            if (this._displayObject) {\n                this._displayObject.scaleX = this._scaleX;\n                this._displayObject.scaleY = this._scaleY;\n            }\n        };\n        GObject.prototype.handleGrayedChanged = function () {\n            if (this._displayObject) {\n                fgui.ToolSet.setColorFilter(this._displayObject, this._grayed);\n            }\n        };\n        GObject.prototype.handleAlphaChanged = function () {\n            if (this._displayObject)\n                this._displayObject.alpha = this._alpha;\n        };\n        GObject.prototype.handleVisibleChanged = function () {\n            if (this._displayObject)\n                this._displayObject.visible = this.internalVisible2;\n            if (this instanceof fgui.GGroup)\n                this.handleVisibleChanged();\n        };\n        GObject.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Text:\n                    return this.text;\n                case fgui.ObjectPropID.Icon:\n                    return this.icon;\n                case fgui.ObjectPropID.Color:\n                    return NaN;\n                case fgui.ObjectPropID.OutlineColor:\n                    return NaN;\n                case fgui.ObjectPropID.Playing:\n                    return false;\n                case fgui.ObjectPropID.Frame:\n                    return 0;\n                case fgui.ObjectPropID.DeltaTime:\n                    return 0;\n                case fgui.ObjectPropID.TimeScale:\n                    return 1;\n                case fgui.ObjectPropID.FontSize:\n                    return 0;\n                case fgui.ObjectPropID.Selected:\n                    return false;\n                default:\n                    return undefined;\n            }\n        };\n        GObject.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Text:\n                    this.text = value;\n                    break;\n                case fgui.ObjectPropID.Icon:\n                    this.icon = value;\n                    break;\n            }\n        };\n        GObject.prototype.constructFromResource = function () {\n        };\n        GObject.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            buffer.seek(beginPos, 0);\n            buffer.skip(5);\n            var f1;\n            var f2;\n            this._id = buffer.readS();\n            this._name = buffer.readS();\n            f1 = buffer.readInt();\n            f2 = buffer.readInt();\n            this.setXY(f1, f2);\n            if (buffer.readBool()) {\n                this.initWidth = buffer.readInt();\n                this.initHeight = buffer.readInt();\n                this.setSize(this.initWidth, this.initHeight, true);\n            }\n            if (buffer.readBool()) {\n                this.minWidth = buffer.readInt();\n                this.maxWidth = buffer.readInt();\n                this.minHeight = buffer.readInt();\n                this.maxHeight = buffer.readInt();\n            }\n            if (buffer.readBool()) {\n                f1 = buffer.readFloat();\n                f2 = buffer.readFloat();\n                this.setScale(f1, f2);\n            }\n            if (buffer.readBool()) {\n                f1 = buffer.readFloat();\n                f2 = buffer.readFloat();\n                this.setSkew(f1, f2);\n            }\n            if (buffer.readBool()) {\n                f1 = buffer.readFloat();\n                f2 = buffer.readFloat();\n                this.setPivot(f1, f2, buffer.readBool());\n            }\n            f1 = buffer.readFloat();\n            if (f1 != 1)\n                this.alpha = f1;\n            f1 = buffer.readFloat();\n            if (f1 != 0)\n                this.rotation = f1;\n            if (!buffer.readBool())\n                this.visible = false;\n            if (!buffer.readBool())\n                this.touchable = false;\n            if (buffer.readBool())\n                this.grayed = true;\n            var bm = buffer.readByte();\n            if (bm == 2)\n                this.blendMode = egret.BlendMode.ADD;\n            else if (bm == 5)\n                this.blendMode = egret.BlendMode.ERASE;\n            var filter = buffer.readByte();\n            if (filter == 1 && this._displayObject)\n                fgui.ToolSet.setColorFilter(this._displayObject, [buffer.readFloat(), buffer.readFloat(), buffer.readFloat(), buffer.readFloat()]);\n            var str = buffer.readS();\n            if (str != null)\n                this.data = str;\n        };\n        GObject.prototype.setup_afterAdd = function (buffer, beginPos) {\n            buffer.seek(beginPos, 1);\n            var str = buffer.readS();\n            if (str != null)\n                this.tooltips = str;\n            var groupId = buffer.readShort();\n            if (groupId >= 0)\n                this.group = this.parent.getChildAt(groupId);\n            buffer.seek(beginPos, 2);\n            var cnt = buffer.readShort();\n            for (var i = 0; i < cnt; i++) {\n                var nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                var gear = this.getGear(buffer.readByte());\n                gear.setup(buffer);\n                buffer.position = nextPos;\n            }\n        };\n        GObject.prototype.initDrag = function () {\n            if (this._draggable)\n                this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__begin, this);\n            else\n                this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__begin, this);\n        };\n        GObject.prototype.dragBegin = function (touchPointID, stageX, stageY) {\n            if (GObject.draggingObject) {\n                var tmp = GObject.draggingObject;\n                tmp.stopDrag();\n                GObject.draggingObject = null;\n                var dragEvent = new fgui.DragEvent(fgui.DragEvent.DRAG_END);\n                dragEvent.stageX = stageX || fgui.GRoot.mouseX;\n                dragEvent.stageY = stageY || fgui.GRoot.mouseY;\n                dragEvent.touchPointID = touchPointID || 0;\n                tmp.dispatchEvent(dragEvent);\n            }\n            sGlobalDragStart.x = stageX || fgui.GRoot.mouseX;\n            sGlobalDragStart.y = stageY || fgui.GRoot.mouseY;\n            this.localToGlobalRect(0, 0, this._width, this._height, sGlobalRect);\n            this._dragTesting = true;\n            GObject.draggingObject = this;\n            fgui.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__moving, this);\n            fgui.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__end, this);\n        };\n        GObject.prototype.dragEnd = function () {\n            if (GObject.draggingObject == this) {\n                this.reset();\n                this._dragTesting = false;\n                GObject.draggingObject = null;\n            }\n        };\n        GObject.prototype.reset = function () {\n            fgui.GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__moving, this);\n            fgui.GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_END, this.__end, this);\n        };\n        GObject.prototype.__begin = function (evt) {\n            if (this._dragStartPos == null)\n                this._dragStartPos = new egret.Point();\n            this._dragStartPos.x = evt.stageX;\n            this._dragStartPos.y = evt.stageY;\n            this._dragTesting = true;\n            fgui.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__moving, this);\n            fgui.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__end, this);\n        };\n        GObject.prototype.__moving = function (evt) {\n            if (GObject.draggingObject != this && this._draggable && this._dragTesting) {\n                var sensitivity = fgui.UIConfig.touchDragSensitivity;\n                if (this._dragStartPos\n                    && Math.abs(this._dragStartPos.x - evt.stageX) < sensitivity\n                    && Math.abs(this._dragStartPos.y - evt.stageY) < sensitivity)\n                    return;\n                this._dragTesting = false;\n                var dragEvent = new fgui.DragEvent(fgui.DragEvent.DRAG_START);\n                dragEvent.stageX = evt.stageX;\n                dragEvent.stageY = evt.stageY;\n                dragEvent.touchPointID = evt.touchPointID;\n                this.dispatchEvent(dragEvent);\n                if (!dragEvent.isDefaultPrevented())\n                    this.dragBegin(evt.touchPointID, evt.stageX, evt.stageY);\n            }\n            if (GObject.draggingObject == this) {\n                var xx = evt.stageX - sGlobalDragStart.x + sGlobalRect.x;\n                var yy = evt.stageY - sGlobalDragStart.y + sGlobalRect.y;\n                if (this._dragBounds) {\n                    var rect = fgui.GRoot.inst.localToGlobalRect(this._dragBounds.x, this._dragBounds.y, this._dragBounds.width, this._dragBounds.height, sDragHelperRect);\n                    if (xx < rect.x)\n                        xx = rect.x;\n                    else if (xx + sGlobalRect.width > rect.right) {\n                        xx = rect.right - sGlobalRect.width;\n                        if (xx < rect.x)\n                            xx = rect.x;\n                    }\n                    if (yy < rect.y)\n                        yy = rect.y;\n                    else if (yy + sGlobalRect.height > rect.bottom) {\n                        yy = rect.bottom - sGlobalRect.height;\n                        if (yy < rect.y)\n                            yy = rect.y;\n                    }\n                }\n                sUpdateInDragging = true;\n                var pt = this.parent.globalToLocal(xx, yy, sHelperPoint);\n                this.setXY(Math.round(pt.x), Math.round(pt.y));\n                sUpdateInDragging = false;\n                var dragEvent = new fgui.DragEvent(fgui.DragEvent.DRAG_MOVING);\n                dragEvent.stageX = evt.stageX;\n                dragEvent.stageY = evt.stageY;\n                dragEvent.touchPointID = evt.touchPointID;\n                this.dispatchEvent(dragEvent);\n            }\n        };\n        GObject.prototype.__end = function (evt) {\n            if (GObject.draggingObject == this) {\n                GObject.draggingObject = null;\n                this.reset();\n                var dragEvent = new fgui.DragEvent(fgui.DragEvent.DRAG_END);\n                dragEvent.stageX = evt.stageX;\n                dragEvent.stageY = evt.stageY;\n                dragEvent.touchPointID = evt.touchPointID;\n                this.dispatchEvent(dragEvent);\n            }\n            else if (this._dragTesting) {\n                this._dragTesting = false;\n                this.reset();\n            }\n        };\n        GObject.XY_CHANGED = \"__xyChanged\";\n        GObject.SIZE_CHANGED = \"__sizeChanged\";\n        GObject.SIZE_DELAY_CHANGE = \"__sizeDelayChange\";\n        GObject.GEAR_STOP = \"gearStop\";\n        return GObject;\n    }(egret.EventDispatcher));\n    fgui.GObject = GObject;\n    var _gInstanceCounter = 0;\n    var sGlobalDragStart = new egret.Point();\n    var sGlobalRect = new egret.Rectangle();\n    var sHelperPoint = new egret.Point();\n    var sDragHelperRect = new egret.Rectangle();\n    var sUpdateInDragging;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GComponent = (function (_super_1) {\n        __extends(GComponent, _super_1);\n        function GComponent() {\n            var _this = _super_1.call(this) || this;\n            _this._sortingChildCount = 0;\n            _this._childrenRenderOrder = fgui.ChildrenRenderOrder.Ascent;\n            _this._apexIndex = 0;\n            _this._children = new Array();\n            _this._controllers = new Array();\n            _this._transitions = new Array();\n            _this._margin = new fgui.Margin();\n            _this._alignOffset = new egret.Point();\n            return _this;\n        }\n        GComponent.prototype.createDisplayObject = function () {\n            this._rootContainer = new fgui.UIContainer();\n            this.setDisplayObject(this._rootContainer);\n            this._container = this._rootContainer;\n        };\n        GComponent.prototype.dispose = function () {\n            var i;\n            var cnt;\n            cnt = this._transitions.length;\n            for (i = 0; i < cnt; ++i) {\n                var trans = this._transitions[i];\n                trans.dispose();\n            }\n            cnt = this._controllers.length;\n            for (i = 0; i < cnt; ++i) {\n                var cc = this._controllers[i];\n                cc.dispose();\n            }\n            if (this._scrollPane)\n                this._scrollPane.dispose();\n            cnt = this._children.length;\n            for (i = cnt - 1; i >= 0; --i) {\n                var obj = this._children[i];\n                obj.parent = null;\n                obj.dispose();\n            }\n            this._boundsChanged = false;\n            _super_1.prototype.dispose.call(this);\n        };\n        Object.defineProperty(GComponent.prototype, \"displayListContainer\", {\n            get: function () {\n                return this._container;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GComponent.prototype.addChild = function (child) {\n            this.addChildAt(child, this._children.length);\n            return child;\n        };\n        GComponent.prototype.addChildAt = function (child, index) {\n            if (index === void 0) { index = 0; }\n            if (!child)\n                throw \"child is null\";\n            var numChildren = this._children.length;\n            if (index >= 0 && index <= numChildren) {\n                if (child.parent == this) {\n                    this.setChildIndex(child, index);\n                }\n                else {\n                    child.removeFromParent();\n                    child.parent = this;\n                    var cnt = this._children.length;\n                    if (child.sortingOrder != 0) {\n                        this._sortingChildCount++;\n                        index = this.getInsertPosForSortingChild(child);\n                    }\n                    else if (this._sortingChildCount > 0) {\n                        if (index > (cnt - this._sortingChildCount))\n                            index = cnt - this._sortingChildCount;\n                    }\n                    if (index == cnt)\n                        this._children.push(child);\n                    else\n                        this._children.splice(index, 0, child);\n                    this.childStateChanged(child);\n                    this.setBoundsChangedFlag();\n                }\n                return child;\n            }\n            else {\n                throw \"Invalid child index\";\n            }\n        };\n        GComponent.prototype.getInsertPosForSortingChild = function (target) {\n            var cnt = this._children.length;\n            var i = 0;\n            for (i = 0; i < cnt; i++) {\n                var child = this._children[i];\n                if (child == target)\n                    continue;\n                if (target.sortingOrder < child.sortingOrder)\n                    break;\n            }\n            return i;\n        };\n        GComponent.prototype.removeChild = function (child, dispose) {\n            var childIndex = this._children.indexOf(child);\n            if (childIndex != -1) {\n                this.removeChildAt(childIndex, dispose);\n            }\n            return child;\n        };\n        GComponent.prototype.removeChildAt = function (index, dispose) {\n            if (index >= 0 && index < this.numChildren) {\n                var child = this._children[index];\n                child.parent = null;\n                if (child.sortingOrder != 0)\n                    this._sortingChildCount--;\n                this._children.splice(index, 1);\n                child.group = null;\n                if (child.inContainer) {\n                    this._container.removeChild(child.displayObject);\n                    if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Arch)\n                        fgui.GTimers.inst.callLater(this.buildNativeDisplayList, this);\n                }\n                if (dispose)\n                    child.dispose();\n                this.setBoundsChangedFlag();\n                return child;\n            }\n            else {\n                throw \"Invalid child index\";\n            }\n        };\n        GComponent.prototype.removeChildren = function (beginIndex, endIndex, dispose) {\n            if (beginIndex == undefined)\n                beginIndex = 0;\n            if (endIndex == undefined)\n                endIndex = -1;\n            if (endIndex < 0 || endIndex >= this.numChildren)\n                endIndex = this.numChildren - 1;\n            for (var i = beginIndex; i <= endIndex; ++i)\n                this.removeChildAt(beginIndex, dispose);\n        };\n        GComponent.prototype.getChildAt = function (index) {\n            if (index >= 0 && index < this.numChildren)\n                return this._children[index];\n            else\n                throw \"Invalid child index\";\n        };\n        GComponent.prototype.getChild = function (name) {\n            var cnt = this._children.length;\n            for (var i = 0; i < cnt; ++i) {\n                if (this._children[i].name == name)\n                    return this._children[i];\n            }\n            return null;\n        };\n        GComponent.prototype.getChildByPath = function (path) {\n            var arr = path.split(\".\");\n            var cnt = arr.length;\n            var gcom = this;\n            var obj;\n            for (var i = 0; i < cnt; ++i) {\n                obj = gcom.getChild(arr[i]);\n                if (!obj)\n                    break;\n                if (i != cnt - 1) {\n                    if (!(obj instanceof GComponent)) {\n                        obj = null;\n                        break;\n                    }\n                    else\n                        gcom = obj;\n                }\n            }\n            return obj;\n        };\n        GComponent.prototype.getVisibleChild = function (name) {\n            var cnt = this._children.length;\n            for (var i = 0; i < cnt; ++i) {\n                var child = this._children[i];\n                if (child.internalVisible && child.internalVisible && child.name == name)\n                    return child;\n            }\n            return null;\n        };\n        GComponent.prototype.getChildInGroup = function (name, group) {\n            var cnt = this._children.length;\n            for (var i = 0; i < cnt; ++i) {\n                var child = this._children[i];\n                if (child.group == group && child.name == name)\n                    return child;\n            }\n            return null;\n        };\n        GComponent.prototype.getChildById = function (id) {\n            var cnt = this._children.length;\n            for (var i = 0; i < cnt; ++i) {\n                if (this._children[i]._id == id)\n                    return this._children[i];\n            }\n            return null;\n        };\n        GComponent.prototype.getChildIndex = function (child) {\n            return this._children.indexOf(child);\n        };\n        GComponent.prototype.setChildIndex = function (child, index) {\n            var oldIndex = this._children.indexOf(child);\n            if (oldIndex == -1)\n                throw \"Not a child of this container\";\n            if (child.sortingOrder != 0)\n                return;\n            var cnt = this._children.length;\n            if (this._sortingChildCount > 0) {\n                if (index > (cnt - this._sortingChildCount - 1))\n                    index = cnt - this._sortingChildCount - 1;\n            }\n            this._setChildIndex(child, oldIndex, index);\n        };\n        GComponent.prototype.setChildIndexBefore = function (child, index) {\n            var oldIndex = this._children.indexOf(child);\n            if (oldIndex == -1)\n                throw \"Not a child of this container\";\n            if (child.sortingOrder != 0)\n                return oldIndex;\n            var cnt = this._children.length;\n            if (this._sortingChildCount > 0) {\n                if (index > (cnt - this._sortingChildCount - 1))\n                    index = cnt - this._sortingChildCount - 1;\n            }\n            if (oldIndex < index)\n                return this._setChildIndex(child, oldIndex, index - 1);\n            else\n                return this._setChildIndex(child, oldIndex, index);\n        };\n        GComponent.prototype._setChildIndex = function (child, oldIndex, index) {\n            var cnt = this._children.length;\n            if (index > cnt)\n                index = cnt;\n            if (oldIndex == index)\n                return oldIndex;\n            this._children.splice(oldIndex, 1);\n            this._children.splice(index, 0, child);\n            if (child.inContainer) {\n                var displayIndex = 0;\n                var g;\n                var i;\n                if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Ascent) {\n                    for (i = 0; i < index; i++) {\n                        g = this._children[i];\n                        if (g.inContainer)\n                            displayIndex++;\n                    }\n                    if (displayIndex == this._container.numChildren)\n                        displayIndex--;\n                    this._container.setChildIndex(child.displayObject, displayIndex);\n                }\n                else if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Descent) {\n                    for (i = cnt - 1; i > index; i--) {\n                        g = this._children[i];\n                        if (g.inContainer)\n                            displayIndex++;\n                    }\n                    if (displayIndex == this._container.numChildren)\n                        displayIndex--;\n                    this._container.setChildIndex(child.displayObject, displayIndex);\n                }\n                else {\n                    fgui.GTimers.inst.callLater(this.buildNativeDisplayList, this);\n                }\n                this.setBoundsChangedFlag();\n            }\n            return index;\n        };\n        GComponent.prototype.swapChildren = function (child1, child2) {\n            var index1 = this._children.indexOf(child1);\n            var index2 = this._children.indexOf(child2);\n            if (index1 == -1 || index2 == -1)\n                throw \"Not a child of this container\";\n            this.swapChildrenAt(index1, index2);\n        };\n        GComponent.prototype.swapChildrenAt = function (index1, index2) {\n            var child1 = this._children[index1];\n            var child2 = this._children[index2];\n            this.setChildIndex(child1, index2);\n            this.setChildIndex(child2, index1);\n        };\n        Object.defineProperty(GComponent.prototype, \"numChildren\", {\n            get: function () {\n                return this._children.length;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GComponent.prototype.isAncestorOf = function (child) {\n            if (!child)\n                return false;\n            var p = child.parent;\n            while (p) {\n                if (p == this)\n                    return true;\n                p = p.parent;\n            }\n            return false;\n        };\n        GComponent.prototype.addController = function (controller) {\n            this._controllers.push(controller);\n            controller.parent = this;\n            this.applyController(controller);\n        };\n        GComponent.prototype.getControllerAt = function (index) {\n            return this._controllers[index];\n        };\n        GComponent.prototype.getController = function (name) {\n            var cnt = this._controllers.length;\n            for (var i = 0; i < cnt; ++i) {\n                var c = this._controllers[i];\n                if (c.name == name)\n                    return c;\n            }\n            return null;\n        };\n        GComponent.prototype.removeController = function (c) {\n            var index = this._controllers.indexOf(c);\n            if (index == -1)\n                throw \"controller not exists\";\n            c.parent = null;\n            this._controllers.splice(index, 1);\n            var length = this._children.length;\n            for (var i = 0; i < length; i++) {\n                var child = this._children[i];\n                child.handleControllerChanged(c);\n            }\n        };\n        Object.defineProperty(GComponent.prototype, \"controllers\", {\n            get: function () {\n                return this._controllers;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GComponent.prototype.childStateChanged = function (child) {\n            if (this._buildingDisplayList)\n                return;\n            var cnt = this._children.length;\n            var g;\n            var i;\n            if (child instanceof fgui.GGroup) {\n                for (i = 0; i < cnt; i++) {\n                    g = this._children[i];\n                    if (g.group == child)\n                        this.childStateChanged(g);\n                }\n                return;\n            }\n            if (!child.displayObject)\n                return;\n            if (child.internalVisible) {\n                if (!child.displayObject.parent) {\n                    var index = 0;\n                    if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Ascent) {\n                        for (i = 0; i < cnt; i++) {\n                            g = this._children[i];\n                            if (g == child)\n                                break;\n                            if (g.displayObject && g.displayObject.parent)\n                                index++;\n                        }\n                        this._container.addChildAt(child.displayObject, index);\n                    }\n                    else if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Descent) {\n                        for (i = cnt - 1; i >= 0; i--) {\n                            g = this._children[i];\n                            if (g == child)\n                                break;\n                            if (g.displayObject && g.displayObject.parent)\n                                index++;\n                        }\n                        this._container.addChildAt(child.displayObject, index);\n                    }\n                    else {\n                        this._container.addChild(child.displayObject);\n                        fgui.GTimers.inst.callLater(this.buildNativeDisplayList, this);\n                    }\n                }\n            }\n            else {\n                if (child.displayObject.parent)\n                    this._container.removeChild(child.displayObject);\n            }\n        };\n        GComponent.prototype.buildNativeDisplayList = function () {\n            var cnt = this._children.length;\n            if (cnt == 0)\n                return;\n            var i;\n            var child;\n            switch (this._childrenRenderOrder) {\n                case fgui.ChildrenRenderOrder.Ascent:\n                    {\n                        for (i = 0; i < cnt; i++) {\n                            child = this._children[i];\n                            if (child.displayObject && child.internalVisible)\n                                this._container.addChild(child.displayObject);\n                        }\n                    }\n                    break;\n                case fgui.ChildrenRenderOrder.Descent:\n                    {\n                        for (i = cnt - 1; i >= 0; i--) {\n                            child = this._children[i];\n                            if (child.displayObject && child.internalVisible)\n                                this._container.addChild(child.displayObject);\n                        }\n                    }\n                    break;\n                case fgui.ChildrenRenderOrder.Arch:\n                    {\n                        var apex = fgui.ToolSet.clamp(this._apexIndex, 0, cnt);\n                        for (i = 0; i < apex; i++) {\n                            child = this._children[i];\n                            if (child.displayObject && child.internalVisible)\n                                this._container.addChild(child.displayObject);\n                        }\n                        for (i = cnt - 1; i >= apex; i--) {\n                            child = this._children[i];\n                            if (child.displayObject && child.internalVisible)\n                                this._container.addChild(child.displayObject);\n                        }\n                    }\n                    break;\n            }\n        };\n        GComponent.prototype.applyController = function (c) {\n            this._applyingController = c;\n            var child;\n            var length = this._children.length;\n            for (var i = 0; i < length; i++) {\n                child = this._children[i];\n                child.handleControllerChanged(c);\n            }\n            this._applyingController = null;\n            c.runActions();\n        };\n        GComponent.prototype.applyAllControllers = function () {\n            var cnt = this._controllers.length;\n            for (var i = 0; i < cnt; ++i) {\n                this.applyController(this._controllers[i]);\n            }\n        };\n        GComponent.prototype.adjustRadioGroupDepth = function (obj, c) {\n            var cnt = this._children.length;\n            var i;\n            var child;\n            var myIndex = -1, maxIndex = -1;\n            for (i = 0; i < cnt; i++) {\n                child = this._children[i];\n                if (child == obj) {\n                    myIndex = i;\n                }\n                else if ((child instanceof fgui.GButton) && child.relatedController == c) {\n                    if (i > maxIndex)\n                        maxIndex = i;\n                }\n            }\n            if (myIndex < maxIndex) {\n                if (this._applyingController)\n                    this._children[maxIndex].handleControllerChanged(this._applyingController);\n                this.swapChildrenAt(myIndex, maxIndex);\n            }\n        };\n        GComponent.prototype.getTransitionAt = function (index) {\n            return this._transitions[index];\n        };\n        GComponent.prototype.getTransition = function (transName) {\n            var cnt = this._transitions.length;\n            for (var i = 0; i < cnt; ++i) {\n                var trans = this._transitions[i];\n                if (trans.name == transName)\n                    return trans;\n            }\n            return null;\n        };\n        GComponent.prototype.isChildInView = function (child) {\n            if (this._rootContainer.scrollRect) {\n                return child.x + child.width >= 0 && child.x <= this.width\n                    && child.y + child.height >= 0 && child.y <= this.height;\n            }\n            else if (this._scrollPane) {\n                return this._scrollPane.isChildInView(child);\n            }\n            else\n                return true;\n        };\n        GComponent.prototype.getFirstChildInView = function () {\n            var cnt = this._children.length;\n            for (var i = 0; i < cnt; ++i) {\n                var child = this._children[i];\n                if (this.isChildInView(child))\n                    return i;\n            }\n            return -1;\n        };\n        Object.defineProperty(GComponent.prototype, \"scrollPane\", {\n            get: function () {\n                return this._scrollPane;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComponent.prototype, \"opaque\", {\n            get: function () {\n                return this._rootContainer.opaque;\n            },\n            set: function (value) {\n                this._rootContainer.opaque = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComponent.prototype, \"margin\", {\n            get: function () {\n                return this._margin;\n            },\n            set: function (value) {\n                this._margin.copy(value);\n                if (this._rootContainer.scrollRect) {\n                    this._container.x = this._margin.left + this._alignOffset.x;\n                    this._container.y = this._margin.top + this._alignOffset.y;\n                }\n                this.handleSizeChanged();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComponent.prototype, \"childrenRenderOrder\", {\n            get: function () {\n                return this._childrenRenderOrder;\n            },\n            set: function (value) {\n                if (this._childrenRenderOrder != value) {\n                    this._childrenRenderOrder = value;\n                    this.buildNativeDisplayList();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComponent.prototype, \"apexIndex\", {\n            get: function () {\n                return this._apexIndex;\n            },\n            set: function (value) {\n                if (this._apexIndex != value) {\n                    this._apexIndex = value;\n                    if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Arch)\n                        this.buildNativeDisplayList();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComponent.prototype, \"mask\", {\n            get: function () {\n                return this._rootContainer.mask;\n            },\n            set: function (value) {\n                this._rootContainer.mask = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComponent.prototype, \"baseUserData\", {\n            get: function () {\n                var buffer = this.packageItem.rawData;\n                buffer.seek(0, 4);\n                return buffer.readS();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GComponent.prototype.updateScrollRect = function () {\n            var rect = this._rootContainer.scrollRect;\n            if (rect == null)\n                rect = new egret.Rectangle();\n            var w = this.width - this._margin.right;\n            var h = this.height - this._margin.bottom;\n            rect.setTo(0, 0, w, h);\n            this._rootContainer.scrollRect = rect;\n        };\n        GComponent.prototype.setupScroll = function (buffer) {\n            if (this._rootContainer == this._container) {\n                this._container = new egret.DisplayObjectContainer();\n                this._rootContainer.addChild(this._container);\n            }\n            this._scrollPane = new fgui.ScrollPane(this);\n            this._scrollPane.setup(buffer);\n            this.setBoundsChangedFlag();\n        };\n        GComponent.prototype.setupOverflow = function (overflow) {\n            if (overflow == fgui.OverflowType.Hidden) {\n                if (this._rootContainer == this._container) {\n                    this._container = new egret.DisplayObjectContainer();\n                    this._rootContainer.addChild(this._container);\n                }\n                this.updateScrollRect();\n                this._container.x = this._margin.left;\n                this._container.y = this._margin.top;\n            }\n            else if (this._margin.left != 0 || this._margin.top != 0) {\n                if (this._rootContainer == this._container) {\n                    this._container = new egret.DisplayObjectContainer();\n                    this._rootContainer.addChild(this._container);\n                }\n                this._container.x = this._margin.left;\n                this._container.y = this._margin.top;\n            }\n            this.setBoundsChangedFlag();\n        };\n        GComponent.prototype.handleSizeChanged = function () {\n            _super_1.prototype.handleSizeChanged.call(this);\n            if (this._scrollPane)\n                this._scrollPane.onOwnerSizeChanged();\n            else if (this._rootContainer.scrollRect)\n                this.updateScrollRect();\n            if (this._rootContainer.hitArea instanceof fgui.PixelHitTest) {\n                var hitTest = (this._rootContainer.hitArea);\n                if (this.sourceWidth != 0)\n                    hitTest.scaleX = this._width / this.sourceWidth;\n                if (this.sourceHeight != 0)\n                    hitTest.scaleY = this._height / this.sourceHeight;\n            }\n        };\n        GComponent.prototype.handleGrayedChanged = function () {\n            var c = this.getController(\"grayed\");\n            if (c) {\n                c.selectedIndex = this.grayed ? 1 : 0;\n                return;\n            }\n            var v = this.grayed;\n            var cnt = this._children.length;\n            for (var i = 0; i < cnt; ++i) {\n                this._children[i].grayed = v;\n            }\n        };\n        GComponent.prototype.handleControllerChanged = function (c) {\n            _super_1.prototype.handleControllerChanged.call(this, c);\n            if (this._scrollPane)\n                this._scrollPane.handleControllerChanged(c);\n        };\n        GComponent.prototype.setBoundsChangedFlag = function () {\n            if (!this._scrollPane && !this._trackBounds)\n                return;\n            if (!this._boundsChanged) {\n                this._boundsChanged = true;\n                egret.callLater(this.__render, this);\n            }\n        };\n        GComponent.prototype.__render = function () {\n            if (this._boundsChanged) {\n                var len = this._children.length;\n                if (len > 0) {\n                    for (var i = 0; i < len; i++) {\n                        var child = this._children[i];\n                        child.ensureSizeCorrect();\n                    }\n                }\n                this.updateBounds();\n            }\n        };\n        GComponent.prototype.ensureBoundsCorrect = function () {\n            var len = this._children.length;\n            if (len > 0) {\n                for (var i = 0; i < len; i++) {\n                    var child = this._children[i];\n                    child.ensureSizeCorrect();\n                }\n            }\n            if (this._boundsChanged)\n                this.updateBounds();\n        };\n        GComponent.prototype.updateBounds = function () {\n            var ax = 0, ay = 0, aw = 0, ah = 0;\n            var len = this._children.length;\n            if (len > 0) {\n                ax = Number.POSITIVE_INFINITY, ay = Number.POSITIVE_INFINITY;\n                var ar = Number.NEGATIVE_INFINITY, ab = Number.NEGATIVE_INFINITY;\n                var tmp = 0;\n                var i = 0;\n                for (var i = 0; i < len; i++) {\n                    var child = this._children[i];\n                    tmp = child.x;\n                    if (tmp < ax)\n                        ax = tmp;\n                    tmp = child.y;\n                    if (tmp < ay)\n                        ay = tmp;\n                    tmp = child.x + child.actualWidth;\n                    if (tmp > ar)\n                        ar = tmp;\n                    tmp = child.y + child.actualHeight;\n                    if (tmp > ab)\n                        ab = tmp;\n                }\n                aw = ar - ax;\n                ah = ab - ay;\n            }\n            this.setBounds(ax, ay, aw, ah);\n        };\n        GComponent.prototype.setBounds = function (ax, ay, aw, ah) {\n            if (ah === void 0) { ah = 0; }\n            this._boundsChanged = false;\n            if (this._scrollPane)\n                this._scrollPane.setContentSize(Math.round(ax + aw), Math.round(ay + ah));\n        };\n        Object.defineProperty(GComponent.prototype, \"viewWidth\", {\n            get: function () {\n                if (this._scrollPane)\n                    return this._scrollPane.viewWidth;\n                else\n                    return this.width - this._margin.left - this._margin.right;\n            },\n            set: function (value) {\n                if (this._scrollPane)\n                    this._scrollPane.viewWidth = value;\n                else\n                    this.width = value + this._margin.left + this._margin.right;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComponent.prototype, \"viewHeight\", {\n            get: function () {\n                if (this._scrollPane)\n                    return this._scrollPane.viewHeight;\n                else\n                    return this.height - this._margin.top - this._margin.bottom;\n            },\n            set: function (value) {\n                if (this._scrollPane)\n                    this._scrollPane.viewHeight = value;\n                else\n                    this.height = value + this._margin.top + this._margin.bottom;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GComponent.prototype.getSnappingPosition = function (xValue, yValue, resultPoint) {\n            if (!resultPoint)\n                resultPoint = new egret.Point();\n            var cnt = this._children.length;\n            if (cnt == 0) {\n                resultPoint.x = 0;\n                resultPoint.y = 0;\n                return resultPoint;\n            }\n            this.ensureBoundsCorrect();\n            var obj = null;\n            var prev = null;\n            var i = 0;\n            if (yValue != 0) {\n                for (; i < cnt; i++) {\n                    obj = this._children[i];\n                    if (yValue < obj.y) {\n                        if (i == 0) {\n                            yValue = 0;\n                            break;\n                        }\n                        else {\n                            prev = this._children[i - 1];\n                            if (yValue < prev.y + prev.actualHeight / 2)\n                                yValue = prev.y;\n                            else\n                                yValue = obj.y;\n                            break;\n                        }\n                    }\n                }\n                if (i == cnt)\n                    yValue = obj.y;\n            }\n            if (xValue != 0) {\n                if (i > 0)\n                    i--;\n                for (; i < cnt; i++) {\n                    obj = this._children[i];\n                    if (xValue < obj.x) {\n                        if (i == 0) {\n                            xValue = 0;\n                            break;\n                        }\n                        else {\n                            prev = this._children[i - 1];\n                            if (xValue < prev.x + prev.actualWidth / 2)\n                                xValue = prev.x;\n                            else\n                                xValue = obj.x;\n                            break;\n                        }\n                    }\n                }\n                if (i == cnt)\n                    xValue = obj.x;\n            }\n            resultPoint.x = xValue;\n            resultPoint.y = yValue;\n            return resultPoint;\n        };\n        GComponent.prototype.childSortingOrderChanged = function (child, oldValue, newValue) {\n            if (newValue === void 0) { newValue = 0; }\n            if (newValue == 0) {\n                this._sortingChildCount--;\n                this.setChildIndex(child, this._children.length);\n            }\n            else {\n                if (oldValue == 0)\n                    this._sortingChildCount++;\n                var oldIndex = this._children.indexOf(child);\n                var index = this.getInsertPosForSortingChild(child);\n                if (oldIndex < index)\n                    this._setChildIndex(child, oldIndex, index - 1);\n                else\n                    this._setChildIndex(child, oldIndex, index);\n            }\n        };\n        GComponent.prototype.constructFromResource = function () {\n            this.constructFromResource2(null, 0);\n        };\n        GComponent.prototype.constructFromResource2 = function (objectPool, poolIndex) {\n            var contentItem = this.packageItem.getBranch();\n            if (!contentItem.decoded) {\n                contentItem.decoded = true;\n                fgui.TranslationHelper.translateComponent(contentItem);\n            }\n            var i;\n            var dataLen;\n            var curPos;\n            var nextPos;\n            var f1;\n            var f2;\n            var i1;\n            var i2;\n            var buffer = contentItem.rawData;\n            buffer.seek(0, 0);\n            this._underConstruct = true;\n            this.sourceWidth = buffer.readInt();\n            this.sourceHeight = buffer.readInt();\n            this.initWidth = this.sourceWidth;\n            this.initHeight = this.sourceHeight;\n            this.setSize(this.sourceWidth, this.sourceHeight);\n            if (buffer.readBool()) {\n                this.minWidth = buffer.readInt();\n                this.maxWidth = buffer.readInt();\n                this.minHeight = buffer.readInt();\n                this.maxHeight = buffer.readInt();\n            }\n            if (buffer.readBool()) {\n                f1 = buffer.readFloat();\n                f2 = buffer.readFloat();\n                this.internalSetPivot(f1, f2, buffer.readBool());\n            }\n            if (buffer.readBool()) {\n                this._margin.top = buffer.readInt();\n                this._margin.bottom = buffer.readInt();\n                this._margin.left = buffer.readInt();\n                this._margin.right = buffer.readInt();\n            }\n            var overflow = buffer.readByte();\n            if (overflow == fgui.OverflowType.Scroll) {\n                var savedPos = buffer.position;\n                buffer.seek(0, 7);\n                this.setupScroll(buffer);\n                buffer.position = savedPos;\n            }\n            else\n                this.setupOverflow(overflow);\n            if (buffer.readBool())\n                buffer.skip(8);\n            this._buildingDisplayList = true;\n            buffer.seek(0, 1);\n            var controllerCount = buffer.readShort();\n            for (i = 0; i < controllerCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                var controller = new fgui.Controller();\n                this._controllers.push(controller);\n                controller.parent = this;\n                controller.setup(buffer);\n                buffer.position = nextPos;\n            }\n            buffer.seek(0, 2);\n            var child;\n            var childCount = buffer.readShort();\n            for (i = 0; i < childCount; i++) {\n                dataLen = buffer.readShort();\n                curPos = buffer.position;\n                if (objectPool)\n                    child = objectPool[poolIndex + i];\n                else {\n                    buffer.seek(curPos, 0);\n                    var type = buffer.readByte();\n                    var src = buffer.readS();\n                    var pkgId = buffer.readS();\n                    var pi = null;\n                    if (src != null) {\n                        var pkg;\n                        if (pkgId != null)\n                            pkg = fgui.UIPackage.getById(pkgId);\n                        else\n                            pkg = contentItem.owner;\n                        pi = pkg ? pkg.getItemById(src) : null;\n                    }\n                    if (pi) {\n                        child = fgui.UIObjectFactory.newObject(pi);\n                        child.constructFromResource();\n                    }\n                    else\n                        child = fgui.UIObjectFactory.newObject(type);\n                }\n                child._underConstruct = true;\n                child.setup_beforeAdd(buffer, curPos);\n                child.parent = this;\n                this._children.push(child);\n                buffer.position = curPos + dataLen;\n            }\n            buffer.seek(0, 3);\n            this.relations.setup(buffer, true);\n            buffer.seek(0, 2);\n            buffer.skip(2);\n            for (i = 0; i < childCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                buffer.seek(buffer.position, 3);\n                this._children[i].relations.setup(buffer, false);\n                buffer.position = nextPos;\n            }\n            buffer.seek(0, 2);\n            buffer.skip(2);\n            for (i = 0; i < childCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                child = this._children[i];\n                child.setup_afterAdd(buffer, buffer.position);\n                child._underConstruct = false;\n                buffer.position = nextPos;\n            }\n            buffer.seek(0, 4);\n            buffer.skip(2);\n            this.opaque = buffer.readBool();\n            var maskId = buffer.readShort();\n            if (maskId != -1) {\n                this.mask = this.getChildAt(maskId).displayObject;\n                buffer.readBool();\n            }\n            var hitTestId = buffer.readS();\n            i1 = buffer.readInt();\n            i2 = buffer.readInt();\n            if (hitTestId != null) {\n                pi = contentItem.owner.getItemById(hitTestId);\n                if (pi && pi.pixelHitTestData)\n                    this._rootContainer.hitArea = new fgui.PixelHitTest(pi.pixelHitTestData, i1, i2);\n            }\n            else if (i1 != 0 && i2 != -1) {\n                this._rootContainer.hitArea = this.getChildAt(i2).displayObject;\n            }\n            buffer.seek(0, 5);\n            var transitionCount = buffer.readShort();\n            for (i = 0; i < transitionCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                var trans = new fgui.Transition(this);\n                trans.setup(buffer);\n                this._transitions.push(trans);\n                buffer.position = nextPos;\n            }\n            if (this._transitions.length > 0) {\n                this.displayObject.addEventListener(egret.Event.ADDED_TO_STAGE, this.___added, this);\n                this.displayObject.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.___removed, this);\n            }\n            this.applyAllControllers();\n            this._buildingDisplayList = false;\n            this._underConstruct = false;\n            this.buildNativeDisplayList();\n            this.setBoundsChangedFlag();\n            if (contentItem.objectType != fgui.ObjectType.Component)\n                this.constructExtension(buffer);\n            this.onConstruct();\n        };\n        GComponent.prototype.onConstruct = function () {\n            this.constructFromXML(null);\n        };\n        GComponent.prototype.constructExtension = function (buffer) {\n        };\n        GComponent.prototype.constructFromXML = function (xml) {\n        };\n        GComponent.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 4);\n            var pageController = buffer.readShort();\n            if (pageController != -1 && this._scrollPane)\n                this._scrollPane.pageController = this._parent.getControllerAt(pageController);\n            var cnt = buffer.readShort();\n            for (var i = 0; i < cnt; i++) {\n                var cc = this.getController(buffer.readS());\n                var pageId = buffer.readS();\n                if (cc)\n                    cc.selectedPageId = pageId;\n            }\n            if (buffer.version >= 2) {\n                cnt = buffer.readShort();\n                for (i = 0; i < cnt; i++) {\n                    var target = buffer.readS();\n                    var propertyId = buffer.readShort();\n                    var value = buffer.readS();\n                    var obj = this.getChildByPath(target);\n                    if (obj)\n                        obj.setProp(propertyId, value);\n                }\n            }\n        };\n        GComponent.prototype.___added = function (evt) {\n            var cnt = this._transitions.length;\n            for (var i = 0; i < cnt; ++i) {\n                this._transitions[i].onOwnerAddedToStage();\n            }\n        };\n        GComponent.prototype.___removed = function (evt) {\n            var cnt = this._transitions.length;\n            for (var i = 0; i < cnt; ++i) {\n                this._transitions[i].onOwnerRemovedFromStage();\n            }\n        };\n        return GComponent;\n    }(fgui.GObject));\n    fgui.GComponent = GComponent;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GButton = (function (_super_1) {\n        __extends(GButton, _super_1);\n        function GButton() {\n            var _this = _super_1.call(this) || this;\n            _this._mode = fgui.ButtonMode.Common;\n            _this._title = \"\";\n            _this._icon = \"\";\n            _this._sound = fgui.UIConfig.buttonSound;\n            _this._soundVolumeScale = fgui.UIConfig.buttonSoundVolumeScale;\n            _this._changeStateOnClick = true;\n            _this._downEffect = 0;\n            _this._downEffectValue = 0.8;\n            return _this;\n        }\n        Object.defineProperty(GButton.prototype, \"icon\", {\n            get: function () {\n                return this._icon;\n            },\n            set: function (value) {\n                this._icon = value;\n                value = (this._selected && this._selectedIcon) ? this._selectedIcon : this._icon;\n                if (this._iconObject)\n                    this._iconObject.icon = value;\n                this.updateGear(7);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"selectedIcon\", {\n            get: function () {\n                return this._selectedIcon;\n            },\n            set: function (value) {\n                this._selectedIcon = value;\n                value = (this._selected && this._selectedIcon) ? this._selectedIcon : this._icon;\n                if (this._iconObject)\n                    this._iconObject.icon = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"title\", {\n            get: function () {\n                return this._title;\n            },\n            set: function (value) {\n                this._title = value;\n                if (this._titleObject)\n                    this._titleObject.text = (this._selected && this._selectedTitle) ? this._selectedTitle : this._title;\n                this.updateGear(6);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"text\", {\n            get: function () {\n                return this.title;\n            },\n            set: function (value) {\n                this.title = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"selectedTitle\", {\n            get: function () {\n                return this._selectedTitle;\n            },\n            set: function (value) {\n                this._selectedTitle = value;\n                if (this._titleObject)\n                    this._titleObject.text = (this._selected && this._selectedTitle) ? this._selectedTitle : this._title;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"titleColor\", {\n            get: function () {\n                var tf = this.getTextField();\n                if (tf)\n                    return tf.color;\n                else\n                    return 0;\n            },\n            set: function (value) {\n                var tf = this.getTextField();\n                if (tf)\n                    tf.color = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"titleFontSize\", {\n            get: function () {\n                var tf = this.getTextField();\n                if (tf)\n                    return tf.fontSize;\n                else\n                    return 0;\n            },\n            set: function (value) {\n                var tf = this.getTextField();\n                if (tf)\n                    tf.fontSize = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"sound\", {\n            get: function () {\n                return this._sound;\n            },\n            set: function (val) {\n                this._sound = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"soundVolumeScale\", {\n            get: function () {\n                return this._soundVolumeScale;\n            },\n            set: function (value) {\n                this._soundVolumeScale = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"selected\", {\n            get: function () {\n                return this._selected;\n            },\n            set: function (val) {\n                if (this._mode == fgui.ButtonMode.Common)\n                    return;\n                if (this._selected != val) {\n                    this._selected = val;\n                    if (this.grayed && this._buttonController && this._buttonController.hasPage(GButton.DISABLED)) {\n                        if (this._selected)\n                            this.setState(GButton.SELECTED_DISABLED);\n                        else\n                            this.setState(GButton.DISABLED);\n                    }\n                    else {\n                        if (this._selected)\n                            this.setState(this._over ? GButton.SELECTED_OVER : GButton.DOWN);\n                        else\n                            this.setState(this._over ? GButton.OVER : GButton.UP);\n                    }\n                    if (this._selectedTitle && this._titleObject)\n                        this._titleObject.text = this._selected ? this._selectedTitle : this._title;\n                    if (this._selectedIcon) {\n                        var str = this._selected ? this._selectedIcon : this._icon;\n                        if (this._iconObject)\n                            this._iconObject.icon = str;\n                    }\n                    if (this._relatedController\n                        && this._parent\n                        && !this._parent._buildingDisplayList) {\n                        if (this._selected) {\n                            this._relatedController.selectedPageId = this._relatedPageId;\n                            if (this._relatedController.autoRadioGroupDepth)\n                                this._parent.adjustRadioGroupDepth(this, this._relatedController);\n                        }\n                        else if (this._mode == fgui.ButtonMode.Check && this._relatedController.selectedPageId == this._relatedPageId)\n                            this._relatedController.oppositePageId = this._relatedPageId;\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"mode\", {\n            get: function () {\n                return this._mode;\n            },\n            set: function (value) {\n                if (this._mode != value) {\n                    if (value == fgui.ButtonMode.Common)\n                        this.selected = false;\n                    this._mode = value;\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"relatedController\", {\n            get: function () {\n                return this._relatedController;\n            },\n            set: function (val) {\n                this._relatedController = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"relatedPageId\", {\n            get: function () {\n                return this._relatedPageId;\n            },\n            set: function (val) {\n                this._relatedPageId = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"changeStateOnClick\", {\n            get: function () {\n                return this._changeStateOnClick;\n            },\n            set: function (value) {\n                this._changeStateOnClick = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"linkedPopup\", {\n            get: function () {\n                return this._linkedPopup;\n            },\n            set: function (value) {\n                this._linkedPopup = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GButton.prototype.getTextField = function () {\n            if (this._titleObject instanceof fgui.GTextField)\n                return this._titleObject;\n            else if ((this._titleObject instanceof fgui.GLabel) || (this._titleObject instanceof GButton))\n                return this._titleObject.getTextField();\n            else\n                return null;\n        };\n        GButton.prototype.addStateListener = function (listener, thisObj) {\n            this.addEventListener(fgui.StateChangeEvent.CHANGED, listener, thisObj);\n        };\n        GButton.prototype.removeStateListener = function (listener, thisObj) {\n            this.removeEventListener(fgui.StateChangeEvent.CHANGED, listener, thisObj);\n        };\n        GButton.prototype.fireClick = function (downEffect) {\n            if (downEffect && this._mode == fgui.ButtonMode.Common) {\n                this.setState(GButton.OVER);\n                fgui.GTimers.inst.add(100, 1, function () { this.setState(GButton.DOWN); }, this);\n                fgui.GTimers.inst.add(200, 1, function () { this.setState(GButton.UP); }, this);\n            }\n            this.__click(null);\n        };\n        GButton.prototype.setState = function (val) {\n            if (this._buttonController)\n                this._buttonController.selectedPage = val;\n            if (this._downEffect == 1) {\n                var cnt = this.numChildren;\n                if (val == GButton.DOWN || val == GButton.SELECTED_OVER || val == GButton.SELECTED_DISABLED) {\n                    var r = this._downEffectValue * 255;\n                    var color = (r << 16) + (r << 8) + r;\n                    for (var i = 0; i < cnt; i++) {\n                        var obj = this.getChildAt(i);\n                        if (obj[\"color\"] != undefined && !(obj instanceof fgui.GTextField))\n                            obj.color = color;\n                    }\n                }\n                else {\n                    for (var i = 0; i < cnt; i++) {\n                        var obj = this.getChildAt(i);\n                        if (obj[\"color\"] != undefined && !(obj instanceof fgui.GTextField))\n                            obj.color = 0xFFFFFF;\n                    }\n                }\n            }\n            else if (this._downEffect == 2) {\n                if (val == GButton.DOWN || val == GButton.SELECTED_OVER || val == GButton.SELECTED_DISABLED) {\n                    if (!this._downScaled) {\n                        this._downScaled = true;\n                        this._rootContainer.cacheHitArea(true);\n                        this.setScale(this.scaleX * this._downEffectValue, this.scaleY * this._downEffectValue);\n                    }\n                }\n                else {\n                    if (this._downScaled) {\n                        this._downScaled = false;\n                        this._rootContainer.cacheHitArea(false);\n                        this.setScale(this.scaleX / this._downEffectValue, this.scaleY / this._downEffectValue);\n                    }\n                }\n            }\n        };\n        GButton.prototype.handleControllerChanged = function (c) {\n            _super_1.prototype.handleControllerChanged.call(this, c);\n            if (this._relatedController == c)\n                this.selected = this._relatedPageId == c.selectedPageId;\n        };\n        GButton.prototype.handleGrayedChanged = function () {\n            if (this._buttonController && this._buttonController.hasPage(GButton.DISABLED)) {\n                if (this.grayed) {\n                    if (this._selected && this._buttonController.hasPage(GButton.SELECTED_DISABLED))\n                        this.setState(GButton.SELECTED_DISABLED);\n                    else\n                        this.setState(GButton.DISABLED);\n                }\n                else if (this._selected)\n                    this.setState(GButton.DOWN);\n                else\n                    this.setState(GButton.UP);\n            }\n            else\n                _super_1.prototype.handleGrayedChanged.call(this);\n        };\n        GButton.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    return this.titleColor;\n                case fgui.ObjectPropID.OutlineColor:\n                    {\n                        var tf = this.getTextField();\n                        if (tf)\n                            return tf.strokeColor;\n                        else\n                            return 0;\n                    }\n                case fgui.ObjectPropID.FontSize:\n                    return this.titleFontSize;\n                case fgui.ObjectPropID.Selected:\n                    return this.selected;\n                default:\n                    return _super_1.prototype.getProp.call(this, index);\n            }\n        };\n        GButton.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    this.titleColor = value;\n                    break;\n                case fgui.ObjectPropID.OutlineColor:\n                    {\n                        var tf = this.getTextField();\n                        if (tf)\n                            tf.strokeColor = value;\n                    }\n                    break;\n                case fgui.ObjectPropID.FontSize:\n                    this.titleFontSize = value;\n                    break;\n                case fgui.ObjectPropID.Selected:\n                    this.selected = value;\n                    break;\n                default:\n                    _super_1.prototype.setProp.call(this, index, value);\n                    break;\n            }\n        };\n        GButton.prototype.constructExtension = function (buffer) {\n            buffer.seek(0, 6);\n            this._mode = buffer.readByte();\n            var str = buffer.readS();\n            if (str)\n                this._sound = str;\n            this._soundVolumeScale = buffer.readFloat();\n            this._downEffect = buffer.readByte();\n            this._downEffectValue = buffer.readFloat();\n            if (this._downEffect == 2)\n                this.setPivot(0.5, 0.5, this.pivotAsAnchor);\n            this._buttonController = this.getController(\"button\");\n            this._titleObject = this.getChild(\"title\");\n            this._iconObject = this.getChild(\"icon\");\n            if (this._titleObject)\n                this._title = this._titleObject.text;\n            if (this._iconObject)\n                this._icon = this._iconObject.icon;\n            if (this._mode == fgui.ButtonMode.Common)\n                this.setState(GButton.UP);\n            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__mousedown, this);\n            this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.__click, this);\n        };\n        GButton.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            if (!buffer.seek(beginPos, 6))\n                return;\n            if (buffer.readByte() != this.packageItem.objectType)\n                return;\n            var str;\n            var iv;\n            str = buffer.readS();\n            if (str != null)\n                this.title = str;\n            str = buffer.readS();\n            if (str != null)\n                this.selectedTitle = str;\n            str = buffer.readS();\n            if (str != null)\n                this.icon = str;\n            str = buffer.readS();\n            if (str != null)\n                this.selectedIcon = str;\n            if (buffer.readBool())\n                this.titleColor = buffer.readColor();\n            iv = buffer.readInt();\n            if (iv != 0)\n                this.titleFontSize = iv;\n            iv = buffer.readShort();\n            if (iv >= 0)\n                this._relatedController = this.parent.getControllerAt(iv);\n            this._relatedPageId = buffer.readS();\n            str = buffer.readS();\n            if (str != null)\n                this._sound = str;\n            if (buffer.readBool())\n                this._soundVolumeScale = buffer.readFloat();\n            this.selected = buffer.readBool();\n        };\n        GButton.prototype.__mousedown = function (evt) {\n            this._down = true;\n            fgui.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__mouseup, this);\n            if (this._mode == fgui.ButtonMode.Common) {\n                if (this.grayed && this._buttonController && this._buttonController.hasPage(GButton.DISABLED))\n                    this.setState(GButton.SELECTED_DISABLED);\n                else\n                    this.setState(GButton.DOWN);\n            }\n            if (this._linkedPopup) {\n                if (this._linkedPopup instanceof fgui.Window)\n                    this._linkedPopup.toggleStatus();\n                else\n                    this.root.togglePopup(this._linkedPopup, this);\n            }\n        };\n        GButton.prototype.__mouseup = function (evt) {\n            if (this._down) {\n                fgui.GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_END, this.__mouseup, this);\n                this._down = false;\n                if (!this.displayObject)\n                    return;\n                if (this._mode == fgui.ButtonMode.Common) {\n                    if (this.grayed && this._buttonController && this._buttonController.hasPage(GButton.DISABLED))\n                        this.setState(GButton.DISABLED);\n                    else if (this._over)\n                        this.setState(GButton.OVER);\n                    else\n                        this.setState(GButton.UP);\n                }\n            }\n        };\n        GButton.prototype.__click = function (evt) {\n            if (this._sound) {\n                var pi = fgui.UIPackage.getItemByURL(this._sound);\n                if (pi) {\n                    var sound = pi.owner.getItemAsset(pi);\n                    if (sound)\n                        fgui.GRoot.inst.playOneShotSound(sound, this._soundVolumeScale);\n                }\n            }\n            if (this._mode == fgui.ButtonMode.Check) {\n                if (this._changeStateOnClick) {\n                    this.selected = !this._selected;\n                    this.dispatchEvent(new fgui.StateChangeEvent(fgui.StateChangeEvent.CHANGED));\n                }\n            }\n            else if (this._mode == fgui.ButtonMode.Radio) {\n                if (this._changeStateOnClick && !this._selected) {\n                    this.selected = true;\n                    this.dispatchEvent(new fgui.StateChangeEvent(fgui.StateChangeEvent.CHANGED));\n                }\n            }\n            else {\n                if (this._relatedController)\n                    this._relatedController.selectedPageId = this._relatedPageId;\n            }\n        };\n        GButton.UP = \"up\";\n        GButton.DOWN = \"down\";\n        GButton.OVER = \"over\";\n        GButton.SELECTED_OVER = \"selectedOver\";\n        GButton.DISABLED = \"disabled\";\n        GButton.SELECTED_DISABLED = \"selectedDisabled\";\n        return GButton;\n    }(fgui.GComponent));\n    fgui.GButton = GButton;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GComboBox = (function (_super_1) {\n        __extends(GComboBox, _super_1);\n        function GComboBox() {\n            var _this = _super_1.call(this) || this;\n            _this._visibleItemCount = 0;\n            _this._selectedIndex = 0;\n            _this._popupDirection = fgui.PopupDirection.Auto;\n            _this._visibleItemCount = fgui.UIConfig.defaultComboBoxVisibleItemCount;\n            _this._itemsUpdated = true;\n            _this._selectedIndex = -1;\n            _this._items = [];\n            _this._values = [];\n            return _this;\n        }\n        Object.defineProperty(GComboBox.prototype, \"text\", {\n            get: function () {\n                if (this._titleObject)\n                    return this._titleObject.text;\n                else\n                    return null;\n            },\n            set: function (value) {\n                if (this._titleObject)\n                    this._titleObject.text = value;\n                this.updateGear(6);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"icon\", {\n            get: function () {\n                if (this._iconObject)\n                    return this._iconObject.icon;\n                else\n                    return null;\n            },\n            set: function (value) {\n                if (this._iconObject)\n                    this._iconObject.icon = value;\n                this.updateGear(7);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"titleColor\", {\n            get: function () {\n                var tf = this.getTextField();\n                if (tf)\n                    return tf.color;\n                else\n                    return 0;\n            },\n            set: function (value) {\n                var tf = this.getTextField();\n                if (tf)\n                    tf.color = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"titleFontSize\", {\n            get: function () {\n                var tf = this.getTextField();\n                if (tf)\n                    return tf.fontSize;\n                else\n                    return 0;\n            },\n            set: function (value) {\n                var tf = this.getTextField();\n                if (tf)\n                    tf.fontSize = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"visibleItemCount\", {\n            get: function () {\n                return this._visibleItemCount;\n            },\n            set: function (value) {\n                this._visibleItemCount = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"popupDirection\", {\n            get: function () {\n                return this._popupDirection;\n            },\n            set: function (value) {\n                this._popupDirection = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"items\", {\n            get: function () {\n                return this._items;\n            },\n            set: function (value) {\n                if (!value)\n                    this._items.length = 0;\n                else\n                    this._items = value.concat();\n                if (this._items.length > 0) {\n                    if (this._selectedIndex >= this._items.length)\n                        this._selectedIndex = this._items.length - 1;\n                    else if (this._selectedIndex == -1)\n                        this._selectedIndex = 0;\n                    this.text = this._items[this._selectedIndex];\n                    if (this._icons && this._selectedIndex < this._icons.length)\n                        this.icon = this._icons[this._selectedIndex];\n                }\n                else {\n                    this.text = \"\";\n                    if (this._icons)\n                        this.icon = null;\n                    this._selectedIndex = -1;\n                }\n                this._itemsUpdated = true;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"icons\", {\n            get: function () {\n                return this._icons;\n            },\n            set: function (value) {\n                this._icons = value;\n                if (this._icons && this._selectedIndex != -1 && this._selectedIndex < this._icons.length)\n                    this.icon = this._icons[this._selectedIndex];\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"values\", {\n            get: function () {\n                return this._values;\n            },\n            set: function (value) {\n                if (!value)\n                    this._values.length = 0;\n                else\n                    this._values = value.concat();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"selectedIndex\", {\n            get: function () {\n                return this._selectedIndex;\n            },\n            set: function (val) {\n                if (this._selectedIndex == val)\n                    return;\n                this._selectedIndex = val;\n                if (this._selectedIndex >= 0 && this._selectedIndex < this._items.length) {\n                    this.text = this._items[this._selectedIndex];\n                    if (this._icons && this._selectedIndex < this._icons.length)\n                        this.icon = this._icons[this._selectedIndex];\n                }\n                else {\n                    this.text = \"\";\n                    if (this._icons)\n                        this.icon = null;\n                }\n                this.updateSelectionController();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"value\", {\n            get: function () {\n                return this._values[this._selectedIndex];\n            },\n            set: function (val) {\n                var index = this._values.indexOf(val);\n                if (index == -1 && val == null)\n                    index = this._values.indexOf(\"\");\n                this.selectedIndex = index;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"selectionController\", {\n            get: function () {\n                return this._selectionController;\n            },\n            set: function (value) {\n                this._selectionController = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GComboBox.prototype.getTextField = function () {\n            if (this._titleObject instanceof fgui.GTextField)\n                return this._titleObject;\n            else if ((this._titleObject instanceof fgui.GLabel) || (this._titleObject instanceof fgui.GButton))\n                return this._titleObject.getTextField();\n            else\n                return null;\n        };\n        GComboBox.prototype.setState = function (val) {\n            if (this._buttonController)\n                this._buttonController.selectedPage = val;\n        };\n        GComboBox.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    return this.titleColor;\n                case fgui.ObjectPropID.OutlineColor:\n                    {\n                        var tf = this.getTextField();\n                        if (tf)\n                            return tf.strokeColor;\n                        else\n                            return 0;\n                    }\n                case fgui.ObjectPropID.FontSize:\n                    {\n                        tf = this.getTextField();\n                        if (tf)\n                            return tf.fontSize;\n                        else\n                            return 0;\n                    }\n                default:\n                    return _super_1.prototype.getProp.call(this, index);\n            }\n        };\n        GComboBox.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    this.titleColor = value;\n                    break;\n                case fgui.ObjectPropID.OutlineColor:\n                    {\n                        var tf = this.getTextField();\n                        if (tf)\n                            tf.strokeColor = value;\n                    }\n                    break;\n                case fgui.ObjectPropID.FontSize:\n                    {\n                        tf = this.getTextField();\n                        if (tf)\n                            tf.fontSize = value;\n                    }\n                    break;\n                default:\n                    _super_1.prototype.setProp.call(this, index, value);\n                    break;\n            }\n        };\n        GComboBox.prototype.constructExtension = function (buffer) {\n            var str;\n            this._buttonController = this.getController(\"button\");\n            this._titleObject = this.getChild(\"title\");\n            this._iconObject = this.getChild(\"icon\");\n            str = buffer.readS();\n            if (str) {\n                this.dropdown = (fgui.UIPackage.createObjectFromURL(str));\n                if (!this.dropdown) {\n                    console.error(\"下拉框必须为元件\");\n                    return;\n                }\n                this.dropdown.name = \"this.dropdown\";\n                this._list = this.dropdown.getChild(\"list\").asList;\n                if (this._list == null) {\n                    console.error(this.resourceURL + \": 下拉框的弹出元件里必须包含名为list的列表\");\n                    return;\n                }\n                this._list.addEventListener(fgui.ItemEvent.CLICK, this.__clickItem, this);\n                this._list.addRelation(this.dropdown, fgui.RelationType.Width);\n                this._list.removeRelation(this.dropdown, fgui.RelationType.Height);\n                this.dropdown.addRelation(this._list, fgui.RelationType.Height);\n                this.dropdown.removeRelation(this._list, fgui.RelationType.Width);\n                this.dropdown.displayObject.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.__popupWinClosed, this);\n            }\n            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__mousedown, this);\n        };\n        GComboBox.prototype.handleControllerChanged = function (c) {\n            _super_1.prototype.handleControllerChanged.call(this, c);\n            if (this._selectionController == c)\n                this.selectedIndex = c.selectedIndex;\n        };\n        GComboBox.prototype.updateSelectionController = function () {\n            if (this._selectionController && !this._selectionController.changing\n                && this._selectedIndex < this._selectionController.pageCount) {\n                var c = this._selectionController;\n                this._selectionController = null;\n                c.selectedIndex = this._selectedIndex;\n                this._selectionController = c;\n            }\n        };\n        GComboBox.prototype.dispose = function () {\n            if (this.dropdown) {\n                this.dropdown.dispose();\n                this.dropdown = null;\n            }\n            _super_1.prototype.dispose.call(this);\n        };\n        GComboBox.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            if (!buffer.seek(beginPos, 6))\n                return;\n            if (buffer.readByte() != this.packageItem.objectType)\n                return;\n            var i;\n            var iv;\n            var nextPos;\n            var str;\n            var itemCount = buffer.readShort();\n            for (i = 0; i < itemCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                this._items[i] = buffer.readS();\n                this._values[i] = buffer.readS();\n                str = buffer.readS();\n                if (str != null) {\n                    if (this._icons == null)\n                        this._icons = new Array();\n                    this._icons[i] = str;\n                }\n                buffer.position = nextPos;\n            }\n            str = buffer.readS();\n            if (str != null) {\n                this.text = str;\n                this._selectedIndex = this._items.indexOf(str);\n            }\n            else if (this._items.length > 0) {\n                this._selectedIndex = 0;\n                this.text = this._items[0];\n            }\n            else\n                this._selectedIndex = -1;\n            str = buffer.readS();\n            if (str != null)\n                this.icon = str;\n            if (buffer.readBool())\n                this.titleColor = buffer.readColor();\n            iv = buffer.readInt();\n            if (iv > 0)\n                this._visibleItemCount = iv;\n            this._popupDirection = buffer.readByte();\n            iv = buffer.readShort();\n            if (iv >= 0)\n                this._selectionController = this.parent.getControllerAt(iv);\n        };\n        GComboBox.prototype.showDropdown = function () {\n            if (this._itemsUpdated) {\n                this._itemsUpdated = false;\n                this._list.removeChildrenToPool();\n                var cnt = this._items.length;\n                for (var i = 0; i < cnt; i++) {\n                    var item = this._list.addItemFromPool();\n                    item.name = i < this._values.length ? this._values[i] : \"\";\n                    item.text = this._items[i];\n                    item.icon = (this._icons && i < this._icons.length) ? this._icons[i] : null;\n                }\n                this._list.resizeToFit(this._visibleItemCount);\n            }\n            this._list.selectedIndex = -1;\n            this.dropdown.width = this.width;\n            this._list.ensureBoundsCorrect();\n            this.root.togglePopup(this.dropdown, this, this._popupDirection);\n            if (this.dropdown.parent)\n                this.setState(fgui.GButton.DOWN);\n        };\n        GComboBox.prototype.__popupWinClosed = function (evt) {\n            if (this._over)\n                this.setState(fgui.GButton.OVER);\n            else\n                this.setState(fgui.GButton.UP);\n        };\n        GComboBox.prototype.__clickItem = function (evt) {\n            fgui.GTimers.inst.add(100, 1, this.__clickItem2, this, this._list.getChildIndex(evt.itemObject));\n        };\n        GComboBox.prototype.__clickItem2 = function (index) {\n            if (this.dropdown.parent instanceof fgui.GRoot)\n                this.dropdown.parent.hidePopup();\n            this._selectedIndex = -1;\n            this.selectedIndex = index;\n            this.dispatchEvent(new fgui.StateChangeEvent(fgui.StateChangeEvent.CHANGED));\n        };\n        GComboBox.prototype.__mousedown = function (evt) {\n            if ((evt.target instanceof egret.TextField) && evt.target.type == egret.TextFieldType.INPUT)\n                return;\n            this._down = true;\n            fgui.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__mouseup, this);\n            if (this.dropdown)\n                this.showDropdown();\n        };\n        GComboBox.prototype.__mouseup = function (evt) {\n            if (this._down) {\n                this._down = false;\n                fgui.GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_END, this.__mouseup, this);\n                if (this.dropdown && !this.dropdown.parent) {\n                    if (this._over)\n                        this.setState(fgui.GButton.OVER);\n                    else\n                        this.setState(fgui.GButton.UP);\n                }\n            }\n        };\n        return GComboBox;\n    }(fgui.GComponent));\n    fgui.GComboBox = GComboBox;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GGraph = (function (_super_1) {\n        __extends(GGraph, _super_1);\n        function GGraph() {\n            var _this = _super_1.call(this) || this;\n            _this._type = 0;\n            _this._lineSize = 0;\n            _this._lineColor = 0;\n            _this._fillColor = 0;\n            _this._lineSize = 1;\n            _this._lineAlpha = 1;\n            _this._fillAlpha = 1;\n            _this._fillColor = 0xFFFFFF;\n            return _this;\n        }\n        Object.defineProperty(GGraph.prototype, \"graphics\", {\n            get: function () {\n                return this._graphics;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GGraph.prototype.drawRect = function (lineSize, lineColor, lineAlpha, fillColor, fillAlpha, corner) {\n            this._type = 1;\n            this._lineSize = lineSize;\n            this._lineColor = lineColor;\n            this._lineAlpha = lineAlpha;\n            this._fillColor = fillColor;\n            this._fillAlpha = fillAlpha;\n            this._cornerRadius = corner;\n            this.updateGraph();\n        };\n        GGraph.prototype.drawEllipse = function (lineSize, lineColor, lineAlpha, fillColor, fillAlpha) {\n            this._type = 2;\n            this._lineSize = lineSize;\n            this._lineColor = lineColor;\n            this._lineAlpha = lineAlpha;\n            this._fillColor = fillColor;\n            this._fillAlpha = fillAlpha;\n            this._cornerRadius = null;\n            this.updateGraph();\n        };\n        GGraph.prototype.drawRegularPolygon = function (lineSize, lineColor, lineAlpha, fillColor, fillAlpha, sides, startAngle, distances) {\n            this._type = 4;\n            this._lineSize = lineSize;\n            this._lineColor = lineColor;\n            this._lineAlpha = lineAlpha;\n            this._fillColor = fillColor;\n            this._fillAlpha = fillAlpha;\n            this._sides = sides;\n            this._startAngle = startAngle || 0;\n            this._distances = distances;\n            this.updateGraph();\n        };\n        GGraph.prototype.drawPolygon = function (lineSize, lineColor, lineAlpha, fillColor, fillAlpha, points) {\n            this._type = 3;\n            this._lineSize = lineSize;\n            this._lineColor = lineColor;\n            this._lineAlpha = lineAlpha;\n            this._fillColor = fillColor;\n            this._fillAlpha = fillAlpha;\n            this._polygonPoints = points;\n            this.updateGraph();\n        };\n        Object.defineProperty(GGraph.prototype, \"distances\", {\n            get: function () {\n                return this._distances;\n            },\n            set: function (value) {\n                this._distances = value;\n                if (this._type == 3)\n                    this.updateGraph();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GGraph.prototype.clearGraphics = function () {\n            if (this._graphics) {\n                this._type = 0;\n                this._graphics.clear();\n            }\n        };\n        Object.defineProperty(GGraph.prototype, \"color\", {\n            get: function () {\n                return this._fillColor;\n            },\n            set: function (value) {\n                this._fillColor = value;\n                if (this._type != 0)\n                    this.updateGraph();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GGraph.prototype.updateGraph = function () {\n            var ctx = this.graphics;\n            ctx.clear();\n            var w = this.width;\n            var h = this.height;\n            if (w == 0 || h == 0)\n                return;\n            if (this._lineSize == 0)\n                ctx.lineStyle(0, 0, 0);\n            else\n                ctx.lineStyle(this._lineSize, this._lineColor, this._lineAlpha);\n            ctx.beginFill(this._fillColor, this._fillAlpha);\n            if (this._type == 1) {\n                if (this._cornerRadius) {\n                    if (this._cornerRadius.length == 1)\n                        ctx.drawRoundRect(0, 0, w, h, this._cornerRadius[0] * 2, this._cornerRadius[0] * 2);\n                    else\n                        ctx.drawRoundRect(0, 0, w, h, this._cornerRadius[0] * 2, this._cornerRadius[1] * 2);\n                }\n                else\n                    ctx.drawRect(0, 0, w, h);\n            }\n            else if (this._type == 2)\n                ctx.drawEllipse(0, 0, w, h);\n            else if (this._type == 3) {\n                fgui.ToolSet.fillPath(ctx, this._polygonPoints, 0, 0);\n            }\n            else if (this._type == 4) {\n                if (!this._polygonPoints)\n                    this._polygonPoints = [];\n                var radius = Math.min(this._width, this._height) / 2;\n                this._polygonPoints.length = 0;\n                var angle = this._startAngle * Math.PI / 180;\n                var deltaAngle = 2 * Math.PI / this._sides;\n                var dist;\n                for (var i = 0; i < this._sides; i++) {\n                    if (this._distances) {\n                        dist = this._distances[i];\n                        if (isNaN(dist))\n                            dist = 1;\n                    }\n                    else\n                        dist = 1;\n                    var xv = radius + radius * dist * Math.cos(angle);\n                    var yv = radius + radius * dist * Math.sin(angle);\n                    this._polygonPoints.push(xv, yv);\n                    angle += deltaAngle;\n                }\n                fgui.ToolSet.fillPath(ctx, this._polygonPoints, 0, 0);\n            }\n            ctx.endFill();\n        };\n        GGraph.prototype.replaceMe = function (target) {\n            if (!this._parent)\n                throw \"parent not set\";\n            target.name = this.name;\n            target.alpha = this.alpha;\n            target.rotation = this.rotation;\n            target.visible = this.visible;\n            target.touchable = this.touchable;\n            target.grayed = this.grayed;\n            target.setXY(this.x, this.y);\n            target.setSize(this.width, this.height);\n            var index = this._parent.getChildIndex(this);\n            this._parent.addChildAt(target, index);\n            target.relations.copyFrom(this.relations);\n            this._parent.removeChild(this, true);\n        };\n        GGraph.prototype.addBeforeMe = function (target) {\n            if (this._parent == null)\n                throw \"parent not set\";\n            var index = this._parent.getChildIndex(this);\n            this._parent.addChildAt(target, index);\n        };\n        GGraph.prototype.addAfterMe = function (target) {\n            if (this._parent == null)\n                throw \"parent not set\";\n            var index = this._parent.getChildIndex(this);\n            index++;\n            this._parent.addChildAt(target, index);\n        };\n        GGraph.prototype.setNativeObject = function (obj) {\n            var sprite = new egret.Sprite();\n            this.setDisplayObject(sprite);\n            if (this._parent)\n                this._parent.childStateChanged(this);\n            this.handleXYChanged();\n            sprite.alpha = this.alpha;\n            sprite.rotation = this.rotation;\n            sprite.visible = this.visible;\n            sprite.touchEnabled = this.touchable;\n            sprite.touchChildren = this.touchable;\n            sprite.addChild(obj);\n        };\n        GGraph.prototype.createDisplayObject = function () {\n            var sprite = new egret.Sprite();\n            sprite.touchEnabled = true;\n            this._graphics = sprite.graphics;\n            this.setDisplayObject(sprite);\n        };\n        GGraph.prototype.getProp = function (index) {\n            if (index == fgui.ObjectPropID.Color)\n                return this.color;\n            else\n                return _super_1.prototype.getProp.call(this, index);\n        };\n        GGraph.prototype.setProp = function (index, value) {\n            if (index == fgui.ObjectPropID.Color)\n                this.color = value;\n            else\n                _super_1.prototype.setProp.call(this, index, value);\n        };\n        GGraph.prototype.handleSizeChanged = function () {\n            _super_1.prototype.handleSizeChanged.call(this);\n            if (this._type != 0)\n                this.updateGraph();\n        };\n        GGraph.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            this._type = buffer.readByte();\n            if (this._type != 0) {\n                var i;\n                var cnt;\n                this._lineSize = buffer.readInt();\n                var c = buffer.readColor(true);\n                this._lineColor = c & 0xFFFFFF;\n                this._lineAlpha = ((c >> 24) & 0xFF) / 0xFF;\n                c = buffer.readColor(true);\n                this._fillColor = c & 0xFFFFFF;\n                this._fillAlpha = ((c >> 24) & 0xFF) / 0xFF;\n                if (buffer.readBool()) {\n                    this._cornerRadius = new Array(4);\n                    for (i = 0; i < 4; i++)\n                        this._cornerRadius[i] = buffer.readFloat();\n                }\n                if (this._type == 3) {\n                    cnt = buffer.readShort();\n                    this._polygonPoints = [];\n                    this._polygonPoints.length = cnt;\n                    for (i = 0; i < cnt; i++)\n                        this._polygonPoints[i] = buffer.readFloat();\n                }\n                else if (this._type == 4) {\n                    this._sides = buffer.readShort();\n                    this._startAngle = buffer.readFloat();\n                    cnt = buffer.readShort();\n                    if (cnt > 0) {\n                        this._distances = [];\n                        for (i = 0; i < cnt; i++)\n                            this._distances[i] = buffer.readFloat();\n                    }\n                }\n                this.updateGraph();\n            }\n        };\n        return GGraph;\n    }(fgui.GObject));\n    fgui.GGraph = GGraph;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GGroup = (function (_super_1) {\n        __extends(GGroup, _super_1);\n        function GGroup() {\n            var _this = _super_1.call(this) || this;\n            _this._layout = 0;\n            _this._lineGap = 0;\n            _this._columnGap = 0;\n            _this._mainGridIndex = -1;\n            _this._mainGridMinSize = 50;\n            _this._mainChildIndex = -1;\n            _this._totalSize = 0;\n            _this._numChildren = 0;\n            _this._updating = 0;\n            return _this;\n        }\n        GGroup.prototype.dispose = function () {\n            this._boundsChanged = false;\n            _super_1.prototype.dispose.call(this);\n        };\n        Object.defineProperty(GGroup.prototype, \"layout\", {\n            get: function () {\n                return this._layout;\n            },\n            set: function (value) {\n                if (this._layout != value) {\n                    this._layout = value;\n                    this.setBoundsChangedFlag();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GGroup.prototype, \"lineGap\", {\n            get: function () {\n                return this._lineGap;\n            },\n            set: function (value) {\n                if (this._lineGap != value) {\n                    this._lineGap = value;\n                    this.setBoundsChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GGroup.prototype, \"columnGap\", {\n            get: function () {\n                return this._columnGap;\n            },\n            set: function (value) {\n                if (this._columnGap != value) {\n                    this._columnGap = value;\n                    this.setBoundsChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GGroup.prototype, \"excludeInvisibles\", {\n            get: function () {\n                return this._excludeInvisibles;\n            },\n            set: function (value) {\n                if (this._excludeInvisibles != value) {\n                    this._excludeInvisibles = value;\n                    this.setBoundsChangedFlag();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GGroup.prototype, \"autoSizeDisabled\", {\n            get: function () {\n                return this._autoSizeDisabled;\n            },\n            set: function (value) {\n                this._autoSizeDisabled = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GGroup.prototype, \"mainGridMinSize\", {\n            get: function () {\n                return this._mainGridMinSize;\n            },\n            set: function (value) {\n                if (this._mainGridMinSize != value) {\n                    this._mainGridMinSize = value;\n                    this.setBoundsChangedFlag();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GGroup.prototype, \"mainGridIndex\", {\n            get: function () {\n                return this._mainGridIndex;\n            },\n            set: function (value) {\n                if (this._mainGridIndex != value) {\n                    this._mainGridIndex = value;\n                    this.setBoundsChangedFlag();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GGroup.prototype.setBoundsChangedFlag = function (positionChangedOnly) {\n            if (this._updating == 0 && this._parent) {\n                if (!positionChangedOnly)\n                    this._percentReady = false;\n                if (!this._boundsChanged) {\n                    this._boundsChanged = true;\n                    if (this._layout != fgui.GroupLayoutType.None)\n                        fgui.GTimers.inst.callLater(this.ensureBoundsCorrect, this);\n                }\n            }\n        };\n        GGroup.prototype.ensureSizeCorrect = function () {\n            if (this._parent == null || !this._boundsChanged || this._layout == 0)\n                return;\n            this._boundsChanged = false;\n            if (this._autoSizeDisabled)\n                this.resizeChildren(0, 0);\n            else {\n                this.handleLayout();\n                this.updateBounds();\n            }\n        };\n        GGroup.prototype.ensureBoundsCorrect = function () {\n            if (this._parent == null || !this._boundsChanged)\n                return;\n            this._boundsChanged = false;\n            if (this._layout == 0)\n                this.updateBounds();\n            else {\n                if (this._autoSizeDisabled)\n                    this.resizeChildren(0, 0);\n                else {\n                    this.handleLayout();\n                    this.updateBounds();\n                }\n            }\n        };\n        GGroup.prototype.updateBounds = function () {\n            fgui.GTimers.inst.remove(this.ensureBoundsCorrect, this);\n            var cnt = this._parent.numChildren;\n            var i;\n            var child;\n            var ax = Number.POSITIVE_INFINITY, ay = Number.POSITIVE_INFINITY;\n            var ar = Number.NEGATIVE_INFINITY, ab = Number.NEGATIVE_INFINITY;\n            var tmp;\n            var empty = true;\n            for (i = 0; i < cnt; i++) {\n                child = this._parent.getChildAt(i);\n                if (child.group != this || this._excludeInvisibles && !child.internalVisible3)\n                    continue;\n                tmp = child.xMin;\n                if (tmp < ax)\n                    ax = tmp;\n                tmp = child.yMin;\n                if (tmp < ay)\n                    ay = tmp;\n                tmp = child.xMin + child.width;\n                if (tmp > ar)\n                    ar = tmp;\n                tmp = child.yMin + child.height;\n                if (tmp > ab)\n                    ab = tmp;\n                empty = false;\n            }\n            var w = 0, h = 0;\n            if (!empty) {\n                this._updating |= 1;\n                this.setXY(ax, ay);\n                this._updating &= 2;\n                w = ar - ax;\n                h = ab - ay;\n            }\n            if ((this._updating & 2) == 0) {\n                this._updating |= 2;\n                this.setSize(w, h);\n                this._updating &= 1;\n            }\n            else {\n                this._updating &= 1;\n                this.resizeChildren(this._width - w, this._height - h);\n            }\n        };\n        GGroup.prototype.handleLayout = function () {\n            this._updating |= 1;\n            var child;\n            var i;\n            var cnt;\n            if (this._layout == fgui.GroupLayoutType.Horizontal) {\n                var curX = this.x;\n                cnt = this._parent.numChildren;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n                    if (this._excludeInvisibles && !child.internalVisible3)\n                        continue;\n                    child.xMin = curX;\n                    if (child.width != 0)\n                        curX += child.width + this._columnGap;\n                }\n            }\n            else if (this._layout == fgui.GroupLayoutType.Vertical) {\n                var curY = this.y;\n                cnt = this._parent.numChildren;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n                    if (this._excludeInvisibles && !child.internalVisible3)\n                        continue;\n                    child.yMin = curY;\n                    if (child.height != 0)\n                        curY += child.height + this._lineGap;\n                }\n            }\n            this._updating &= 2;\n        };\n        GGroup.prototype.moveChildren = function (dx, dy) {\n            if ((this._updating & 1) != 0 || this._parent == null)\n                return;\n            this._updating |= 1;\n            var cnt = this._parent.numChildren;\n            var i;\n            var child;\n            for (i = 0; i < cnt; i++) {\n                child = this._parent.getChildAt(i);\n                if (child.group == this) {\n                    child.setXY(child.x + dx, child.y + dy);\n                }\n            }\n            this._updating &= 2;\n        };\n        GGroup.prototype.resizeChildren = function (dw, dh) {\n            if (this._layout == fgui.GroupLayoutType.None || (this._updating & 2) != 0 || this._parent == null)\n                return;\n            this._updating |= 2;\n            if (this._boundsChanged) {\n                this._boundsChanged = false;\n                if (!this._autoSizeDisabled) {\n                    this.updateBounds();\n                    return;\n                }\n            }\n            var cnt = this._parent.numChildren;\n            var i;\n            var child;\n            if (!this._percentReady) {\n                this._percentReady = true;\n                this._numChildren = 0;\n                this._totalSize = 0;\n                this._mainChildIndex = -1;\n                var j = 0;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n                    if (!this._excludeInvisibles || child.internalVisible3) {\n                        if (j == this._mainGridIndex)\n                            this._mainChildIndex = i;\n                        this._numChildren++;\n                        if (this._layout == 1)\n                            this._totalSize += child.width;\n                        else\n                            this._totalSize += child.height;\n                    }\n                    j++;\n                }\n                if (this._mainChildIndex != -1) {\n                    if (this._layout == 1) {\n                        child = this._parent.getChildAt(this._mainChildIndex);\n                        this._totalSize += this._mainGridMinSize - child.width;\n                        child._sizePercentInGroup = this._mainGridMinSize / this._totalSize;\n                    }\n                    else {\n                        child = this._parent.getChildAt(this._mainChildIndex);\n                        this._totalSize += this._mainGridMinSize - child.height;\n                        child._sizePercentInGroup = this._mainGridMinSize / this._totalSize;\n                    }\n                }\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n                    if (i == this._mainChildIndex)\n                        continue;\n                    if (this._totalSize > 0)\n                        child._sizePercentInGroup = (this._layout == 1 ? child.width : child.height) / this._totalSize;\n                    else\n                        child._sizePercentInGroup = 0;\n                }\n            }\n            var remainSize = 0;\n            var remainPercent = 1;\n            var priorHandled = false;\n            if (this._layout == 1) {\n                remainSize = this.width - (this._numChildren - 1) * this._columnGap;\n                if (this._mainChildIndex != -1 && remainSize >= this._totalSize) {\n                    child = this._parent.getChildAt(this._mainChildIndex);\n                    child.setSize(remainSize - (this._totalSize - this._mainGridMinSize), child._rawHeight + dh, true);\n                    remainSize -= child.width;\n                    remainPercent -= child._sizePercentInGroup;\n                    priorHandled = true;\n                }\n                var curX = this.x;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n                    if (this._excludeInvisibles && !child.internalVisible3) {\n                        child.setSize(child._rawWidth, child._rawHeight + dh, true);\n                        continue;\n                    }\n                    if (!priorHandled || i != this._mainChildIndex) {\n                        child.setSize(Math.round(child._sizePercentInGroup / remainPercent * remainSize), child._rawHeight + dh, true);\n                        remainPercent -= child._sizePercentInGroup;\n                        remainSize -= child.width;\n                    }\n                    child.xMin = curX;\n                    if (child.width != 0)\n                        curX += child.width + this._columnGap;\n                }\n            }\n            else {\n                remainSize = this.height - (this._numChildren - 1) * this._lineGap;\n                if (this._mainChildIndex != -1 && remainSize >= this._totalSize) {\n                    child = this._parent.getChildAt(this._mainChildIndex);\n                    child.setSize(child._rawWidth + dw, remainSize - (this._totalSize - this._mainGridMinSize), true);\n                    remainSize -= child.height;\n                    remainPercent -= child._sizePercentInGroup;\n                    priorHandled = true;\n                }\n                var curY = this.y;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n                    if (this._excludeInvisibles && !child.internalVisible3) {\n                        child.setSize(child._rawWidth + dw, child._rawHeight, true);\n                        continue;\n                    }\n                    if (!priorHandled || i != this._mainChildIndex) {\n                        child.setSize(child._rawWidth + dw, Math.round(child._sizePercentInGroup / remainPercent * remainSize), true);\n                        remainPercent -= child._sizePercentInGroup;\n                        remainSize -= child.height;\n                    }\n                    child.yMin = curY;\n                    if (child.height != 0)\n                        curY += child.height + this._lineGap;\n                }\n            }\n            this._updating &= 1;\n        };\n        GGroup.prototype.handleAlphaChanged = function () {\n            if (this._underConstruct)\n                return;\n            var cnt = this._parent.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                var child = this._parent.getChildAt(i);\n                if (child.group == this)\n                    child.alpha = this.alpha;\n            }\n        };\n        GGroup.prototype.handleVisibleChanged = function () {\n            if (!this._parent)\n                return;\n            var cnt = this._parent.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                var child = this._parent.getChildAt(i);\n                if (child.group == this)\n                    child.handleVisibleChanged();\n            }\n        };\n        GGroup.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            this._layout = buffer.readByte();\n            this._lineGap = buffer.readInt();\n            this._columnGap = buffer.readInt();\n            if (buffer.version >= 2) {\n                this._excludeInvisibles = buffer.readBool();\n                this._autoSizeDisabled = buffer.readBool();\n                this._mainGridIndex = buffer.readInt();\n            }\n        };\n        GGroup.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            if (!this.visible)\n                this.handleVisibleChanged();\n        };\n        return GGroup;\n    }(fgui.GObject));\n    fgui.GGroup = GGroup;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GImage = (function (_super_1) {\n        __extends(GImage, _super_1);\n        function GImage() {\n            var _this = _super_1.call(this) || this;\n            _this._flip = fgui.FlipType.None;\n            return _this;\n        }\n        Object.defineProperty(GImage.prototype, \"color\", {\n            get: function () {\n                return this._content.color;\n            },\n            set: function (value) {\n                if (this._content.color != value) {\n                    this._content.color = value;\n                    this.updateGear(4);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GImage.prototype, \"flip\", {\n            get: function () {\n                return this._flip;\n            },\n            set: function (value) {\n                if (this._flip != value) {\n                    this._flip = value;\n                    var sx = 1, sy = 1;\n                    if (this._flip == fgui.FlipType.Horizontal || this._flip == fgui.FlipType.Both)\n                        sx = -1;\n                    if (this._flip == fgui.FlipType.Vertical || this._flip == fgui.FlipType.Both)\n                        sy = -1;\n                    this._content.scaleX = sx;\n                    this._content.scaleY = sy;\n                    this.handleXYChanged();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GImage.prototype, \"fillMethod\", {\n            get: function () {\n                return this._content.fillMethod;\n            },\n            set: function (value) {\n                this._content.fillMethod = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GImage.prototype, \"fillOrigin\", {\n            get: function () {\n                return this._content.fillOrigin;\n            },\n            set: function (value) {\n                this._content.fillOrigin = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GImage.prototype, \"fillClockwise\", {\n            get: function () {\n                return this._content.fillClockwise;\n            },\n            set: function (value) {\n                this._content.fillClockwise = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GImage.prototype, \"fillAmount\", {\n            get: function () {\n                return this._content.fillAmount;\n            },\n            set: function (value) {\n                this._content.fillAmount = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GImage.prototype, \"texture\", {\n            get: function () {\n                return this._content.texture;\n            },\n            set: function (value) {\n                if (value) {\n                    this.sourceWidth = value.textureWidth;\n                    this.sourceHeight = value.textureHeight;\n                }\n                else {\n                    this.sourceWidth = 0;\n                    this.sourceHeight = 0;\n                }\n                this.initWidth = this.sourceWidth;\n                this.initHeight = this.sourceHeight;\n                this._content.scale9Grid = null;\n                this._content.fillMode = egret.BitmapFillMode.SCALE;\n                this._content.texture = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GImage.prototype.createDisplayObject = function () {\n            this._content = new fgui.Image();\n            this._content.touchEnabled = false;\n            this.setDisplayObject(this._content);\n        };\n        GImage.prototype.constructFromResource = function () {\n            var contentItem = this.packageItem.getBranch();\n            this.sourceWidth = contentItem.width;\n            this.sourceHeight = contentItem.height;\n            this.initWidth = this.sourceWidth;\n            this.initHeight = this.sourceHeight;\n            this.setSize(this.sourceWidth, this.sourceHeight);\n            contentItem = contentItem.getHighResolution();\n            contentItem.load();\n            this._content.scale9Grid = contentItem.scale9Grid;\n            this._content.smoothing = contentItem.smoothing;\n            if (contentItem.scaleByTile)\n                this._content.fillMode = egret.BitmapFillMode.REPEAT;\n            this.setSize(this.sourceWidth, this.sourceHeight);\n            this._content.texture = contentItem.asset;\n        };\n        GImage.prototype.handleXYChanged = function () {\n            _super_1.prototype.handleXYChanged.call(this);\n            if (this._flip != fgui.FlipType.None) {\n                if (this._content.scaleX == -1)\n                    this._content.x += this.width;\n                if (this._content.scaleY == -1)\n                    this._content.y += this.height;\n            }\n        };\n        GImage.prototype.getProp = function (index) {\n            if (index == fgui.ObjectPropID.Color)\n                return this.color;\n            else\n                return _super_1.prototype.getProp.call(this, index);\n        };\n        GImage.prototype.setProp = function (index, value) {\n            if (index == fgui.ObjectPropID.Color)\n                this.color = value;\n            else\n                _super_1.prototype.setProp.call(this, index, value);\n        };\n        GImage.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            if (buffer.readBool())\n                this.color = buffer.readColor();\n            this.flip = buffer.readByte();\n            this._content.fillMethod = buffer.readByte();\n            if (this._content.fillMethod != 0) {\n                this._content.fillOrigin = buffer.readByte();\n                this._content.fillClockwise = buffer.readBool();\n                this._content.fillAmount = buffer.readFloat();\n            }\n        };\n        return GImage;\n    }(fgui.GObject));\n    fgui.GImage = GImage;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GLabel = (function (_super_1) {\n        __extends(GLabel, _super_1);\n        function GLabel() {\n            return _super_1.call(this) || this;\n        }\n        Object.defineProperty(GLabel.prototype, \"icon\", {\n            get: function () {\n                if (this._iconObject)\n                    return this._iconObject.icon;\n            },\n            set: function (value) {\n                if (this._iconObject)\n                    this._iconObject.icon = value;\n                this.updateGear(7);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLabel.prototype, \"title\", {\n            get: function () {\n                if (this._titleObject)\n                    return this._titleObject.text;\n                else\n                    return null;\n            },\n            set: function (value) {\n                if (this._titleObject)\n                    this._titleObject.text = value;\n                this.updateGear(6);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLabel.prototype, \"text\", {\n            get: function () {\n                return this.title;\n            },\n            set: function (value) {\n                this.title = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLabel.prototype, \"titleColor\", {\n            get: function () {\n                var tf = this.getTextField();\n                if (tf)\n                    return tf.color;\n                else\n                    return 0;\n            },\n            set: function (value) {\n                var tf = this.getTextField();\n                if (tf)\n                    tf.color = value;\n                this.updateGear(4);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLabel.prototype, \"titleFontSize\", {\n            get: function () {\n                var tf = this.getTextField();\n                if (tf)\n                    return tf.fontSize;\n                else\n                    return 0;\n            },\n            set: function (value) {\n                var tf = this.getTextField();\n                if (tf)\n                    tf.fontSize = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLabel.prototype, \"editable\", {\n            get: function () {\n                if (this._titleObject && (this._titleObject instanceof fgui.GTextInput))\n                    return this._titleObject.asTextInput.editable;\n                else\n                    return false;\n            },\n            set: function (val) {\n                if (this._titleObject)\n                    this._titleObject.asTextInput.editable = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GLabel.prototype.getTextField = function () {\n            if (this._titleObject instanceof fgui.GTextField)\n                return this._titleObject;\n            else if ((this._titleObject instanceof GLabel) || (this._titleObject instanceof fgui.GButton))\n                return this._titleObject.getTextField();\n            else\n                return null;\n        };\n        GLabel.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    return this.titleColor;\n                case fgui.ObjectPropID.OutlineColor:\n                    {\n                        var tf = this.getTextField();\n                        if (tf)\n                            return tf.strokeColor;\n                        else\n                            return 0;\n                    }\n                case fgui.ObjectPropID.FontSize:\n                    return this.titleFontSize;\n                default:\n                    return _super_1.prototype.getProp.call(this, index);\n            }\n        };\n        GLabel.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    this.titleColor = value;\n                    break;\n                case fgui.ObjectPropID.OutlineColor:\n                    {\n                        var tf = this.getTextField();\n                        if (tf)\n                            tf.strokeColor = value;\n                    }\n                    break;\n                case fgui.ObjectPropID.FontSize:\n                    this.titleFontSize = value;\n                    break;\n                default:\n                    _super_1.prototype.setProp.call(this, index, value);\n                    break;\n            }\n        };\n        GLabel.prototype.constructExtension = function (buffer) {\n            this._titleObject = this.getChild(\"title\");\n            this._iconObject = this.getChild(\"icon\");\n        };\n        GLabel.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            if (!buffer.seek(beginPos, 6))\n                return;\n            if (buffer.readByte() != this.packageItem.objectType)\n                return;\n            var str;\n            str = buffer.readS();\n            if (str != null)\n                this.title = str;\n            str = buffer.readS();\n            if (str != null)\n                this.icon = str;\n            if (buffer.readBool())\n                this.titleColor = buffer.readColor();\n            var iv = buffer.readInt();\n            if (iv != 0)\n                this.titleFontSize = iv;\n            if (buffer.readBool()) {\n                var input = this.getTextField();\n                if (input instanceof fgui.GTextInput) {\n                    str = buffer.readS();\n                    if (str != null)\n                        input.promptText = str;\n                    str = buffer.readS();\n                    if (str != null)\n                        input.restrict = str;\n                    iv = buffer.readInt();\n                    if (iv != 0)\n                        input.maxLength = iv;\n                    iv = buffer.readInt();\n                    if (iv != 0) {\n                    }\n                    if (buffer.readBool())\n                        input.password = true;\n                }\n                else\n                    buffer.skip(13);\n            }\n        };\n        return GLabel;\n    }(fgui.GComponent));\n    fgui.GLabel = GLabel;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GList = (function (_super_1) {\n        __extends(GList, _super_1);\n        function GList() {\n            var _this = _super_1.call(this) || this;\n            _this.scrollItemToViewOnClick = true;\n            _this.foldInvisibleItems = false;\n            _this._lineCount = 0;\n            _this._columnCount = 0;\n            _this._lineGap = 0;\n            _this._columnGap = 0;\n            _this._lastSelectedIndex = 0;\n            _this._numItems = 0;\n            _this._realNumItems = 0;\n            _this._firstIndex = 0;\n            _this._curLineItemCount = 0;\n            _this._curLineItemCount2 = 0;\n            _this._virtualListChanged = 0;\n            _this.itemInfoVer = 0;\n            _this._trackBounds = true;\n            _this._pool = new fgui.GObjectPool();\n            _this._layout = fgui.ListLayoutType.SingleColumn;\n            _this._autoResizeItem = true;\n            _this._lastSelectedIndex = -1;\n            _this._selectionMode = fgui.ListSelectionMode.Single;\n            _this.opaque = true;\n            _this._align = fgui.AlignType.Left;\n            _this._verticalAlign = fgui.VertAlignType.Top;\n            _this._container = new egret.DisplayObjectContainer();\n            _this._rootContainer.addChild(_this._container);\n            return _this;\n        }\n        GList.prototype.dispose = function () {\n            this._pool.clear();\n            _super_1.prototype.dispose.call(this);\n        };\n        Object.defineProperty(GList.prototype, \"layout\", {\n            get: function () {\n                return this._layout;\n            },\n            set: function (value) {\n                if (this._layout != value) {\n                    this._layout = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"lineCount\", {\n            get: function () {\n                return this._lineCount;\n            },\n            set: function (value) {\n                if (this._lineCount != value) {\n                    this._lineCount = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"columnCount\", {\n            get: function () {\n                return this._columnCount;\n            },\n            set: function (value) {\n                if (this._columnCount != value) {\n                    this._columnCount = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"lineGap\", {\n            get: function () {\n                return this._lineGap;\n            },\n            set: function (value) {\n                if (this._lineGap != value) {\n                    this._lineGap = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"columnGap\", {\n            get: function () {\n                return this._columnGap;\n            },\n            set: function (value) {\n                if (this._columnGap != value) {\n                    this._columnGap = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"align\", {\n            get: function () {\n                return this._align;\n            },\n            set: function (value) {\n                if (this._align != value) {\n                    this._align = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"verticalAlign\", {\n            get: function () {\n                return this._verticalAlign;\n            },\n            set: function (value) {\n                if (this._verticalAlign != value) {\n                    this._verticalAlign = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"virtualItemSize\", {\n            get: function () {\n                return this._itemSize;\n            },\n            set: function (value) {\n                if (this._virtual) {\n                    if (!this._itemSize)\n                        this._itemSize = new egret.Point();\n                    this._itemSize.copyFrom(value);\n                    this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"defaultItem\", {\n            get: function () {\n                return this._defaultItem;\n            },\n            set: function (val) {\n                this._defaultItem = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"autoResizeItem\", {\n            get: function () {\n                return this._autoResizeItem;\n            },\n            set: function (value) {\n                if (this._autoResizeItem != value) {\n                    this._autoResizeItem = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"selectionMode\", {\n            get: function () {\n                return this._selectionMode;\n            },\n            set: function (value) {\n                this._selectionMode = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"selectionController\", {\n            get: function () {\n                return this._selectionController;\n            },\n            set: function (value) {\n                this._selectionController = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"itemPool\", {\n            get: function () {\n                return this._pool;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GList.prototype.getFromPool = function (url) {\n            if (!url)\n                url = this._defaultItem;\n            var obj = this._pool.getObject(url);\n            if (obj)\n                obj.visible = true;\n            return obj;\n        };\n        GList.prototype.returnToPool = function (obj) {\n            obj.displayObject.cacheAsBitmap = false;\n            this._pool.returnObject(obj);\n        };\n        GList.prototype.addChildAt = function (child, index) {\n            _super_1.prototype.addChildAt.call(this, child, index);\n            if (child instanceof fgui.GButton) {\n                child.selected = false;\n                child.changeStateOnClick = false;\n            }\n            child.addEventListener(egret.TouchEvent.TOUCH_TAP, this.__clickItem, this);\n            return child;\n        };\n        GList.prototype.addItem = function (url) {\n            if (!url)\n                url = this._defaultItem;\n            return this.addChild(fgui.UIPackage.createObjectFromURL(url));\n        };\n        GList.prototype.addItemFromPool = function (url) {\n            return this.addChild(this.getFromPool(url));\n        };\n        GList.prototype.removeChildAt = function (index, dispose) {\n            var child = _super_1.prototype.removeChildAt.call(this, index, dispose);\n            child.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.__clickItem, this);\n            return child;\n        };\n        GList.prototype.removeChildToPoolAt = function (index) {\n            var child = _super_1.prototype.removeChildAt.call(this, index);\n            this.returnToPool(child);\n        };\n        GList.prototype.removeChildToPool = function (child) {\n            _super_1.prototype.removeChild.call(this, child);\n            this.returnToPool(child);\n        };\n        GList.prototype.removeChildrenToPool = function (beginIndex, endIndex) {\n            if (beginIndex == undefined)\n                beginIndex = 0;\n            if (endIndex == undefined)\n                endIndex = -1;\n            if (endIndex < 0 || endIndex >= this._children.length)\n                endIndex = this._children.length - 1;\n            for (var i = beginIndex; i <= endIndex; ++i)\n                this.removeChildToPoolAt(beginIndex);\n        };\n        Object.defineProperty(GList.prototype, \"selectedIndex\", {\n            get: function () {\n                var i;\n                if (this._virtual) {\n                    for (i = 0; i < this._realNumItems; i++) {\n                        var ii = this._virtualItems[i];\n                        if ((ii.obj instanceof fgui.GButton) && ii.obj.selected\n                            || ii.obj == null && ii.selected) {\n                            if (this._loop)\n                                return i % this._numItems;\n                            else\n                                return i;\n                        }\n                    }\n                }\n                else {\n                    var cnt = this._children.length;\n                    for (i = 0; i < cnt; i++) {\n                        var obj = this._children[i];\n                        if ((obj instanceof fgui.GButton) && obj.selected)\n                            return i;\n                    }\n                }\n                return -1;\n            },\n            set: function (value) {\n                if (value >= 0 && value < this.numItems) {\n                    if (this._selectionMode != fgui.ListSelectionMode.Single)\n                        this.clearSelection();\n                    this.addSelection(value);\n                }\n                else\n                    this.clearSelection();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GList.prototype.getSelection = function (result) {\n            if (!result)\n                result = new Array();\n            var i;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii = this._virtualItems[i];\n                    if ((ii.obj instanceof fgui.GButton) && ii.obj.selected\n                        || ii.obj == null && ii.selected) {\n                        var j = i;\n                        if (this._loop) {\n                            j = i % this._numItems;\n                            if (result.indexOf(j) != -1)\n                                continue;\n                        }\n                        result.push(j);\n                    }\n                }\n            }\n            else {\n                var cnt = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj = this._children[i];\n                    if ((obj instanceof fgui.GButton) && obj.selected)\n                        result.push(i);\n                }\n            }\n            return result;\n        };\n        GList.prototype.addSelection = function (index, scrollItToView) {\n            if (this._selectionMode == fgui.ListSelectionMode.None)\n                return;\n            this.checkVirtualList();\n            if (this._selectionMode == fgui.ListSelectionMode.Single)\n                this.clearSelection();\n            if (scrollItToView)\n                this.scrollToView(index);\n            this._lastSelectedIndex = index;\n            var obj;\n            if (this._virtual) {\n                var ii = this._virtualItems[index];\n                if (ii.obj)\n                    obj = ii.obj;\n                ii.selected = true;\n            }\n            else\n                obj = this.getChildAt(index);\n            if ((obj instanceof fgui.GButton) && !obj.selected) {\n                obj.selected = true;\n                this.updateSelectionController(index);\n            }\n        };\n        GList.prototype.removeSelection = function (index) {\n            if (this._selectionMode == fgui.ListSelectionMode.None)\n                return;\n            var obj;\n            if (this._virtual) {\n                var ii = this._virtualItems[index];\n                if (ii.obj)\n                    obj = ii.obj;\n                ii.selected = false;\n            }\n            else\n                obj = this.getChildAt(index);\n            if (obj instanceof fgui.GButton)\n                obj.selected = false;\n        };\n        GList.prototype.clearSelection = function () {\n            var i;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii = this._virtualItems[i];\n                    if (ii.obj instanceof fgui.GButton)\n                        ii.obj.selected = false;\n                    ii.selected = false;\n                }\n            }\n            else {\n                var cnt = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj = this._children[i];\n                    if (obj instanceof fgui.GButton)\n                        obj.selected = false;\n                }\n            }\n        };\n        GList.prototype.clearSelectionExcept = function (g) {\n            var i;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii = this._virtualItems[i];\n                    if (ii.obj != g) {\n                        if ((ii.obj instanceof fgui.GButton))\n                            ii.obj.selected = false;\n                        ii.selected = false;\n                    }\n                }\n            }\n            else {\n                var cnt = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj = this._children[i];\n                    if ((obj instanceof fgui.GButton) && obj != g)\n                        obj.selected = false;\n                }\n            }\n        };\n        GList.prototype.selectAll = function () {\n            this.checkVirtualList();\n            var last = -1;\n            var i;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii = this._virtualItems[i];\n                    if ((ii.obj instanceof fgui.GButton) && !ii.obj.selected) {\n                        ii.obj.selected = true;\n                        last = i;\n                    }\n                    ii.selected = true;\n                }\n            }\n            else {\n                var cnt = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj = this._children[i];\n                    if ((obj instanceof fgui.GButton) && !obj.selected) {\n                        obj.selected = true;\n                        last = i;\n                    }\n                }\n            }\n            if (last != -1)\n                this.updateSelectionController(last);\n        };\n        GList.prototype.selectNone = function () {\n            this.clearSelection();\n        };\n        GList.prototype.selectReverse = function () {\n            this.checkVirtualList();\n            var last = -1;\n            var i;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii = this._virtualItems[i];\n                    if (ii.obj instanceof fgui.GButton) {\n                        ii.obj.selected = !ii.obj.selected;\n                        if (ii.obj.selected)\n                            last = i;\n                    }\n                    ii.selected = !ii.selected;\n                }\n            }\n            else {\n                var cnt = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj = this._children[i];\n                    if (obj instanceof fgui.GButton) {\n                        obj.selected = !obj.selected;\n                        if (obj.selected)\n                            last = i;\n                    }\n                }\n            }\n            if (last != -1)\n                this.updateSelectionController(last);\n        };\n        GList.prototype.handleArrowKey = function (dir) {\n            var index = this.selectedIndex;\n            if (index == -1)\n                return;\n            switch (dir) {\n                case 1:\n                    if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowVertical) {\n                        index--;\n                        if (index >= 0) {\n                            this.clearSelection();\n                            this.addSelection(index, true);\n                        }\n                    }\n                    else if (this._layout == fgui.ListLayoutType.FlowHorizontal || this._layout == fgui.ListLayoutType.Pagination) {\n                        var current = this._children[index];\n                        var k = 0;\n                        for (var i = index - 1; i >= 0; i--) {\n                            var obj = this._children[i];\n                            if (obj.y != current.y) {\n                                current = obj;\n                                break;\n                            }\n                            k++;\n                        }\n                        for (; i >= 0; i--) {\n                            obj = this._children[i];\n                            if (obj.y != current.y) {\n                                this.clearSelection();\n                                this.addSelection(i + k + 1, true);\n                                break;\n                            }\n                        }\n                    }\n                    break;\n                case 3:\n                    if (this._layout == fgui.ListLayoutType.SingleRow || this._layout == fgui.ListLayoutType.FlowHorizontal || this._layout == fgui.ListLayoutType.Pagination) {\n                        index++;\n                        if (index < this._children.length) {\n                            this.clearSelection();\n                            this.addSelection(index, true);\n                        }\n                    }\n                    else if (this._layout == fgui.ListLayoutType.FlowVertical) {\n                        current = this._children[index];\n                        k = 0;\n                        var cnt = this._children.length;\n                        for (i = index + 1; i < cnt; i++) {\n                            obj = this._children[i];\n                            if (obj.x != current.x) {\n                                current = obj;\n                                break;\n                            }\n                            k++;\n                        }\n                        for (; i < cnt; i++) {\n                            obj = this._children[i];\n                            if (obj.x != current.x) {\n                                this.clearSelection();\n                                this.addSelection(i - k - 1, true);\n                                break;\n                            }\n                        }\n                    }\n                    break;\n                case 5:\n                    if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowVertical) {\n                        index++;\n                        if (index < this._children.length) {\n                            this.clearSelection();\n                            this.addSelection(index, true);\n                        }\n                    }\n                    else if (this._layout == fgui.ListLayoutType.FlowHorizontal || this._layout == fgui.ListLayoutType.Pagination) {\n                        current = this._children[index];\n                        k = 0;\n                        cnt = this._children.length;\n                        for (i = index + 1; i < cnt; i++) {\n                            obj = this._children[i];\n                            if (obj.y != current.y) {\n                                current = obj;\n                                break;\n                            }\n                            k++;\n                        }\n                        for (; i < cnt; i++) {\n                            obj = this._children[i];\n                            if (obj.y != current.y) {\n                                this.clearSelection();\n                                this.addSelection(i - k - 1, true);\n                                break;\n                            }\n                        }\n                    }\n                    break;\n                case 7:\n                    if (this._layout == fgui.ListLayoutType.SingleRow || this._layout == fgui.ListLayoutType.FlowHorizontal || this._layout == fgui.ListLayoutType.Pagination) {\n                        index--;\n                        if (index >= 0) {\n                            this.clearSelection();\n                            this.addSelection(index, true);\n                        }\n                    }\n                    else if (this._layout == fgui.ListLayoutType.FlowVertical) {\n                        current = this._children[index];\n                        k = 0;\n                        for (i = index - 1; i >= 0; i--) {\n                            obj = this._children[i];\n                            if (obj.x != current.x) {\n                                current = obj;\n                                break;\n                            }\n                            k++;\n                        }\n                        for (; i >= 0; i--) {\n                            obj = this._children[i];\n                            if (obj.x != current.x) {\n                                this.clearSelection();\n                                this.addSelection(i + k + 1, true);\n                                break;\n                            }\n                        }\n                    }\n                    break;\n            }\n        };\n        GList.prototype.__clickItem = function (evt) {\n            if (this._scrollPane && this._scrollPane.isDragged)\n                return;\n            var item = (evt.currentTarget);\n            this.setSelectionOnEvent(item);\n            if (this._scrollPane && this.scrollItemToViewOnClick)\n                this._scrollPane.scrollToView(item, true);\n            var ie = new fgui.ItemEvent(fgui.ItemEvent.CLICK, item);\n            ie.stageX = evt.stageX;\n            ie.stageY = evt.stageY;\n            this.dispatchItemEvent(ie);\n        };\n        GList.prototype.dispatchItemEvent = function (evt) {\n            this.dispatchEvent(evt);\n        };\n        GList.prototype.setSelectionOnEvent = function (item) {\n            if (!(item instanceof fgui.GButton) || this._selectionMode == fgui.ListSelectionMode.None)\n                return;\n            var dontChangeLastIndex = false;\n            var index = this.childIndexToItemIndex(this.getChildIndex(item));\n            if (this._selectionMode == fgui.ListSelectionMode.Single) {\n                if (!item.selected) {\n                    this.clearSelectionExcept(item);\n                    item.selected = true;\n                }\n            }\n            else {\n                if (fgui.GRoot.shiftKeyDown) {\n                    if (!item.selected) {\n                        if (this._lastSelectedIndex != -1) {\n                            var min = Math.min(this._lastSelectedIndex, index);\n                            var max = Math.max(this._lastSelectedIndex, index);\n                            max = Math.min(max, this.numItems - 1);\n                            var i;\n                            if (this._virtual) {\n                                for (i = min; i <= max; i++) {\n                                    var ii = this._virtualItems[i];\n                                    if (ii.obj instanceof fgui.GButton)\n                                        ii.obj.selected = true;\n                                    ii.selected = true;\n                                }\n                            }\n                            else {\n                                for (i = min; i <= max; i++) {\n                                    var obj = this.getChildAt(i);\n                                    if (obj instanceof fgui.GButton)\n                                        obj.selected = true;\n                                }\n                            }\n                            dontChangeLastIndex = true;\n                        }\n                        else {\n                            item.selected = true;\n                        }\n                    }\n                }\n                else if (fgui.GRoot.ctrlKeyDown || this._selectionMode == fgui.ListSelectionMode.Multiple_SingleClick) {\n                    item.selected = !item.selected;\n                }\n                else {\n                    if (!item.selected) {\n                        this.clearSelectionExcept(item);\n                        item.selected = true;\n                    }\n                    else\n                        this.clearSelectionExcept(item);\n                }\n            }\n            if (!dontChangeLastIndex)\n                this._lastSelectedIndex = index;\n            if (item.selected)\n                this.updateSelectionController(index);\n        };\n        GList.prototype.resizeToFit = function (itemCount, minSize) {\n            if (itemCount === void 0) { itemCount = Number.POSITIVE_INFINITY; }\n            if (minSize === void 0) { minSize = 0; }\n            this.ensureBoundsCorrect();\n            var curCount = this.numItems;\n            if (itemCount > curCount)\n                itemCount = curCount;\n            if (this._virtual) {\n                var lineCount = Math.ceil(itemCount / this._curLineItemCount);\n                if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal)\n                    this.viewHeight = lineCount * this._itemSize.y + Math.max(0, lineCount - 1) * this._lineGap;\n                else\n                    this.viewWidth = lineCount * this._itemSize.x + Math.max(0, lineCount - 1) * this._columnGap;\n            }\n            else if (itemCount == 0) {\n                if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal)\n                    this.viewHeight = minSize;\n                else\n                    this.viewWidth = minSize;\n            }\n            else {\n                var i = itemCount - 1;\n                var obj;\n                while (i >= 0) {\n                    obj = this.getChildAt(i);\n                    if (!this.foldInvisibleItems || obj.visible)\n                        break;\n                    i--;\n                }\n                if (i < 0) {\n                    if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal)\n                        this.viewHeight = minSize;\n                    else\n                        this.viewWidth = minSize;\n                }\n                else {\n                    var size = 0;\n                    if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                        size = obj.y + obj.height;\n                        if (size < minSize)\n                            size = minSize;\n                        this.viewHeight = size;\n                    }\n                    else {\n                        size = obj.x + obj.width;\n                        if (size < minSize)\n                            size = minSize;\n                        this.viewWidth = size;\n                    }\n                }\n            }\n        };\n        GList.prototype.getMaxItemWidth = function () {\n            var cnt = this._children.length;\n            var max = 0;\n            for (var i = 0; i < cnt; i++) {\n                var child = this.getChildAt(i);\n                if (child.width > max)\n                    max = child.width;\n            }\n            return max;\n        };\n        GList.prototype.handleSizeChanged = function () {\n            _super_1.prototype.handleSizeChanged.call(this);\n            this.setBoundsChangedFlag();\n            if (this._virtual)\n                this.setVirtualListChangedFlag(true);\n        };\n        GList.prototype.handleControllerChanged = function (c) {\n            _super_1.prototype.handleControllerChanged.call(this, c);\n            if (this._selectionController == c)\n                this.selectedIndex = c.selectedIndex;\n        };\n        GList.prototype.updateSelectionController = function (index) {\n            if (this._selectionController && !this._selectionController.changing\n                && index < this._selectionController.pageCount) {\n                var c = this._selectionController;\n                this._selectionController = null;\n                c.selectedIndex = index;\n                this._selectionController = c;\n            }\n        };\n        GList.prototype.getSnappingPosition = function (xValue, yValue, result) {\n            if (this._virtual) {\n                if (!result)\n                    result = new egret.Point();\n                var saved;\n                var index;\n                if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                    saved = yValue;\n                    s_n = yValue;\n                    index = this.getIndexOnPos1(false);\n                    yValue = s_n;\n                    if (index < this._virtualItems.length && saved - yValue > this._virtualItems[index].height / 2 && index < this._realNumItems)\n                        yValue += this._virtualItems[index].height + this._lineGap;\n                }\n                else if (this._layout == fgui.ListLayoutType.SingleRow || this._layout == fgui.ListLayoutType.FlowVertical) {\n                    saved = xValue;\n                    s_n = xValue;\n                    index = this.getIndexOnPos2(false);\n                    xValue = s_n;\n                    if (index < this._virtualItems.length && saved - xValue > this._virtualItems[index].width / 2 && index < this._realNumItems)\n                        xValue += this._virtualItems[index].width + this._columnGap;\n                }\n                else {\n                    saved = xValue;\n                    s_n = xValue;\n                    index = this.getIndexOnPos3(false);\n                    xValue = s_n;\n                    if (index < this._virtualItems.length && saved - xValue > this._virtualItems[index].width / 2 && index < this._realNumItems)\n                        xValue += this._virtualItems[index].width + this._columnGap;\n                }\n                result.x = xValue;\n                result.y = yValue;\n                return result;\n            }\n            else {\n                return _super_1.prototype.getSnappingPosition.call(this, xValue, yValue, result);\n            }\n        };\n        GList.prototype.scrollToView = function (index, ani, setFirst) {\n            if (this._virtual) {\n                if (this._numItems == 0)\n                    return;\n                this.checkVirtualList();\n                if (index >= this._virtualItems.length)\n                    throw \"Invalid child index: \" + index + \">\" + this._virtualItems.length;\n                if (this._loop)\n                    index = Math.floor(this._firstIndex / this._numItems) * this._numItems + index;\n                var rect;\n                var ii = this._virtualItems[index];\n                var pos = 0;\n                var i;\n                if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                    for (i = this._curLineItemCount - 1; i < index; i += this._curLineItemCount)\n                        pos += this._virtualItems[i].height + this._lineGap;\n                    rect = new egret.Rectangle(0, pos, this._itemSize.x, ii.height);\n                }\n                else if (this._layout == fgui.ListLayoutType.SingleRow || this._layout == fgui.ListLayoutType.FlowVertical) {\n                    for (i = this._curLineItemCount - 1; i < index; i += this._curLineItemCount)\n                        pos += this._virtualItems[i].width + this._columnGap;\n                    rect = new egret.Rectangle(pos, 0, ii.width, this._itemSize.y);\n                }\n                else {\n                    var page = index / (this._curLineItemCount * this._curLineItemCount2);\n                    rect = new egret.Rectangle(page * this.viewWidth + (index % this._curLineItemCount) * (ii.width + this._columnGap), (index / this._curLineItemCount) % this._curLineItemCount2 * (ii.height + this._lineGap), ii.width, ii.height);\n                }\n                if (this._scrollPane)\n                    this._scrollPane.scrollToView(rect, ani, setFirst);\n            }\n            else {\n                var obj = this.getChildAt(index);\n                if (obj) {\n                    if (this._scrollPane)\n                        this._scrollPane.scrollToView(obj, ani, setFirst);\n                    else if (this.parent && this.parent.scrollPane)\n                        this.parent.scrollPane.scrollToView(obj, ani, setFirst);\n                }\n            }\n        };\n        GList.prototype.getFirstChildInView = function () {\n            return this.childIndexToItemIndex(_super_1.prototype.getFirstChildInView.call(this));\n        };\n        GList.prototype.childIndexToItemIndex = function (index) {\n            if (!this._virtual)\n                return index;\n            if (this._layout == fgui.ListLayoutType.Pagination) {\n                for (var i = this._firstIndex; i < this._realNumItems; i++) {\n                    if (this._virtualItems[i].obj) {\n                        index--;\n                        if (index < 0)\n                            return i;\n                    }\n                }\n                return index;\n            }\n            else {\n                index += this._firstIndex;\n                if (this._loop && this._numItems > 0)\n                    index = index % this._numItems;\n                return index;\n            }\n        };\n        GList.prototype.itemIndexToChildIndex = function (index) {\n            if (!this._virtual)\n                return index;\n            if (this._layout == fgui.ListLayoutType.Pagination) {\n                return this.getChildIndex(this._virtualItems[index].obj);\n            }\n            else {\n                if (this._loop && this._numItems > 0) {\n                    var j = this._firstIndex % this._numItems;\n                    if (index >= j)\n                        index = index - j;\n                    else\n                        index = this._numItems - j + index;\n                }\n                else\n                    index -= this._firstIndex;\n                return index;\n            }\n        };\n        GList.prototype.setVirtual = function () {\n            this._setVirtual(false);\n        };\n        GList.prototype.setVirtualAndLoop = function () {\n            this._setVirtual(true);\n        };\n        GList.prototype._setVirtual = function (loop) {\n            if (!this._virtual) {\n                if (this._scrollPane == null)\n                    throw \"Virtual list must be scrollable!\";\n                if (loop) {\n                    if (this._layout == fgui.ListLayoutType.FlowHorizontal || this._layout == fgui.ListLayoutType.FlowVertical)\n                        throw \"Loop list is not supported for FlowHorizontal or FlowVertical layout!\";\n                    this._scrollPane.bouncebackEffect = false;\n                }\n                this._virtual = true;\n                this._loop = loop;\n                this._virtualItems = new Array();\n                this.removeChildrenToPool();\n                if (this._itemSize == null) {\n                    this._itemSize = new egret.Point();\n                    var obj = this.getFromPool(null);\n                    if (obj == null) {\n                        throw \"Virtual List must have a default list item resource.\";\n                    }\n                    else {\n                        this._itemSize.x = obj.width;\n                        this._itemSize.y = obj.height;\n                    }\n                    this.returnToPool(obj);\n                }\n                if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                    this._scrollPane.scrollStep = this._itemSize.y;\n                    if (this._loop)\n                        this._scrollPane._loop = 2;\n                }\n                else {\n                    this._scrollPane.scrollStep = this._itemSize.x;\n                    if (this._loop)\n                        this._scrollPane._loop = 1;\n                }\n                this._scrollPane.addEventListener(fgui.ScrollPane.SCROLL, this.__scrolled, this);\n                this.setVirtualListChangedFlag(true);\n            }\n        };\n        Object.defineProperty(GList.prototype, \"numItems\", {\n            get: function () {\n                if (this._virtual)\n                    return this._numItems;\n                else\n                    return this._children.length;\n            },\n            set: function (value) {\n                if (this._virtual) {\n                    if (this.itemRenderer == null)\n                        throw \"Set itemRenderer first!\";\n                    this._numItems = value;\n                    if (this._loop)\n                        this._realNumItems = this._numItems * 6;\n                    else\n                        this._realNumItems = this._numItems;\n                    var oldCount = this._virtualItems.length;\n                    if (this._realNumItems > oldCount) {\n                        for (i = oldCount; i < this._realNumItems; i++) {\n                            var ii = {\n                                width: this._itemSize.x,\n                                height: this._itemSize.y,\n                                updateFlag: 0\n                            };\n                            this._virtualItems.push(ii);\n                        }\n                    }\n                    else {\n                        for (i = this._realNumItems; i < oldCount; i++)\n                            this._virtualItems[i].selected = false;\n                    }\n                    if (this._virtualListChanged != 0)\n                        fgui.GTimers.inst.remove(this._refreshVirtualList, this);\n                    this._refreshVirtualList();\n                }\n                else {\n                    var cnt = this._children.length;\n                    if (value > cnt) {\n                        for (var i = cnt; i < value; i++) {\n                            if (this.itemProvider == null)\n                                this.addItemFromPool();\n                            else\n                                this.addItemFromPool(this.itemProvider.call(this.callbackThisObj, i));\n                        }\n                    }\n                    else {\n                        this.removeChildrenToPool(value, cnt);\n                    }\n                    if (this.itemRenderer != null) {\n                        for (i = 0; i < value; i++)\n                            this.itemRenderer.call(this.callbackThisObj, i, this.getChildAt(i));\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GList.prototype.refreshVirtualList = function () {\n            this.setVirtualListChangedFlag(false);\n        };\n        GList.prototype.checkVirtualList = function () {\n            if (this._virtualListChanged != 0) {\n                this._refreshVirtualList();\n                fgui.GTimers.inst.remove(this._refreshVirtualList, this);\n            }\n        };\n        GList.prototype.setVirtualListChangedFlag = function (layoutChanged) {\n            if (layoutChanged)\n                this._virtualListChanged = 2;\n            else if (this._virtualListChanged == 0)\n                this._virtualListChanged = 1;\n            fgui.GTimers.inst.callLater(this._refreshVirtualList, this);\n        };\n        GList.prototype._refreshVirtualList = function () {\n            var layoutChanged = this._virtualListChanged == 2;\n            this._virtualListChanged = 0;\n            this._eventLocked = true;\n            if (layoutChanged) {\n                if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.SingleRow)\n                    this._curLineItemCount = 1;\n                else if (this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                    if (this._columnCount > 0)\n                        this._curLineItemCount = this._columnCount;\n                    else {\n                        this._curLineItemCount = Math.floor((this._scrollPane.viewWidth + this._columnGap) / (this._itemSize.x + this._columnGap));\n                        if (this._curLineItemCount <= 0)\n                            this._curLineItemCount = 1;\n                    }\n                }\n                else if (this._layout == fgui.ListLayoutType.FlowVertical) {\n                    if (this._lineCount > 0)\n                        this._curLineItemCount = this._lineCount;\n                    else {\n                        this._curLineItemCount = Math.floor((this._scrollPane.viewHeight + this._lineGap) / (this._itemSize.y + this._lineGap));\n                        if (this._curLineItemCount <= 0)\n                            this._curLineItemCount = 1;\n                    }\n                }\n                else {\n                    if (this._columnCount > 0)\n                        this._curLineItemCount = this._columnCount;\n                    else {\n                        this._curLineItemCount = Math.floor((this._scrollPane.viewWidth + this._columnGap) / (this._itemSize.x + this._columnGap));\n                        if (this._curLineItemCount <= 0)\n                            this._curLineItemCount = 1;\n                    }\n                    if (this._lineCount > 0)\n                        this._curLineItemCount2 = this._lineCount;\n                    else {\n                        this._curLineItemCount2 = Math.floor((this._scrollPane.viewHeight + this._lineGap) / (this._itemSize.y + this._lineGap));\n                        if (this._curLineItemCount2 <= 0)\n                            this._curLineItemCount2 = 1;\n                    }\n                }\n            }\n            var ch = 0, cw = 0;\n            if (this._realNumItems > 0) {\n                var i;\n                var len = Math.ceil(this._realNumItems / this._curLineItemCount) * this._curLineItemCount;\n                var len2 = Math.min(this._curLineItemCount, this._realNumItems);\n                if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                    for (i = 0; i < len; i += this._curLineItemCount)\n                        ch += this._virtualItems[i].height + this._lineGap;\n                    if (ch > 0)\n                        ch -= this._lineGap;\n                    if (this._autoResizeItem)\n                        cw = this._scrollPane.viewWidth;\n                    else {\n                        for (i = 0; i < len2; i++)\n                            cw += this._virtualItems[i].width + this._columnGap;\n                        if (cw > 0)\n                            cw -= this._columnGap;\n                    }\n                }\n                else if (this._layout == fgui.ListLayoutType.SingleRow || this._layout == fgui.ListLayoutType.FlowVertical) {\n                    for (i = 0; i < len; i += this._curLineItemCount)\n                        cw += this._virtualItems[i].width + this._columnGap;\n                    if (cw > 0)\n                        cw -= this._columnGap;\n                    if (this._autoResizeItem)\n                        ch = this._scrollPane.viewHeight;\n                    else {\n                        for (i = 0; i < len2; i++)\n                            ch += this._virtualItems[i].height + this._lineGap;\n                        if (ch > 0)\n                            ch -= this._lineGap;\n                    }\n                }\n                else {\n                    var pageCount = Math.ceil(len / (this._curLineItemCount * this._curLineItemCount2));\n                    cw = pageCount * this.viewWidth;\n                    ch = this.viewHeight;\n                }\n            }\n            this.handleAlign(cw, ch);\n            this._scrollPane.setContentSize(cw, ch);\n            this._eventLocked = false;\n            this.handleScroll(true);\n        };\n        GList.prototype.__scrolled = function (evt) {\n            this.handleScroll(false);\n        };\n        GList.prototype.getIndexOnPos1 = function (forceUpdate) {\n            if (this._realNumItems < this._curLineItemCount) {\n                s_n = 0;\n                return 0;\n            }\n            var i;\n            var pos2;\n            var pos3;\n            if (this.numChildren > 0 && !forceUpdate) {\n                pos2 = this.getChildAt(0).y;\n                if (pos2 > s_n) {\n                    for (i = this._firstIndex - this._curLineItemCount; i >= 0; i -= this._curLineItemCount) {\n                        pos2 -= (this._virtualItems[i].height + this._lineGap);\n                        if (pos2 <= s_n) {\n                            s_n = pos2;\n                            return i;\n                        }\n                    }\n                    s_n = 0;\n                    return 0;\n                }\n                else {\n                    for (i = this._firstIndex; i < this._realNumItems; i += this._curLineItemCount) {\n                        pos3 = pos2 + this._virtualItems[i].height + this._lineGap;\n                        if (pos3 > s_n) {\n                            s_n = pos2;\n                            return i;\n                        }\n                        pos2 = pos3;\n                    }\n                    s_n = pos2;\n                    return this._realNumItems - this._curLineItemCount;\n                }\n            }\n            else {\n                pos2 = 0;\n                for (i = 0; i < this._realNumItems; i += this._curLineItemCount) {\n                    pos3 = pos2 + this._virtualItems[i].height + this._lineGap;\n                    if (pos3 > s_n) {\n                        s_n = pos2;\n                        return i;\n                    }\n                    pos2 = pos3;\n                }\n                s_n = pos2;\n                return this._realNumItems - this._curLineItemCount;\n            }\n        };\n        GList.prototype.getIndexOnPos2 = function (forceUpdate) {\n            if (this._realNumItems < this._curLineItemCount) {\n                s_n = 0;\n                return 0;\n            }\n            var i;\n            var pos2;\n            var pos3;\n            if (this.numChildren > 0 && !forceUpdate) {\n                pos2 = this.getChildAt(0).x;\n                if (pos2 > s_n) {\n                    for (i = this._firstIndex - this._curLineItemCount; i >= 0; i -= this._curLineItemCount) {\n                        pos2 -= (this._virtualItems[i].width + this._columnGap);\n                        if (pos2 <= s_n) {\n                            s_n = pos2;\n                            return i;\n                        }\n                    }\n                    s_n = 0;\n                    return 0;\n                }\n                else {\n                    for (i = this._firstIndex; i < this._realNumItems; i += this._curLineItemCount) {\n                        pos3 = pos2 + this._virtualItems[i].width + this._columnGap;\n                        if (pos3 > s_n) {\n                            s_n = pos2;\n                            return i;\n                        }\n                        pos2 = pos3;\n                    }\n                    s_n = pos2;\n                    return this._realNumItems - this._curLineItemCount;\n                }\n            }\n            else {\n                pos2 = 0;\n                for (i = 0; i < this._realNumItems; i += this._curLineItemCount) {\n                    pos3 = pos2 + this._virtualItems[i].width + this._columnGap;\n                    if (pos3 > s_n) {\n                        s_n = pos2;\n                        return i;\n                    }\n                    pos2 = pos3;\n                }\n                s_n = pos2;\n                return this._realNumItems - this._curLineItemCount;\n            }\n        };\n        GList.prototype.getIndexOnPos3 = function (forceUpdate) {\n            if (this._realNumItems < this._curLineItemCount) {\n                s_n = 0;\n                return 0;\n            }\n            var viewWidth = this.viewWidth;\n            var page = Math.floor(s_n / viewWidth);\n            var startIndex = page * (this._curLineItemCount * this._curLineItemCount2);\n            var pos2 = page * viewWidth;\n            var i;\n            var pos3;\n            for (i = 0; i < this._curLineItemCount; i++) {\n                pos3 = pos2 + this._virtualItems[startIndex + i].width + this._columnGap;\n                if (pos3 > s_n) {\n                    s_n = pos2;\n                    return startIndex + i;\n                }\n                pos2 = pos3;\n            }\n            s_n = pos2;\n            return startIndex + this._curLineItemCount - 1;\n        };\n        GList.prototype.handleScroll = function (forceUpdate) {\n            if (this._eventLocked)\n                return;\n            if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                var enterCounter = 0;\n                while (this.handleScroll1(forceUpdate)) {\n                    enterCounter++;\n                    forceUpdate = false;\n                    if (enterCounter > 20) {\n                        console.log(\"FairyGUI: list will never be filled as the item renderer function always returns a different size.\");\n                        break;\n                    }\n                }\n                this.handleArchOrder1();\n            }\n            else if (this._layout == fgui.ListLayoutType.SingleRow || this._layout == fgui.ListLayoutType.FlowVertical) {\n                enterCounter = 0;\n                while (this.handleScroll2(forceUpdate)) {\n                    enterCounter++;\n                    forceUpdate = false;\n                    if (enterCounter > 20) {\n                        console.log(\"FairyGUI: list will never be filled as the item renderer function always returns a different size.\");\n                        break;\n                    }\n                }\n                this.handleArchOrder2();\n            }\n            else {\n                this.handleScroll3(forceUpdate);\n            }\n            this._boundsChanged = false;\n        };\n        GList.prototype.handleScroll1 = function (forceUpdate) {\n            var pos = this._scrollPane.scrollingPosY;\n            var max = pos + this._scrollPane.viewHeight;\n            var end = max == this._scrollPane.contentHeight;\n            s_n = pos;\n            var newFirstIndex = this.getIndexOnPos1(forceUpdate);\n            pos = s_n;\n            if (newFirstIndex == this._firstIndex && !forceUpdate) {\n                return false;\n            }\n            var oldFirstIndex = this._firstIndex;\n            this._firstIndex = newFirstIndex;\n            var curIndex = newFirstIndex;\n            var forward = oldFirstIndex > newFirstIndex;\n            var childCount = this.numChildren;\n            var lastIndex = oldFirstIndex + childCount - 1;\n            var reuseIndex = forward ? lastIndex : oldFirstIndex;\n            var curX = 0, curY = pos;\n            var needRender;\n            var deltaSize = 0;\n            var firstItemDeltaSize = 0;\n            var url = this.defaultItem;\n            var ii, ii2;\n            var i, j;\n            var partSize = (this._scrollPane.viewWidth - this._columnGap * (this._curLineItemCount - 1)) / this._curLineItemCount;\n            this.itemInfoVer++;\n            while (curIndex < this._realNumItems && (end || curY < max)) {\n                ii = this._virtualItems[curIndex];\n                if (ii.obj == null || forceUpdate) {\n                    if (this.itemProvider != null) {\n                        url = this.itemProvider.call(this.callbackThisObj, curIndex % this._numItems);\n                        if (url == null)\n                            url = this._defaultItem;\n                        url = fgui.UIPackage.normalizeURL(url);\n                    }\n                    if (ii.obj && ii.obj.resourceURL != url) {\n                        if (ii.obj instanceof fgui.GButton)\n                            ii.selected = ii.obj.selected;\n                        this.removeChildToPool(ii.obj);\n                        ii.obj = null;\n                    }\n                }\n                if (ii.obj == null) {\n                    if (forward) {\n                        for (j = reuseIndex; j >= oldFirstIndex; j--) {\n                            ii2 = this._virtualItems[j];\n                            if (ii2.obj && ii2.updateFlag != this.itemInfoVer && ii2.obj.resourceURL == url) {\n                                if (ii2.obj instanceof fgui.GButton)\n                                    ii2.selected = ii2.obj.selected;\n                                ii.obj = ii2.obj;\n                                ii2.obj = null;\n                                if (j == reuseIndex)\n                                    reuseIndex--;\n                                break;\n                            }\n                        }\n                    }\n                    else {\n                        for (j = reuseIndex; j <= lastIndex; j++) {\n                            ii2 = this._virtualItems[j];\n                            if (ii2.obj && ii2.updateFlag != this.itemInfoVer && ii2.obj.resourceURL == url) {\n                                if (ii2.obj instanceof fgui.GButton)\n                                    ii2.selected = ii2.obj.selected;\n                                ii.obj = ii2.obj;\n                                ii2.obj = null;\n                                if (j == reuseIndex)\n                                    reuseIndex++;\n                                break;\n                            }\n                        }\n                    }\n                    if (ii.obj) {\n                        this.setChildIndex(ii.obj, forward ? curIndex - newFirstIndex : this.numChildren);\n                    }\n                    else {\n                        ii.obj = this._pool.getObject(url);\n                        if (forward)\n                            this.addChildAt(ii.obj, curIndex - newFirstIndex);\n                        else\n                            this.addChild(ii.obj);\n                    }\n                    if (ii.obj instanceof fgui.GButton)\n                        ii.obj.selected = ii.selected;\n                    needRender = true;\n                }\n                else\n                    needRender = forceUpdate;\n                if (needRender) {\n                    if (this._autoResizeItem && (this._layout == fgui.ListLayoutType.SingleColumn || this._columnCount > 0))\n                        ii.obj.setSize(partSize, ii.obj.height, true);\n                    this.itemRenderer.call(this.callbackThisObj, curIndex % this._numItems, ii.obj);\n                    if (curIndex % this._curLineItemCount == 0) {\n                        deltaSize += Math.ceil(ii.obj.height) - ii.height;\n                        if (curIndex == newFirstIndex && oldFirstIndex > newFirstIndex) {\n                            firstItemDeltaSize = Math.ceil(ii.obj.height) - ii.height;\n                        }\n                    }\n                    ii.width = Math.ceil(ii.obj.width);\n                    ii.height = Math.ceil(ii.obj.height);\n                }\n                ii.updateFlag = this.itemInfoVer;\n                ii.obj.setXY(curX, curY);\n                if (curIndex == newFirstIndex)\n                    max += ii.height;\n                curX += ii.width + this._columnGap;\n                if (curIndex % this._curLineItemCount == this._curLineItemCount - 1) {\n                    curX = 0;\n                    curY += ii.height + this._lineGap;\n                }\n                curIndex++;\n            }\n            for (i = 0; i < childCount; i++) {\n                ii = this._virtualItems[oldFirstIndex + i];\n                if (ii.updateFlag != this.itemInfoVer && ii.obj) {\n                    if (ii.obj instanceof fgui.GButton)\n                        ii.selected = ii.obj.selected;\n                    this.removeChildToPool(ii.obj);\n                    ii.obj = null;\n                }\n            }\n            childCount = this._children.length;\n            for (i = 0; i < childCount; i++) {\n                var obj = this._virtualItems[newFirstIndex + i].obj;\n                if (this._children[i] != obj)\n                    this.setChildIndex(obj, i);\n            }\n            if (deltaSize != 0 || firstItemDeltaSize != 0)\n                this._scrollPane.changeContentSizeOnScrolling(0, deltaSize, 0, firstItemDeltaSize);\n            if (curIndex > 0 && this.numChildren > 0 && this._container.y <= 0 && this.getChildAt(0).y > -this._container.y)\n                return true;\n            else\n                return false;\n        };\n        GList.prototype.handleScroll2 = function (forceUpdate) {\n            var pos = this._scrollPane.scrollingPosX;\n            var max = pos + this._scrollPane.viewWidth;\n            var end = pos == this._scrollPane.contentWidth;\n            s_n = pos;\n            var newFirstIndex = this.getIndexOnPos2(forceUpdate);\n            pos = s_n;\n            if (newFirstIndex == this._firstIndex && !forceUpdate) {\n                return false;\n            }\n            var oldFirstIndex = this._firstIndex;\n            this._firstIndex = newFirstIndex;\n            var curIndex = newFirstIndex;\n            var forward = oldFirstIndex > newFirstIndex;\n            var childCount = this.numChildren;\n            var lastIndex = oldFirstIndex + childCount - 1;\n            var reuseIndex = forward ? lastIndex : oldFirstIndex;\n            var curX = pos, curY = 0;\n            var needRender;\n            var deltaSize = 0;\n            var firstItemDeltaSize = 0;\n            var url = this.defaultItem;\n            var ii, ii2;\n            var i, j;\n            var partSize = (this._scrollPane.viewHeight - this._lineGap * (this._curLineItemCount - 1)) / this._curLineItemCount;\n            this.itemInfoVer++;\n            while (curIndex < this._realNumItems && (end || curX < max)) {\n                ii = this._virtualItems[curIndex];\n                if (ii.obj == null || forceUpdate) {\n                    if (this.itemProvider != null) {\n                        url = this.itemProvider.call(this.callbackThisObj, curIndex % this._numItems);\n                        if (url == null)\n                            url = this._defaultItem;\n                        url = fgui.UIPackage.normalizeURL(url);\n                    }\n                    if (ii.obj && ii.obj.resourceURL != url) {\n                        if (ii.obj instanceof fgui.GButton)\n                            ii.selected = ii.obj.selected;\n                        this.removeChildToPool(ii.obj);\n                        ii.obj = null;\n                    }\n                }\n                if (ii.obj == null) {\n                    if (forward) {\n                        for (j = reuseIndex; j >= oldFirstIndex; j--) {\n                            ii2 = this._virtualItems[j];\n                            if (ii2.obj && ii2.updateFlag != this.itemInfoVer && ii2.obj.resourceURL == url) {\n                                if (ii2.obj instanceof fgui.GButton)\n                                    ii2.selected = ii2.obj.selected;\n                                ii.obj = ii2.obj;\n                                ii2.obj = null;\n                                if (j == reuseIndex)\n                                    reuseIndex--;\n                                break;\n                            }\n                        }\n                    }\n                    else {\n                        for (j = reuseIndex; j <= lastIndex; j++) {\n                            ii2 = this._virtualItems[j];\n                            if (ii2.obj && ii2.updateFlag != this.itemInfoVer && ii2.obj.resourceURL == url) {\n                                if (ii2.obj instanceof fgui.GButton)\n                                    ii2.selected = ii2.obj.selected;\n                                ii.obj = ii2.obj;\n                                ii2.obj = null;\n                                if (j == reuseIndex)\n                                    reuseIndex++;\n                                break;\n                            }\n                        }\n                    }\n                    if (ii.obj) {\n                        this.setChildIndex(ii.obj, forward ? curIndex - newFirstIndex : this.numChildren);\n                    }\n                    else {\n                        ii.obj = this._pool.getObject(url);\n                        if (forward)\n                            this.addChildAt(ii.obj, curIndex - newFirstIndex);\n                        else\n                            this.addChild(ii.obj);\n                    }\n                    if (ii.obj instanceof fgui.GButton)\n                        ii.obj.selected = ii.selected;\n                    needRender = true;\n                }\n                else\n                    needRender = forceUpdate;\n                if (needRender) {\n                    if (this._autoResizeItem && (this._layout == fgui.ListLayoutType.SingleRow || this._lineCount > 0))\n                        ii.obj.setSize(ii.obj.width, partSize, true);\n                    this.itemRenderer.call(this.callbackThisObj, curIndex % this._numItems, ii.obj);\n                    if (curIndex % this._curLineItemCount == 0) {\n                        deltaSize += Math.ceil(ii.obj.width) - ii.width;\n                        if (curIndex == newFirstIndex && oldFirstIndex > newFirstIndex) {\n                            firstItemDeltaSize = Math.ceil(ii.obj.width) - ii.width;\n                        }\n                    }\n                    ii.width = Math.ceil(ii.obj.width);\n                    ii.height = Math.ceil(ii.obj.height);\n                }\n                ii.updateFlag = this.itemInfoVer;\n                ii.obj.setXY(curX, curY);\n                if (curIndex == newFirstIndex)\n                    max += ii.width;\n                curY += ii.height + this._lineGap;\n                if (curIndex % this._curLineItemCount == this._curLineItemCount - 1) {\n                    curY = 0;\n                    curX += ii.width + this._columnGap;\n                }\n                curIndex++;\n            }\n            for (i = 0; i < childCount; i++) {\n                ii = this._virtualItems[oldFirstIndex + i];\n                if (ii.updateFlag != this.itemInfoVer && ii.obj) {\n                    if (ii.obj instanceof fgui.GButton)\n                        ii.selected = ii.obj.selected;\n                    this.removeChildToPool(ii.obj);\n                    ii.obj = null;\n                }\n            }\n            childCount = this._children.length;\n            for (i = 0; i < childCount; i++) {\n                var obj = this._virtualItems[newFirstIndex + i].obj;\n                if (this._children[i] != obj)\n                    this.setChildIndex(obj, i);\n            }\n            if (deltaSize != 0 || firstItemDeltaSize != 0)\n                this._scrollPane.changeContentSizeOnScrolling(deltaSize, 0, firstItemDeltaSize, 0);\n            if (curIndex > 0 && this.numChildren > 0 && this._container.x <= 0 && this.getChildAt(0).x > -this._container.x)\n                return true;\n            else\n                return false;\n        };\n        GList.prototype.handleScroll3 = function (forceUpdate) {\n            var pos = this._scrollPane.scrollingPosX;\n            s_n = pos;\n            var newFirstIndex = this.getIndexOnPos3(forceUpdate);\n            pos = s_n;\n            if (newFirstIndex == this._firstIndex && !forceUpdate)\n                return;\n            var oldFirstIndex = this._firstIndex;\n            this._firstIndex = newFirstIndex;\n            var reuseIndex = oldFirstIndex;\n            var virtualItemCount = this._virtualItems.length;\n            var pageSize = this._curLineItemCount * this._curLineItemCount2;\n            var startCol = newFirstIndex % this._curLineItemCount;\n            var viewWidth = this.viewWidth;\n            var page = Math.floor(newFirstIndex / pageSize);\n            var startIndex = page * pageSize;\n            var lastIndex = startIndex + pageSize * 2;\n            var needRender;\n            var i;\n            var ii, ii2;\n            var col;\n            var url = this._defaultItem;\n            var partWidth = (this._scrollPane.viewWidth - this._columnGap * (this._curLineItemCount - 1)) / this._curLineItemCount;\n            var partHeight = (this._scrollPane.viewHeight - this._lineGap * (this._curLineItemCount2 - 1)) / this._curLineItemCount2;\n            this.itemInfoVer++;\n            for (i = startIndex; i < lastIndex; i++) {\n                if (i >= this._realNumItems)\n                    continue;\n                col = i % this._curLineItemCount;\n                if (i - startIndex < pageSize) {\n                    if (col < startCol)\n                        continue;\n                }\n                else {\n                    if (col > startCol)\n                        continue;\n                }\n                ii = this._virtualItems[i];\n                ii.updateFlag = this.itemInfoVer;\n            }\n            var lastObj;\n            var insertIndex = 0;\n            for (i = startIndex; i < lastIndex; i++) {\n                if (i >= this._realNumItems)\n                    continue;\n                ii = this._virtualItems[i];\n                if (ii.updateFlag != this.itemInfoVer)\n                    continue;\n                if (ii.obj == null) {\n                    while (reuseIndex < virtualItemCount) {\n                        ii2 = this._virtualItems[reuseIndex];\n                        if (ii2.obj && ii2.updateFlag != this.itemInfoVer) {\n                            if (ii2.obj instanceof fgui.GButton)\n                                ii2.selected = ii2.obj.selected;\n                            ii.obj = ii2.obj;\n                            ii2.obj = null;\n                            break;\n                        }\n                        reuseIndex++;\n                    }\n                    if (insertIndex == -1)\n                        insertIndex = this.getChildIndex(lastObj) + 1;\n                    if (ii.obj == null) {\n                        if (this.itemProvider != null) {\n                            url = this.itemProvider.call(this.callbackThisObj, i % this._numItems);\n                            if (url == null)\n                                url = this._defaultItem;\n                            url = fgui.UIPackage.normalizeURL(url);\n                        }\n                        ii.obj = this._pool.getObject(url);\n                        this.addChildAt(ii.obj, insertIndex);\n                    }\n                    else {\n                        insertIndex = this.setChildIndexBefore(ii.obj, insertIndex);\n                    }\n                    insertIndex++;\n                    if (ii.obj instanceof fgui.GButton)\n                        ii.obj.selected = ii.selected;\n                    needRender = true;\n                }\n                else {\n                    needRender = forceUpdate;\n                    insertIndex = -1;\n                    lastObj = ii.obj;\n                }\n                if (needRender) {\n                    if (this._autoResizeItem) {\n                        if (this._curLineItemCount == this._columnCount && this._curLineItemCount2 == this._lineCount)\n                            ii.obj.setSize(partWidth, partHeight, true);\n                        else if (this._curLineItemCount == this._columnCount)\n                            ii.obj.setSize(partWidth, ii.obj.height, true);\n                        else if (this._curLineItemCount2 == this._lineCount)\n                            ii.obj.setSize(ii.obj.width, partHeight, true);\n                    }\n                    this.itemRenderer.call(this.callbackThisObj, i % this._numItems, ii.obj);\n                    ii.width = Math.ceil(ii.obj.width);\n                    ii.height = Math.ceil(ii.obj.height);\n                }\n            }\n            var borderX = (startIndex / pageSize) * viewWidth;\n            var xx = borderX;\n            var yy = 0;\n            var lineHeight = 0;\n            for (i = startIndex; i < lastIndex; i++) {\n                if (i >= this._realNumItems)\n                    continue;\n                ii = this._virtualItems[i];\n                if (ii.updateFlag == this.itemInfoVer)\n                    ii.obj.setXY(xx, yy);\n                if (ii.height > lineHeight)\n                    lineHeight = ii.height;\n                if (i % this._curLineItemCount == this._curLineItemCount - 1) {\n                    xx = borderX;\n                    yy += lineHeight + this._lineGap;\n                    lineHeight = 0;\n                    if (i == startIndex + pageSize - 1) {\n                        borderX += viewWidth;\n                        xx = borderX;\n                        yy = 0;\n                    }\n                }\n                else\n                    xx += ii.width + this._columnGap;\n            }\n            for (i = reuseIndex; i < virtualItemCount; i++) {\n                ii = this._virtualItems[i];\n                if (ii.updateFlag != this.itemInfoVer && ii.obj) {\n                    if (ii.obj instanceof fgui.GButton)\n                        ii.selected = ii.obj.selected;\n                    this.removeChildToPool(ii.obj);\n                    ii.obj = null;\n                }\n            }\n        };\n        GList.prototype.handleArchOrder1 = function () {\n            if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Arch) {\n                var mid = this._scrollPane.posY + this.viewHeight / 2;\n                var minDist = Number.POSITIVE_INFINITY;\n                var dist = 0;\n                var apexIndex = 0;\n                var cnt = this.numChildren;\n                for (var i = 0; i < cnt; i++) {\n                    var obj = this.getChildAt(i);\n                    if (!this.foldInvisibleItems || obj.visible) {\n                        dist = Math.abs(mid - obj.y - obj.height / 2);\n                        if (dist < minDist) {\n                            minDist = dist;\n                            apexIndex = i;\n                        }\n                    }\n                }\n                this.apexIndex = apexIndex;\n            }\n        };\n        GList.prototype.handleArchOrder2 = function () {\n            if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Arch) {\n                var mid = this._scrollPane.posX + this.viewWidth / 2;\n                var minDist = Number.POSITIVE_INFINITY;\n                var dist = 0;\n                var apexIndex = 0;\n                var cnt = this.numChildren;\n                for (var i = 0; i < cnt; i++) {\n                    var obj = this.getChildAt(i);\n                    if (!this.foldInvisibleItems || obj.visible) {\n                        dist = Math.abs(mid - obj.x - obj.width / 2);\n                        if (dist < minDist) {\n                            minDist = dist;\n                            apexIndex = i;\n                        }\n                    }\n                }\n                this.apexIndex = apexIndex;\n            }\n        };\n        GList.prototype.handleAlign = function (contentWidth, contentHeight) {\n            var newOffsetX = 0;\n            var newOffsetY = 0;\n            if (contentHeight < this.viewHeight) {\n                if (this._verticalAlign == fgui.VertAlignType.Middle)\n                    newOffsetY = Math.floor((this.viewHeight - contentHeight) / 2);\n                else if (this._verticalAlign == fgui.VertAlignType.Bottom)\n                    newOffsetY = this.viewHeight - contentHeight;\n            }\n            if (contentWidth < this.viewWidth) {\n                if (this._align == fgui.AlignType.Center)\n                    newOffsetX = Math.floor((this.viewWidth - contentWidth) / 2);\n                else if (this._align == fgui.AlignType.Right)\n                    newOffsetX = this.viewWidth - contentWidth;\n            }\n            if (newOffsetX != this._alignOffset.x || newOffsetY != this._alignOffset.y) {\n                this._alignOffset.setTo(newOffsetX, newOffsetY);\n                if (this._scrollPane)\n                    this._scrollPane.adjustMaskContainer();\n                else {\n                    this._container.x = this._margin.left + this._alignOffset.x;\n                    this._container.y = this._margin.top + this._alignOffset.y;\n                }\n            }\n        };\n        GList.prototype.updateBounds = function () {\n            if (this._virtual)\n                return;\n            var i;\n            var child;\n            var curX = 0;\n            var curY = 0;\n            var maxWidth = 0;\n            var maxHeight = 0;\n            var cw = 0, ch = 0;\n            var j = 0;\n            var page = 0;\n            var k = 0;\n            var cnt = this._children.length;\n            var viewWidth = this.viewWidth;\n            var viewHeight = this.viewHeight;\n            var lineSize = 0;\n            var lineStart = 0;\n            var ratio = 0;\n            if (this._layout == fgui.ListLayoutType.SingleColumn) {\n                for (i = 0; i < cnt; i++) {\n                    child = this.getChildAt(i);\n                    if (this.foldInvisibleItems && !child.visible)\n                        continue;\n                    if (curY != 0)\n                        curY += this._lineGap;\n                    child.y = curY;\n                    if (this._autoResizeItem)\n                        child.setSize(viewWidth, child.height, true);\n                    curY += Math.ceil(child.height);\n                    if (child.width > maxWidth)\n                        maxWidth = child.width;\n                }\n                ch = curY;\n                if (ch <= viewHeight && this._autoResizeItem && this._scrollPane && this._scrollPane._displayInDemand && this._scrollPane.vtScrollBar) {\n                    viewWidth += this._scrollPane.vtScrollBar.width;\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        child.setSize(viewWidth, child.height, true);\n                        if (child.width > maxWidth)\n                            maxWidth = child.width;\n                    }\n                }\n                cw = Math.ceil(maxWidth);\n            }\n            else if (this._layout == fgui.ListLayoutType.SingleRow) {\n                for (i = 0; i < cnt; i++) {\n                    child = this.getChildAt(i);\n                    if (this.foldInvisibleItems && !child.visible)\n                        continue;\n                    if (curX != 0)\n                        curX += this._columnGap;\n                    child.x = curX;\n                    if (this._autoResizeItem)\n                        child.setSize(child.width, viewHeight, true);\n                    curX += Math.ceil(child.width);\n                    if (child.height > maxHeight)\n                        maxHeight = child.height;\n                }\n                cw = curX;\n                if (cw <= viewWidth && this._autoResizeItem && this._scrollPane && this._scrollPane._displayInDemand && this._scrollPane.hzScrollBar) {\n                    viewHeight += this._scrollPane.hzScrollBar.height;\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        child.setSize(child.width, viewHeight, true);\n                        if (child.height > maxHeight)\n                            maxHeight = child.height;\n                    }\n                }\n                ch = Math.ceil(maxHeight);\n            }\n            else if (this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                if (this._autoResizeItem && this._columnCount > 0) {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        lineSize += child.sourceWidth;\n                        j++;\n                        if (j == this._columnCount || i == cnt - 1) {\n                            ratio = (viewWidth - lineSize - (j - 1) * this._columnGap) / lineSize;\n                            curX = 0;\n                            for (j = lineStart; j <= i; j++) {\n                                child = this.getChildAt(j);\n                                if (this.foldInvisibleItems && !child.visible)\n                                    continue;\n                                child.setXY(curX, curY);\n                                if (j < i) {\n                                    child.setSize(child.sourceWidth + Math.round(child.sourceWidth * ratio), child.height, true);\n                                    curX += Math.ceil(child.width) + this._columnGap;\n                                }\n                                else {\n                                    child.setSize(viewWidth - curX, child.height, true);\n                                }\n                                if (child.height > maxHeight)\n                                    maxHeight = child.height;\n                            }\n                            curY += Math.ceil(maxHeight) + this._lineGap;\n                            maxHeight = 0;\n                            j = 0;\n                            lineStart = i + 1;\n                            lineSize = 0;\n                        }\n                    }\n                    ch = curY + Math.ceil(maxHeight);\n                    cw = viewWidth;\n                }\n                else {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        if (curX != 0)\n                            curX += this._columnGap;\n                        if (this._columnCount != 0 && j >= this._columnCount\n                            || this._columnCount == 0 && curX + child.width > viewWidth && maxHeight != 0) {\n                            curX = 0;\n                            curY += Math.ceil(maxHeight) + this._lineGap;\n                            maxHeight = 0;\n                            j = 0;\n                        }\n                        child.setXY(curX, curY);\n                        curX += Math.ceil(child.width);\n                        if (curX > maxWidth)\n                            maxWidth = curX;\n                        if (child.height > maxHeight)\n                            maxHeight = child.height;\n                        j++;\n                    }\n                    ch = curY + Math.ceil(maxHeight);\n                    cw = Math.ceil(maxWidth);\n                }\n            }\n            else if (this._layout == fgui.ListLayoutType.FlowVertical) {\n                if (this._autoResizeItem && this._lineCount > 0) {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        lineSize += child.sourceHeight;\n                        j++;\n                        if (j == this._lineCount || i == cnt - 1) {\n                            ratio = (viewHeight - lineSize - (j - 1) * this._lineGap) / lineSize;\n                            curY = 0;\n                            for (j = lineStart; j <= i; j++) {\n                                child = this.getChildAt(j);\n                                if (this.foldInvisibleItems && !child.visible)\n                                    continue;\n                                child.setXY(curX, curY);\n                                if (j < i) {\n                                    child.setSize(child.width, child.sourceHeight + Math.round(child.sourceHeight * ratio), true);\n                                    curY += Math.ceil(child.height) + this._lineGap;\n                                }\n                                else {\n                                    child.setSize(child.width, viewHeight - curY, true);\n                                }\n                                if (child.width > maxWidth)\n                                    maxWidth = child.width;\n                            }\n                            curX += Math.ceil(maxWidth) + this._columnGap;\n                            maxWidth = 0;\n                            j = 0;\n                            lineStart = i + 1;\n                            lineSize = 0;\n                        }\n                    }\n                    cw = curX + Math.ceil(maxWidth);\n                    ch = viewHeight;\n                }\n                else {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        if (curY != 0)\n                            curY += this._lineGap;\n                        if (this._lineCount != 0 && j >= this._lineCount\n                            || this._lineCount == 0 && curY + child.height > viewHeight && maxWidth != 0) {\n                            curY = 0;\n                            curX += Math.ceil(maxWidth) + this._columnGap;\n                            maxWidth = 0;\n                            j = 0;\n                        }\n                        child.setXY(curX, curY);\n                        curY += Math.ceil(child.height);\n                        if (curY > maxHeight)\n                            maxHeight = curY;\n                        if (child.width > maxWidth)\n                            maxWidth = child.width;\n                        j++;\n                    }\n                    cw = curX + Math.ceil(maxWidth);\n                    ch = Math.ceil(maxHeight);\n                }\n            }\n            else {\n                var eachHeight;\n                if (this._autoResizeItem && this._lineCount > 0)\n                    eachHeight = Math.floor((viewHeight - (this._lineCount - 1) * this._lineGap) / this._lineCount);\n                if (this._autoResizeItem && this._columnCount > 0) {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        if (j == 0 && (this._lineCount != 0 && k >= this._lineCount\n                            || this._lineCount == 0 && curY + (this._lineCount > 0 ? eachHeight : child.height) > viewHeight)) {\n                            page++;\n                            curY = 0;\n                            k = 0;\n                        }\n                        lineSize += child.sourceWidth;\n                        j++;\n                        if (j == this._columnCount || i == cnt - 1) {\n                            ratio = (viewWidth - lineSize - (j - 1) * this._columnGap) / lineSize;\n                            curX = 0;\n                            for (j = lineStart; j <= i; j++) {\n                                child = this.getChildAt(j);\n                                if (this.foldInvisibleItems && !child.visible)\n                                    continue;\n                                child.setXY(page * viewWidth + curX, curY);\n                                if (j < i) {\n                                    child.setSize(child.sourceWidth + Math.round(child.sourceWidth * ratio), this._lineCount > 0 ? eachHeight : child.height, true);\n                                    curX += Math.ceil(child.width) + this._columnGap;\n                                }\n                                else {\n                                    child.setSize(viewWidth - curX, this._lineCount > 0 ? eachHeight : child.height, true);\n                                }\n                                if (child.height > maxHeight)\n                                    maxHeight = child.height;\n                            }\n                            curY += Math.ceil(maxHeight) + this._lineGap;\n                            maxHeight = 0;\n                            j = 0;\n                            lineStart = i + 1;\n                            lineSize = 0;\n                            k++;\n                        }\n                    }\n                }\n                else {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        if (curX != 0)\n                            curX += this._columnGap;\n                        if (this._autoResizeItem && this._lineCount > 0)\n                            child.setSize(child.width, eachHeight, true);\n                        if (this._columnCount != 0 && j >= this._columnCount\n                            || this._columnCount == 0 && curX + child.width > viewWidth && maxHeight != 0) {\n                            curX = 0;\n                            curY += Math.ceil(maxHeight) + this._lineGap;\n                            maxHeight = 0;\n                            j = 0;\n                            k++;\n                            if (this._lineCount != 0 && k >= this._lineCount\n                                || this._lineCount == 0 && curY + child.height > viewHeight && maxWidth != 0) {\n                                page++;\n                                curY = 0;\n                                k = 0;\n                            }\n                        }\n                        child.setXY(page * viewWidth + curX, curY);\n                        curX += Math.ceil(child.width);\n                        if (curX > maxWidth)\n                            maxWidth = curX;\n                        if (child.height > maxHeight)\n                            maxHeight = child.height;\n                        j++;\n                    }\n                }\n                ch = page > 0 ? viewHeight : curY + Math.ceil(maxHeight);\n                cw = (page + 1) * viewWidth;\n            }\n            this.handleAlign(cw, ch);\n            this.setBounds(0, 0, cw, ch);\n        };\n        GList.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            this._layout = buffer.readByte();\n            this._selectionMode = buffer.readByte();\n            this._align = buffer.readByte();\n            this._verticalAlign = buffer.readByte();\n            this._lineGap = buffer.readShort();\n            this._columnGap = buffer.readShort();\n            this._lineCount = buffer.readShort();\n            this._columnCount = buffer.readShort();\n            this._autoResizeItem = buffer.readBool();\n            this._childrenRenderOrder = buffer.readByte();\n            this._apexIndex = buffer.readShort();\n            if (buffer.readBool()) {\n                this._margin.top = buffer.readInt();\n                this._margin.bottom = buffer.readInt();\n                this._margin.left = buffer.readInt();\n                this._margin.right = buffer.readInt();\n            }\n            var overflow = buffer.readByte();\n            if (overflow == fgui.OverflowType.Scroll) {\n                var savedPos = buffer.position;\n                buffer.seek(beginPos, 7);\n                this.setupScroll(buffer);\n                buffer.position = savedPos;\n            }\n            else\n                this.setupOverflow(overflow);\n            if (buffer.readBool())\n                buffer.skip(8);\n            if (buffer.version >= 2) {\n                this.scrollItemToViewOnClick = buffer.readBool();\n                this.foldInvisibleItems = buffer.readBool();\n            }\n            buffer.seek(beginPos, 8);\n            this._defaultItem = buffer.readS();\n            this.readItems(buffer);\n        };\n        GList.prototype.readItems = function (buffer) {\n            var cnt;\n            var i;\n            var nextPos;\n            var str;\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                str = buffer.readS();\n                if (str == null) {\n                    str = this.defaultItem;\n                    if (!str) {\n                        buffer.position = nextPos;\n                        continue;\n                    }\n                }\n                var obj = this.getFromPool(str);\n                if (obj != null) {\n                    this.addChild(obj);\n                    this.setupItem(buffer, obj);\n                }\n                buffer.position = nextPos;\n            }\n        };\n        GList.prototype.setupItem = function (buffer, obj) {\n            var str;\n            str = buffer.readS();\n            if (str != null)\n                obj.text = str;\n            str = buffer.readS();\n            if (str != null && (obj instanceof fgui.GButton))\n                obj.selectedTitle = str;\n            str = buffer.readS();\n            if (str != null)\n                obj.icon = str;\n            str = buffer.readS();\n            if (str != null && (obj instanceof fgui.GButton))\n                obj.selectedIcon = str;\n            str = buffer.readS();\n            if (str != null)\n                obj.name = str;\n            var cnt;\n            var i;\n            if (obj instanceof fgui.GComponent) {\n                cnt = buffer.readShort();\n                for (i = 0; i < cnt; i++) {\n                    var cc = obj.getController(buffer.readS());\n                    str = buffer.readS();\n                    if (cc)\n                        cc.selectedPageId = str;\n                }\n                if (buffer.version >= 2) {\n                    cnt = buffer.readShort();\n                    for (i = 0; i < cnt; i++) {\n                        var target = buffer.readS();\n                        var propertyId = buffer.readShort();\n                        var value = buffer.readS();\n                        var obj2 = obj.getChildByPath(target);\n                        if (obj2)\n                            obj2.setProp(propertyId, value);\n                    }\n                }\n            }\n        };\n        GList.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 6);\n            var i = buffer.readShort();\n            if (i != -1)\n                this._selectionController = this.parent.getControllerAt(i);\n        };\n        return GList;\n    }(fgui.GComponent));\n    fgui.GList = GList;\n    var s_n = 0;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GObjectPool = (function () {\n        function GObjectPool() {\n            this._count = 0;\n            this._pool = {};\n        }\n        GObjectPool.prototype.clear = function () {\n            for (var i1 in this._pool) {\n                var arr = this._pool[i1];\n                var cnt = arr.length;\n                for (var i = 0; i < cnt; i++)\n                    arr[i].dispose();\n            }\n            this._pool = {};\n            this._count = 0;\n        };\n        Object.defineProperty(GObjectPool.prototype, \"count\", {\n            get: function () {\n                return this._count;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObjectPool.prototype.getObject = function (url) {\n            url = fgui.UIPackage.normalizeURL(url);\n            if (url == null)\n                return null;\n            var arr = this._pool[url];\n            if (arr && arr.length) {\n                this._count--;\n                return arr.shift();\n            }\n            var child = fgui.UIPackage.createObjectFromURL(url);\n            return child;\n        };\n        GObjectPool.prototype.returnObject = function (obj) {\n            var url = obj.resourceURL;\n            if (!url)\n                return;\n            var arr = this._pool[url];\n            if (arr == null) {\n                arr = new Array();\n                this._pool[url] = arr;\n            }\n            this._count++;\n            arr.push(obj);\n        };\n        return GObjectPool;\n    }());\n    fgui.GObjectPool = GObjectPool;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GLoader = (function (_super_1) {\n        __extends(GLoader, _super_1);\n        function GLoader() {\n            var _this = _super_1.call(this) || this;\n            _this._url = \"\";\n            _this._fill = fgui.LoaderFillType.None;\n            _this._align = fgui.AlignType.Left;\n            _this._verticalAlign = fgui.VertAlignType.Top;\n            _this._showErrorSign = true;\n            return _this;\n        }\n        GLoader.prototype.createDisplayObject = function () {\n            this._container = new fgui.UIContainer();\n            this._container.opaque = true;\n            this.setDisplayObject(this._container);\n            this._content = new fgui.MovieClip();\n            this._container.addChild(this._content);\n        };\n        GLoader.prototype.dispose = function () {\n            if (!this._contentItem) {\n                var texture = this._content.texture;\n                if (texture)\n                    this.freeExternal(texture);\n            }\n            if (this._content2)\n                this._content2.dispose();\n            _super_1.prototype.dispose.call(this);\n        };\n        Object.defineProperty(GLoader.prototype, \"url\", {\n            get: function () {\n                return this._url;\n            },\n            set: function (value) {\n                if (this._url == value)\n                    return;\n                this.clearContent();\n                this._url = value;\n                this.loadContent();\n                this.updateGear(7);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"icon\", {\n            get: function () {\n                return this._url;\n            },\n            set: function (value) {\n                this.url = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"align\", {\n            get: function () {\n                return this._align;\n            },\n            set: function (value) {\n                if (this._align != value) {\n                    this._align = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"verticalAlign\", {\n            get: function () {\n                return this._verticalAlign;\n            },\n            set: function (value) {\n                if (this._verticalAlign != value) {\n                    this._verticalAlign = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"fill\", {\n            get: function () {\n                return this._fill;\n            },\n            set: function (value) {\n                if (this._fill != value) {\n                    this._fill = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"shrinkOnly\", {\n            get: function () {\n                return this._shrinkOnly;\n            },\n            set: function (value) {\n                if (this._shrinkOnly != value) {\n                    this._shrinkOnly = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"autoSize\", {\n            get: function () {\n                return this._autoSize;\n            },\n            set: function (value) {\n                if (this._autoSize != value) {\n                    this._autoSize = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"playing\", {\n            get: function () {\n                return this._content.playing;\n            },\n            set: function (value) {\n                if (this._content.playing != value) {\n                    this._content.playing = value;\n                    this.updateGear(5);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"frame\", {\n            get: function () {\n                return this._content.frame;\n            },\n            set: function (value) {\n                if (this._content.frame != value) {\n                    this._content.frame = value;\n                    this.updateGear(5);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"color\", {\n            get: function () {\n                return this._content.color;\n            },\n            set: function (value) {\n                if (this._content.color != value) {\n                    this._content.color = value;\n                    this.updateGear(4);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"showErrorSign\", {\n            get: function () {\n                return this._showErrorSign;\n            },\n            set: function (value) {\n                this._showErrorSign = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"content\", {\n            get: function () {\n                return this._content;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"component\", {\n            get: function () {\n                return this._content2;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"texture\", {\n            get: function () {\n                return this._content.texture;\n            },\n            set: function (value) {\n                this.url = null;\n                this._content.frames = null;\n                this._content.texture = value;\n                if (value) {\n                    this.sourceWidth = value.textureWidth;\n                    this.sourceHeight = value.textureHeight;\n                }\n                else {\n                    this.sourceWidth = this.sourceHeight = 0;\n                }\n                this.updateLayout();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"fillMethod\", {\n            get: function () {\n                return this._content.fillMethod;\n            },\n            set: function (value) {\n                this._content.fillMethod = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"fillOrigin\", {\n            get: function () {\n                return this._content.fillOrigin;\n            },\n            set: function (value) {\n                this._content.fillOrigin = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"fillClockwise\", {\n            get: function () {\n                return this._content.fillClockwise;\n            },\n            set: function (value) {\n                this._content.fillClockwise = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"fillAmount\", {\n            get: function () {\n                return this._content.fillAmount;\n            },\n            set: function (value) {\n                this._content.fillAmount = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GLoader.prototype.loadContent = function () {\n            if (!this._url)\n                return;\n            if (fgui.ToolSet.startsWith(this._url, \"ui://\"))\n                this.loadFromPackage(this._url);\n            else\n                this.loadExternal();\n        };\n        GLoader.prototype.loadFromPackage = function (itemURL) {\n            this._contentItem = fgui.UIPackage.getItemByURL(itemURL);\n            if (this._contentItem) {\n                this._contentItem = this._contentItem.getBranch();\n                this.sourceWidth = this._contentItem.width;\n                this.sourceHeight = this._contentItem.height;\n                this._contentItem = this._contentItem.getHighResolution();\n                this._contentItem.load();\n                if (this._autoSize)\n                    this.setSize(this.sourceWidth, this.sourceHeight);\n                if (this._contentItem.type == fgui.PackageItemType.Image) {\n                    if (this._contentItem.asset == null) {\n                        this.setErrorState();\n                    }\n                    else {\n                        this._content.texture = this._contentItem.asset;\n                        this._content.scale9Grid = this._contentItem.scale9Grid;\n                        if (this._contentItem.scaleByTile)\n                            this._content.fillMode = egret.BitmapFillMode.REPEAT;\n                        else\n                            this._content.fillMode = egret.BitmapFillMode.SCALE;\n                        this.updateLayout();\n                    }\n                }\n                else if (this._contentItem.type == fgui.PackageItemType.MovieClip) {\n                    this._content.interval = this._contentItem.interval;\n                    this._content.swing = this._contentItem.swing;\n                    this._content.repeatDelay = this._contentItem.repeatDelay;\n                    this._content.frames = this._contentItem.frames;\n                    this.updateLayout();\n                }\n                else if (this._contentItem.type == fgui.PackageItemType.Component) {\n                    var obj = fgui.UIPackage.createObjectFromURL(itemURL);\n                    if (!obj)\n                        this.setErrorState();\n                    else if (!(obj instanceof fgui.GComponent)) {\n                        obj.dispose();\n                        this.setErrorState();\n                    }\n                    else {\n                        this._content2 = obj.asCom;\n                        this._container.addChild(this._content2.displayObject);\n                        this.updateLayout();\n                    }\n                }\n                else\n                    this.setErrorState();\n            }\n            else\n                this.setErrorState();\n        };\n        GLoader.prototype.loadExternal = function () {\n            RES.getResByUrl(this._url, this.__getResCompleted, this);\n        };\n        GLoader.prototype.freeExternal = function (texture) {\n        };\n        GLoader.prototype.onExternalLoadSuccess = function (texture) {\n            this._content.texture = texture;\n            this._content.scale9Grid = null;\n            this._content.fillMode = egret.BitmapFillMode.SCALE;\n            this.sourceWidth = texture.textureWidth;\n            this.sourceHeight = texture.textureHeight;\n            this.updateLayout();\n        };\n        GLoader.prototype.onExternalLoadFailed = function () {\n            this.setErrorState();\n        };\n        GLoader.prototype.__getResCompleted = function (res, key) {\n            if (res instanceof egret.Texture)\n                this.onExternalLoadSuccess(res);\n            else\n                this.onExternalLoadFailed();\n        };\n        GLoader.prototype.setErrorState = function () {\n            if (!this._showErrorSign)\n                return;\n            if (this._errorSign == null) {\n                if (fgui.UIConfig.loaderErrorSign != null) {\n                    this._errorSign = GLoader._errorSignPool.getObject(fgui.UIConfig.loaderErrorSign);\n                }\n            }\n            if (this._errorSign) {\n                this._errorSign.setSize(this.width, this.height);\n                this._container.addChild(this._errorSign.displayObject);\n            }\n        };\n        GLoader.prototype.clearErrorState = function () {\n            if (this._errorSign) {\n                this._container.removeChild(this._errorSign.displayObject);\n                GLoader._errorSignPool.returnObject(this._errorSign);\n                this._errorSign = null;\n            }\n        };\n        GLoader.prototype.updateLayout = function () {\n            if (!this._content2 && !this._content) {\n                if (this._autoSize) {\n                    this._updatingLayout = true;\n                    this.setSize(50, 30);\n                    this._updatingLayout = false;\n                }\n                return;\n            }\n            var cw = this.sourceWidth;\n            var ch = this.sourceHeight;\n            if (this._autoSize) {\n                this._updatingLayout = true;\n                if (cw == 0)\n                    cw = 50;\n                if (ch == 0)\n                    ch = 30;\n                this.setSize(cw, ch);\n                this._updatingLayout = false;\n                if (cw == this._width && ch == this._height) {\n                    if (this._content2) {\n                        this._content2.setXY(0, 0);\n                        this._content2.setScale(1, 1);\n                    }\n                    else {\n                        this._content.x = 0;\n                        this._content.y = 0;\n                        this._content.width = cw;\n                        this._content.height = ch;\n                    }\n                    return;\n                }\n            }\n            var sx = 1, sy = 1;\n            if (this._fill != fgui.LoaderFillType.None) {\n                sx = this.width / this.sourceWidth;\n                sy = this.height / this.sourceHeight;\n                if (sx != 1 || sy != 1) {\n                    if (this._fill == fgui.LoaderFillType.ScaleMatchHeight)\n                        sx = sy;\n                    else if (this._fill == fgui.LoaderFillType.ScaleMatchWidth)\n                        sy = sx;\n                    else if (this._fill == fgui.LoaderFillType.Scale) {\n                        if (sx > sy)\n                            sx = sy;\n                        else\n                            sy = sx;\n                    }\n                    else if (this._fill == fgui.LoaderFillType.ScaleNoBorder) {\n                        if (sx > sy)\n                            sy = sx;\n                        else\n                            sx = sy;\n                    }\n                    if (this._shrinkOnly) {\n                        if (sx > 1)\n                            sx = 1;\n                        if (sy > 1)\n                            sy = 1;\n                    }\n                    cw = this.sourceWidth * sx;\n                    ch = this.sourceHeight * sy;\n                }\n            }\n            if (this._content2) {\n                this._content2.setScale(sx, sy);\n            }\n            else {\n                this._content.width = cw;\n                this._content.height = ch;\n            }\n            var nx, ny;\n            if (this._align == fgui.AlignType.Center)\n                nx = Math.floor((this.width - cw) / 2);\n            else if (this._align == fgui.AlignType.Right)\n                nx = this.width - cw;\n            else\n                nx = 0;\n            if (this._verticalAlign == fgui.VertAlignType.Middle)\n                ny = Math.floor((this.height - ch) / 2);\n            else if (this._verticalAlign == fgui.VertAlignType.Bottom)\n                ny = this.height - ch;\n            else\n                ny = 0;\n            if (this._content2)\n                this._content2.setXY(nx, ny);\n            else {\n                this._content.x = nx;\n                this._content.y = ny;\n            }\n        };\n        GLoader.prototype.clearContent = function () {\n            this.clearErrorState();\n            if (!this._contentItem && this._content.texture) {\n                this.freeExternal(this._content.texture);\n            }\n            this._content.texture = null;\n            this._content.frames = null;\n            if (this._content2) {\n                this._container.removeChild(this._content2.displayObject);\n                this._content2.dispose();\n                this._content2 = null;\n            }\n            this._contentItem = null;\n        };\n        GLoader.prototype.handleSizeChanged = function () {\n            _super_1.prototype.handleSizeChanged.call(this);\n            if (!this._updatingLayout)\n                this.updateLayout();\n        };\n        GLoader.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    return this.color;\n                case fgui.ObjectPropID.Playing:\n                    return this.playing;\n                case fgui.ObjectPropID.Frame:\n                    return this.frame;\n                case fgui.ObjectPropID.TimeScale:\n                    return this._content.timeScale;\n                default:\n                    return _super_1.prototype.getProp.call(this, index);\n            }\n        };\n        GLoader.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    this.color = value;\n                    break;\n                case fgui.ObjectPropID.Playing:\n                    this.playing = value;\n                    break;\n                case fgui.ObjectPropID.Frame:\n                    this.frame = value;\n                    break;\n                case fgui.ObjectPropID.TimeScale:\n                    this._content.timeScale = value;\n                    break;\n                case fgui.ObjectPropID.DeltaTime:\n                    this._content.advance(value);\n                    break;\n                default:\n                    _super_1.prototype.setProp.call(this, index, value);\n                    break;\n            }\n        };\n        GLoader.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            this._url = buffer.readS();\n            this._align = buffer.readByte();\n            this._verticalAlign = buffer.readByte();\n            this._fill = buffer.readByte();\n            this._shrinkOnly = buffer.readBool();\n            this._autoSize = buffer.readBool();\n            this._showErrorSign = buffer.readBool();\n            this._content.playing = buffer.readBool();\n            this._content.frame = buffer.readInt();\n            if (buffer.readBool())\n                this.color = buffer.readColor();\n            this._content.fillMethod = buffer.readByte();\n            if (this._content.fillMethod != 0) {\n                this._content.fillOrigin = buffer.readByte();\n                this._content.fillClockwise = buffer.readBool();\n                this._content.fillAmount = buffer.readFloat();\n            }\n            if (this._url)\n                this.loadContent();\n        };\n        GLoader._errorSignPool = new fgui.GObjectPool();\n        return GLoader;\n    }(fgui.GObject));\n    fgui.GLoader = GLoader;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GLoader3D = (function (_super_1) {\n        __extends(GLoader3D, _super_1);\n        function GLoader3D() {\n            var _this = _super_1.call(this) || this;\n            _this._frame = 0;\n            _this._playing = true;\n            _this._url = \"\";\n            _this._fill = fgui.LoaderFillType.None;\n            _this._align = fgui.AlignType.Left;\n            _this._verticalAlign = fgui.VertAlignType.Top;\n            _this._color = 0xFFFFFF;\n            return _this;\n        }\n        GLoader3D.prototype.createDisplayObject = function () {\n            var d = new fgui.UIContainer();\n            d.opaque = true;\n            this.setDisplayObject(d);\n            this._container = new egret.DisplayObjectContainer();\n            d.addChild(this._container);\n        };\n        GLoader3D.prototype.dispose = function () {\n            _super_1.prototype.dispose.call(this);\n        };\n        Object.defineProperty(GLoader3D.prototype, \"url\", {\n            get: function () {\n                return this._url;\n            },\n            set: function (value) {\n                if (this._url == value)\n                    return;\n                this._url = value;\n                this.loadContent();\n                this.updateGear(7);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"icon\", {\n            get: function () {\n                return this._url;\n            },\n            set: function (value) {\n                this.url = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"align\", {\n            get: function () {\n                return this._align;\n            },\n            set: function (value) {\n                if (this._align != value) {\n                    this._align = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"verticalAlign\", {\n            get: function () {\n                return this._verticalAlign;\n            },\n            set: function (value) {\n                if (this._verticalAlign != value) {\n                    this._verticalAlign = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"fill\", {\n            get: function () {\n                return this._fill;\n            },\n            set: function (value) {\n                if (this._fill != value) {\n                    this._fill = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"shrinkOnly\", {\n            get: function () {\n                return this._shrinkOnly;\n            },\n            set: function (value) {\n                if (this._shrinkOnly != value) {\n                    this._shrinkOnly = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"autoSize\", {\n            get: function () {\n                return this._autoSize;\n            },\n            set: function (value) {\n                if (this._autoSize != value) {\n                    this._autoSize = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"playing\", {\n            get: function () {\n                return this._playing;\n            },\n            set: function (value) {\n                if (this._playing != value) {\n                    this._playing = value;\n                    this.updateGear(5);\n                    this.onChange();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"frame\", {\n            get: function () {\n                return this._frame;\n            },\n            set: function (value) {\n                if (this._frame != value) {\n                    this._frame = value;\n                    this.updateGear(5);\n                    this.onChange();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"animationName\", {\n            get: function () {\n                return this._animationName;\n            },\n            set: function (value) {\n                if (this._animationName != value) {\n                    this._animationName = value;\n                    this.onChange();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"skinName\", {\n            get: function () {\n                return this._skinName;\n            },\n            set: function (value) {\n                if (this._skinName != value) {\n                    this._skinName = value;\n                    this.onChange();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"loop\", {\n            get: function () {\n                return this._loop;\n            },\n            set: function (value) {\n                if (this._loop != value) {\n                    this._loop = value;\n                    this.onChange();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"color\", {\n            get: function () {\n                return this._color;\n            },\n            set: function (value) {\n                if (this._color != value) {\n                    this._color = value;\n                    this.updateGear(4);\n                    if (this._content)\n                        this._content.tint = value;\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"content\", {\n            get: function () {\n                return this._content;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GLoader3D.prototype.loadContent = function () {\n            this.clearContent();\n            if (!this._url)\n                return;\n            if (fgui.ToolSet.startsWith(this._url, \"ui://\"))\n                this.loadFromPackage(this._url);\n            else\n                this.loadExternal();\n        };\n        GLoader3D.prototype.loadFromPackage = function (itemURL) {\n            this._contentItem = fgui.UIPackage.getItemByURL(itemURL);\n            if (this._contentItem) {\n                this._contentItem = this._contentItem.getBranch();\n                this.sourceWidth = this._contentItem.width;\n                this.sourceHeight = this._contentItem.height;\n                this._contentItem = this._contentItem.getHighResolution();\n                if (this._autoSize)\n                    this.setSize(this.sourceWidth, this.sourceHeight);\n                if (this._contentItem.type == fgui.PackageItemType.Spine || this._contentItem.type == fgui.PackageItemType.DragonBones)\n                    this._contentItem.owner.getItemAssetAsync(this._contentItem, this.onLoaded.bind(this));\n            }\n        };\n        GLoader3D.prototype.onLoaded = function (err, item) {\n            if (this._contentItem != item)\n                return;\n            if (err)\n                console.warn(err);\n            if (!this._contentItem.asset)\n                return;\n            if (this._contentItem.type == fgui.PackageItemType.DragonBones) {\n                var asset = this._contentItem.asset;\n                this.setDragonBones(this._contentItem.armatureName, asset.data.name, asset.atlasData.name, this._skinName, this._contentItem.skeletonAnchor);\n            }\n        };\n        GLoader3D.prototype.setDragonBones = function (armatureName, dragonBonesName, skinName, textureAtlasName, anchor) {\n            this.url = null;\n            var egretFactory = dragonBones.EgretFactory.factory;\n            this._content = egretFactory.buildArmatureDisplay(armatureName, dragonBonesName, skinName, textureAtlasName);\n            this._container.addChild(this._content);\n            this._content.x = anchor.x;\n            this._content.y = anchor.y;\n            this._content.tint = this._color;\n            this.onChangeDragonBones();\n            this.updateLayout();\n        };\n        GLoader3D.prototype.onChange = function () {\n            this.onChangeDragonBones();\n        };\n        GLoader3D.prototype.onChangeDragonBones = function () {\n            if (!(this._content instanceof dragonBones.EgretArmatureDisplay))\n                return;\n            if (this._animationName) {\n                if (this._playing)\n                    this._content.animation.play(this._animationName, this._loop ? 0 : 1);\n                else\n                    this._content.animation.gotoAndStopByFrame(this._animationName, this._frame);\n            }\n            else\n                this._content.animation.reset();\n        };\n        GLoader3D.prototype.loadExternal = function () {\n        };\n        GLoader3D.prototype.updateLayout = function () {\n            var cw = this.sourceWidth;\n            var ch = this.sourceHeight;\n            if (this._autoSize) {\n                this._updatingLayout = true;\n                if (cw == 0)\n                    cw = 50;\n                if (ch == 0)\n                    ch = 30;\n                this.setSize(cw, ch);\n                this._updatingLayout = false;\n                if (cw == this._width && ch == this._height) {\n                    this._container.scaleX = this._container.scaleY = 1;\n                    this._container.x = this._container.y = 0;\n                    return;\n                }\n            }\n            var sx = 1, sy = 1;\n            if (this._fill != fgui.LoaderFillType.None) {\n                sx = this.width / this.sourceWidth;\n                sy = this.height / this.sourceHeight;\n                if (sx != 1 || sy != 1) {\n                    if (this._fill == fgui.LoaderFillType.ScaleMatchHeight)\n                        sx = sy;\n                    else if (this._fill == fgui.LoaderFillType.ScaleMatchWidth)\n                        sy = sx;\n                    else if (this._fill == fgui.LoaderFillType.Scale) {\n                        if (sx > sy)\n                            sx = sy;\n                        else\n                            sy = sx;\n                    }\n                    else if (this._fill == fgui.LoaderFillType.ScaleNoBorder) {\n                        if (sx > sy)\n                            sy = sx;\n                        else\n                            sx = sy;\n                    }\n                    if (this._shrinkOnly) {\n                        if (sx > 1)\n                            sx = 1;\n                        if (sy > 1)\n                            sy = 1;\n                    }\n                    cw = this.sourceWidth * sx;\n                    ch = this.sourceHeight * sy;\n                }\n            }\n            this._container.scaleX = sx;\n            this._container.scaleY = sy;\n            var nx, ny;\n            if (this._align == fgui.AlignType.Center)\n                nx = Math.floor((this.width - cw) / 2);\n            else if (this._align == fgui.AlignType.Right)\n                nx = this.width - cw;\n            else\n                nx = 0;\n            if (this._verticalAlign == fgui.VertAlignType.Middle)\n                ny = Math.floor((this.height - ch) / 2);\n            else if (this._verticalAlign == fgui.VertAlignType.Bottom)\n                ny = this.height - ch;\n            else\n                ny = 0;\n            this._container.x = nx;\n            this._container.y = ny;\n        };\n        GLoader3D.prototype.clearContent = function () {\n            this._contentItem = null;\n            if (this._content) {\n                this._container.removeChild(this._content);\n                if ('dispose' in this._content)\n                    this._content.dispose();\n                this._content = null;\n            }\n        };\n        GLoader3D.prototype.handleSizeChanged = function () {\n            _super_1.prototype.handleSizeChanged.call(this);\n            if (!this._updatingLayout)\n                this.updateLayout();\n        };\n        GLoader3D.prototype.handleGrayedChanged = function () {\n        };\n        GLoader3D.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    return this.color;\n                case fgui.ObjectPropID.Playing:\n                    return this.playing;\n                case fgui.ObjectPropID.Frame:\n                    return this.frame;\n                case fgui.ObjectPropID.TimeScale:\n                    return 1;\n                default:\n                    return _super_1.prototype.getProp.call(this, index);\n            }\n        };\n        GLoader3D.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    this.color = value;\n                    break;\n                case fgui.ObjectPropID.Playing:\n                    this.playing = value;\n                    break;\n                case fgui.ObjectPropID.Frame:\n                    this.frame = value;\n                    break;\n                case fgui.ObjectPropID.TimeScale:\n                    break;\n                case fgui.ObjectPropID.DeltaTime:\n                    break;\n                default:\n                    _super_1.prototype.setProp.call(this, index, value);\n                    break;\n            }\n        };\n        GLoader3D.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            this._url = buffer.readS();\n            this._align = buffer.readByte();\n            this._verticalAlign = buffer.readByte();\n            this._fill = buffer.readByte();\n            this._shrinkOnly = buffer.readBool();\n            this._autoSize = buffer.readBool();\n            this._animationName = buffer.readS();\n            this._skinName = buffer.readS();\n            this._playing = buffer.readBool();\n            this._frame = buffer.readInt();\n            this._loop = buffer.readBool();\n            if (buffer.readBool())\n                this.color = buffer.readColor();\n            if (this._url)\n                this.loadContent();\n        };\n        return GLoader3D;\n    }(fgui.GObject));\n    fgui.GLoader3D = GLoader3D;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GMovieClip = (function (_super_1) {\n        __extends(GMovieClip, _super_1);\n        function GMovieClip() {\n            return _super_1.call(this) || this;\n        }\n        Object.defineProperty(GMovieClip.prototype, \"color\", {\n            get: function () {\n                return this._content.color;\n            },\n            set: function (value) {\n                if (this._content.color != value) {\n                    this._content.color = value;\n                    this.updateGear(4);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GMovieClip.prototype.createDisplayObject = function () {\n            this._content = new fgui.MovieClip();\n            this._content.touchEnabled = false;\n            this.setDisplayObject(this._content);\n        };\n        Object.defineProperty(GMovieClip.prototype, \"playing\", {\n            get: function () {\n                return this._content.playing;\n            },\n            set: function (value) {\n                if (this._content.playing != value) {\n                    this._content.playing = value;\n                    this.updateGear(5);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GMovieClip.prototype, \"frame\", {\n            get: function () {\n                return this._content.frame;\n            },\n            set: function (value) {\n                if (this._content.frame != value) {\n                    this._content.frame = value;\n                    this.updateGear(5);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GMovieClip.prototype, \"timeScale\", {\n            get: function () {\n                return this._content.timeScale;\n            },\n            set: function (value) {\n                this._content.timeScale = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GMovieClip.prototype.rewind = function () {\n            this._content.rewind();\n        };\n        GMovieClip.prototype.syncStatus = function (anotherMc) {\n            this._content.syncStatus(anotherMc._content);\n        };\n        GMovieClip.prototype.advance = function (timeInMiniseconds) {\n            this._content.advance(timeInMiniseconds);\n        };\n        GMovieClip.prototype.setPlaySettings = function (start, end, times, endAt, endCallback, callbackObj) {\n            this._content.setPlaySettings(start, end, times, endAt, endCallback, callbackObj);\n        };\n        GMovieClip.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    return this.color;\n                case fgui.ObjectPropID.Playing:\n                    return this.playing;\n                case fgui.ObjectPropID.Frame:\n                    return this.frame;\n                case fgui.ObjectPropID.TimeScale:\n                    return this.timeScale;\n                default:\n                    return _super_1.prototype.getProp.call(this, index);\n            }\n        };\n        GMovieClip.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    this.color = value;\n                    break;\n                case fgui.ObjectPropID.Playing:\n                    this.playing = value;\n                    break;\n                case fgui.ObjectPropID.Frame:\n                    this.frame = value;\n                    break;\n                case fgui.ObjectPropID.TimeScale:\n                    this.timeScale = value;\n                    break;\n                case fgui.ObjectPropID.DeltaTime:\n                    this.advance(value);\n                    break;\n                default:\n                    _super_1.prototype.setProp.call(this, index, value);\n                    break;\n            }\n        };\n        GMovieClip.prototype.constructFromResource = function () {\n            var contentItem = this.packageItem.getBranch();\n            this.sourceWidth = contentItem.width;\n            this.sourceHeight = contentItem.height;\n            this.initWidth = this.sourceWidth;\n            this.initHeight = this.sourceHeight;\n            this.setSize(this.sourceWidth, this.sourceHeight);\n            contentItem = contentItem.getHighResolution();\n            contentItem.load();\n            this._content.interval = contentItem.interval;\n            this._content.swing = contentItem.swing;\n            this._content.repeatDelay = contentItem.repeatDelay;\n            this._content.frames = contentItem.frames;\n            this._content.smoothing = contentItem.smoothing;\n        };\n        GMovieClip.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            if (buffer.readBool())\n                this.color = buffer.readColor();\n            buffer.readByte();\n            this._content.frame = buffer.readInt();\n            this._content.playing = buffer.readBool();\n        };\n        return GMovieClip;\n    }(fgui.GObject));\n    fgui.GMovieClip = GMovieClip;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GProgressBar = (function (_super_1) {\n        __extends(GProgressBar, _super_1);\n        function GProgressBar() {\n            var _this = _super_1.call(this) || this;\n            _this._min = 0;\n            _this._max = 0;\n            _this._value = 0;\n            _this._barMaxWidth = 0;\n            _this._barMaxHeight = 0;\n            _this._barMaxWidthDelta = 0;\n            _this._barMaxHeightDelta = 0;\n            _this._barStartX = 0;\n            _this._barStartY = 0;\n            _this._titleType = fgui.ProgressTitleType.Percent;\n            _this._value = 50;\n            _this._max = 100;\n            return _this;\n        }\n        Object.defineProperty(GProgressBar.prototype, \"titleType\", {\n            get: function () {\n                return this._titleType;\n            },\n            set: function (value) {\n                if (this._titleType != value) {\n                    this._titleType = value;\n                    this.update(this._value);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GProgressBar.prototype, \"min\", {\n            get: function () {\n                return this._min;\n            },\n            set: function (value) {\n                if (this._min != value) {\n                    this._min = value;\n                    this.update(this._value);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GProgressBar.prototype, \"max\", {\n            get: function () {\n                return this._max;\n            },\n            set: function (value) {\n                if (this._max != value) {\n                    this._max = value;\n                    this.update(this._value);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GProgressBar.prototype, \"value\", {\n            get: function () {\n                return this._value;\n            },\n            set: function (value) {\n                if (this._value != value) {\n                    fgui.GTween.kill(this, false, this.update);\n                    this._value = value;\n                    this.update(value);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GProgressBar.prototype.tweenValue = function (value, duration) {\n            var oldValule;\n            var tweener = fgui.GTween.getTween(this, this.update);\n            if (tweener) {\n                oldValule = tweener.value.x;\n                tweener.kill();\n            }\n            else\n                oldValule = this._value;\n            this._value = value;\n            return fgui.GTween.to(oldValule, this._value, duration).setTarget(this, this.update).setEase(fgui.EaseType.Linear);\n        };\n        GProgressBar.prototype.update = function (newValue) {\n            var percent = fgui.ToolSet.clamp01((newValue - this._min) / (this._max - this._min));\n            if (this._titleObject) {\n                switch (this._titleType) {\n                    case fgui.ProgressTitleType.Percent:\n                        this._titleObject.text = Math.floor(percent * 100) + \"%\";\n                        break;\n                    case fgui.ProgressTitleType.ValueAndMax:\n                        this._titleObject.text = Math.floor(newValue) + \"/\" + Math.floor(this._max);\n                        break;\n                    case fgui.ProgressTitleType.Value:\n                        this._titleObject.text = \"\" + Math.floor(newValue);\n                        break;\n                    case fgui.ProgressTitleType.Max:\n                        this._titleObject.text = \"\" + Math.floor(this._max);\n                        break;\n                }\n            }\n            var fullWidth = this.width - this._barMaxWidthDelta;\n            var fullHeight = this.height - this._barMaxHeightDelta;\n            if (!this._reverse) {\n                if (this._barObjectH) {\n                    if (!this.setFillAmount(this._barObjectH, percent))\n                        this._barObjectH.width = Math.round(fullWidth * percent);\n                }\n                if (this._barObjectV) {\n                    if (!this.setFillAmount(this._barObjectV, percent))\n                        this._barObjectV.height = Math.round(fullHeight * percent);\n                }\n            }\n            else {\n                if (this._barObjectH) {\n                    if (!this.setFillAmount(this._barObjectH, 1 - percent)) {\n                        this._barObjectH.width = Math.round(fullWidth * percent);\n                        this._barObjectH.x = this._barStartX + (fullWidth - this._barObjectH.width);\n                    }\n                }\n                if (this._barObjectV) {\n                    if (!this.setFillAmount(this._barObjectV, 1 - percent)) {\n                        this._barObjectV.height = Math.round(fullHeight * percent);\n                        this._barObjectV.y = this._barStartY + (fullHeight - this._barObjectV.height);\n                    }\n                }\n            }\n            if (this._aniObject)\n                this._aniObject.setProp(fgui.ObjectPropID.Frame, Math.floor(percent * 100));\n        };\n        GProgressBar.prototype.setFillAmount = function (bar, percent) {\n            if (((bar instanceof fgui.GImage) || (bar instanceof fgui.GLoader)) && bar.fillMethod != fgui.FillMethod.None) {\n                bar.fillAmount = percent;\n                return true;\n            }\n            else\n                return false;\n        };\n        GProgressBar.prototype.constructExtension = function (buffer) {\n            buffer.seek(0, 6);\n            this._titleType = buffer.readByte();\n            this._reverse = buffer.readBool();\n            this._titleObject = this.getChild(\"title\");\n            this._barObjectH = this.getChild(\"bar\");\n            this._barObjectV = this.getChild(\"bar_v\");\n            this._aniObject = this.getChild(\"ani\");\n            if (this._barObjectH) {\n                this._barMaxWidth = this._barObjectH.width;\n                this._barMaxWidthDelta = this.width - this._barMaxWidth;\n                this._barStartX = this._barObjectH.x;\n            }\n            if (this._barObjectV) {\n                this._barMaxHeight = this._barObjectV.height;\n                this._barMaxHeightDelta = this.height - this._barMaxHeight;\n                this._barStartY = this._barObjectV.y;\n            }\n        };\n        GProgressBar.prototype.handleSizeChanged = function () {\n            _super_1.prototype.handleSizeChanged.call(this);\n            if (this._barObjectH)\n                this._barMaxWidth = this.width - this._barMaxWidthDelta;\n            if (this._barObjectV)\n                this._barMaxHeight = this.height - this._barMaxHeightDelta;\n            if (!this._underConstruct)\n                this.update(this._value);\n        };\n        GProgressBar.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            if (!buffer.seek(beginPos, 6)) {\n                this.update(this._value);\n                return;\n            }\n            if (buffer.readByte() != this.packageItem.objectType) {\n                this.update(this._value);\n                return;\n            }\n            this._value = buffer.readInt();\n            this._max = buffer.readInt();\n            if (buffer.version >= 2)\n                this._min = buffer.readInt();\n            this.update(this._value);\n        };\n        return GProgressBar;\n    }(fgui.GComponent));\n    fgui.GProgressBar = GProgressBar;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GTextField = (function (_super_1) {\n        __extends(GTextField, _super_1);\n        function GTextField() {\n            var _this = _super_1.call(this) || this;\n            _this._fontSize = 0;\n            _this._leading = 0;\n            _this._letterSpacing = 0;\n            _this._textWidth = 0;\n            _this._textHeight = 0;\n            _this._fontSize = 12;\n            _this._align = fgui.AlignType.Left;\n            _this._verticalAlign = fgui.VertAlignType.Top;\n            _this._text = \"\";\n            _this._leading = 3;\n            _this._color = 0;\n            _this._autoSize = fgui.AutoSizeType.Both;\n            _this._widthAutoSize = true;\n            _this._heightAutoSize = true;\n            return _this;\n        }\n        GTextField.prototype.createDisplayObject = function () {\n            this._textField = new egret.TextField();\n            this._textField.touchEnabled = false;\n            this.setDisplayObject(this._textField);\n        };\n        GTextField.prototype.switchBitmapMode = function (val) {\n            if (val && this.displayObject == this._textField) {\n                if (this._bitmapContainer == null)\n                    this._bitmapContainer = new egret.Sprite();\n                this.switchDisplayObject(this._bitmapContainer);\n            }\n            else if (!val && this.displayObject == this._bitmapContainer)\n                this.switchDisplayObject(this._textField);\n        };\n        GTextField.prototype.dispose = function () {\n            _super_1.prototype.dispose.call(this);\n            this._bitmapFont = null;\n            this._requireRender = false;\n        };\n        Object.defineProperty(GTextField.prototype, \"text\", {\n            get: function () {\n                return this._text;\n            },\n            set: function (value) {\n                this._text = value;\n                if (this._text == null)\n                    this._text = \"\";\n                this.updateGear(6);\n                if (this.parent && this.parent._underConstruct)\n                    this.renderNow();\n                else\n                    this.render();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTextField.prototype.updateTextFieldText = function () {\n            var text2 = this._text;\n            if (this._templateVars)\n                text2 = this.parseTemplate(text2);\n            if (this._ubbEnabled) {\n                var arr = GTextField._htmlParser.parser(fgui.UBBParser.inst.parse(fgui.ToolSet.encodeHTML(text2)));\n                if (this._underline) {\n                    for (var i = 0; i < arr.length; i++) {\n                        var element = arr[i];\n                        if (element.style)\n                            element.style.underline = true;\n                        else\n                            element.style = { underline: true };\n                    }\n                }\n                this._textField.textFlow = arr;\n            }\n            else if (this._underline) {\n                var arr = new Array(1);\n                arr[0] = { text: text2, style: { underline: true } };\n                this._textField.textFlow = arr;\n            }\n            else\n                this._textField.text = text2;\n        };\n        Object.defineProperty(GTextField.prototype, \"font\", {\n            get: function () {\n                return this._font;\n            },\n            set: function (value) {\n                if (this._font != value) {\n                    this._font = value;\n                    this.updateTextFormat();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"fontSize\", {\n            get: function () {\n                return this._fontSize;\n            },\n            set: function (value) {\n                if (value < 0)\n                    return;\n                if (this._fontSize != value) {\n                    this._fontSize = value;\n                    this.updateTextFormat();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"color\", {\n            get: function () {\n                return this._color;\n            },\n            set: function (value) {\n                if (this._color != value) {\n                    this._color = value;\n                    this.updateGear(4);\n                    this.updateTextFormat();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"align\", {\n            get: function () {\n                return this._align;\n            },\n            set: function (value) {\n                if (this._align != value) {\n                    this._align = value;\n                    this._textField.textAlign = this.getAlignTypeString(this._align);\n                    if (this._bitmapFont && !this._underConstruct)\n                        this.render();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"verticalAlign\", {\n            get: function () {\n                return this._verticalAlign;\n            },\n            set: function (value) {\n                if (this._verticalAlign != value) {\n                    this._verticalAlign = value;\n                    this._textField.verticalAlign = this.getVertAlignTypeString(this._verticalAlign);\n                    if (this._bitmapFont && !this._underConstruct)\n                        this.render();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTextField.prototype.getAlignTypeString = function (type) {\n            return type == fgui.AlignType.Left ? egret.HorizontalAlign.LEFT :\n                (type == fgui.AlignType.Center ? egret.HorizontalAlign.CENTER : egret.HorizontalAlign.RIGHT);\n        };\n        GTextField.prototype.getVertAlignTypeString = function (type) {\n            return type == fgui.VertAlignType.Top ? egret.VerticalAlign.TOP :\n                (type == fgui.VertAlignType.Middle ? egret.VerticalAlign.MIDDLE : egret.VerticalAlign.BOTTOM);\n        };\n        Object.defineProperty(GTextField.prototype, \"leading\", {\n            get: function () {\n                return this._leading;\n            },\n            set: function (value) {\n                if (this._leading != value) {\n                    this._leading = value;\n                    this.updateTextFormat();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"letterSpacing\", {\n            get: function () {\n                return this._letterSpacing;\n            },\n            set: function (value) {\n                if (this._letterSpacing != value) {\n                    this._letterSpacing = value;\n                    this.updateTextFormat();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"underline\", {\n            get: function () {\n                return this._underline;\n            },\n            set: function (value) {\n                this._underline = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"bold\", {\n            get: function () {\n                return this._textField.bold;\n            },\n            set: function (value) {\n                this._textField.bold = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"italic\", {\n            get: function () {\n                return this._textField.italic;\n            },\n            set: function (value) {\n                this._textField.italic = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"singleLine\", {\n            get: function () {\n                return !this._textField.multiline;\n            },\n            set: function (value) {\n                value = !value;\n                if (this._textField.multiline != value) {\n                    this._textField.multiline = value;\n                    this.render();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"stroke\", {\n            get: function () {\n                return this._textField.stroke;\n            },\n            set: function (value) {\n                this._textField.stroke = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"strokeColor\", {\n            get: function () {\n                return this._textField.strokeColor;\n            },\n            set: function (value) {\n                this._textField.strokeColor = value;\n                this.updateGear(4);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"ubbEnabled\", {\n            get: function () {\n                return this._ubbEnabled;\n            },\n            set: function (value) {\n                if (this._ubbEnabled != value) {\n                    this._ubbEnabled = value;\n                    this.render();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"autoSize\", {\n            get: function () {\n                return this._autoSize;\n            },\n            set: function (value) {\n                if (this._autoSize != value) {\n                    this._autoSize = value;\n                    this._widthAutoSize = value == fgui.AutoSizeType.Both;\n                    this._heightAutoSize = value == fgui.AutoSizeType.Both || value == fgui.AutoSizeType.Height;\n                    this.render();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"textWidth\", {\n            get: function () {\n                if (this._requireRender)\n                    this.renderNow();\n                return this._textWidth;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTextField.prototype.ensureSizeCorrect = function () {\n            if (this._sizeDirty && this._requireRender)\n                this.renderNow();\n        };\n        GTextField.prototype.updateTextFormat = function () {\n            this._textField.size = this._fontSize;\n            this._bitmapFont = null;\n            if (fgui.ToolSet.startsWith(this._font, \"ui://\")) {\n                var pi = fgui.UIPackage.getItemByURL(this._font);\n                if (pi)\n                    this._bitmapFont = pi.owner.getItemAsset(pi);\n            }\n            if (this._bitmapFont == null) {\n                if (this._font)\n                    this._textField.fontFamily = this._font;\n                else\n                    this._textField.fontFamily = fgui.UIConfig.defaultFont;\n            }\n            if (this.grayed)\n                this._textField.textColor = 0xAAAAAA;\n            else\n                this._textField.textColor = this._color;\n            this._textField.lineSpacing = this._leading;\n            if (!this._underConstruct)\n                this.render();\n        };\n        GTextField.prototype.render = function () {\n            if (!this._requireRender) {\n                this._requireRender = true;\n                egret.callLater(this.__render, this);\n            }\n            if (!this._sizeDirty && (this._widthAutoSize || this._heightAutoSize)) {\n                this._sizeDirty = true;\n                this.dispatchEventWith(fgui.GObject.SIZE_DELAY_CHANGE);\n            }\n        };\n        GTextField.prototype.__render = function () {\n            if (this._requireRender)\n                this.renderNow();\n        };\n        GTextField.prototype.renderNow = function (updateBounds) {\n            if (updateBounds === void 0) { updateBounds = true; }\n            this._requireRender = false;\n            this._sizeDirty = false;\n            if (this._bitmapFont) {\n                this.renderWithBitmapFont(updateBounds);\n                return;\n            }\n            this.switchBitmapMode(false);\n            this._textField.width = this._widthAutoSize ? (this.maxWidth <= 0 ? 10000 : this.maxWidth) : Math.ceil(this.width);\n            this.updateTextFieldText();\n            this._textWidth = Math.ceil(this._textField.textWidth);\n            if (this._textWidth > 0)\n                this._textWidth += 4;\n            this._textHeight = Math.ceil(this._textField.textHeight);\n            if (this._textHeight > 0)\n                this._textHeight += 4;\n            var w, h = 0;\n            if (this._widthAutoSize) {\n                w = this._textWidth;\n                this._textField.width = w;\n            }\n            else\n                w = this.width;\n            if (this._heightAutoSize) {\n                h = this._textHeight;\n                if (this._textField.height != this._textHeight)\n                    this._textField.height = this._textHeight;\n            }\n            else {\n                h = this.height;\n                if (this._textHeight > h)\n                    this._textHeight = h;\n            }\n            if (updateBounds) {\n                this._updatingSize = true;\n                this.setSize(w, h);\n                this._updatingSize = false;\n            }\n        };\n        GTextField.prototype.renderWithBitmapFont = function (updateBounds) {\n            this.switchBitmapMode(true);\n            if (!this._bitmapPool)\n                this._bitmapPool = [];\n            var cnt = this._bitmapContainer.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                var obj = this._bitmapContainer.getChildAt(i);\n                this._bitmapPool.push(obj);\n            }\n            this._bitmapContainer.removeChildren();\n            if (!this._lines)\n                this._lines = new Array();\n            else\n                returnList(this._lines);\n            var letterSpacing = this._letterSpacing;\n            var lineSpacing = this._leading - 1;\n            var rectWidth = this.width - GUTTER_X * 2;\n            var lineWidth = 0, lineHeight = 0, lineTextHeight = 0;\n            var glyphWidth = 0, glyphHeight = 0;\n            var wordChars = 0, wordStart = 0, wordEnd = 0;\n            var lastLineHeight = 0;\n            var lineBuffer = \"\";\n            var lineY = GUTTER_Y;\n            var line;\n            var wordWrap = !this._widthAutoSize && this._textField.multiline;\n            var fontScale = this._bitmapFont.resizable ? this._fontSize / this._bitmapFont.size : 1;\n            var tint = this._bitmapFont.tint;\n            this._textWidth = 0;\n            this._textHeight = 0;\n            var text2 = this._text;\n            if (this._templateVars)\n                text2 = this.parseTemplate(text2);\n            var textLength = text2.length;\n            for (var offset = 0; offset < textLength; ++offset) {\n                var ch = text2.charAt(offset);\n                var cc = ch.charCodeAt(0);\n                if (cc == 10) {\n                    lineBuffer += ch;\n                    line = borrow();\n                    line.width = lineWidth;\n                    if (lineTextHeight == 0) {\n                        if (lastLineHeight == 0)\n                            lastLineHeight = this._fontSize;\n                        if (lineHeight == 0)\n                            lineHeight = lastLineHeight;\n                        lineTextHeight = lineHeight;\n                    }\n                    line.height = lineHeight;\n                    lastLineHeight = lineHeight;\n                    line.textHeight = lineTextHeight;\n                    line.text = lineBuffer;\n                    line.y = lineY;\n                    lineY += (line.height + lineSpacing);\n                    if (line.width > this._textWidth)\n                        this._textWidth = line.width;\n                    this._lines.push(line);\n                    lineBuffer = \"\";\n                    lineWidth = 0;\n                    lineHeight = 0;\n                    lineTextHeight = 0;\n                    wordChars = 0;\n                    wordStart = 0;\n                    wordEnd = 0;\n                    continue;\n                }\n                if (cc >= 65 && cc <= 90 || cc >= 97 && cc <= 122) {\n                    if (wordChars == 0)\n                        wordStart = lineWidth;\n                    wordChars++;\n                }\n                else {\n                    if (wordChars > 0)\n                        wordEnd = lineWidth;\n                    wordChars = 0;\n                }\n                if (cc == 32) {\n                    glyphWidth = Math.ceil(this._fontSize / 2);\n                    glyphHeight = this._fontSize;\n                }\n                else {\n                    var glyph = this._bitmapFont.glyphs[ch];\n                    if (glyph) {\n                        glyphWidth = Math.ceil(glyph.advance * fontScale);\n                        glyphHeight = Math.ceil(glyph.lineHeight * fontScale);\n                    }\n                    else {\n                        glyphWidth = 0;\n                        glyphHeight = 0;\n                    }\n                }\n                if (glyphHeight > lineTextHeight)\n                    lineTextHeight = glyphHeight;\n                if (glyphHeight > lineHeight)\n                    lineHeight = glyphHeight;\n                if (lineWidth != 0)\n                    lineWidth += letterSpacing;\n                lineWidth += glyphWidth;\n                if (!wordWrap || lineWidth <= rectWidth) {\n                    lineBuffer += ch;\n                }\n                else {\n                    line = borrow();\n                    line.height = lineHeight;\n                    line.textHeight = lineTextHeight;\n                    if (lineBuffer.length == 0) {\n                        line.text = ch;\n                    }\n                    else if (wordChars > 0 && wordEnd > 0) {\n                        lineBuffer += ch;\n                        var len = lineBuffer.length - wordChars;\n                        line.text = fgui.ToolSet.trimRight(lineBuffer.substr(0, len));\n                        line.width = wordEnd;\n                        lineBuffer = lineBuffer.substr(len);\n                        lineWidth -= wordStart;\n                    }\n                    else {\n                        line.text = lineBuffer;\n                        line.width = lineWidth - (glyphWidth + letterSpacing);\n                        lineBuffer = ch;\n                        lineWidth = glyphWidth;\n                        lineHeight = glyphHeight;\n                        lineTextHeight = glyphHeight;\n                    }\n                    line.y = lineY;\n                    lineY += (line.height + lineSpacing);\n                    if (line.width > this._textWidth)\n                        this._textWidth = line.width;\n                    wordChars = 0;\n                    wordStart = 0;\n                    wordEnd = 0;\n                    this._lines.push(line);\n                }\n            }\n            if (lineBuffer.length > 0) {\n                line = borrow();\n                line.width = lineWidth;\n                if (lineHeight == 0)\n                    lineHeight = lastLineHeight;\n                if (lineTextHeight == 0)\n                    lineTextHeight = lineHeight;\n                line.height = lineHeight;\n                line.textHeight = lineTextHeight;\n                line.text = lineBuffer;\n                line.y = lineY;\n                if (line.width > this._textWidth)\n                    this._textWidth = line.width;\n                this._lines.push(line);\n            }\n            if (this._textWidth > 0)\n                this._textWidth += GUTTER_X * 2;\n            var count = this._lines.length;\n            if (count == 0) {\n                this._textHeight = 0;\n            }\n            else {\n                line = this._lines[this._lines.length - 1];\n                this._textHeight = line.y + line.height + GUTTER_Y;\n            }\n            var w, h = 0;\n            if (this._widthAutoSize) {\n                if (this._textWidth == 0)\n                    w = 0;\n                else\n                    w = this._textWidth;\n            }\n            else\n                w = this.width;\n            if (this._heightAutoSize) {\n                if (this._textHeight == 0)\n                    h = 0;\n                else\n                    h = this._textHeight;\n            }\n            else\n                h = this.height;\n            if (updateBounds) {\n                this._updatingSize = true;\n                this.setSize(w, h);\n                this._updatingSize = false;\n            }\n            if (w == 0 || h == 0)\n                return;\n            var charX = GUTTER_X;\n            var lineIndent = 0;\n            var charIndent = 0;\n            rectWidth = this.width - GUTTER_X * 2;\n            var lineCount = this._lines.length;\n            for (var i = 0; i < lineCount; i++) {\n                line = this._lines[i];\n                charX = GUTTER_X;\n                if (this._align == fgui.AlignType.Center)\n                    lineIndent = (rectWidth - line.width) / 2;\n                else if (this._align == fgui.AlignType.Right)\n                    lineIndent = rectWidth - line.width;\n                else\n                    lineIndent = 0;\n                textLength = line.text.length;\n                for (var j = 0; j < textLength; j++) {\n                    ch = line.text.charAt(j);\n                    cc = ch.charCodeAt(0);\n                    if (cc == 10)\n                        continue;\n                    if (cc == 32) {\n                        charX += letterSpacing + Math.ceil(this._fontSize / 2);\n                        continue;\n                    }\n                    glyph = this._bitmapFont.glyphs[ch];\n                    if (glyph) {\n                        charIndent = (line.height + line.textHeight) / 2 - Math.ceil(glyph.lineHeight * fontScale);\n                        var bm;\n                        if (this._bitmapPool.length)\n                            bm = this._bitmapPool.pop();\n                        else {\n                            bm = new egret.Bitmap();\n                            bm.smoothing = true;\n                        }\n                        bm.x = charX + lineIndent + Math.ceil(glyph.x * fontScale);\n                        bm.y = line.y + charIndent + Math.ceil(glyph.y * fontScale);\n                        bm[\"$backupY\"] = bm.y;\n                        bm.texture = glyph.texture;\n                        bm.scaleX = fontScale;\n                        bm.scaleY = fontScale;\n                        if (tint)\n                            bm.tint = this._color;\n                        else\n                            bm.tint = 0xFFFFFF;\n                        this._bitmapContainer.addChild(bm);\n                        charX += letterSpacing + Math.ceil(glyph.advance * fontScale);\n                    }\n                    else {\n                        charX += letterSpacing;\n                    }\n                }\n            }\n            this.doAlign();\n        };\n        GTextField.prototype.handleSizeChanged = function () {\n            if (this._updatingSize)\n                return;\n            if (this._bitmapFont) {\n                if (!this._widthAutoSize)\n                    this.render();\n                else\n                    this.doAlign();\n            }\n            else {\n                if (this._underConstruct) {\n                    this._textField.width = this.width;\n                    this._textField.height = this.height;\n                }\n                else {\n                    if (!this._widthAutoSize) {\n                        if (!this._heightAutoSize) {\n                            this._textField.width = this.width;\n                            this._textField.height = this.height;\n                        }\n                        else\n                            this._textField.width = this.width;\n                    }\n                }\n            }\n        };\n        GTextField.prototype.parseTemplate = function (template) {\n            var pos1 = 0, pos2, pos3;\n            var tag;\n            var value;\n            var result = \"\";\n            while ((pos2 = template.indexOf(\"{\", pos1)) != -1) {\n                if (pos2 > 0 && template.charCodeAt(pos2 - 1) == 92) {\n                    result += template.substring(pos1, pos2 - 1);\n                    result += \"{\";\n                    pos1 = pos2 + 1;\n                    continue;\n                }\n                result += template.substring(pos1, pos2);\n                pos1 = pos2;\n                pos2 = template.indexOf(\"}\", pos1);\n                if (pos2 == -1)\n                    break;\n                if (pos2 == pos1 + 1) {\n                    result += template.substr(pos1, 2);\n                    pos1 = pos2 + 1;\n                    continue;\n                }\n                tag = template.substring(pos1 + 1, pos2);\n                pos3 = tag.indexOf(\"=\");\n                if (pos3 != -1) {\n                    value = this._templateVars[tag.substring(0, pos3)];\n                    if (value == null)\n                        result += tag.substring(pos3 + 1);\n                    else\n                        result += value;\n                }\n                else {\n                    value = this._templateVars[tag];\n                    if (value != null)\n                        result += value;\n                }\n                pos1 = pos2 + 1;\n            }\n            if (pos1 < template.length)\n                result += template.substr(pos1);\n            return result;\n        };\n        Object.defineProperty(GTextField.prototype, \"templateVars\", {\n            get: function () {\n                return this._templateVars;\n            },\n            set: function (value) {\n                if (!this._templateVars && !value)\n                    return;\n                this._templateVars = value;\n                this.flushVars();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTextField.prototype.setVar = function (name, value) {\n            if (!this._templateVars)\n                this._templateVars = {};\n            this._templateVars[name] = value;\n            return this;\n        };\n        GTextField.prototype.flushVars = function () {\n            this.render();\n        };\n        GTextField.prototype.handleGrayedChanged = function () {\n            _super_1.prototype.handleGrayedChanged.call(this);\n            this.updateTextFormat();\n        };\n        GTextField.prototype.doAlign = function () {\n            var yOffset;\n            if (this._verticalAlign == fgui.VertAlignType.Top || this._textHeight == 0)\n                yOffset = GUTTER_Y;\n            else {\n                var dh = this.height - this._textHeight;\n                if (dh < 0)\n                    dh = 0;\n                if (this._verticalAlign == fgui.VertAlignType.Middle)\n                    yOffset = Math.floor(dh / 2);\n                else\n                    yOffset = Math.floor(dh);\n            }\n            var cnt = this._bitmapContainer.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                var obj = this._bitmapContainer.getChildAt(i);\n                obj.y = obj[\"$backupY\"] + yOffset;\n            }\n        };\n        GTextField.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    return this.color;\n                case fgui.ObjectPropID.OutlineColor:\n                    return this.strokeColor;\n                case fgui.ObjectPropID.FontSize:\n                    return this.fontSize;\n                default:\n                    return _super_1.prototype.getProp.call(this, index);\n            }\n        };\n        GTextField.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    this.color = value;\n                    break;\n                case fgui.ObjectPropID.OutlineColor:\n                    this.strokeColor = value;\n                    break;\n                case fgui.ObjectPropID.FontSize:\n                    this.fontSize = value;\n                    break;\n                default:\n                    _super_1.prototype.setProp.call(this, index, value);\n                    break;\n            }\n        };\n        GTextField.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            this._font = buffer.readS();\n            this._fontSize = buffer.readShort();\n            this._color = buffer.readColor();\n            this.align = buffer.readByte();\n            this.verticalAlign = buffer.readByte();\n            this._leading = buffer.readShort();\n            this._letterSpacing = buffer.readShort();\n            this._ubbEnabled = buffer.readBool();\n            this._autoSize = buffer.readByte();\n            this._widthAutoSize = this._autoSize == fgui.AutoSizeType.Both;\n            this._heightAutoSize = this._autoSize == fgui.AutoSizeType.Both || this._autoSize == fgui.AutoSizeType.Height;\n            this._underline = buffer.readBool();\n            this._textField.italic = buffer.readBool();\n            this._textField.bold = buffer.readBool();\n            this._textField.multiline = !buffer.readBool();\n            if (buffer.readBool()) {\n                this._textField.strokeColor = buffer.readColor();\n                this.stroke = buffer.readFloat() + 1;\n            }\n            if (buffer.readBool())\n                buffer.skip(12);\n            if (buffer.readBool())\n                this._templateVars = {};\n        };\n        GTextField.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            this.updateTextFormat();\n            buffer.seek(beginPos, 6);\n            var str = buffer.readS();\n            if (str != null)\n                this.text = str;\n            this._sizeDirty = false;\n        };\n        GTextField._htmlParser = new egret.HtmlTextParser();\n        return GTextField;\n    }(fgui.GObject));\n    fgui.GTextField = GTextField;\n    var pool = [];\n    function borrow() {\n        if (pool.length) {\n            var ret = pool.pop();\n            ret.width = 0;\n            ret.height = 0;\n            ret.textHeight = 0;\n            ret.text = null;\n            ret.y = 0;\n            return ret;\n        }\n        else\n            return {\n                width: 0,\n                height: 0,\n                textHeight: 0,\n                text: null,\n                y: 0\n            };\n    }\n    function returnList(value) {\n        var length = value.length;\n        for (var i = 0; i < length; i++) {\n            var li = value[i];\n            pool.push(li);\n        }\n        value.length = 0;\n    }\n    var GUTTER_X = 2;\n    var GUTTER_Y = 2;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GRichTextField = (function (_super_1) {\n        __extends(GRichTextField, _super_1);\n        function GRichTextField() {\n            var _this = _super_1.call(this) || this;\n            _this._textField.touchEnabled = true;\n            return _this;\n        }\n        GRichTextField.prototype.updateTextFieldText = function () {\n            var text2 = this._text;\n            if (this._templateVars)\n                text2 = this.parseTemplate(text2);\n            var arr;\n            if (this._ubbEnabled)\n                arr = fgui.GTextField._htmlParser.parser(fgui.UBBParser.inst.parse(text2));\n            else\n                arr = fgui.GTextField._htmlParser.parser(text2);\n            if (this._underline) {\n                for (var i = 0; i < arr.length; i++) {\n                    var element = arr[i];\n                    if (element.style)\n                        element.style.underline = true;\n                    else\n                        element.style = { underline: true };\n                }\n            }\n            this._textField.textFlow = arr;\n        };\n        return GRichTextField;\n    }(fgui.GTextField));\n    fgui.GRichTextField = GRichTextField;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GRoot = (function (_super_1) {\n        __extends(GRoot, _super_1);\n        function GRoot() {\n            var _this = _super_1.call(this) || this;\n            if (GRoot._inst == null)\n                GRoot._inst = _this;\n            _this.opaque = false;\n            _this._volumeScale = 1;\n            _this._popupStack = new Array();\n            _this._justClosedPopups = new Array();\n            _this.displayObject.addEventListener(egret.Event.ADDED_TO_STAGE, _this.__addedToStage, _this);\n            return _this;\n        }\n        Object.defineProperty(GRoot, \"inst\", {\n            get: function () {\n                if (GRoot._inst == null)\n                    new GRoot();\n                return GRoot._inst;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GRoot.prototype, \"nativeStage\", {\n            get: function () {\n                return this._nativeStage;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GRoot.prototype.showWindow = function (win) {\n            this.addChild(win);\n            win.requestFocus();\n            if (win.x > this.width)\n                win.x = this.width - win.width;\n            else if (win.x + win.width < 0)\n                win.x = 0;\n            if (win.y > this.height)\n                win.y = this.height - win.height;\n            else if (win.y + win.height < 0)\n                win.y = 0;\n            this.adjustModalLayer();\n        };\n        GRoot.prototype.hideWindow = function (win) {\n            win.hide();\n        };\n        GRoot.prototype.hideWindowImmediately = function (win) {\n            if (win.parent == this)\n                this.removeChild(win);\n            this.adjustModalLayer();\n        };\n        GRoot.prototype.bringToFront = function (win) {\n            var cnt = this.numChildren;\n            var i;\n            if (this._modalLayer.parent != null && !win.modal)\n                i = this.getChildIndex(this._modalLayer) - 1;\n            else\n                i = cnt - 1;\n            for (; i >= 0; i--) {\n                var g = this.getChildAt(i);\n                if (g == win)\n                    return;\n                if (g instanceof fgui.Window)\n                    break;\n            }\n            if (i >= 0)\n                this.setChildIndex(win, i);\n        };\n        GRoot.prototype.showModalWait = function (msg) {\n            if (fgui.UIConfig.globalModalWaiting != null) {\n                if (this._modalWaitPane == null)\n                    this._modalWaitPane = fgui.UIPackage.createObjectFromURL(fgui.UIConfig.globalModalWaiting);\n                this._modalWaitPane.setSize(this.width, this.height);\n                this._modalWaitPane.addRelation(this, fgui.RelationType.Size);\n                this.addChild(this._modalWaitPane);\n                this._modalWaitPane.text = msg;\n            }\n        };\n        GRoot.prototype.closeModalWait = function () {\n            if (this._modalWaitPane != null && this._modalWaitPane.parent != null)\n                this.removeChild(this._modalWaitPane);\n        };\n        GRoot.prototype.closeAllExceptModals = function () {\n            var arr = this._children.slice();\n            var cnt = arr.length;\n            for (var i = 0; i < cnt; i++) {\n                var g = arr[i];\n                if ((g instanceof fgui.Window) && !g.modal)\n                    g.hide();\n            }\n        };\n        GRoot.prototype.closeAllWindows = function () {\n            var arr = this._children.slice();\n            var cnt = arr.length;\n            for (var i = 0; i < cnt; i++) {\n                var g = arr[i];\n                if (g instanceof fgui.Window)\n                    g.hide();\n            }\n        };\n        GRoot.prototype.getTopWindow = function () {\n            var cnt = this.numChildren;\n            for (var i = cnt - 1; i >= 0; i--) {\n                var g = this.getChildAt(i);\n                if (g instanceof fgui.Window) {\n                    return g;\n                }\n            }\n            return null;\n        };\n        Object.defineProperty(GRoot.prototype, \"modalLayer\", {\n            get: function () {\n                return this._modalLayer;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GRoot.prototype, \"hasModalWindow\", {\n            get: function () {\n                return this._modalLayer.parent != null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GRoot.prototype, \"modalWaiting\", {\n            get: function () {\n                return this._modalWaitPane && this._modalWaitPane.inContainer;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GRoot.prototype.showPopup = function (popup, target, dir) {\n            if (this._popupStack.length > 0) {\n                var k = this._popupStack.indexOf(popup);\n                if (k != -1) {\n                    for (var i = this._popupStack.length - 1; i >= k; i--)\n                        this.removeChild(this._popupStack.pop());\n                }\n            }\n            this._popupStack.push(popup);\n            if (target) {\n                var p = target;\n                while (p) {\n                    if (p.parent == this) {\n                        if (popup.sortingOrder < p.sortingOrder) {\n                            popup.sortingOrder = p.sortingOrder;\n                        }\n                        break;\n                    }\n                    p = p.parent;\n                }\n            }\n            this.addChild(popup);\n            this.adjustModalLayer();\n            var pos;\n            var sizeW = 0, sizeH = 0;\n            if (target) {\n                pos = target.localToRoot();\n                sizeW = target.width;\n                sizeH = target.height;\n            }\n            else {\n                pos = this.globalToLocal(GRoot.mouseX, GRoot.mouseY);\n            }\n            var xx, yy;\n            xx = pos.x;\n            if (xx + popup.width > this.width)\n                xx = xx + sizeW - popup.width;\n            yy = pos.y + sizeH;\n            if (((dir === undefined || dir === fgui.PopupDirection.Auto) && pos.y + popup.height > this.height)\n                || dir === false || dir === fgui.PopupDirection.Up) {\n                yy = pos.y - popup.height - 1;\n                if (yy < 0) {\n                    yy = 0;\n                    xx += sizeW / 2;\n                }\n            }\n            popup.x = xx;\n            popup.y = yy;\n        };\n        GRoot.prototype.togglePopup = function (popup, target, dir) {\n            if (this._justClosedPopups.indexOf(popup) != -1)\n                return;\n            this.showPopup(popup, target, dir);\n        };\n        GRoot.prototype.hidePopup = function (popup) {\n            if (popup) {\n                var k = this._popupStack.indexOf(popup);\n                if (k != -1) {\n                    for (var i = this._popupStack.length - 1; i >= k; i--)\n                        this.closePopup(this._popupStack.pop());\n                }\n            }\n            else {\n                var cnt = this._popupStack.length;\n                for (i = cnt - 1; i >= 0; i--)\n                    this.closePopup(this._popupStack[i]);\n                this._popupStack.length = 0;\n            }\n        };\n        Object.defineProperty(GRoot.prototype, \"hasAnyPopup\", {\n            get: function () {\n                return this._popupStack.length != 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GRoot.prototype.closePopup = function (target) {\n            if (target.parent) {\n                if (target instanceof fgui.Window)\n                    target.hide();\n                else\n                    this.removeChild(target);\n            }\n        };\n        GRoot.prototype.showTooltips = function (msg) {\n            if (this._defaultTooltipWin == null) {\n                var resourceURL = fgui.UIConfig.tooltipsWin;\n                if (!resourceURL) {\n                    console.error(\"UIConfig.tooltipsWin not defined\");\n                    return;\n                }\n                this._defaultTooltipWin = fgui.UIPackage.createObjectFromURL(resourceURL);\n            }\n            this._defaultTooltipWin.text = msg;\n            this.showTooltipsWin(this._defaultTooltipWin);\n        };\n        GRoot.prototype.showTooltipsWin = function (tooltipWin, position) {\n            this.hideTooltips();\n            this._tooltipWin = tooltipWin;\n            var xx = 0;\n            var yy = 0;\n            if (!position) {\n                xx = GRoot.mouseX + 10;\n                yy = GRoot.mouseY + 20;\n            }\n            else {\n                xx = position.x;\n                yy = position.y;\n            }\n            var pt = this.globalToLocal(xx, yy);\n            xx = pt.x;\n            yy = pt.y;\n            if (xx + this._tooltipWin.width > this.width) {\n                xx = xx - this._tooltipWin.width - 1;\n                if (xx < 0)\n                    xx = 10;\n            }\n            if (yy + this._tooltipWin.height > this.height) {\n                yy = yy - this._tooltipWin.height - 1;\n                if (xx - this._tooltipWin.width - 1 > 0)\n                    xx = xx - this._tooltipWin.width - 1;\n                if (yy < 0)\n                    yy = 10;\n            }\n            this._tooltipWin.x = xx;\n            this._tooltipWin.y = yy;\n            this.addChild(this._tooltipWin);\n        };\n        GRoot.prototype.hideTooltips = function () {\n            if (this._tooltipWin) {\n                if (this._tooltipWin.parent)\n                    this.removeChild(this._tooltipWin);\n                this._tooltipWin = null;\n            }\n        };\n        GRoot.prototype.getObjectUnderPoint = function (globalX, globalY) {\n            var ret = this._nativeStage.$hitTest(globalX, globalY);\n            if (ret)\n                return fgui.ToolSet.displayObjectToGObject(ret);\n            else\n                return null;\n        };\n        Object.defineProperty(GRoot.prototype, \"focus\", {\n            get: function () {\n                return null;\n            },\n            set: function (value) {\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GRoot.prototype.setFocus = function (value) {\n        };\n        Object.defineProperty(GRoot.prototype, \"volumeScale\", {\n            get: function () {\n                return this._volumeScale;\n            },\n            set: function (value) {\n                this._volumeScale = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GRoot.prototype.playOneShotSound = function (sound, volumeScale) {\n            volumeScale = volumeScale || 1;\n            var vs = this._volumeScale * volumeScale;\n            var channel = sound.play(0, 1);\n            channel.volume = vs;\n        };\n        GRoot.prototype.adjustModalLayer = function () {\n            var cnt = this.numChildren;\n            if (this._modalWaitPane && this._modalWaitPane.parent)\n                this.setChildIndex(this._modalWaitPane, cnt - 1);\n            for (var i = cnt - 1; i >= 0; i--) {\n                var g = this.getChildAt(i);\n                if ((g instanceof fgui.Window) && g.modal) {\n                    if (this._modalLayer.parent == null)\n                        this.addChildAt(this._modalLayer, i);\n                    else\n                        this.setChildIndexBefore(this._modalLayer, i);\n                    return;\n                }\n            }\n            if (this._modalLayer.parent)\n                this.removeChild(this._modalLayer);\n        };\n        GRoot.prototype.__addedToStage = function (evt) {\n            this.displayObject.removeEventListener(egret.Event.ADDED_TO_STAGE, this.__addedToStage, this);\n            this._nativeStage = this.displayObject.stage;\n            this._nativeStage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__stageMouseDownCapture, this, true);\n            this._nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__stageMouseUpCapture, this, true);\n            this._nativeStage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__stageMouseMoveCapture, this, true);\n            this._modalLayer = new fgui.GGraph();\n            this._modalLayer.setSize(this.width, this.height);\n            this._modalLayer.drawRect(0, 0, 0, fgui.UIConfig.modalLayerColor, fgui.UIConfig.modalLayerAlpha);\n            this._modalLayer.addRelation(this, fgui.RelationType.Size);\n            this.displayObject.stage.addEventListener(egret.Event.RESIZE, this.__winResize, this);\n            this.__winResize(null);\n        };\n        GRoot.prototype.__stageMouseDownCapture = function (evt) {\n            GRoot.mouseX = evt.stageX;\n            GRoot.mouseY = evt.stageY;\n            GRoot.touchDown = true;\n            if (this._tooltipWin)\n                this.hideTooltips();\n            this._justClosedPopups.length = 0;\n            if (this._popupStack.length > 0) {\n                var mc = (evt.target);\n                while (mc != this.displayObject.stage && mc) {\n                    if (mc[\"$owner\"]) {\n                        var pindex = this._popupStack.indexOf(mc[\"$owner\"]);\n                        if (pindex != -1) {\n                            for (var i = this._popupStack.length - 1; i > pindex; i--) {\n                                var popup = this._popupStack.pop();\n                                this.closePopup(popup);\n                                this._justClosedPopups.push(popup);\n                            }\n                            return;\n                        }\n                    }\n                    mc = mc.parent;\n                }\n                var cnt = this._popupStack.length;\n                for (i = cnt - 1; i >= 0; i--) {\n                    popup = this._popupStack[i];\n                    this.closePopup(popup);\n                    this._justClosedPopups.push(popup);\n                }\n                this._popupStack.length = 0;\n            }\n        };\n        GRoot.prototype.__stageMouseMoveCapture = function (evt) {\n            GRoot.mouseX = evt.stageX;\n            GRoot.mouseY = evt.stageY;\n        };\n        GRoot.prototype.__stageMouseUpCapture = function (evt) {\n            GRoot.touchDown = false;\n        };\n        GRoot.prototype.__winResize = function (evt) {\n            this.setSize(this._nativeStage.stageWidth, this._nativeStage.stageHeight);\n        };\n        GRoot.prototype.updateContentScaleLevel = function () {\n            var ss = 1;\n            if (ss >= 3.5)\n                GRoot.contentScaleLevel = 3;\n            else if (ss >= 2.5)\n                GRoot.contentScaleLevel = 2;\n            else if (ss >= 1.5)\n                GRoot.contentScaleLevel = 1;\n            else\n                GRoot.contentScaleLevel = 0;\n        };\n        GRoot.contentScaleLevel = 0;\n        GRoot.contentScaleFactor = 1;\n        return GRoot;\n    }(fgui.GComponent));\n    fgui.GRoot = GRoot;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GScrollBar = (function (_super_1) {\n        __extends(GScrollBar, _super_1);\n        function GScrollBar() {\n            var _this = _super_1.call(this) || this;\n            _this._dragOffset = new egret.Point();\n            _this._scrollPerc = 0;\n            return _this;\n        }\n        GScrollBar.prototype.setScrollPane = function (target, vertical) {\n            this._target = target;\n            this._vertical = vertical;\n        };\n        GScrollBar.prototype.setDisplayPerc = function (value) {\n            if (this._vertical) {\n                if (!this._fixedGripSize)\n                    this._grip.height = Math.floor(value * this._bar.height);\n                this._grip.y = this._bar.y + (this._bar.height - this._grip.height) * this._scrollPerc;\n            }\n            else {\n                if (!this._fixedGripSize)\n                    this._grip.width = Math.floor(value * this._bar.width);\n                this._grip.x = this._bar.x + (this._bar.width - this._grip.width) * this._scrollPerc;\n            }\n            this._grip.visible = value != 0 && value != 1;\n        };\n        GScrollBar.prototype.setScrollPerc = function (val) {\n            this._scrollPerc = val;\n            if (this._vertical)\n                this._grip.y = this._bar.y + (this._bar.height - this._grip.height) * this._scrollPerc;\n            else\n                this._grip.x = this._bar.x + (this._bar.width - this._grip.width) * this._scrollPerc;\n        };\n        Object.defineProperty(GScrollBar.prototype, \"minSize\", {\n            get: function () {\n                if (this._vertical)\n                    return (this._arrowButton1 ? this._arrowButton1.height : 0) + (this._arrowButton2 ? this._arrowButton2.height : 0);\n                else\n                    return (this._arrowButton1 ? this._arrowButton1.width : 0) + (this._arrowButton2 ? this._arrowButton2.width : 0);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GScrollBar.prototype, \"gripDragging\", {\n            get: function () {\n                return this._gripDragging;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GScrollBar.prototype.constructExtension = function (buffer) {\n            buffer.seek(0, 6);\n            this._fixedGripSize = buffer.readBool();\n            this._grip = this.getChild(\"grip\");\n            if (!this._grip) {\n                console.error(\"需要定义grip\");\n                return;\n            }\n            this._bar = this.getChild(\"bar\");\n            if (!this._bar) {\n                console.error(\"需要定义bar\");\n                return;\n            }\n            this._arrowButton1 = this.getChild(\"arrow1\");\n            this._arrowButton2 = this.getChild(\"arrow2\");\n            this._grip.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__gripMouseDown, this);\n            if (this._arrowButton1)\n                this._arrowButton1.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__arrowButton1Click, this);\n            if (this._arrowButton2)\n                this._arrowButton2.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__arrowButton2Click, this);\n            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__barMouseDown, this);\n        };\n        GScrollBar.prototype.__gripMouseDown = function (evt) {\n            this._gripDragging = true;\n            this._target.updateScrollBarVisible();\n            evt.stopPropagation();\n            this.globalToLocal(evt.stageX, evt.stageY, this._dragOffset);\n            this._dragOffset.x -= this._grip.x;\n            this._dragOffset.y -= this._grip.y;\n            this._grip.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__gripMouseMove, this);\n            this._grip.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.__gripMouseUp, this);\n        };\n        GScrollBar.prototype.__gripMouseMove = function (evt) {\n            if (!this.onStage)\n                return;\n            var pt = this.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            if (this._vertical) {\n                var curY = pt.y - this._dragOffset.y;\n                this._target.setPercY((curY - this._bar.y) / (this._bar.height - this._grip.height), false);\n            }\n            else {\n                var curX = pt.x - this._dragOffset.x;\n                this._target.setPercX((curX - this._bar.x) / (this._bar.width - this._grip.width), false);\n            }\n        };\n        GScrollBar.prototype.__gripMouseUp = function (evt) {\n            var st = evt.currentTarget;\n            st.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__gripMouseMove, this);\n            st.removeEventListener(egret.TouchEvent.TOUCH_END, this.__gripMouseUp, this);\n            if (this.onStage)\n                return;\n            this._gripDragging = false;\n            this._target.updateScrollBarVisible();\n        };\n        GScrollBar.prototype.__arrowButton1Click = function (evt) {\n            evt.stopPropagation();\n            if (this._vertical)\n                this._target.scrollUp();\n            else\n                this._target.scrollLeft();\n        };\n        GScrollBar.prototype.__arrowButton2Click = function (evt) {\n            evt.stopPropagation();\n            if (this._vertical)\n                this._target.scrollDown();\n            else\n                this._target.scrollRight();\n        };\n        GScrollBar.prototype.__barMouseDown = function (evt) {\n            var pt = this._grip.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            if (this._vertical) {\n                if (pt.y < 0)\n                    this._target.scrollUp(4);\n                else\n                    this._target.scrollDown(4);\n            }\n            else {\n                if (pt.x < 0)\n                    this._target.scrollLeft(4);\n                else\n                    this._target.scrollRight(4);\n            }\n        };\n        return GScrollBar;\n    }(fgui.GComponent));\n    fgui.GScrollBar = GScrollBar;\n    var s_vec2 = new egret.Point();\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GSlider = (function (_super_1) {\n        __extends(GSlider, _super_1);\n        function GSlider() {\n            var _this = _super_1.call(this) || this;\n            _this._min = 0;\n            _this._max = 0;\n            _this._value = 0;\n            _this._barMaxWidth = 0;\n            _this._barMaxHeight = 0;\n            _this._barMaxWidthDelta = 0;\n            _this._barMaxHeightDelta = 0;\n            _this._clickPercent = 0;\n            _this._barStartX = 0;\n            _this._barStartY = 0;\n            _this.changeOnClick = true;\n            _this.canDrag = true;\n            _this._titleType = fgui.ProgressTitleType.Percent;\n            _this._value = 50;\n            _this._max = 100;\n            _this._clickPos = new egret.Point();\n            return _this;\n        }\n        Object.defineProperty(GSlider.prototype, \"titleType\", {\n            get: function () {\n                return this._titleType;\n            },\n            set: function (value) {\n                this._titleType = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GSlider.prototype, \"wholeNumbers\", {\n            get: function () {\n                return this._wholeNumbers;\n            },\n            set: function (value) {\n                if (this._wholeNumbers != value) {\n                    this._wholeNumbers = value;\n                    this.update();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GSlider.prototype, \"min\", {\n            get: function () {\n                return this._min;\n            },\n            set: function (value) {\n                if (this._min != value) {\n                    this._min = value;\n                    this.update();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GSlider.prototype, \"max\", {\n            get: function () {\n                return this._max;\n            },\n            set: function (value) {\n                if (this._max != value) {\n                    this._max = value;\n                    this.update();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GSlider.prototype, \"value\", {\n            get: function () {\n                return this._value;\n            },\n            set: function (value) {\n                if (this._value != value) {\n                    this._value = value;\n                    this.update();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GSlider.prototype.update = function () {\n            this.updateWithPercent((this._value - this._min) / (this._max - this._min));\n        };\n        GSlider.prototype.updateWithPercent = function (percent, manual) {\n            percent = fgui.ToolSet.clamp01(percent);\n            if (manual) {\n                var newValue = fgui.ToolSet.clamp(this._min + (this._max - this._min) * percent, this._min, this._max);\n                if (this._wholeNumbers) {\n                    newValue = Math.round(newValue);\n                    percent = fgui.ToolSet.clamp01((newValue - this._min) / (this._max - this._min));\n                }\n                if (newValue != this._value) {\n                    this._value = newValue;\n                    this.dispatchEvent(new fgui.StateChangeEvent(fgui.StateChangeEvent.CHANGED));\n                }\n            }\n            if (this._titleObject) {\n                switch (this._titleType) {\n                    case fgui.ProgressTitleType.Percent:\n                        this._titleObject.text = Math.floor(percent * 100) + \"%\";\n                        break;\n                    case fgui.ProgressTitleType.ValueAndMax:\n                        this._titleObject.text = this._value + \"/\" + this._max;\n                        break;\n                    case fgui.ProgressTitleType.Value:\n                        this._titleObject.text = \"\" + this._value;\n                        break;\n                    case fgui.ProgressTitleType.Max:\n                        this._titleObject.text = \"\" + this._max;\n                        break;\n                }\n            }\n            var fullWidth = this.width - this._barMaxWidthDelta;\n            var fullHeight = this.height - this._barMaxHeightDelta;\n            if (!this._reverse) {\n                if (this._barObjectH)\n                    this._barObjectH.width = Math.round(fullWidth * percent);\n                if (this._barObjectV)\n                    this._barObjectV.height = Math.round(fullHeight * percent);\n            }\n            else {\n                if (this._barObjectH) {\n                    this._barObjectH.width = Math.round(fullWidth * percent);\n                    this._barObjectH.x = this._barStartX + (fullWidth - this._barObjectH.width);\n                }\n                if (this._barObjectV) {\n                    this._barObjectV.height = Math.round(fullHeight * percent);\n                    this._barObjectV.y = this._barStartY + (fullHeight - this._barObjectV.height);\n                }\n            }\n        };\n        GSlider.prototype.constructExtension = function (buffer) {\n            buffer.seek(0, 6);\n            this._titleType = buffer.readByte();\n            this._reverse = buffer.readBool();\n            if (buffer.version >= 2) {\n                this._wholeNumbers = buffer.readBool();\n                this.changeOnClick = buffer.readBool();\n            }\n            this._titleObject = (this.getChild(\"title\"));\n            this._barObjectH = this.getChild(\"bar\");\n            this._barObjectV = this.getChild(\"bar_v\");\n            this._gripObject = this.getChild(\"grip\");\n            if (this._barObjectH) {\n                this._barMaxWidth = this._barObjectH.width;\n                this._barMaxWidthDelta = this.width - this._barMaxWidth;\n                this._barStartX = this._barObjectH.x;\n            }\n            if (this._barObjectV) {\n                this._barMaxHeight = this._barObjectV.height;\n                this._barMaxHeightDelta = this.height - this._barMaxHeight;\n                this._barStartY = this._barObjectV.y;\n            }\n            if (this._gripObject) {\n                this._gripObject.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__gripMouseDown, this);\n            }\n            this.displayObject.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__barMouseDown, this);\n        };\n        GSlider.prototype.handleSizeChanged = function () {\n            _super_1.prototype.handleSizeChanged.call(this);\n            if (this._barObjectH)\n                this._barMaxWidth = this.width - this._barMaxWidthDelta;\n            if (this._barObjectV)\n                this._barMaxHeight = this.height - this._barMaxHeightDelta;\n            if (!this._underConstruct)\n                this.update();\n        };\n        GSlider.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            if (!buffer.seek(beginPos, 6)) {\n                this.update();\n                return;\n            }\n            if (buffer.readByte() != this.packageItem.objectType) {\n                this.update();\n                return;\n            }\n            this._value = buffer.readInt();\n            this._max = buffer.readInt();\n            if (buffer.version >= 2)\n                this._min = buffer.readInt();\n            this.update();\n        };\n        GSlider.prototype.__gripMouseDown = function (evt) {\n            this.canDrag = true;\n            evt.stopPropagation();\n            this._clickPos = this.globalToLocal(evt.stageX, evt.stageY);\n            this._clickPercent = fgui.ToolSet.clamp01((this._value - this._min) / (this._max - this._min));\n            this._gripObject.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__gripMouseMove, this);\n            this._gripObject.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.__gripMouseUp, this);\n        };\n        GSlider.prototype.__gripMouseMove = function (evt) {\n            if (!this.canDrag) {\n                return;\n            }\n            var pt = this.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            var deltaX = pt.x - this._clickPos.x;\n            var deltaY = pt.y - this._clickPos.y;\n            if (this._reverse) {\n                deltaX = -deltaX;\n                deltaY = -deltaY;\n            }\n            var percent;\n            if (this._barObjectH)\n                percent = this._clickPercent + deltaX / this._barMaxWidth;\n            else\n                percent = this._clickPercent + deltaY / this._barMaxHeight;\n            this.updateWithPercent(percent, true);\n        };\n        GSlider.prototype.__gripMouseUp = function (evt) {\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__gripMouseMove, this);\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_END, this.__gripMouseUp, this);\n        };\n        GSlider.prototype.__barMouseDown = function (evt) {\n            if (!this.changeOnClick)\n                return;\n            var pt = this._gripObject.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            var percent = fgui.ToolSet.clamp01((this._value - this._min) / (this._max - this._min));\n            var delta;\n            if (this._barObjectH)\n                delta = pt.x / this._barMaxWidth;\n            if (this._barObjectV)\n                delta = pt.y / this._barMaxHeight;\n            if (this._reverse)\n                percent -= delta;\n            else\n                percent += delta;\n            this.updateWithPercent(percent, true);\n        };\n        return GSlider;\n    }(fgui.GComponent));\n    fgui.GSlider = GSlider;\n    var s_vec2 = new egret.Point();\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GTextInput = (function (_super_1) {\n        __extends(GTextInput, _super_1);\n        function GTextInput() {\n            var _this = _super_1.call(this) || this;\n            _this._widthAutoSize = false;\n            _this._heightAutoSize = false;\n            _this.displayObject.touchChildren = true;\n            _this._textField.type = egret.TextFieldType.INPUT;\n            _this._textField.addEventListener(egret.Event.CHANGE, _this.__textChanged, _this);\n            _this._textField.addEventListener(egret.FocusEvent.FOCUS_IN, _this.__focusIn, _this);\n            _this._textField.addEventListener(egret.FocusEvent.FOCUS_OUT, _this.__focusOut, _this);\n            return _this;\n        }\n        GTextInput.prototype.dispose = function () {\n            _super_1.prototype.dispose.call(this);\n        };\n        Object.defineProperty(GTextInput.prototype, \"editable\", {\n            get: function () {\n                return this._textField.type == egret.TextFieldType.INPUT;\n            },\n            set: function (val) {\n                if (val)\n                    this._textField.type = egret.TextFieldType.INPUT;\n                else\n                    this._textField.type = egret.TextFieldType.DYNAMIC;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextInput.prototype, \"maxLength\", {\n            get: function () {\n                return this._textField.maxChars;\n            },\n            set: function (val) {\n                this._textField.maxChars = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextInput.prototype, \"promptText\", {\n            get: function () {\n                return this._promptText;\n            },\n            set: function (val) {\n                this._promptText = val;\n                this.updateTextFieldText();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextInput.prototype, \"restrict\", {\n            get: function () {\n                return this._textField.restrict;\n            },\n            set: function (value) {\n                this._textField.restrict = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextInput.prototype, \"password\", {\n            get: function () {\n                return this._password;\n            },\n            set: function (val) {\n                if (this._password != val) {\n                    this._password = val;\n                    this._textField.displayAsPassword = this._password;\n                    if (val)\n                        this._textField.inputType = egret.TextFieldInputType.PASSWORD;\n                    else\n                        this._textField.inputType = egret.TextFieldInputType.TEXT;\n                    this.render();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextInput.prototype, \"verticalAlign\", {\n            get: function () {\n                return this._verticalAlign;\n            },\n            set: function (value) {\n                if (this._verticalAlign != value) {\n                    this._verticalAlign = value;\n                    this.updateVertAlign();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTextInput.prototype.updateVertAlign = function () {\n            switch (this._verticalAlign) {\n                case fgui.VertAlignType.Top:\n                    this._textField.verticalAlign = egret.VerticalAlign.TOP;\n                    break;\n                case fgui.VertAlignType.Middle:\n                    this._textField.verticalAlign = egret.VerticalAlign.MIDDLE;\n                    break;\n                case fgui.VertAlignType.Bottom:\n                    this._textField.verticalAlign = egret.VerticalAlign.BOTTOM;\n                    break;\n            }\n        };\n        GTextInput.prototype.updateTextFieldText = function () {\n            if (!this._text && this._promptText) {\n                this._textField.displayAsPassword = false;\n                this._textField.textFlow = (new egret.HtmlTextParser).parser(fgui.UBBParser.inst.parse(this._promptText));\n            }\n            else {\n                this._textField.displayAsPassword = this._password;\n                if (this._ubbEnabled)\n                    this._textField.textFlow = (new egret.HtmlTextParser).parser(fgui.UBBParser.inst.parse(fgui.ToolSet.encodeHTML(this._text)));\n                else\n                    this._textField.text = this._text;\n            }\n        };\n        GTextInput.prototype.handleSizeChanged = function () {\n            if (!this._updatingSize) {\n                this._textField.width = Math.ceil(this.width);\n                this._textField.height = Math.ceil(this.height);\n            }\n        };\n        GTextInput.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 4);\n            var str = buffer.readS();\n            if (str != null)\n                this._promptText = str;\n            str = buffer.readS();\n            if (str != null)\n                this._textField.restrict = str;\n            var iv = buffer.readInt();\n            if (iv != 0)\n                this._textField.maxChars = iv;\n            iv = buffer.readInt();\n            if (iv != 0) {\n            }\n            if (buffer.readBool())\n                this.password = true;\n            this.updateVertAlign();\n        };\n        GTextInput.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            if (!this._text && this._promptText) {\n                this._textField.displayAsPassword = false;\n                this._textField.textFlow = (new egret.HtmlTextParser).parser(fgui.UBBParser.inst.parse(fgui.ToolSet.encodeHTML(this._promptText)));\n            }\n        };\n        GTextInput.prototype.__textChanged = function (evt) {\n            this._text = this._textField.text;\n        };\n        GTextInput.prototype.__focusIn = function (evt) {\n            if (!this._text && this._promptText) {\n                this._textField.displayAsPassword = this._password;\n                this._textField.text = \"\";\n            }\n        };\n        GTextInput.prototype.__focusOut = function (evt) {\n            this._text = this._textField.text;\n            if (!this._text && this._promptText) {\n                this._textField.displayAsPassword = false;\n                this._textField.textFlow = (new egret.HtmlTextParser).parser(fgui.UBBParser.inst.parse(fgui.ToolSet.encodeHTML(this._promptText)));\n            }\n        };\n        return GTextInput;\n    }(fgui.GTextField));\n    fgui.GTextInput = GTextInput;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GTree = (function (_super_1) {\n        __extends(GTree, _super_1);\n        function GTree() {\n            var _this = _super_1.call(this) || this;\n            _this._indent = 15;\n            _this._rootNode = new fgui.GTreeNode(true);\n            _this._rootNode._setTree(_this);\n            _this._rootNode.expanded = true;\n            return _this;\n        }\n        Object.defineProperty(GTree.prototype, \"rootNode\", {\n            get: function () {\n                return this._rootNode;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTree.prototype, \"indent\", {\n            get: function () {\n                return this._indent;\n            },\n            set: function (value) {\n                this._indent = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTree.prototype, \"clickToExpand\", {\n            get: function () {\n                return this._clickToExpand;\n            },\n            set: function (value) {\n                this._clickToExpand = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTree.prototype.getSelectedNode = function () {\n            if (this.selectedIndex != -1)\n                return this.getChildAt(this.selectedIndex)._treeNode;\n            else\n                return null;\n        };\n        GTree.prototype.getSelectedNodes = function (result) {\n            if (!result)\n                result = new Array();\n            s_list.length = 0;\n            _super_1.prototype.getSelection.call(this, s_list);\n            var cnt = s_list.length;\n            var ret = new Array();\n            for (var i = 0; i < cnt; i++) {\n                var node = this.getChildAt(s_list[i])._treeNode;\n                ret.push(node);\n            }\n            return ret;\n        };\n        GTree.prototype.selectNode = function (node, scrollItToView) {\n            var parentNode = node.parent;\n            while (parentNode && parentNode != this._rootNode) {\n                parentNode.expanded = true;\n                parentNode = parentNode.parent;\n            }\n            if (!node._cell)\n                return;\n            this.addSelection(this.getChildIndex(node._cell), scrollItToView);\n        };\n        GTree.prototype.unselectNode = function (node) {\n            if (!node._cell)\n                return;\n            this.removeSelection(this.getChildIndex(node._cell));\n        };\n        GTree.prototype.expandAll = function (folderNode) {\n            if (!folderNode)\n                folderNode = this._rootNode;\n            folderNode.expanded = true;\n            var cnt = folderNode.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                var node = folderNode.getChildAt(i);\n                if (node.isFolder)\n                    this.expandAll(node);\n            }\n        };\n        GTree.prototype.collapseAll = function (folderNode) {\n            if (!folderNode)\n                folderNode = this._rootNode;\n            if (folderNode != this._rootNode)\n                folderNode.expanded = false;\n            var cnt = folderNode.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                var node = folderNode.getChildAt(i);\n                if (node.isFolder)\n                    this.collapseAll(node);\n            }\n        };\n        GTree.prototype.createCell = function (node) {\n            var child = this.getFromPool(node._resURL ? node._resURL : this.defaultItem);\n            if (!(child instanceof fgui.GComponent))\n                throw new Error(\"cannot create tree node object.\");\n            child._treeNode = node;\n            node._cell = child;\n            var indentObj = child.getChild(\"indent\");\n            if (indentObj != null)\n                indentObj.width = (node.level - 1) * this._indent;\n            var cc;\n            cc = child.getController(\"expanded\");\n            if (cc) {\n                cc.addEventListener(fgui.StateChangeEvent.CHANGED, this.__expandedStateChanged, this);\n                cc.selectedIndex = node.expanded ? 1 : 0;\n            }\n            cc = child.getController(\"leaf\");\n            if (cc)\n                cc.selectedIndex = node.isFolder ? 0 : 1;\n            if (node.isFolder)\n                child.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__cellMouseDown, this);\n            if (this.treeNodeRender)\n                this.treeNodeRender.call(this.callbackThisObj, node, child);\n        };\n        GTree.prototype._afterInserted = function (node) {\n            if (!node._cell)\n                this.createCell(node);\n            var index = this.getInsertIndexForNode(node);\n            this.addChildAt(node._cell, index);\n            if (this.treeNodeRender)\n                this.treeNodeRender.call(this.callbackThisObj, node, node._cell);\n            if (node.isFolder && node.expanded)\n                this.checkChildren(node, index);\n        };\n        GTree.prototype.getInsertIndexForNode = function (node) {\n            var prevNode = node.getPrevSibling();\n            if (prevNode == null)\n                prevNode = node.parent;\n            var insertIndex = this.getChildIndex(prevNode._cell) + 1;\n            var myLevel = node.level;\n            var cnt = this.numChildren;\n            for (var i = insertIndex; i < cnt; i++) {\n                var testNode = this.getChildAt(i)._treeNode;\n                if (testNode.level <= myLevel)\n                    break;\n                insertIndex++;\n            }\n            return insertIndex;\n        };\n        GTree.prototype._afterRemoved = function (node) {\n            this.removeNode(node);\n        };\n        GTree.prototype._afterExpanded = function (node) {\n            if (node == this._rootNode) {\n                this.checkChildren(this._rootNode, 0);\n                return;\n            }\n            if (this.treeNodeWillExpand != null)\n                this.treeNodeWillExpand.call(this.callbackThisObj, node, true);\n            if (node._cell == null)\n                return;\n            if (this.treeNodeRender)\n                this.treeNodeRender.call(this.callbackThisObj, node, node._cell);\n            var cc = node._cell.getController(\"expanded\");\n            if (cc)\n                cc.selectedIndex = 1;\n            if (node._cell.parent)\n                this.checkChildren(node, this.getChildIndex(node._cell));\n        };\n        GTree.prototype._afterCollapsed = function (node) {\n            if (node == this._rootNode) {\n                this.checkChildren(this._rootNode, 0);\n                return;\n            }\n            if (this.treeNodeWillExpand)\n                this.treeNodeWillExpand.call(this.callbackThisObj, node, false);\n            if (node._cell == null)\n                return;\n            if (this.treeNodeRender)\n                this.treeNodeRender.call(this.callbackThisObj, node, node._cell);\n            var cc = node._cell.getController(\"expanded\");\n            if (cc)\n                cc.selectedIndex = 0;\n            if (node._cell.parent)\n                this.hideFolderNode(node);\n        };\n        GTree.prototype._afterMoved = function (node) {\n            var startIndex = this.getChildIndex(node._cell);\n            var endIndex;\n            if (node.isFolder)\n                endIndex = this.getFolderEndIndex(startIndex, node.level);\n            else\n                endIndex = startIndex + 1;\n            var insertIndex = this.getInsertIndexForNode(node);\n            var i;\n            var cnt = endIndex - startIndex;\n            var obj;\n            if (insertIndex < startIndex) {\n                for (i = 0; i < cnt; i++) {\n                    obj = this.getChildAt(startIndex + i);\n                    this.setChildIndex(obj, insertIndex + i);\n                }\n            }\n            else {\n                for (i = 0; i < cnt; i++) {\n                    obj = this.getChildAt(startIndex);\n                    this.setChildIndex(obj, insertIndex);\n                }\n            }\n        };\n        GTree.prototype.getFolderEndIndex = function (startIndex, level) {\n            var cnt = this.numChildren;\n            for (var i = startIndex + 1; i < cnt; i++) {\n                var node = this.getChildAt(i)._treeNode;\n                if (node.level <= level)\n                    return i;\n            }\n            return cnt;\n        };\n        GTree.prototype.checkChildren = function (folderNode, index) {\n            var cnt = folderNode.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                index++;\n                var node = folderNode.getChildAt(i);\n                if (node._cell == null)\n                    this.createCell(node);\n                if (!node._cell.parent)\n                    this.addChildAt(node._cell, index);\n                if (node.isFolder && node.expanded)\n                    index = this.checkChildren(node, index);\n            }\n            return index;\n        };\n        GTree.prototype.hideFolderNode = function (folderNode) {\n            var cnt = folderNode.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                var node = folderNode.getChildAt(i);\n                if (node._cell)\n                    this.removeChild(node._cell);\n                if (node.isFolder && node.expanded)\n                    this.hideFolderNode(node);\n            }\n        };\n        GTree.prototype.removeNode = function (node) {\n            if (node._cell) {\n                if (node._cell.parent)\n                    this.removeChild(node._cell);\n                this.returnToPool(node._cell);\n                node._cell._treeNode = null;\n                node._cell = null;\n            }\n            if (node.isFolder) {\n                var cnt = node.numChildren;\n                for (var i = 0; i < cnt; i++) {\n                    var node2 = node.getChildAt(i);\n                    this.removeNode(node2);\n                }\n            }\n        };\n        GTree.prototype.__cellMouseDown = function (evt) {\n            var node = evt.currentTarget._treeNode;\n            this._expandedStatusInEvt = node.expanded;\n        };\n        GTree.prototype.__expandedStateChanged = function (evt) {\n            var cc = evt.currentTarget;\n            var node = cc.parent._treeNode;\n            node.expanded = cc.selectedIndex == 1;\n        };\n        GTree.prototype.dispatchItemEvent = function (evt) {\n            if (this._clickToExpand != 0) {\n                var node = evt.itemObject._treeNode;\n                if (node && node.isFolder && this._expandedStatusInEvt == node.expanded) {\n                    if (this._clickToExpand == 2) {\n                    }\n                    else\n                        node.expanded = !node.expanded;\n                }\n            }\n            _super_1.prototype.dispatchItemEvent.call(this, evt);\n        };\n        GTree.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 9);\n            this._indent = buffer.readInt();\n            this._clickToExpand = buffer.readByte();\n        };\n        GTree.prototype.readItems = function (buffer) {\n            var cnt;\n            var i;\n            var nextPos;\n            var str;\n            var isFolder;\n            var lastNode;\n            var level;\n            var prevLevel = 0;\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                str = buffer.readS();\n                if (str == null) {\n                    str = this.defaultItem;\n                    if (!str) {\n                        buffer.position = nextPos;\n                        continue;\n                    }\n                }\n                isFolder = buffer.readBool();\n                level = buffer.readByte();\n                var node = new fgui.GTreeNode(isFolder, str);\n                node.expanded = true;\n                if (i == 0)\n                    this._rootNode.addChild(node);\n                else {\n                    if (level > prevLevel)\n                        lastNode.addChild(node);\n                    else if (level < prevLevel) {\n                        for (var j = level; j <= prevLevel; j++)\n                            lastNode = lastNode.parent;\n                        lastNode.addChild(node);\n                    }\n                    else\n                        lastNode.parent.addChild(node);\n                }\n                lastNode = node;\n                prevLevel = level;\n                this.setupItem(buffer, node.cell);\n                buffer.position = nextPos;\n            }\n        };\n        return GTree;\n    }(fgui.GList));\n    fgui.GTree = GTree;\n    var s_list = new Array();\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GTreeNode = (function () {\n        function GTreeNode(hasChild, resURL) {\n            this._level = 0;\n            this._resURL = resURL;\n            if (hasChild)\n                this._children = new Array();\n        }\n        Object.defineProperty(GTreeNode.prototype, \"expanded\", {\n            get: function () {\n                return this._expanded;\n            },\n            set: function (value) {\n                if (!this._children)\n                    return;\n                if (this._expanded != value) {\n                    this._expanded = value;\n                    if (this._tree) {\n                        if (this._expanded)\n                            this._tree._afterExpanded(this);\n                        else\n                            this._tree._afterCollapsed(this);\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTreeNode.prototype, \"isFolder\", {\n            get: function () {\n                return this._children != null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTreeNode.prototype, \"parent\", {\n            get: function () {\n                return this._parent;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTreeNode.prototype, \"text\", {\n            get: function () {\n                if (this._cell)\n                    return this._cell.text;\n                else\n                    return null;\n            },\n            set: function (value) {\n                if (this._cell)\n                    this._cell.text = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTreeNode.prototype, \"icon\", {\n            get: function () {\n                if (this._cell)\n                    return this._cell.icon;\n                else\n                    return null;\n            },\n            set: function (value) {\n                if (this._cell)\n                    this._cell.icon = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTreeNode.prototype, \"cell\", {\n            get: function () {\n                return this._cell;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTreeNode.prototype, \"level\", {\n            get: function () {\n                return this._level;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTreeNode.prototype._setLevel = function (value) {\n            this._level = value;\n        };\n        GTreeNode.prototype.addChild = function (child) {\n            this.addChildAt(child, this._children.length);\n            return child;\n        };\n        GTreeNode.prototype.addChildAt = function (child, index) {\n            if (!child)\n                throw new Error(\"child is null\");\n            var numChildren = this._children.length;\n            if (index >= 0 && index <= numChildren) {\n                if (child._parent == this) {\n                    this.setChildIndex(child, index);\n                }\n                else {\n                    if (child._parent)\n                        child._parent.removeChild(child);\n                    var cnt = this._children.length;\n                    if (index == cnt)\n                        this._children.push(child);\n                    else\n                        this._children.splice(index, 0, child);\n                    child._parent = this;\n                    child._level = this._level + 1;\n                    child._setTree(this._tree);\n                    if (this._tree && this == this._tree.rootNode || this._cell && this._cell.parent && this._expanded)\n                        this._tree._afterInserted(child);\n                }\n                return child;\n            }\n            else {\n                throw new RangeError(\"Invalid child index\");\n            }\n        };\n        GTreeNode.prototype.removeChild = function (child) {\n            var childIndex = this._children.indexOf(child);\n            if (childIndex != -1) {\n                this.removeChildAt(childIndex);\n            }\n            return child;\n        };\n        GTreeNode.prototype.removeChildAt = function (index) {\n            if (index >= 0 && index < this.numChildren) {\n                var child = this._children[index];\n                this._children.splice(index, 1);\n                child._parent = null;\n                if (this._tree) {\n                    child._setTree(null);\n                    this._tree._afterRemoved(child);\n                }\n                return child;\n            }\n            else {\n                throw \"Invalid child index\";\n            }\n        };\n        GTreeNode.prototype.removeChildren = function (beginIndex, endIndex) {\n            beginIndex = beginIndex || 0;\n            if (endIndex == null)\n                endIndex = -1;\n            if (endIndex < 0 || endIndex >= this.numChildren)\n                endIndex = this.numChildren - 1;\n            for (var i = beginIndex; i <= endIndex; ++i)\n                this.removeChildAt(beginIndex);\n        };\n        GTreeNode.prototype.getChildAt = function (index) {\n            if (index >= 0 && index < this.numChildren)\n                return this._children[index];\n            else\n                throw \"Invalid child index\";\n        };\n        GTreeNode.prototype.getChildIndex = function (child) {\n            return this._children.indexOf(child);\n        };\n        GTreeNode.prototype.getPrevSibling = function () {\n            if (this._parent == null)\n                return null;\n            var i = this._parent._children.indexOf(this);\n            if (i <= 0)\n                return null;\n            return this._parent._children[i - 1];\n        };\n        GTreeNode.prototype.getNextSibling = function () {\n            if (this._parent == null)\n                return null;\n            var i = this._parent._children.indexOf(this);\n            if (i < 0 || i >= this._parent._children.length - 1)\n                return null;\n            return this._parent._children[i + 1];\n        };\n        GTreeNode.prototype.setChildIndex = function (child, index) {\n            var oldIndex = this._children.indexOf(child);\n            if (oldIndex == -1)\n                throw \"Not a child of this container\";\n            var cnt = this._children.length;\n            if (index < 0)\n                index = 0;\n            else if (index > cnt)\n                index = cnt;\n            if (oldIndex == index)\n                return;\n            this._children.splice(oldIndex, 1);\n            this._children.splice(index, 0, child);\n            if (this._tree && this == this._tree.rootNode || this._cell && this._cell.parent && this._expanded)\n                this._tree._afterMoved(child);\n        };\n        GTreeNode.prototype.swapChildren = function (child1, child2) {\n            var index1 = this._children.indexOf(child1);\n            var index2 = this._children.indexOf(child2);\n            if (index1 == -1 || index2 == -1)\n                throw \"Not a child of this container\";\n            this.swapChildrenAt(index1, index2);\n        };\n        GTreeNode.prototype.swapChildrenAt = function (index1, index2) {\n            var child1 = this._children[index1];\n            var child2 = this._children[index2];\n            this.setChildIndex(child1, index2);\n            this.setChildIndex(child2, index1);\n        };\n        Object.defineProperty(GTreeNode.prototype, \"numChildren\", {\n            get: function () {\n                return this._children.length;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTreeNode.prototype.expandToRoot = function () {\n            var p = this;\n            while (p) {\n                p.expanded = true;\n                p = p.parent;\n            }\n        };\n        Object.defineProperty(GTreeNode.prototype, \"tree\", {\n            get: function () {\n                return this._tree;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTreeNode.prototype._setTree = function (value) {\n            this._tree = value;\n            if (this._tree && this._tree.treeNodeWillExpand && this._expanded)\n                this._tree.treeNodeWillExpand(this, true);\n            if (this._children) {\n                var cnt = this._children.length;\n                for (var i = 0; i < cnt; i++) {\n                    var node = this._children[i];\n                    node._level = this._level + 1;\n                    node._setTree(value);\n                }\n            }\n        };\n        return GTreeNode;\n    }());\n    fgui.GTreeNode = GTreeNode;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var Margin = (function () {\n        function Margin() {\n            this.left = 0;\n            this.right = 0;\n            this.top = 0;\n            this.bottom = 0;\n        }\n        Margin.prototype.copy = function (source) {\n            this.top = source.top;\n            this.bottom = source.bottom;\n            this.left = source.left;\n            this.right = source.right;\n        };\n        return Margin;\n    }());\n    fgui.Margin = Margin;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var PixelHitTest = (function () {\n        function PixelHitTest(data, offsetX, offsetY) {\n            this._data = data;\n            this.offsetX = offsetX;\n            this.offsetY = offsetY;\n            this.scaleX = 1;\n            this.scaleY = 1;\n        }\n        PixelHitTest.prototype.contains = function (x, y) {\n            x = Math.floor((x / this.scaleX - this.offsetX) * this._data.scale);\n            y = Math.floor((y / this.scaleY - this.offsetY) * this._data.scale);\n            if (x < 0 || y < 0 || x >= this._data.pixelWidth)\n                return false;\n            var pos = y * this._data.pixelWidth + x;\n            var pos2 = Math.floor(pos / 8);\n            var pos3 = pos % 8;\n            if (pos2 >= 0 && pos2 < this._data.pixels.length)\n                return ((this._data.pixels[pos2] >> pos3) & 0x1) == 1;\n            else\n                return false;\n        };\n        return PixelHitTest;\n    }());\n    fgui.PixelHitTest = PixelHitTest;\n    var PixelHitTestData = (function () {\n        function PixelHitTestData() {\n        }\n        PixelHitTestData.prototype.load = function (ba) {\n            ba.readInt();\n            this.pixelWidth = ba.readInt();\n            this.scale = 1 / ba.readByte();\n            var len = ba.readInt();\n            this.pixels = [];\n            for (var i = 0; i < len; i++) {\n                var j = ba.readByte();\n                if (j < 0)\n                    j += 256;\n                this.pixels[i] = j;\n            }\n        };\n        return PixelHitTestData;\n    }());\n    fgui.PixelHitTestData = PixelHitTestData;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var PackageItem = (function () {\n        function PackageItem() {\n            this.width = 0;\n            this.height = 0;\n        }\n        PackageItem.prototype.load = function () {\n            return this.owner.getItemAsset(this);\n        };\n        PackageItem.prototype.getBranch = function () {\n            if (this.branches && this.owner._branchIndex != -1) {\n                var itemId = this.branches[this.owner._branchIndex];\n                if (itemId)\n                    return this.owner.getItemById(itemId);\n            }\n            return this;\n        };\n        PackageItem.prototype.getHighResolution = function () {\n            if (this.highResolution && fgui.GRoot.contentScaleLevel > 0) {\n                var itemId = this.highResolution[fgui.GRoot.contentScaleLevel - 1];\n                if (itemId)\n                    return this.owner.getItemById(itemId);\n            }\n            return this;\n        };\n        PackageItem.prototype.toString = function () {\n            return this.name;\n        };\n        return PackageItem;\n    }());\n    fgui.PackageItem = PackageItem;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var PopupMenu = (function () {\n        function PopupMenu(resourceURL) {\n            if (!resourceURL) {\n                resourceURL = fgui.UIConfig.popupMenu;\n                if (!resourceURL)\n                    throw \"UIConfig.popupMenu not defined\";\n            }\n            this._contentPane = fgui.UIPackage.createObjectFromURL(resourceURL).asCom;\n            this._contentPane.addEventListener(egret.Event.ADDED_TO_STAGE, this.__addedToStage, this);\n            this._list = (this._contentPane.getChild(\"list\"));\n            this._list.removeChildrenToPool();\n            this._list.addRelation(this._contentPane, fgui.RelationType.Width);\n            this._list.removeRelation(this._contentPane, fgui.RelationType.Height);\n            this._contentPane.addRelation(this._list, fgui.RelationType.Height);\n            this._list.addEventListener(fgui.ItemEvent.CLICK, this.__clickItem, this);\n        }\n        PopupMenu.prototype.dispose = function () {\n            this._contentPane.dispose();\n        };\n        PopupMenu.prototype.addItem = function (caption, callback) {\n            var item = this._list.addItemFromPool().asButton;\n            item.title = caption;\n            item.data = callback;\n            item.grayed = false;\n            var c = item.getController(\"checked\");\n            if (c)\n                c.selectedIndex = 0;\n            return item;\n        };\n        PopupMenu.prototype.addItemAt = function (caption, index, callback) {\n            var item = this._list.getFromPool().asButton;\n            this._list.addChildAt(item, index);\n            item.title = caption;\n            item.data = callback;\n            item.grayed = false;\n            var c = item.getController(\"checked\");\n            if (c)\n                c.selectedIndex = 0;\n            return item;\n        };\n        PopupMenu.prototype.addSeperator = function () {\n            if (fgui.UIConfig.popupMenu_seperator == null)\n                throw \"UIConfig.popupMenu_seperator not defined\";\n            this.list.addItemFromPool(fgui.UIConfig.popupMenu_seperator);\n        };\n        PopupMenu.prototype.getItemName = function (index) {\n            var item = this._list.getChildAt(index);\n            return item.name;\n        };\n        PopupMenu.prototype.setItemText = function (name, caption) {\n            var item = this._list.getChild(name).asButton;\n            item.title = caption;\n        };\n        PopupMenu.prototype.setItemVisible = function (name, visible) {\n            var item = this._list.getChild(name).asButton;\n            if (item.visible != visible) {\n                item.visible = visible;\n                this._list.setBoundsChangedFlag();\n            }\n        };\n        PopupMenu.prototype.setItemGrayed = function (name, grayed) {\n            var item = this._list.getChild(name).asButton;\n            item.grayed = grayed;\n        };\n        PopupMenu.prototype.setItemCheckable = function (name, checkable) {\n            var item = this._list.getChild(name).asButton;\n            var c = item.getController(\"checked\");\n            if (c) {\n                if (checkable) {\n                    if (c.selectedIndex == 0)\n                        c.selectedIndex = 1;\n                }\n                else\n                    c.selectedIndex = 0;\n            }\n        };\n        PopupMenu.prototype.setItemChecked = function (name, checked) {\n            var item = this._list.getChild(name).asButton;\n            var c = item.getController(\"checked\");\n            if (c)\n                c.selectedIndex = checked ? 2 : 1;\n        };\n        PopupMenu.prototype.isItemChecked = function (name) {\n            var item = this._list.getChild(name).asButton;\n            var c = item.getController(\"checked\");\n            if (c)\n                return c.selectedIndex == 2;\n            else\n                return false;\n        };\n        PopupMenu.prototype.removeItem = function (name) {\n            var item = this._list.getChild(name);\n            if (item) {\n                var index = this._list.getChildIndex(item);\n                this._list.removeChildToPoolAt(index);\n                return true;\n            }\n            else\n                return false;\n        };\n        PopupMenu.prototype.clearItems = function () {\n            this._list.removeChildrenToPool();\n        };\n        Object.defineProperty(PopupMenu.prototype, \"itemCount\", {\n            get: function () {\n                return this._list.numChildren;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(PopupMenu.prototype, \"contentPane\", {\n            get: function () {\n                return this._contentPane;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(PopupMenu.prototype, \"list\", {\n            get: function () {\n                return this._list;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        PopupMenu.prototype.show = function (target, dir) {\n            var r = target ? target.root : fgui.GRoot.inst;\n            r.showPopup(this.contentPane, (target instanceof fgui.GRoot) ? null : target, dir);\n        };\n        PopupMenu.prototype.__clickItem = function (evt) {\n            fgui.GTimers.inst.add(100, 1, this.__clickItem2, this, evt);\n        };\n        PopupMenu.prototype.__clickItem2 = function (evt) {\n            var item = evt.itemObject.asButton;\n            if (item == null)\n                return;\n            if (item.grayed) {\n                this._list.selectedIndex = -1;\n                return;\n            }\n            var c = item.getController(\"checked\");\n            if (c && c.selectedIndex != 0) {\n                if (c.selectedIndex == 1)\n                    c.selectedIndex = 2;\n                else\n                    c.selectedIndex = 1;\n            }\n            var r = (this._contentPane.parent);\n            r.hidePopup(this.contentPane);\n            if (item.data != null) {\n                if (item.data.length == 1)\n                    item.data(evt);\n                else\n                    item.data();\n            }\n        };\n        PopupMenu.prototype.__addedToStage = function (evt) {\n            this._list.selectedIndex = -1;\n            this._list.resizeToFit(100000, 10);\n        };\n        return PopupMenu;\n    }());\n    fgui.PopupMenu = PopupMenu;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var RelationItem = (function () {\n        function RelationItem(owner) {\n            this._owner = owner;\n            this._defs = new Array();\n        }\n        Object.defineProperty(RelationItem.prototype, \"owner\", {\n            get: function () {\n                return this._owner;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(RelationItem.prototype, \"target\", {\n            get: function () {\n                return this._target;\n            },\n            set: function (value) {\n                if (this._target != value) {\n                    if (this._target)\n                        this.releaseRefTarget(this._target);\n                    this._target = value;\n                    if (this._target)\n                        this.addRefTarget(this._target);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        RelationItem.prototype.add = function (relationType, usePercent) {\n            if (relationType == fgui.RelationType.Size) {\n                this.add(fgui.RelationType.Width, usePercent);\n                this.add(fgui.RelationType.Height, usePercent);\n                return;\n            }\n            var length = this._defs.length;\n            for (var i = 0; i < length; i++) {\n                var def = this._defs[i];\n                if (def.type == relationType)\n                    return;\n            }\n            this.internalAdd(relationType, usePercent);\n        };\n        RelationItem.prototype.internalAdd = function (relationType, usePercent) {\n            if (relationType == fgui.RelationType.Size) {\n                this.internalAdd(fgui.RelationType.Width, usePercent);\n                this.internalAdd(fgui.RelationType.Height, usePercent);\n                return;\n            }\n            var info = new RelationDef();\n            info.percent = usePercent;\n            info.type = relationType;\n            info.axis = (relationType <= fgui.RelationType.Right_Right || relationType == fgui.RelationType.Width || relationType >= fgui.RelationType.LeftExt_Left && relationType <= fgui.RelationType.RightExt_Right) ? 0 : 1;\n            this._defs.push(info);\n            if (usePercent || relationType == fgui.RelationType.Left_Center || relationType == fgui.RelationType.Center_Center || relationType == fgui.RelationType.Right_Center\n                || relationType == fgui.RelationType.Top_Middle || relationType == fgui.RelationType.Middle_Middle || relationType == fgui.RelationType.Bottom_Middle)\n                this._owner.pixelSnapping = true;\n        };\n        RelationItem.prototype.remove = function (relationType) {\n            if (relationType === void 0) { relationType = 0; }\n            if (relationType == fgui.RelationType.Size) {\n                this.remove(fgui.RelationType.Width);\n                this.remove(fgui.RelationType.Height);\n                return;\n            }\n            var dc = this._defs.length;\n            for (var k = 0; k < dc; k++) {\n                if (this._defs[k].type == relationType) {\n                    this._defs.splice(k, 1);\n                    break;\n                }\n            }\n        };\n        RelationItem.prototype.copyFrom = function (source) {\n            this.target = source.target;\n            this._defs.length = 0;\n            var length = source._defs.length;\n            for (var i = 0; i < length; i++) {\n                var info = source._defs[i];\n                var info2 = new RelationDef();\n                info2.copyFrom(info);\n                this._defs.push(info2);\n            }\n        };\n        RelationItem.prototype.dispose = function () {\n            if (this._target) {\n                this.releaseRefTarget(this._target);\n                this._target = null;\n            }\n        };\n        Object.defineProperty(RelationItem.prototype, \"isEmpty\", {\n            get: function () {\n                return this._defs.length == 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        RelationItem.prototype.applyOnSelfResized = function (dWidth, dHeight, applyPivot) {\n            var ox = this._owner.x;\n            var oy = this._owner.y;\n            var length = this._defs.length;\n            for (var i = 0; i < length; i++) {\n                var info = this._defs[i];\n                switch (info.type) {\n                    case fgui.RelationType.Center_Center:\n                        this._owner.x -= (0.5 - (applyPivot ? this._owner.pivotX : 0)) * dWidth;\n                        break;\n                    case fgui.RelationType.Right_Center:\n                    case fgui.RelationType.Right_Left:\n                    case fgui.RelationType.Right_Right:\n                        this._owner.x -= (1 - (applyPivot ? this._owner.pivotX : 0)) * dWidth;\n                        break;\n                    case fgui.RelationType.Middle_Middle:\n                        this._owner.y -= (0.5 - (applyPivot ? this._owner.pivotY : 0)) * dHeight;\n                        break;\n                    case fgui.RelationType.Bottom_Middle:\n                    case fgui.RelationType.Bottom_Top:\n                    case fgui.RelationType.Bottom_Bottom:\n                        this._owner.y -= (1 - (applyPivot ? this._owner.pivotY : 0)) * dHeight;\n                        break;\n                }\n            }\n            if (ox != this._owner.x || oy != this._owner.y) {\n                ox = this._owner.x - ox;\n                oy = this._owner.y - oy;\n                this._owner.updateGearFromRelations(1, ox, oy);\n                if (this._owner.parent) {\n                    var len = this._owner.parent._transitions.length;\n                    if (len > 0) {\n                        for (var i = 0; i < len; ++i) {\n                            this._owner.parent._transitions[i].updateFromRelations(this._owner.id, ox, oy);\n                        }\n                    }\n                }\n            }\n        };\n        RelationItem.prototype.applyOnXYChanged = function (info, dx, dy) {\n            var tmp;\n            switch (info.type) {\n                case fgui.RelationType.Left_Left:\n                case fgui.RelationType.Left_Center:\n                case fgui.RelationType.Left_Right:\n                case fgui.RelationType.Center_Center:\n                case fgui.RelationType.Right_Left:\n                case fgui.RelationType.Right_Center:\n                case fgui.RelationType.Right_Right:\n                    this._owner.x += dx;\n                    break;\n                case fgui.RelationType.Top_Top:\n                case fgui.RelationType.Top_Middle:\n                case fgui.RelationType.Top_Bottom:\n                case fgui.RelationType.Middle_Middle:\n                case fgui.RelationType.Bottom_Top:\n                case fgui.RelationType.Bottom_Middle:\n                case fgui.RelationType.Bottom_Bottom:\n                    this._owner.y += dy;\n                    break;\n                case fgui.RelationType.Width:\n                case fgui.RelationType.Height:\n                    break;\n                case fgui.RelationType.LeftExt_Left:\n                case fgui.RelationType.LeftExt_Right:\n                    if (this._owner != this._target.parent) {\n                        tmp = this._owner.xMin;\n                        this._owner.width = this._owner._rawWidth - dx;\n                        this._owner.xMin = tmp + dx;\n                    }\n                    else\n                        this._owner.width = this._owner._rawWidth - dx;\n                    break;\n                case fgui.RelationType.RightExt_Left:\n                case fgui.RelationType.RightExt_Right:\n                    if (this._owner != this._target.parent) {\n                        tmp = this._owner.xMin;\n                        this._owner.width = this._owner._rawWidth + dx;\n                        this._owner.xMin = tmp;\n                    }\n                    else\n                        this._owner.width = this._owner._rawWidth + dx;\n                    break;\n                case fgui.RelationType.TopExt_Top:\n                case fgui.RelationType.TopExt_Bottom:\n                    if (this._owner != this._target.parent) {\n                        tmp = this._owner.yMin;\n                        this._owner.height = this._owner._rawHeight - dy;\n                        this._owner.yMin = tmp + dy;\n                    }\n                    else\n                        this._owner.height = this._owner._rawHeight - dy;\n                    break;\n                case fgui.RelationType.BottomExt_Top:\n                case fgui.RelationType.BottomExt_Bottom:\n                    if (this._owner != this._target.parent) {\n                        tmp = this._owner.yMin;\n                        this._owner.height = this._owner._rawHeight + dy;\n                        this._owner.yMin = tmp;\n                    }\n                    else\n                        this._owner.height = this._owner._rawHeight + dy;\n                    break;\n            }\n        };\n        RelationItem.prototype.applyOnSizeChanged = function (info) {\n            var pos = 0, pivot = 0, delta = 0;\n            var v, tmp;\n            if (info.axis == 0) {\n                if (this._target != this._owner.parent) {\n                    pos = this._target.x;\n                    if (this._target.pivotAsAnchor)\n                        pivot = this._target.pivotX;\n                }\n                if (info.percent) {\n                    if (this._targetWidth != 0)\n                        delta = this._target._width / this._targetWidth;\n                }\n                else\n                    delta = this._target._width - this._targetWidth;\n            }\n            else {\n                if (this._target != this._owner.parent) {\n                    pos = this._target.y;\n                    if (this._target.pivotAsAnchor)\n                        pivot = this._target.pivotY;\n                }\n                if (info.percent) {\n                    if (this._targetHeight != 0)\n                        delta = this._target._height / this._targetHeight;\n                }\n                else\n                    delta = this._target._height - this._targetHeight;\n            }\n            switch (info.type) {\n                case fgui.RelationType.Left_Left:\n                    if (info.percent)\n                        this._owner.xMin = pos + (this._owner.xMin - pos) * delta;\n                    else if (pivot != 0)\n                        this._owner.x += delta * (-pivot);\n                    break;\n                case fgui.RelationType.Left_Center:\n                    if (info.percent)\n                        this._owner.xMin = pos + (this._owner.xMin - pos) * delta;\n                    else\n                        this._owner.x += delta * (0.5 - pivot);\n                    break;\n                case fgui.RelationType.Left_Right:\n                    if (info.percent)\n                        this._owner.xMin = pos + (this._owner.xMin - pos) * delta;\n                    else\n                        this._owner.x += delta * (1 - pivot);\n                    break;\n                case fgui.RelationType.Center_Center:\n                    if (info.percent)\n                        this._owner.xMin = pos + (this._owner.xMin + this._owner._rawWidth * 0.5 - pos) * delta - this._owner._rawWidth * 0.5;\n                    else\n                        this._owner.x += delta * (0.5 - pivot);\n                    break;\n                case fgui.RelationType.Right_Left:\n                    if (info.percent)\n                        this._owner.xMin = pos + (this._owner.xMin + this._owner._rawWidth - pos) * delta - this._owner._rawWidth;\n                    else if (pivot != 0)\n                        this._owner.x += delta * (-pivot);\n                    break;\n                case fgui.RelationType.Right_Center:\n                    if (info.percent)\n                        this._owner.xMin = pos + (this._owner.xMin + this._owner._rawWidth - pos) * delta - this._owner._rawWidth;\n                    else\n                        this._owner.x += delta * (0.5 - pivot);\n                    break;\n                case fgui.RelationType.Right_Right:\n                    if (info.percent)\n                        this._owner.xMin = pos + (this._owner.xMin + this._owner._rawWidth - pos) * delta - this._owner._rawWidth;\n                    else\n                        this._owner.x += delta * (1 - pivot);\n                    break;\n                case fgui.RelationType.Top_Top:\n                    if (info.percent)\n                        this._owner.yMin = pos + (this._owner.yMin - pos) * delta;\n                    else if (pivot != 0)\n                        this._owner.y += delta * (-pivot);\n                    break;\n                case fgui.RelationType.Top_Middle:\n                    if (info.percent)\n                        this._owner.yMin = pos + (this._owner.yMin - pos) * delta;\n                    else\n                        this._owner.y += delta * (0.5 - pivot);\n                    break;\n                case fgui.RelationType.Top_Bottom:\n                    if (info.percent)\n                        this._owner.yMin = pos + (this._owner.yMin - pos) * delta;\n                    else\n                        this._owner.y += delta * (1 - pivot);\n                    break;\n                case fgui.RelationType.Middle_Middle:\n                    if (info.percent)\n                        this._owner.yMin = pos + (this._owner.yMin + this._owner._rawHeight * 0.5 - pos) * delta - this._owner._rawHeight * 0.5;\n                    else\n                        this._owner.y += delta * (0.5 - pivot);\n                    break;\n                case fgui.RelationType.Bottom_Top:\n                    if (info.percent)\n                        this._owner.yMin = pos + (this._owner.yMin + this._owner._rawHeight - pos) * delta - this._owner._rawHeight;\n                    else if (pivot != 0)\n                        this._owner.y += delta * (-pivot);\n                    break;\n                case fgui.RelationType.Bottom_Middle:\n                    if (info.percent)\n                        this._owner.yMin = pos + (this._owner.yMin + this._owner._rawHeight - pos) * delta - this._owner._rawHeight;\n                    else\n                        this._owner.y += delta * (0.5 - pivot);\n                    break;\n                case fgui.RelationType.Bottom_Bottom:\n                    if (info.percent)\n                        this._owner.yMin = pos + (this._owner.yMin + this._owner._rawHeight - pos) * delta - this._owner._rawHeight;\n                    else\n                        this._owner.y += delta * (1 - pivot);\n                    break;\n                case fgui.RelationType.Width:\n                    if (this._owner._underConstruct && this._owner == this._target.parent)\n                        v = this._owner.sourceWidth - this._target.initWidth;\n                    else\n                        v = this._owner._rawWidth - this._targetWidth;\n                    if (info.percent)\n                        v = v * delta;\n                    if (this._target == this._owner.parent) {\n                        if (this._owner.pivotAsAnchor) {\n                            tmp = this._owner.xMin;\n                            this._owner.setSize(this._target._width + v, this._owner._rawHeight, true);\n                            this._owner.xMin = tmp;\n                        }\n                        else\n                            this._owner.setSize(this._target._width + v, this._owner._rawHeight, true);\n                    }\n                    else\n                        this._owner.width = this._target._width + v;\n                    break;\n                case fgui.RelationType.Height:\n                    if (this._owner._underConstruct && this._owner == this._target.parent)\n                        v = this._owner.sourceHeight - this._target.initHeight;\n                    else\n                        v = this._owner._rawHeight - this._targetHeight;\n                    if (info.percent)\n                        v = v * delta;\n                    if (this._target == this._owner.parent) {\n                        if (this._owner.pivotAsAnchor) {\n                            tmp = this._owner.yMin;\n                            this._owner.setSize(this._owner._rawWidth, this._target._height + v, true);\n                            this._owner.yMin = tmp;\n                        }\n                        else\n                            this._owner.setSize(this._owner._rawWidth, this._target._height + v, true);\n                    }\n                    else\n                        this._owner.height = this._target._height + v;\n                    break;\n                case fgui.RelationType.LeftExt_Left:\n                    tmp = this._owner.xMin;\n                    if (info.percent)\n                        v = pos + (tmp - pos) * delta - tmp;\n                    else\n                        v = delta * (-pivot);\n                    this._owner.width = this._owner._rawWidth - v;\n                    this._owner.xMin = tmp + v;\n                    break;\n                case fgui.RelationType.LeftExt_Right:\n                    tmp = this._owner.xMin;\n                    if (info.percent)\n                        v = pos + (tmp - pos) * delta - tmp;\n                    else\n                        v = delta * (1 - pivot);\n                    this._owner.width = this._owner._rawWidth - v;\n                    this._owner.xMin = tmp + v;\n                    break;\n                case fgui.RelationType.RightExt_Left:\n                    tmp = this._owner.xMin;\n                    if (info.percent)\n                        v = pos + (tmp + this._owner._rawWidth - pos) * delta - (tmp + this._owner._rawWidth);\n                    else\n                        v = delta * (-pivot);\n                    this._owner.width = this._owner._rawWidth + v;\n                    this._owner.xMin = tmp;\n                    break;\n                case fgui.RelationType.RightExt_Right:\n                    tmp = this._owner.xMin;\n                    if (info.percent) {\n                        if (this._owner == this._target.parent) {\n                            if (this._owner._underConstruct)\n                                this._owner.width = pos + this._target._width - this._target._width * pivot +\n                                    (this._owner.sourceWidth - pos - this._target.initWidth + this._target.initWidth * pivot) * delta;\n                            else\n                                this._owner.width = pos + (this._owner._rawWidth - pos) * delta;\n                        }\n                        else {\n                            v = pos + (tmp + this._owner._rawWidth - pos) * delta - (tmp + this._owner._rawWidth);\n                            this._owner.width = this._owner._rawWidth + v;\n                            this._owner.xMin = tmp;\n                        }\n                    }\n                    else {\n                        if (this._owner == this._target.parent) {\n                            if (this._owner._underConstruct)\n                                this._owner.width = this._owner.sourceWidth + (this._target._width - this._target.initWidth) * (1 - pivot);\n                            else\n                                this._owner.width = this._owner._rawWidth + delta * (1 - pivot);\n                        }\n                        else {\n                            v = delta * (1 - pivot);\n                            this._owner.width = this._owner._rawWidth + v;\n                            this._owner.xMin = tmp;\n                        }\n                    }\n                    break;\n                case fgui.RelationType.TopExt_Top:\n                    tmp = this._owner.yMin;\n                    if (info.percent)\n                        v = pos + (tmp - pos) * delta - tmp;\n                    else\n                        v = delta * (-pivot);\n                    this._owner.height = this._owner._rawHeight - v;\n                    this._owner.yMin = tmp + v;\n                    break;\n                case fgui.RelationType.TopExt_Bottom:\n                    tmp = this._owner.yMin;\n                    if (info.percent)\n                        v = pos + (tmp - pos) * delta - tmp;\n                    else\n                        v = delta * (1 - pivot);\n                    this._owner.height = this._owner._rawHeight - v;\n                    this._owner.yMin = tmp + v;\n                    break;\n                case fgui.RelationType.BottomExt_Top:\n                    tmp = this._owner.yMin;\n                    if (info.percent)\n                        v = pos + (tmp + this._owner._rawHeight - pos) * delta - (tmp + this._owner._rawHeight);\n                    else\n                        v = delta * (-pivot);\n                    this._owner.height = this._owner._rawHeight + v;\n                    this._owner.yMin = tmp;\n                    break;\n                case fgui.RelationType.BottomExt_Bottom:\n                    tmp = this._owner.yMin;\n                    if (info.percent) {\n                        if (this._owner == this._target.parent) {\n                            if (this._owner._underConstruct)\n                                this._owner.height = pos + this._target._height - this._target._height * pivot +\n                                    (this._owner.sourceHeight - pos - this._target.initHeight + this._target.initHeight * pivot) * delta;\n                            else\n                                this._owner.height = pos + (this._owner._rawHeight - pos) * delta;\n                        }\n                        else {\n                            v = pos + (tmp + this._owner._rawHeight - pos) * delta - (tmp + this._owner._rawHeight);\n                            this._owner.height = this._owner._rawHeight + v;\n                            this._owner.yMin = tmp;\n                        }\n                    }\n                    else {\n                        if (this._owner == this._target.parent) {\n                            if (this._owner._underConstruct)\n                                this._owner.height = this._owner.sourceHeight + (this._target._height - this._target.initHeight) * (1 - pivot);\n                            else\n                                this._owner.height = this._owner._rawHeight + delta * (1 - pivot);\n                        }\n                        else {\n                            v = delta * (1 - pivot);\n                            this._owner.height = this._owner._rawHeight + v;\n                            this._owner.yMin = tmp;\n                        }\n                    }\n                    break;\n            }\n        };\n        RelationItem.prototype.addRefTarget = function (target) {\n            if (target != this._owner.parent)\n                target.addEventListener(fgui.GObject.XY_CHANGED, this.__targetXYChanged, this);\n            target.addEventListener(fgui.GObject.SIZE_CHANGED, this.__targetSizeChanged, this);\n            target.addEventListener(fgui.GObject.SIZE_DELAY_CHANGE, this.__targetSizeWillChange, this);\n            this._targetX = this._target.x;\n            this._targetY = this._target.y;\n            this._targetWidth = this._target._width;\n            this._targetHeight = this._target._height;\n        };\n        RelationItem.prototype.releaseRefTarget = function (target) {\n            target.removeEventListener(fgui.GObject.XY_CHANGED, this.__targetXYChanged, this);\n            target.removeEventListener(fgui.GObject.SIZE_CHANGED, this.__targetSizeChanged, this);\n            target.removeEventListener(fgui.GObject.SIZE_DELAY_CHANGE, this.__targetSizeWillChange, this);\n        };\n        RelationItem.prototype.__targetXYChanged = function (evt) {\n            if (this._owner.relations.handling != null || this._owner.group != null && this._owner.group._updating) {\n                this._targetX = this._target.x;\n                this._targetY = this._target.y;\n                return;\n            }\n            this._owner.relations.handling = this._target;\n            var ox = this._owner.x;\n            var oy = this._owner.y;\n            var dx = this._target.x - this._targetX;\n            var dy = this._target.y - this._targetY;\n            var length = this._defs.length;\n            for (var i = 0; i < length; i++) {\n                var info = this._defs[i];\n                this.applyOnXYChanged(info, dx, dy);\n            }\n            this._targetX = this._target.x;\n            this._targetY = this._target.y;\n            if (ox != this._owner.x || oy != this._owner.y) {\n                ox = this._owner.x - ox;\n                oy = this._owner.y - oy;\n                this._owner.updateGearFromRelations(1, ox, oy);\n                if (this._owner.parent) {\n                    var len = this._owner.parent._transitions.length;\n                    if (len > 0) {\n                        for (var i = 0; i < len; ++i) {\n                            this._owner.parent._transitions[i].updateFromRelations(this._owner.id, ox, oy);\n                        }\n                    }\n                }\n            }\n            this._owner.relations.handling = null;\n        };\n        RelationItem.prototype.__targetSizeChanged = function (evt) {\n            if (this._owner.relations.handling != null)\n                return;\n            this._owner.relations.handling = this._target;\n            var ox = this._owner.x;\n            var oy = this._owner.y;\n            var ow = this._owner._rawWidth;\n            var oh = this._owner._rawHeight;\n            var length = this._defs.length;\n            for (var i = 0; i < length; i++) {\n                var info = this._defs[i];\n                this.applyOnSizeChanged(info);\n            }\n            this._targetWidth = this._target._width;\n            this._targetHeight = this._target._height;\n            if (ox != this._owner.x || oy != this._owner.y) {\n                ox = this._owner.x - ox;\n                oy = this._owner.y - oy;\n                this._owner.updateGearFromRelations(1, ox, oy);\n                if (this._owner.parent) {\n                    var len = this._owner.parent._transitions.length;\n                    if (len > 0) {\n                        for (var i = 0; i < len; ++i) {\n                            this._owner.parent._transitions[i].updateFromRelations(this._owner.id, ox, oy);\n                        }\n                    }\n                }\n            }\n            if (ow != this._owner._rawWidth || oh != this._owner._rawHeight) {\n                ow = this._owner._rawWidth - ow;\n                oh = this._owner._rawHeight - oh;\n                this._owner.updateGearFromRelations(2, ow, oh);\n            }\n            this._owner.relations.handling = null;\n        };\n        RelationItem.prototype.__targetSizeWillChange = function (evt) {\n            this._owner.relations.sizeDirty = true;\n        };\n        return RelationItem;\n    }());\n    fgui.RelationItem = RelationItem;\n    var RelationDef = (function () {\n        function RelationDef() {\n        }\n        RelationDef.prototype.copyFrom = function (source) {\n            this.percent = source.percent;\n            this.type = source.type;\n            this.axis = source.axis;\n        };\n        return RelationDef;\n    }());\n    fgui.RelationDef = RelationDef;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var Relations = (function () {\n        function Relations(owner) {\n            this._owner = owner;\n            this._items = new Array();\n        }\n        Relations.prototype.add = function (target, relationType, usePercent) {\n            var length = this._items.length;\n            for (var i = 0; i < length; i++) {\n                var item = this._items[i];\n                if (item.target == target) {\n                    item.add(relationType, usePercent);\n                    return;\n                }\n            }\n            var newItem = new fgui.RelationItem(this._owner);\n            newItem.target = target;\n            newItem.add(relationType, usePercent);\n            this._items.push(newItem);\n        };\n        Relations.prototype.remove = function (target, relationType) {\n            relationType = relationType || 0;\n            var cnt = this._items.length;\n            var i = 0;\n            while (i < cnt) {\n                var item = this._items[i];\n                if (item.target == target) {\n                    item.remove(relationType);\n                    if (item.isEmpty) {\n                        item.dispose();\n                        this._items.splice(i, 1);\n                        cnt--;\n                    }\n                    else\n                        i++;\n                }\n                else\n                    i++;\n            }\n        };\n        Relations.prototype.contains = function (target) {\n            var length = this._items.length;\n            for (var i = 0; i < length; i++) {\n                var item = this._items[i];\n                if (item.target == target)\n                    return true;\n            }\n            return false;\n        };\n        Relations.prototype.clearFor = function (target) {\n            var cnt = this._items.length;\n            var i = 0;\n            while (i < cnt) {\n                var item = this._items[i];\n                if (item.target == target) {\n                    item.dispose();\n                    this._items.splice(i, 1);\n                    cnt--;\n                }\n                else\n                    i++;\n            }\n        };\n        Relations.prototype.clearAll = function () {\n            var length = this._items.length;\n            for (var i = 0; i < length; i++) {\n                var item = this._items[i];\n                item.dispose();\n            }\n            this._items.length = 0;\n        };\n        Relations.prototype.copyFrom = function (source) {\n            this.clearAll();\n            var arr = source._items;\n            var length = arr.length;\n            for (var i = 0; i < length; i++) {\n                var ri = arr[i];\n                var item = new fgui.RelationItem(this._owner);\n                item.copyFrom(ri);\n                this._items.push(item);\n            }\n        };\n        Relations.prototype.dispose = function () {\n            this.clearAll();\n        };\n        Relations.prototype.onOwnerSizeChanged = function (dWidth, dHeight, applyPivot) {\n            if (this._items.length == 0)\n                return;\n            var length = this._items.length;\n            for (var i = 0; i < length; i++) {\n                var item = this._items[i];\n                item.applyOnSelfResized(dWidth, dHeight, applyPivot);\n            }\n        };\n        Relations.prototype.ensureRelationsSizeCorrect = function () {\n            if (this._items.length == 0)\n                return;\n            this.sizeDirty = false;\n            var length = this._items.length;\n            for (var i = 0; i < length; i++) {\n                var item = this._items[i];\n                item.target.ensureSizeCorrect();\n            }\n        };\n        Object.defineProperty(Relations.prototype, \"empty\", {\n            get: function () {\n                return this._items.length == 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Relations.prototype.setup = function (buffer, parentToChild) {\n            var cnt = buffer.readByte();\n            var target;\n            for (var i = 0; i < cnt; i++) {\n                var targetIndex = buffer.readShort();\n                if (targetIndex == -1)\n                    target = this._owner.parent;\n                else if (parentToChild)\n                    target = this._owner.getChildAt(targetIndex);\n                else\n                    target = this._owner.parent.getChildAt(targetIndex);\n                var newItem = new fgui.RelationItem(this._owner);\n                newItem.target = target;\n                this._items.push(newItem);\n                var cnt2 = buffer.readByte();\n                for (var j = 0; j < cnt2; j++) {\n                    var rt = buffer.readByte();\n                    var usePercent = buffer.readBool();\n                    newItem.internalAdd(rt, usePercent);\n                }\n            }\n        };\n        return Relations;\n    }());\n    fgui.Relations = Relations;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ScrollPane = (function (_super_1) {\n        __extends(ScrollPane, _super_1);\n        function ScrollPane(owner) {\n            var _this = _super_1.call(this) || this;\n            _this._owner = owner;\n            _this._maskContainer = new egret.DisplayObjectContainer();\n            _this._owner._rootContainer.addChild(_this._maskContainer);\n            _this._container = _this._owner._container;\n            _this._container.x = 0;\n            _this._container.y = 0;\n            _this._maskContainer.addChild(_this._container);\n            _this._scrollBarMargin = new fgui.Margin();\n            _this._xPos = 0;\n            _this._yPos = 0;\n            _this._aniFlag = 0;\n            _this._tweening = 0;\n            _this._footerLockedSize = 0;\n            _this._headerLockedSize = 0;\n            _this._viewSize = new egret.Point();\n            _this._contentSize = new egret.Point();\n            _this._pageSize = new egret.Point(1, 1);\n            _this._overlapSize = new egret.Point();\n            _this._tweenTime = new egret.Point();\n            _this._tweenStart = new egret.Point();\n            _this._tweenDuration = new egret.Point();\n            _this._tweenChange = new egret.Point();\n            _this._velocity = new egret.Point();\n            _this._containerPos = new egret.Point();\n            _this._beginTouchPos = new egret.Point();\n            _this._lastTouchPos = new egret.Point();\n            _this._lastTouchGlobalPos = new egret.Point();\n            _this._scrollStep = fgui.UIConfig.defaultScrollStep;\n            _this._decelerationRate = fgui.UIConfig.defaultScrollDecelerationRate;\n            _this._owner.addEventListener(egret.TouchEvent.TOUCH_BEGIN, _this.__touchBegin, _this);\n            return _this;\n        }\n        ScrollPane.prototype.setup = function (buffer) {\n            this._scrollType = buffer.readByte();\n            var scrollBarDisplay = buffer.readByte();\n            var flags = buffer.readInt();\n            if (buffer.readBool()) {\n                this._scrollBarMargin.top = buffer.readInt();\n                this._scrollBarMargin.bottom = buffer.readInt();\n                this._scrollBarMargin.left = buffer.readInt();\n                this._scrollBarMargin.right = buffer.readInt();\n            }\n            var vtScrollBarRes = buffer.readS();\n            var hzScrollBarRes = buffer.readS();\n            var headerRes = buffer.readS();\n            var footerRes = buffer.readS();\n            if ((flags & 1) != 0)\n                this._displayOnLeft = true;\n            if ((flags & 2) != 0)\n                this._snapToItem = true;\n            if ((flags & 4) != 0)\n                this._displayInDemand = true;\n            if ((flags & 8) != 0)\n                this._pageMode = true;\n            if (flags & 16)\n                this._touchEffect = true;\n            else if (flags & 32)\n                this._touchEffect = false;\n            else\n                this._touchEffect = fgui.UIConfig.defaultScrollTouchEffect;\n            if (flags & 64)\n                this._bouncebackEffect = true;\n            else if (flags & 128)\n                this._bouncebackEffect = false;\n            else\n                this._bouncebackEffect = fgui.UIConfig.defaultScrollBounceEffect;\n            if ((flags & 256) != 0)\n                this._inertiaDisabled = true;\n            if ((flags & 512) == 0)\n                this._maskContainer.scrollRect = new egret.Rectangle();\n            if ((flags & 1024) != 0)\n                this._floating = true;\n            if ((flags & 2048) != 0)\n                this._dontClipMargin = true;\n            if (scrollBarDisplay == fgui.ScrollBarDisplayType.Default)\n                scrollBarDisplay = fgui.UIConfig.defaultScrollBarDisplay;\n            if (scrollBarDisplay != fgui.ScrollBarDisplayType.Hidden) {\n                if (this._scrollType == fgui.ScrollType.Both || this._scrollType == fgui.ScrollType.Vertical) {\n                    var res = vtScrollBarRes ? vtScrollBarRes : fgui.UIConfig.verticalScrollBar;\n                    if (res) {\n                        this._vtScrollBar = fgui.UIPackage.createObjectFromURL(res);\n                        if (!this._vtScrollBar)\n                            throw \"cannot create scrollbar from \" + res;\n                        this._vtScrollBar.setScrollPane(this, true);\n                        this._owner._rootContainer.addChild(this._vtScrollBar.displayObject);\n                    }\n                }\n                if (this._scrollType == fgui.ScrollType.Both || this._scrollType == fgui.ScrollType.Horizontal) {\n                    var res = hzScrollBarRes ? hzScrollBarRes : fgui.UIConfig.horizontalScrollBar;\n                    if (res) {\n                        this._hzScrollBar = fgui.UIPackage.createObjectFromURL(res);\n                        if (!this._hzScrollBar)\n                            throw \"cannot create scrollbar from \" + res;\n                        this._hzScrollBar.setScrollPane(this, false);\n                        this._owner._rootContainer.addChild(this._hzScrollBar.displayObject);\n                    }\n                }\n                if (scrollBarDisplay == fgui.ScrollBarDisplayType.Auto)\n                    this._scrollBarDisplayAuto = true;\n                if (this._scrollBarDisplayAuto) {\n                    if (this._vtScrollBar)\n                        this._vtScrollBar.displayObject.visible = false;\n                    if (this._hzScrollBar)\n                        this._hzScrollBar.displayObject.visible = false;\n                }\n            }\n            if (headerRes) {\n                this._header = fgui.UIPackage.createObjectFromURL(headerRes);\n                if (!this._header)\n                    throw \"cannot create scrollPane header from \" + headerRes;\n            }\n            if (footerRes) {\n                this._footer = fgui.UIPackage.createObjectFromURL(footerRes);\n                if (!this._footer)\n                    throw \"cannot create scrollPane footer from \" + footerRes;\n            }\n            if (this._header || this._footer)\n                this._refreshBarAxis = (this._scrollType == fgui.ScrollType.Both || this._scrollType == fgui.ScrollType.Vertical) ? \"y\" : \"x\";\n            this.setSize(this._owner.width, this._owner.height);\n        };\n        ScrollPane.prototype.dispose = function () {\n            if (this._tweening != 0)\n                fgui.GTimers.inst.remove(this.tweenUpdate, this);\n            delete this._pageController;\n            if (this._hzScrollBar)\n                this._hzScrollBar.dispose();\n            if (this._vtScrollBar)\n                this._vtScrollBar.dispose();\n            if (this._header)\n                this._header.dispose();\n            if (this._footer)\n                this._footer.dispose();\n        };\n        Object.defineProperty(ScrollPane.prototype, \"owner\", {\n            get: function () {\n                return this._owner;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"hzScrollBar\", {\n            get: function () {\n                return this._hzScrollBar;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"vtScrollBar\", {\n            get: function () {\n                return this._vtScrollBar;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"header\", {\n            get: function () {\n                return this._header;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"footer\", {\n            get: function () {\n                return this._footer;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"bouncebackEffect\", {\n            get: function () {\n                return this._bouncebackEffect;\n            },\n            set: function (sc) {\n                this._bouncebackEffect = sc;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"touchEffect\", {\n            get: function () {\n                return this._touchEffect;\n            },\n            set: function (sc) {\n                this._touchEffect = sc;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"scrollStep\", {\n            get: function () {\n                return this._scrollStep;\n            },\n            set: function (val) {\n                this._scrollStep = val;\n                if (this._scrollStep == 0)\n                    this._scrollStep = fgui.UIConfig.defaultScrollStep;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"decelerationRate\", {\n            get: function () {\n                return this._decelerationRate;\n            },\n            set: function (val) {\n                this._decelerationRate = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"snapToItem\", {\n            get: function () {\n                return this._snapToItem;\n            },\n            set: function (value) {\n                this._snapToItem = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"isDragged\", {\n            get: function () {\n                return this._dragged;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"percX\", {\n            get: function () {\n                return this._overlapSize.x == 0 ? 0 : this._xPos / this._overlapSize.x;\n            },\n            set: function (value) {\n                this.setPercX(value, false);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ScrollPane.prototype.setPercX = function (value, ani) {\n            if (ani === void 0) { ani = false; }\n            this._owner.ensureBoundsCorrect();\n            this.setPosX(this._overlapSize.x * fgui.ToolSet.clamp01(value), ani);\n        };\n        Object.defineProperty(ScrollPane.prototype, \"percY\", {\n            get: function () {\n                return this._overlapSize.y == 0 ? 0 : this._yPos / this._overlapSize.y;\n            },\n            set: function (value) {\n                this.setPercY(value, false);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ScrollPane.prototype.setPercY = function (value, ani) {\n            if (ani === void 0) { ani = false; }\n            this._owner.ensureBoundsCorrect();\n            this.setPosY(this._overlapSize.y * fgui.ToolSet.clamp01(value), ani);\n        };\n        Object.defineProperty(ScrollPane.prototype, \"posX\", {\n            get: function () {\n                return this._xPos;\n            },\n            set: function (value) {\n                this.setPosX(value, false);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ScrollPane.prototype.setPosX = function (value, ani) {\n            this._owner.ensureBoundsCorrect();\n            if (this._loop == 1)\n                value = this.loopCheckingNewPos(value, \"x\");\n            value = fgui.ToolSet.clamp(value, 0, this._overlapSize.x);\n            if (value != this._xPos) {\n                this._xPos = value;\n                this.posChanged(ani);\n            }\n        };\n        Object.defineProperty(ScrollPane.prototype, \"posY\", {\n            get: function () {\n                return this._yPos;\n            },\n            set: function (value) {\n                this.setPosY(value, false);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ScrollPane.prototype.setPosY = function (value, ani) {\n            this._owner.ensureBoundsCorrect();\n            if (this._loop == 1)\n                value = this.loopCheckingNewPos(value, \"y\");\n            value = fgui.ToolSet.clamp(value, 0, this._overlapSize.y);\n            if (value != this._yPos) {\n                this._yPos = value;\n                this.posChanged(ani);\n            }\n        };\n        Object.defineProperty(ScrollPane.prototype, \"contentWidth\", {\n            get: function () {\n                return this._contentSize.x;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"contentHeight\", {\n            get: function () {\n                return this._contentSize.y;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"viewWidth\", {\n            get: function () {\n                return this._viewSize.x;\n            },\n            set: function (value) {\n                value = value + this._owner.margin.left + this._owner.margin.right;\n                if (this._vtScrollBar && !this._floating)\n                    value += this._vtScrollBar.width;\n                this._owner.width = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"viewHeight\", {\n            get: function () {\n                return this._viewSize.y;\n            },\n            set: function (value) {\n                value = value + this._owner.margin.top + this._owner.margin.bottom;\n                if (this._hzScrollBar && !this._floating)\n                    value += this._hzScrollBar.height;\n                this._owner.height = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"currentPageX\", {\n            get: function () {\n                if (!this._pageMode)\n                    return 0;\n                var page = Math.floor(this._xPos / this._pageSize.x);\n                if (this._xPos - page * this._pageSize.x > this._pageSize.x * 0.5)\n                    page++;\n                return page;\n            },\n            set: function (value) {\n                this.setCurrentPageX(value, false);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"currentPageY\", {\n            get: function () {\n                if (!this._pageMode)\n                    return 0;\n                var page = Math.floor(this._yPos / this._pageSize.y);\n                if (this._yPos - page * this._pageSize.y > this._pageSize.y * 0.5)\n                    page++;\n                return page;\n            },\n            set: function (value) {\n                this.setCurrentPageY(value, false);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ScrollPane.prototype.setCurrentPageX = function (value, ani) {\n            if (!this._pageMode)\n                return;\n            this._owner.ensureBoundsCorrect();\n            if (this._overlapSize.x > 0)\n                this.setPosX(value * this._pageSize.x, ani);\n        };\n        ScrollPane.prototype.setCurrentPageY = function (value, ani) {\n            if (!this._pageMode)\n                return;\n            this._owner.ensureBoundsCorrect();\n            if (this._overlapSize.y > 0)\n                this.setPosY(value * this._pageSize.y, ani);\n        };\n        Object.defineProperty(ScrollPane.prototype, \"isBottomMost\", {\n            get: function () {\n                return this._yPos == this._overlapSize.y || this._overlapSize.y == 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"isRightMost\", {\n            get: function () {\n                return this._xPos == this._overlapSize.x || this._overlapSize.x == 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"pageController\", {\n            get: function () {\n                return this._pageController;\n            },\n            set: function (value) {\n                this._pageController = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"scrollingPosX\", {\n            get: function () {\n                return fgui.ToolSet.clamp(-this._container.x, 0, this._overlapSize.x);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"scrollingPosY\", {\n            get: function () {\n                return fgui.ToolSet.clamp(-this._container.y, 0, this._overlapSize.y);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ScrollPane.prototype.scrollTop = function (ani) {\n            this.setPercY(0, ani);\n        };\n        ScrollPane.prototype.scrollBottom = function (ani) {\n            this.setPercY(1, ani);\n        };\n        ScrollPane.prototype.scrollUp = function (ratio, ani) {\n            ratio = ratio || 1;\n            if (this._pageMode)\n                this.setPosY(this._yPos - this._pageSize.y * ratio, ani);\n            else\n                this.setPosY(this._yPos - this._scrollStep * ratio, ani);\n        };\n        ScrollPane.prototype.scrollDown = function (ratio, ani) {\n            ratio = ratio || 1;\n            if (this._pageMode)\n                this.setPosY(this._yPos + this._pageSize.y * ratio, ani);\n            else\n                this.setPosY(this._yPos + this._scrollStep * ratio, ani);\n        };\n        ScrollPane.prototype.scrollLeft = function (ratio, ani) {\n            ratio = ratio || 1;\n            if (this._pageMode)\n                this.setPosX(this._xPos - this._pageSize.x * ratio, ani);\n            else\n                this.setPosX(this._xPos - this._scrollStep * ratio, ani);\n        };\n        ScrollPane.prototype.scrollRight = function (ratio, ani) {\n            ratio = ratio || 1;\n            if (this._pageMode)\n                this.setPosX(this._xPos + this._pageSize.x * ratio, ani);\n            else\n                this.setPosX(this._xPos + this._scrollStep * ratio, ani);\n        };\n        ScrollPane.prototype.scrollToView = function (target, ani, setFirst) {\n            this._owner.ensureBoundsCorrect();\n            if (this._needRefresh)\n                this.refresh();\n            var rect;\n            if (target instanceof fgui.GObject) {\n                if (target.parent != this._owner) {\n                    target.parent.localToGlobalRect(target.x, target.y, target.width, target.height, s_rect);\n                    rect = this._owner.globalToLocalRect(s_rect.x, s_rect.y, s_rect.width, s_rect.height, s_rect);\n                }\n                else {\n                    rect = s_rect;\n                    rect.setTo(target.x, target.y, target.width, target.height);\n                }\n            }\n            else\n                rect = target;\n            if (this._overlapSize.y > 0) {\n                var bottom = this._yPos + this._viewSize.y;\n                if (setFirst || rect.y <= this._yPos || rect.height >= this._viewSize.y) {\n                    if (this._pageMode)\n                        this.setPosY(Math.floor(rect.y / this._pageSize.y) * this._pageSize.y, ani);\n                    else\n                        this.setPosY(rect.y, ani);\n                }\n                else if (rect.y + rect.height > bottom) {\n                    if (this._pageMode)\n                        this.setPosY(Math.floor(rect.y / this._pageSize.y) * this._pageSize.y, ani);\n                    else if (rect.height <= this._viewSize.y / 2)\n                        this.setPosY(rect.y + rect.height * 2 - this._viewSize.y, ani);\n                    else\n                        this.setPosY(rect.y + rect.height - this._viewSize.y, ani);\n                }\n            }\n            if (this._overlapSize.x > 0) {\n                var right = this._xPos + this._viewSize.x;\n                if (setFirst || rect.x <= this._xPos || rect.width >= this._viewSize.x) {\n                    if (this._pageMode)\n                        this.setPosX(Math.floor(rect.x / this._pageSize.x) * this._pageSize.x, ani);\n                    else\n                        this.setPosX(rect.x, ani);\n                }\n                else if (rect.x + rect.width > right) {\n                    if (this._pageMode)\n                        this.setPosX(Math.floor(rect.x / this._pageSize.x) * this._pageSize.x, ani);\n                    else if (rect.width <= this._viewSize.x / 2)\n                        this.setPosX(rect.x + rect.width * 2 - this._viewSize.x, ani);\n                    else\n                        this.setPosX(rect.x + rect.width - this._viewSize.x, ani);\n                }\n            }\n            if (!ani && this._needRefresh)\n                this.refresh();\n        };\n        ScrollPane.prototype.isChildInView = function (obj) {\n            if (this._overlapSize.y > 0) {\n                var dist = obj.y + this._container.y;\n                if (dist < -obj.height || dist > this._viewSize.y)\n                    return false;\n            }\n            if (this._overlapSize.x > 0) {\n                dist = obj.x + this._container.x;\n                if (dist < -obj.width || dist > this._viewSize.x)\n                    return false;\n            }\n            return true;\n        };\n        ScrollPane.prototype.cancelDragging = function () {\n            this._owner.displayObject.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__touchMove, this);\n            this._owner.displayObject.removeEventListener(egret.TouchEvent.TOUCH_END, this.__touchEnd, this);\n            this._owner.displayObject.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.__touchTap, this);\n            if (ScrollPane.draggingPane == this)\n                ScrollPane.draggingPane = null;\n            _gestureFlag = 0;\n            this._dragged = false;\n            this._maskContainer.touchChildren = true;\n        };\n        ScrollPane.prototype.lockHeader = function (size) {\n            if (this._headerLockedSize == size)\n                return;\n            this._headerLockedSize = size;\n            if (!this._refreshEventDispatching && this._container[this._refreshBarAxis] >= 0) {\n                this._tweenStart.setTo(this._container.x, this._container.y);\n                this._tweenChange.setTo(0, 0);\n                this._tweenChange[this._refreshBarAxis] = this._headerLockedSize - this._tweenStart[this._refreshBarAxis];\n                this._tweenDuration.setTo(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT);\n                this.startTween(2);\n            }\n        };\n        ScrollPane.prototype.lockFooter = function (size) {\n            if (this._footerLockedSize == size)\n                return;\n            this._footerLockedSize = size;\n            if (!this._refreshEventDispatching && this._container[this._refreshBarAxis] <= -this._overlapSize[this._refreshBarAxis]) {\n                this._tweenStart.setTo(this._container.x, this._container.y);\n                this._tweenChange.setTo(0, 0);\n                var max = this._overlapSize[this._refreshBarAxis];\n                if (max == 0)\n                    max = Math.max(this._contentSize[this._refreshBarAxis] + this._footerLockedSize - this._viewSize[this._refreshBarAxis], 0);\n                else\n                    max += this._footerLockedSize;\n                this._tweenChange[this._refreshBarAxis] = -max - this._tweenStart[this._refreshBarAxis];\n                this._tweenDuration.setTo(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT);\n                this.startTween(2);\n            }\n        };\n        ScrollPane.prototype.onOwnerSizeChanged = function () {\n            this.setSize(this._owner.width, this._owner.height);\n            this.posChanged(false);\n        };\n        ScrollPane.prototype.handleControllerChanged = function (c) {\n            if (this._pageController == c) {\n                if (this._scrollType == fgui.ScrollType.Horizontal)\n                    this.setCurrentPageX(c.selectedIndex, true);\n                else\n                    this.setCurrentPageY(c.selectedIndex, true);\n            }\n        };\n        ScrollPane.prototype.updatePageController = function () {\n            if (this._pageController && !this._pageController.changing) {\n                var index;\n                if (this._scrollType == fgui.ScrollType.Horizontal)\n                    index = this.currentPageX;\n                else\n                    index = this.currentPageY;\n                if (index < this._pageController.pageCount) {\n                    var c = this._pageController;\n                    this._pageController = null;\n                    c.selectedIndex = index;\n                    this._pageController = c;\n                }\n            }\n        };\n        ScrollPane.prototype.adjustMaskContainer = function () {\n            var mx = 0, my = 0;\n            if (this._dontClipMargin) {\n                if (this._displayOnLeft && this._vtScrollBar && !this._floating)\n                    mx = this._vtScrollBar.width;\n            }\n            else {\n                if (this._displayOnLeft && this._vtScrollBar && !this._floating)\n                    mx = this._owner.margin.left + this._vtScrollBar.width;\n                else\n                    mx = this._owner.margin.left;\n                my = this._owner.margin.top;\n            }\n            this._maskContainer.x = mx;\n            this._maskContainer.y = my;\n            mx = this._owner._alignOffset.x;\n            my = this._owner._alignOffset.y;\n            if (mx != 0 || my != 0 || this._dontClipMargin) {\n                if (!this._alignContainer) {\n                    this._alignContainer = new egret.DisplayObjectContainer();\n                    this._maskContainer.addChild(this._alignContainer);\n                    this._alignContainer.addChild(this._container);\n                }\n            }\n            if (this._alignContainer) {\n                if (this._dontClipMargin) {\n                    mx += this._owner.margin.left;\n                    my += this._owner.margin.top;\n                }\n                this._alignContainer.x = mx;\n                this._alignContainer.y = my;\n            }\n        };\n        ScrollPane.prototype.setSize = function (aWidth, aHeight) {\n            this.adjustMaskContainer();\n            if (this._hzScrollBar) {\n                this._hzScrollBar.y = aHeight - this._hzScrollBar.height;\n                if (this._vtScrollBar && !this._vScrollNone) {\n                    this._hzScrollBar.width = aWidth - this._vtScrollBar.width - this._scrollBarMargin.left - this._scrollBarMargin.right;\n                    if (this._displayOnLeft)\n                        this._hzScrollBar.x = this._scrollBarMargin.left + this._vtScrollBar.width;\n                    else\n                        this._hzScrollBar.x = this._scrollBarMargin.left;\n                }\n                else {\n                    this._hzScrollBar.width = aWidth - this._scrollBarMargin.left - this._scrollBarMargin.right;\n                    this._hzScrollBar.x = this._scrollBarMargin.left;\n                }\n            }\n            if (this._vtScrollBar) {\n                if (!this._displayOnLeft)\n                    this._vtScrollBar.x = aWidth - this._vtScrollBar.width;\n                if (this._hzScrollBar)\n                    this._vtScrollBar.height = aHeight - this._hzScrollBar.height - this._scrollBarMargin.top - this._scrollBarMargin.bottom;\n                else\n                    this._vtScrollBar.height = aHeight - this._scrollBarMargin.top - this._scrollBarMargin.bottom;\n                this._vtScrollBar.y = this._scrollBarMargin.top;\n            }\n            this._viewSize.x = aWidth;\n            this._viewSize.y = aHeight;\n            if (this._hzScrollBar && !this._floating)\n                this._viewSize.y -= this._hzScrollBar.height;\n            if (this._vtScrollBar && !this._floating)\n                this._viewSize.x -= this._vtScrollBar.width;\n            this._viewSize.x -= (this._owner.margin.left + this._owner.margin.right);\n            this._viewSize.y -= (this._owner.margin.top + this._owner.margin.bottom);\n            this._viewSize.x = Math.max(1, this._viewSize.x);\n            this._viewSize.y = Math.max(1, this._viewSize.y);\n            this._pageSize.x = this._viewSize.x;\n            this._pageSize.y = this._viewSize.y;\n            this.handleSizeChanged();\n        };\n        ScrollPane.prototype.setContentSize = function (aWidth, aHeight) {\n            if (this._contentSize.x == aWidth && this._contentSize.y == aHeight)\n                return;\n            this._contentSize.x = aWidth;\n            this._contentSize.y = aHeight;\n            this.handleSizeChanged();\n        };\n        ScrollPane.prototype.changeContentSizeOnScrolling = function (deltaWidth, deltaHeight, deltaPosX, deltaPosY) {\n            var isRightmost = this._xPos == this._overlapSize.x;\n            var isBottom = this._yPos == this._overlapSize.y;\n            this._contentSize.x += deltaWidth;\n            this._contentSize.y += deltaHeight;\n            this.handleSizeChanged();\n            if (this._tweening == 1) {\n                if (deltaWidth != 0 && isRightmost && this._tweenChange.x < 0) {\n                    this._xPos = this._overlapSize.x;\n                    this._tweenChange.x = -this._xPos - this._tweenStart.x;\n                }\n                if (deltaHeight != 0 && isBottom && this._tweenChange.y < 0) {\n                    this._yPos = this._overlapSize.y;\n                    this._tweenChange.y = -this._yPos - this._tweenStart.y;\n                }\n            }\n            else if (this._tweening == 2) {\n                if (deltaPosX != 0) {\n                    this._container.x -= deltaPosX;\n                    this._tweenStart.x -= deltaPosX;\n                    this._xPos = -this._container.x;\n                }\n                if (deltaPosY != 0) {\n                    this._container.y -= deltaPosY;\n                    this._tweenStart.y -= deltaPosY;\n                    this._yPos = -this._container.y;\n                }\n            }\n            else if (this._dragged) {\n                if (deltaPosX != 0) {\n                    this._container.x -= deltaPosX;\n                    this._containerPos.x -= deltaPosX;\n                    this._xPos = -this._container.x;\n                }\n                if (deltaPosY != 0) {\n                    this._container.y -= deltaPosY;\n                    this._containerPos.y -= deltaPosY;\n                    this._yPos = -this._container.y;\n                }\n            }\n            else {\n                if (deltaWidth != 0 && isRightmost) {\n                    this._xPos = this._overlapSize.x;\n                    this._container.x = -this._xPos;\n                }\n                if (deltaHeight != 0 && isBottom) {\n                    this._yPos = this._overlapSize.y;\n                    this._container.y = -this._yPos;\n                }\n            }\n            if (this._pageMode)\n                this.updatePageController();\n        };\n        ScrollPane.prototype.handleSizeChanged = function () {\n            if (this._displayInDemand) {\n                this._vScrollNone = this._contentSize.y <= this._viewSize.y;\n                this._hScrollNone = this._contentSize.x <= this._viewSize.x;\n            }\n            if (this._vtScrollBar) {\n                if (this._contentSize.y == 0)\n                    this._vtScrollBar.setDisplayPerc(0);\n                else\n                    this._vtScrollBar.setDisplayPerc(Math.min(1, this._viewSize.y / this._contentSize.y));\n            }\n            if (this._hzScrollBar) {\n                if (this._contentSize.x == 0)\n                    this._hzScrollBar.setDisplayPerc(0);\n                else\n                    this._hzScrollBar.setDisplayPerc(Math.min(1, this._viewSize.x / this._contentSize.x));\n            }\n            this.updateScrollBarVisible();\n            var rect = this._maskContainer.scrollRect;\n            if (rect) {\n                rect.width = this._viewSize.x;\n                rect.height = this._viewSize.y;\n                if (this._vScrollNone && this._vtScrollBar)\n                    rect.width += this._vtScrollBar.width;\n                if (this._hScrollNone && this._hzScrollBar)\n                    rect.height += this._hzScrollBar.height;\n                if (this._dontClipMargin) {\n                    rect.width += (this._owner.margin.left + this._owner.margin.right);\n                    rect.height += (this._owner.margin.top + this._owner.margin.bottom);\n                }\n                this._maskContainer.scrollRect = rect;\n            }\n            if (this._scrollType == fgui.ScrollType.Horizontal || this._scrollType == fgui.ScrollType.Both)\n                this._overlapSize.x = Math.ceil(Math.max(0, this._contentSize.x - this._viewSize.x));\n            else\n                this._overlapSize.x = 0;\n            if (this._scrollType == fgui.ScrollType.Vertical || this._scrollType == fgui.ScrollType.Both)\n                this._overlapSize.y = Math.ceil(Math.max(0, this._contentSize.y - this._viewSize.y));\n            else\n                this._overlapSize.y = 0;\n            this._xPos = fgui.ToolSet.clamp(this._xPos, 0, this._overlapSize.x);\n            this._yPos = fgui.ToolSet.clamp(this._yPos, 0, this._overlapSize.y);\n            if (this._refreshBarAxis != null) {\n                var max = this._overlapSize[this._refreshBarAxis];\n                if (max == 0)\n                    max = Math.max(this._contentSize[this._refreshBarAxis] + this._footerLockedSize - this._viewSize[this._refreshBarAxis], 0);\n                else\n                    max += this._footerLockedSize;\n                if (this._refreshBarAxis == \"x\") {\n                    this._container.x = fgui.ToolSet.clamp(this._container.x, -max, this._headerLockedSize);\n                    this._container.y = fgui.ToolSet.clamp(this._container.y, -this._overlapSize.y, 0);\n                }\n                else {\n                    this._container.x = fgui.ToolSet.clamp(this._container.x, -this._overlapSize.x, 0);\n                    this._container.y = fgui.ToolSet.clamp(this._container.y, -max, this._headerLockedSize);\n                }\n                if (this._header) {\n                    if (this._refreshBarAxis == \"x\")\n                        this._header.height = this._viewSize.y;\n                    else\n                        this._header.width = this._viewSize.x;\n                }\n                if (this._footer) {\n                    if (this._refreshBarAxis == \"y\")\n                        this._footer.height = this._viewSize.y;\n                    else\n                        this._footer.width = this._viewSize.x;\n                }\n            }\n            else {\n                this._container.x = fgui.ToolSet.clamp(this._container.x, -this._overlapSize.x, 0);\n                this._container.y = fgui.ToolSet.clamp(this._container.y, -this._overlapSize.y, 0);\n            }\n            this.updateScrollBarPos();\n            if (this._pageMode)\n                this.updatePageController();\n        };\n        ScrollPane.prototype.posChanged = function (ani) {\n            if (this._aniFlag == 0)\n                this._aniFlag = ani ? 1 : -1;\n            else if (this._aniFlag == 1 && !ani)\n                this._aniFlag = -1;\n            this._needRefresh = true;\n            fgui.GTimers.inst.callLater(this.refresh, this);\n            if (this._tweening != 0)\n                this.killTween();\n        };\n        ScrollPane.prototype.refresh = function () {\n            this._needRefresh = false;\n            fgui.GTimers.inst.remove(this.refresh, this);\n            if (this._pageMode || this._snapToItem) {\n                sEndPos.setTo(-this._xPos, -this._yPos);\n                this.alignPosition(sEndPos, false);\n                this._xPos = -sEndPos.x;\n                this._yPos = -sEndPos.y;\n            }\n            this.refresh2();\n            this.dispatchEventWith(ScrollPane.SCROLL);\n            if (this._needRefresh) {\n                this._needRefresh = false;\n                fgui.GTimers.inst.remove(this.refresh, this);\n                this.refresh2();\n            }\n            this.updateScrollBarPos();\n            this._aniFlag = 0;\n        };\n        ScrollPane.prototype.refresh2 = function () {\n            if (this._aniFlag == 1 && !this._dragged) {\n                var posX;\n                var posY;\n                if (this._overlapSize.x > 0)\n                    posX = -Math.floor(this._xPos);\n                else {\n                    if (this._container.x != 0)\n                        this._container.x = 0;\n                    posX = 0;\n                }\n                if (this._overlapSize.y > 0)\n                    posY = -Math.floor(this._yPos);\n                else {\n                    if (this._container.y != 0)\n                        this._container.y = 0;\n                    posY = 0;\n                }\n                if (posX != this._container.x || posY != this._container.y) {\n                    this._tweenDuration.setTo(TWEEN_TIME_GO, TWEEN_TIME_GO);\n                    this._tweenStart.setTo(this._container.x, this._container.y);\n                    this._tweenChange.setTo(posX - this._tweenStart.x, posY - this._tweenStart.y);\n                    this.startTween(1);\n                }\n                else if (this._tweening != 0)\n                    this.killTween();\n            }\n            else {\n                if (this._tweening != 0)\n                    this.killTween();\n                this._container.x = Math.floor(-this._xPos);\n                this._container.y = Math.floor(-this._yPos);\n                this.loopCheckingCurrent();\n            }\n            if (this._pageMode)\n                this.updatePageController();\n        };\n        ScrollPane.prototype.__touchBegin = function (evt) {\n            if (!this._touchEffect)\n                return;\n            if (this._tweening != 0) {\n                this.killTween();\n                this._dragged = true;\n            }\n            else\n                this._dragged = false;\n            var pt = this._owner.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            this._containerPos.setTo(this._container.x, this._container.y);\n            this._beginTouchPos.setTo(pt.x, pt.y);\n            this._lastTouchPos.setTo(pt.x, pt.y);\n            this._lastTouchGlobalPos.setTo(evt.stageX, evt.stageY);\n            this._isHoldAreaDone = false;\n            this._velocity.setTo(0, 0);\n            this._velocityScale = 1;\n            this._lastMoveTime = egret.getTimer() / 1000;\n            this._owner.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__touchMove, this);\n            this._owner.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.__touchEnd, this);\n            this._owner.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_TAP, this.__touchTap, this);\n        };\n        ScrollPane.prototype.__touchMove = function (evt) {\n            if (this._owner.displayObject.stage == null)\n                return;\n            if (!this._touchEffect)\n                return;\n            if (ScrollPane.draggingPane && ScrollPane.draggingPane != this || fgui.GObject.draggingObject)\n                return;\n            var pt = this._owner.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            var sensitivity = fgui.UIConfig.touchScrollSensitivity;\n            var diff, diff2;\n            var sv, sh, st;\n            if (this._scrollType == fgui.ScrollType.Vertical) {\n                if (!this._isHoldAreaDone) {\n                    _gestureFlag |= 1;\n                    diff = Math.abs(this._beginTouchPos.y - pt.y);\n                    if (diff < sensitivity)\n                        return;\n                    if ((_gestureFlag & 2) != 0) {\n                        diff2 = Math.abs(this._beginTouchPos.x - pt.x);\n                        if (diff < diff2)\n                            return;\n                    }\n                }\n                sv = true;\n            }\n            else if (this._scrollType == fgui.ScrollType.Horizontal) {\n                if (!this._isHoldAreaDone) {\n                    _gestureFlag |= 2;\n                    diff = Math.abs(this._beginTouchPos.x - pt.x);\n                    if (diff < sensitivity)\n                        return;\n                    if ((_gestureFlag & 1) != 0) {\n                        diff2 = Math.abs(this._beginTouchPos.y - pt.y);\n                        if (diff < diff2)\n                            return;\n                    }\n                }\n                sh = true;\n            }\n            else {\n                _gestureFlag = 3;\n                if (!this._isHoldAreaDone) {\n                    diff = Math.abs(this._beginTouchPos.y - pt.y);\n                    if (diff < sensitivity) {\n                        diff = Math.abs(this._beginTouchPos.x - pt.x);\n                        if (diff < sensitivity)\n                            return;\n                    }\n                }\n                sv = sh = true;\n            }\n            var newPosX = Math.floor(this._containerPos.x + pt.x - this._beginTouchPos.x);\n            var newPosY = Math.floor(this._containerPos.y + pt.y - this._beginTouchPos.y);\n            if (sv) {\n                if (newPosY > 0) {\n                    if (!this._bouncebackEffect)\n                        this._container.y = 0;\n                    else if (this._header && this._header.maxHeight != 0)\n                        this._container.y = Math.floor(Math.min(newPosY * 0.5, this._header.maxHeight));\n                    else\n                        this._container.y = Math.floor(Math.min(newPosY * 0.5, this._viewSize.y * PULL_RATIO));\n                }\n                else if (newPosY < -this._overlapSize.y) {\n                    if (!this._bouncebackEffect)\n                        this._container.y = -this._overlapSize.y;\n                    else if (this._footer && this._footer.maxHeight > 0)\n                        this._container.y = Math.floor(Math.max((newPosY + this._overlapSize.y) * 0.5, -this._footer.maxHeight) - this._overlapSize.y);\n                    else\n                        this._container.y = Math.floor(Math.max((newPosY + this._overlapSize.y) * 0.5, -this._viewSize.y * PULL_RATIO) - this._overlapSize.y);\n                }\n                else\n                    this._container.y = newPosY;\n            }\n            if (sh) {\n                if (newPosX > 0) {\n                    if (!this._bouncebackEffect)\n                        this._container.x = 0;\n                    else if (this._header && this._header.maxWidth != 0)\n                        this._container.x = Math.floor(Math.min(newPosX * 0.5, this._header.maxWidth));\n                    else\n                        this._container.x = Math.floor(Math.min(newPosX * 0.5, this._viewSize.x * PULL_RATIO));\n                }\n                else if (newPosX < 0 - this._overlapSize.x) {\n                    if (!this._bouncebackEffect)\n                        this._container.x = -this._overlapSize.x;\n                    else if (this._footer && this._footer.maxWidth > 0)\n                        this._container.x = Math.floor(Math.max((newPosX + this._overlapSize.x) * 0.5, -this._footer.maxWidth) - this._overlapSize.x);\n                    else\n                        this._container.x = Math.floor(Math.max((newPosX + this._overlapSize.x) * 0.5, -this._viewSize.x * PULL_RATIO) - this._overlapSize.x);\n                }\n                else\n                    this._container.x = newPosX;\n            }\n            var now = egret.getTimer() / 1000;\n            var deltaTime = Math.max(now - this._lastMoveTime, 1 / 60);\n            var deltaPositionX = pt.x - this._lastTouchPos.x;\n            var deltaPositionY = pt.y - this._lastTouchPos.y;\n            if (!sh)\n                deltaPositionX = 0;\n            if (!sv)\n                deltaPositionY = 0;\n            if (deltaTime != 0) {\n                var frameRate = this._owner.displayObject.stage.frameRate;\n                var elapsed = deltaTime * frameRate - 1;\n                if (elapsed > 1) {\n                    var factor = Math.pow(0.833, elapsed);\n                    this._velocity.x = this._velocity.x * factor;\n                    this._velocity.y = this._velocity.y * factor;\n                }\n                this._velocity.x = fgui.ToolSet.lerp(this._velocity.x, deltaPositionX * 60 / frameRate / deltaTime, deltaTime * 10);\n                this._velocity.y = fgui.ToolSet.lerp(this._velocity.y, deltaPositionY * 60 / frameRate / deltaTime, deltaTime * 10);\n            }\n            var deltaGlobalPositionX = this._lastTouchGlobalPos.x - evt.stageX;\n            var deltaGlobalPositionY = this._lastTouchGlobalPos.y - evt.stageY;\n            if (deltaPositionX != 0)\n                this._velocityScale = Math.abs(deltaGlobalPositionX / deltaPositionX);\n            else if (deltaPositionY != 0)\n                this._velocityScale = Math.abs(deltaGlobalPositionY / deltaPositionY);\n            this._lastTouchPos.setTo(pt.x, pt.y);\n            this._lastTouchGlobalPos.setTo(evt.stageX, evt.stageY);\n            this._lastMoveTime = now;\n            if (this._overlapSize.x > 0)\n                this._xPos = fgui.ToolSet.clamp(-this._container.x, 0, this._overlapSize.x);\n            if (this._overlapSize.y > 0)\n                this._yPos = fgui.ToolSet.clamp(-this._container.y, 0, this._overlapSize.y);\n            if (this._loop != 0) {\n                newPosX = this._container.x;\n                newPosY = this._container.y;\n                if (this.loopCheckingCurrent()) {\n                    this._containerPos.x += this._container.x - newPosX;\n                    this._containerPos.y += this._container.y - newPosY;\n                }\n            }\n            ScrollPane.draggingPane = this;\n            this._isHoldAreaDone = true;\n            this._dragged = true;\n            this._maskContainer.touchChildren = false;\n            this.updateScrollBarPos();\n            this.updateScrollBarVisible();\n            if (this._pageMode)\n                this.updatePageController();\n            this.dispatchEventWith(ScrollPane.SCROLL);\n        };\n        ScrollPane.prototype.__touchEnd = function (evt) {\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__touchMove, this);\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_END, this.__touchEnd, this);\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.__touchTap, this);\n            if (ScrollPane.draggingPane == this)\n                ScrollPane.draggingPane = null;\n            _gestureFlag = 0;\n            if (!this._dragged || !this._touchEffect || this._owner.displayObject.stage == null) {\n                this._dragged = false;\n                this._maskContainer.touchChildren = true;\n                return;\n            }\n            this._dragged = false;\n            this._maskContainer.touchChildren = true;\n            this._tweenStart.setTo(this._container.x, this._container.y);\n            sEndPos.setTo(this._tweenStart.x, this._tweenStart.y);\n            var flag = false;\n            if (this._container.x > 0) {\n                sEndPos.x = 0;\n                flag = true;\n            }\n            else if (this._container.x < -this._overlapSize.x) {\n                sEndPos.x = -this._overlapSize.x;\n                flag = true;\n            }\n            if (this._container.y > 0) {\n                sEndPos.y = 0;\n                flag = true;\n            }\n            else if (this._container.y < -this._overlapSize.y) {\n                sEndPos.y = -this._overlapSize.y;\n                flag = true;\n            }\n            if (flag) {\n                this._tweenChange.setTo(sEndPos.x - this._tweenStart.x, sEndPos.y - this._tweenStart.y);\n                if (this._tweenChange.x < -fgui.UIConfig.touchDragSensitivity || this._tweenChange.y < -fgui.UIConfig.touchDragSensitivity) {\n                    this._refreshEventDispatching = true;\n                    this.dispatchEventWith(ScrollPane.PULL_DOWN_RELEASE);\n                    this._refreshEventDispatching = false;\n                }\n                else if (this._tweenChange.x > fgui.UIConfig.touchDragSensitivity || this._tweenChange.y > fgui.UIConfig.touchDragSensitivity) {\n                    this._refreshEventDispatching = true;\n                    this.dispatchEventWith(ScrollPane.PULL_UP_RELEASE);\n                    this._refreshEventDispatching = false;\n                }\n                if (this._headerLockedSize > 0 && sEndPos[this._refreshBarAxis] == 0) {\n                    sEndPos[this._refreshBarAxis] = this._headerLockedSize;\n                    this._tweenChange.x = sEndPos.x - this._tweenStart.x;\n                    this._tweenChange.y = sEndPos.y - this._tweenStart.y;\n                }\n                else if (this._footerLockedSize > 0 && sEndPos[this._refreshBarAxis] == -this._overlapSize[this._refreshBarAxis]) {\n                    var max = this._overlapSize[this._refreshBarAxis];\n                    if (max == 0)\n                        max = Math.max(this._contentSize[this._refreshBarAxis] + this._footerLockedSize - this._viewSize[this._refreshBarAxis], 0);\n                    else\n                        max += this._footerLockedSize;\n                    sEndPos[this._refreshBarAxis] = -max;\n                    this._tweenChange.x = sEndPos.x - this._tweenStart.x;\n                    this._tweenChange.y = sEndPos.y - this._tweenStart.y;\n                }\n                this._tweenDuration.setTo(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT);\n            }\n            else {\n                if (!this._inertiaDisabled) {\n                    var frameRate = this._owner.displayObject.stage.frameRate;\n                    var elapsed = (egret.getTimer() / 1000 - this._lastMoveTime) * frameRate - 1;\n                    if (elapsed > 1) {\n                        var factor = Math.pow(0.833, elapsed);\n                        this._velocity.x = this._velocity.x * factor;\n                        this._velocity.y = this._velocity.y * factor;\n                    }\n                    this.updateTargetAndDuration(this._tweenStart, sEndPos);\n                }\n                else\n                    this._tweenDuration.setTo(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT);\n                sOldChange.setTo(sEndPos.x - this._tweenStart.x, sEndPos.y - this._tweenStart.y);\n                this.loopCheckingTarget(sEndPos);\n                if (this._pageMode || this._snapToItem)\n                    this.alignPosition(sEndPos, true);\n                this._tweenChange.x = sEndPos.x - this._tweenStart.x;\n                this._tweenChange.y = sEndPos.y - this._tweenStart.y;\n                if (this._tweenChange.x == 0 && this._tweenChange.y == 0) {\n                    this.updateScrollBarVisible();\n                    return;\n                }\n                if (this._pageMode || this._snapToItem) {\n                    this.fixDuration(\"x\", sOldChange.x);\n                    this.fixDuration(\"y\", sOldChange.y);\n                }\n            }\n            this.startTween(2);\n        };\n        ScrollPane.prototype.__touchTap = function (evt) {\n            this._dragged = false;\n        };\n        ScrollPane.prototype.updateScrollBarPos = function () {\n            if (this._vtScrollBar)\n                this._vtScrollBar.setScrollPerc(this._overlapSize.y == 0 ? 0 : fgui.ToolSet.clamp(-this._container.y, 0, this._overlapSize.y) / this._overlapSize.y);\n            if (this._hzScrollBar)\n                this._hzScrollBar.setScrollPerc(this._overlapSize.x == 0 ? 0 : fgui.ToolSet.clamp(-this._container.x, 0, this._overlapSize.x) / this._overlapSize.x);\n            this.checkRefreshBar();\n        };\n        ScrollPane.prototype.updateScrollBarVisible = function () {\n            if (this._vtScrollBar) {\n                if (this._viewSize.y <= this._vtScrollBar.minSize || this._vScrollNone)\n                    this._vtScrollBar.displayObject.visible = false;\n                else\n                    this.updateScrollBarVisible2(this._vtScrollBar);\n            }\n            if (this._hzScrollBar) {\n                if (this._viewSize.x <= this._hzScrollBar.minSize || this._hScrollNone)\n                    this._hzScrollBar.displayObject.visible = false;\n                else\n                    this.updateScrollBarVisible2(this._hzScrollBar);\n            }\n        };\n        ScrollPane.prototype.updateScrollBarVisible2 = function (bar) {\n            if (this._scrollBarDisplayAuto)\n                fgui.GTween.kill(bar, false, \"alpha\");\n            if (this._scrollBarDisplayAuto && this._tweening == 0 && !this._dragged && !bar.gripDragging) {\n                if (bar.displayObject.visible)\n                    fgui.GTween.to(1, 0, 0.5).setDelay(0.5).onComplete(this.__barTweenComplete, this).setTarget(bar, \"alpha\");\n            }\n            else {\n                bar.alpha = 1;\n                bar.displayObject.visible = true;\n            }\n        };\n        ScrollPane.prototype.__barTweenComplete = function (tweener) {\n            var bar = (tweener.target);\n            bar.alpha = 1;\n            bar.displayObject.visible = false;\n        };\n        ScrollPane.prototype.getLoopPartSize = function (division, axis) {\n            return (this._contentSize[axis] + (axis == \"x\" ? this._owner.columnGap : this._owner.lineGap)) / division;\n        };\n        ScrollPane.prototype.loopCheckingCurrent = function () {\n            var changed = false;\n            if (this._loop == 1 && this._overlapSize.x > 0) {\n                if (this._xPos < 0.001) {\n                    this._xPos += this.getLoopPartSize(2, \"x\");\n                    changed = true;\n                }\n                else if (this._xPos >= this._overlapSize.x) {\n                    this._xPos -= this.getLoopPartSize(2, \"x\");\n                    changed = true;\n                }\n            }\n            else if (this._loop == 2 && this._overlapSize.y > 0) {\n                if (this._yPos < 0.001) {\n                    this._yPos += this.getLoopPartSize(2, \"y\");\n                    changed = true;\n                }\n                else if (this._yPos >= this._overlapSize.y) {\n                    this._yPos -= this.getLoopPartSize(2, \"y\");\n                    changed = true;\n                }\n            }\n            if (changed) {\n                this._container.x = Math.floor(-this._xPos);\n                this._container.y = Math.floor(-this._yPos);\n            }\n            return changed;\n        };\n        ScrollPane.prototype.loopCheckingTarget = function (endPos) {\n            if (this._loop == 1)\n                this.loopCheckingTarget2(endPos, \"x\");\n            if (this._loop == 2)\n                this.loopCheckingTarget2(endPos, \"y\");\n        };\n        ScrollPane.prototype.loopCheckingTarget2 = function (endPos, axis) {\n            var halfSize;\n            var tmp;\n            if (endPos[axis] > 0) {\n                halfSize = this.getLoopPartSize(2, axis);\n                tmp = this._tweenStart[axis] - halfSize;\n                if (tmp <= 0 && tmp >= -this._overlapSize[axis]) {\n                    endPos[axis] -= halfSize;\n                    this._tweenStart[axis] = tmp;\n                }\n            }\n            else if (endPos[axis] < -this._overlapSize[axis]) {\n                halfSize = this.getLoopPartSize(2, axis);\n                tmp = this._tweenStart[axis] + halfSize;\n                if (tmp <= 0 && tmp >= -this._overlapSize[axis]) {\n                    endPos[axis] += halfSize;\n                    this._tweenStart[axis] = tmp;\n                }\n            }\n        };\n        ScrollPane.prototype.loopCheckingNewPos = function (value, axis) {\n            if (this._overlapSize[axis] == 0)\n                return value;\n            var pos = axis == \"x\" ? this._xPos : this._yPos;\n            var changed = false;\n            var v;\n            if (value < 0.001) {\n                value += this.getLoopPartSize(2, axis);\n                if (value > pos) {\n                    v = this.getLoopPartSize(6, axis);\n                    v = Math.ceil((value - pos) / v) * v;\n                    pos = fgui.ToolSet.clamp(pos + v, 0, this._overlapSize[axis]);\n                    changed = true;\n                }\n            }\n            else if (value >= this._overlapSize[axis]) {\n                value -= this.getLoopPartSize(2, axis);\n                if (value < pos) {\n                    v = this.getLoopPartSize(6, axis);\n                    v = Math.ceil((pos - value) / v) * v;\n                    pos = fgui.ToolSet.clamp(pos - v, 0, this._overlapSize[axis]);\n                    changed = true;\n                }\n            }\n            if (changed) {\n                if (axis == \"x\")\n                    this._container.x = -Math.floor(pos);\n                else\n                    this._container.y = -Math.floor(pos);\n            }\n            return value;\n        };\n        ScrollPane.prototype.alignPosition = function (pos, inertialScrolling) {\n            if (this._pageMode) {\n                pos.x = this.alignByPage(pos.x, \"x\", inertialScrolling);\n                pos.y = this.alignByPage(pos.y, \"y\", inertialScrolling);\n            }\n            else if (this._snapToItem) {\n                var pt = this._owner.getSnappingPosition(-pos.x, -pos.y, s_vec2);\n                if (pos.x < 0 && pos.x > -this._overlapSize.x)\n                    pos.x = -pt.x;\n                if (pos.y < 0 && pos.y > -this._overlapSize.y)\n                    pos.y = -pt.y;\n            }\n        };\n        ScrollPane.prototype.alignByPage = function (pos, axis, inertialScrolling) {\n            var page;\n            if (pos > 0)\n                page = 0;\n            else if (pos < -this._overlapSize[axis])\n                page = Math.ceil(this._contentSize[axis] / this._pageSize[axis]) - 1;\n            else {\n                page = Math.floor(-pos / this._pageSize[axis]);\n                var change = inertialScrolling ? (pos - this._containerPos[axis]) : (pos - this._container[axis]);\n                var testPageSize = Math.min(this._pageSize[axis], this._contentSize[axis] - (page + 1) * this._pageSize[axis]);\n                var delta = -pos - page * this._pageSize[axis];\n                if (Math.abs(change) > this._pageSize[axis]) {\n                    if (delta > testPageSize * 0.5)\n                        page++;\n                }\n                else {\n                    if (delta > testPageSize * (change < 0 ? 0.3 : 0.7))\n                        page++;\n                }\n                pos = -page * this._pageSize[axis];\n                if (pos < -this._overlapSize[axis])\n                    pos = -this._overlapSize[axis];\n            }\n            if (inertialScrolling) {\n                var oldPos = this._tweenStart[axis];\n                var oldPage;\n                if (oldPos > 0)\n                    oldPage = 0;\n                else if (oldPos < -this._overlapSize[axis])\n                    oldPage = Math.ceil(this._contentSize[axis] / this._pageSize[axis]) - 1;\n                else\n                    oldPage = Math.floor(-oldPos / this._pageSize[axis]);\n                var startPage = Math.floor(-this._containerPos[axis] / this._pageSize[axis]);\n                if (Math.abs(page - startPage) > 1 && Math.abs(oldPage - startPage) <= 1) {\n                    if (page > startPage)\n                        page = startPage + 1;\n                    else\n                        page = startPage - 1;\n                    pos = -page * this._pageSize[axis];\n                }\n            }\n            return pos;\n        };\n        ScrollPane.prototype.updateTargetAndDuration = function (orignPos, resultPos) {\n            resultPos.x = this.updateTargetAndDuration2(orignPos.x, \"x\");\n            resultPos.y = this.updateTargetAndDuration2(orignPos.y, \"y\");\n        };\n        ScrollPane.prototype.updateTargetAndDuration2 = function (pos, axis) {\n            var v = this._velocity[axis];\n            var duration = 0;\n            if (pos > 0)\n                pos = 0;\n            else if (pos < -this._overlapSize[axis])\n                pos = -this._overlapSize[axis];\n            else {\n                var isMobile = egret.Capabilities.isMobile;\n                var v2 = Math.abs(v) * this._velocityScale;\n                if (isMobile)\n                    v2 *= 1136 / Math.max(this._owner.displayObject.stage.stageWidth, this._owner.displayObject.stage.stageHeight);\n                var ratio = 0;\n                if (this._pageMode || !isMobile) {\n                    if (v2 > 500)\n                        ratio = Math.pow((v2 - 500) / 500, 2);\n                }\n                else {\n                    if (v2 > 1000)\n                        ratio = Math.pow((v2 - 1000) / 1000, 2);\n                }\n                if (ratio != 0) {\n                    if (ratio > 1)\n                        ratio = 1;\n                    v2 *= ratio;\n                    v *= ratio;\n                    this._velocity[axis] = v;\n                    duration = Math.log(60 / v2) / Math.log(this._decelerationRate) / 60;\n                    var change = Math.floor(v * duration * 0.4);\n                    pos += change;\n                }\n            }\n            if (duration < TWEEN_TIME_DEFAULT)\n                duration = TWEEN_TIME_DEFAULT;\n            this._tweenDuration[axis] = duration;\n            return pos;\n        };\n        ScrollPane.prototype.fixDuration = function (axis, oldChange) {\n            if (this._tweenChange[axis] == 0 || Math.abs(this._tweenChange[axis]) >= Math.abs(oldChange))\n                return;\n            var newDuration = Math.abs(this._tweenChange[axis] / oldChange) * this._tweenDuration[axis];\n            if (newDuration < TWEEN_TIME_DEFAULT)\n                newDuration = TWEEN_TIME_DEFAULT;\n            this._tweenDuration[axis] = newDuration;\n        };\n        ScrollPane.prototype.startTween = function (type) {\n            this._tweenTime.setTo(0, 0);\n            this._tweening = type;\n            fgui.GTimers.inst.add(1, 0, this.tweenUpdate, this);\n            this.updateScrollBarVisible();\n        };\n        ScrollPane.prototype.killTween = function () {\n            if (this._tweening == 1) {\n                this._container.x = this._tweenStart.x + this._tweenChange.x;\n                this._container.y = this._tweenStart.y + this._tweenChange.y;\n                this.dispatchEventWith(ScrollPane.SCROLL);\n            }\n            this._tweening = 0;\n            fgui.GTimers.inst.remove(this.tweenUpdate, this);\n            this.updateScrollBarVisible();\n            this.dispatchEventWith(ScrollPane.SCROLL_END);\n        };\n        ScrollPane.prototype.checkRefreshBar = function () {\n            if (this._header == null && this._footer == null)\n                return;\n            var pos = this._container[this._refreshBarAxis];\n            if (this._header) {\n                if (pos > 0) {\n                    if (this._header.displayObject.parent == null)\n                        this._maskContainer.addChildAt(this._header.displayObject, 0);\n                    var pt = s_vec2;\n                    pt.setTo(this._header.width, this._header.height);\n                    pt[this._refreshBarAxis] = pos;\n                    this._header.setSize(pt.x, pt.y);\n                }\n                else {\n                    if (this._header.displayObject.parent)\n                        this._maskContainer.removeChild(this._header.displayObject);\n                }\n            }\n            if (this._footer) {\n                var max = this._overlapSize[this._refreshBarAxis];\n                if (pos < -max || max == 0 && this._footerLockedSize > 0) {\n                    if (this._footer.displayObject.parent == null)\n                        this._maskContainer.addChildAt(this._footer.displayObject, 0);\n                    pt = s_vec2;\n                    pt.setTo(this._footer.x, this._footer.y);\n                    if (max > 0)\n                        pt[this._refreshBarAxis] = pos + this._contentSize[this._refreshBarAxis];\n                    else\n                        pt[this._refreshBarAxis] = Math.max(Math.min(pos + this._viewSize[this._refreshBarAxis], this._viewSize[this._refreshBarAxis] - this._footerLockedSize), this._viewSize[this._refreshBarAxis] - this._contentSize[this._refreshBarAxis]);\n                    this._footer.setXY(pt.x, pt.y);\n                    pt.setTo(this._footer.width, this._footer.height);\n                    if (max > 0)\n                        pt[this._refreshBarAxis] = -max - pos;\n                    else\n                        pt[this._refreshBarAxis] = this._viewSize[this._refreshBarAxis] - this._footer[this._refreshBarAxis];\n                    this._footer.setSize(pt.x, pt.y);\n                }\n                else {\n                    if (this._footer.displayObject.parent)\n                        this._maskContainer.removeChild(this._footer.displayObject);\n                }\n            }\n        };\n        ScrollPane.prototype.tweenUpdate = function (timestamp) {\n            var nx = this.runTween(\"x\");\n            var ny = this.runTween(\"y\");\n            this._container.x = nx;\n            this._container.y = ny;\n            if (this._tweening == 2) {\n                if (this._overlapSize.x > 0)\n                    this._xPos = fgui.ToolSet.clamp(-nx, 0, this._overlapSize.x);\n                if (this._overlapSize.y > 0)\n                    this._yPos = fgui.ToolSet.clamp(-ny, 0, this._overlapSize.y);\n                if (this._pageMode)\n                    this.updatePageController();\n            }\n            if (this._tweenChange.x == 0 && this._tweenChange.y == 0) {\n                this._tweening = 0;\n                fgui.GTimers.inst.remove(this.tweenUpdate, this);\n                this.loopCheckingCurrent();\n                this.updateScrollBarPos();\n                this.updateScrollBarVisible();\n                this.dispatchEventWith(ScrollPane.SCROLL);\n                this.dispatchEventWith(ScrollPane.SCROLL_END);\n            }\n            else {\n                this.updateScrollBarPos();\n                this.dispatchEventWith(ScrollPane.SCROLL);\n            }\n            return true;\n        };\n        ScrollPane.prototype.runTween = function (axis) {\n            var newValue;\n            if (this._tweenChange[axis] != 0) {\n                this._tweenTime[axis] += fgui.GTimers.deltaTime / 1000;\n                if (this._tweenTime[axis] >= this._tweenDuration[axis]) {\n                    newValue = this._tweenStart[axis] + this._tweenChange[axis];\n                    this._tweenChange[axis] = 0;\n                }\n                else {\n                    var ratio = easeFunc(this._tweenTime[axis], this._tweenDuration[axis]);\n                    newValue = this._tweenStart[axis] + Math.floor(this._tweenChange[axis] * ratio);\n                }\n                var threshold1 = 0;\n                var threshold2 = -this._overlapSize[axis];\n                if (this._headerLockedSize > 0 && this._refreshBarAxis == axis)\n                    threshold1 = this._headerLockedSize;\n                if (this._footerLockedSize > 0 && this._refreshBarAxis == axis) {\n                    var max = this._overlapSize[this._refreshBarAxis];\n                    if (max == 0)\n                        max = Math.max(this._contentSize[this._refreshBarAxis] + this._footerLockedSize - this._viewSize[this._refreshBarAxis], 0);\n                    else\n                        max += this._footerLockedSize;\n                    threshold2 = -max;\n                }\n                if (this._tweening == 2 && this._bouncebackEffect) {\n                    if (newValue > 20 + threshold1 && this._tweenChange[axis] > 0\n                        || newValue > threshold1 && this._tweenChange[axis] == 0) {\n                        this._tweenTime[axis] = 0;\n                        this._tweenDuration[axis] = TWEEN_TIME_DEFAULT;\n                        this._tweenChange[axis] = -newValue + threshold1;\n                        this._tweenStart[axis] = newValue;\n                    }\n                    else if (newValue < threshold2 - 20 && this._tweenChange[axis] < 0\n                        || newValue < threshold2 && this._tweenChange[axis] == 0) {\n                        this._tweenTime[axis] = 0;\n                        this._tweenDuration[axis] = TWEEN_TIME_DEFAULT;\n                        this._tweenChange[axis] = threshold2 - newValue;\n                        this._tweenStart[axis] = newValue;\n                    }\n                }\n                else {\n                    if (newValue > threshold1) {\n                        newValue = threshold1;\n                        this._tweenChange[axis] = 0;\n                    }\n                    else if (newValue < threshold2) {\n                        newValue = threshold2;\n                        this._tweenChange[axis] = 0;\n                    }\n                }\n            }\n            else\n                newValue = this._container[axis];\n            return newValue;\n        };\n        ScrollPane.SCROLL = \"__scroll\";\n        ScrollPane.SCROLL_END = \"__scrollEnd\";\n        ScrollPane.PULL_DOWN_RELEASE = \"pullDownRelease\";\n        ScrollPane.PULL_UP_RELEASE = \"pullUpRelease\";\n        return ScrollPane;\n    }(egret.EventDispatcher));\n    fgui.ScrollPane = ScrollPane;\n    var _gestureFlag = 0;\n    var TWEEN_TIME_GO = 0.5;\n    var TWEEN_TIME_DEFAULT = 0.3;\n    var PULL_RATIO = 0.5;\n    var s_vec2 = new egret.Point();\n    var s_rect = new egret.Rectangle();\n    var sEndPos = new egret.Point();\n    var sOldChange = new egret.Point();\n    function easeFunc(t, d) {\n        return (t = t / d - 1) * t * t + 1;\n    }\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var Transition = (function () {\n        function Transition(owner) {\n            this._ownerBaseX = 0;\n            this._ownerBaseY = 0;\n            this._totalTimes = 0;\n            this._totalTasks = 0;\n            this._options = 0;\n            this._totalDuration = 0;\n            this._autoPlayTimes = 1;\n            this._autoPlayDelay = 0;\n            this._timeScale = 1;\n            this._startTime = 0;\n            this._endTime = 0;\n            this._owner = owner;\n            this._items = new Array();\n        }\n        Transition.prototype.play = function (onComplete, onCompleteObj, onCompleteParam, times, delay, startTime, endTime) {\n            this._play(onComplete, onCompleteObj, onCompleteParam, times, delay, startTime, endTime, false);\n        };\n        Transition.prototype.playReverse = function (onComplete, onCompleteObj, onCompleteParam, times, delay) {\n            this._play(onComplete, onCompleteObj, onCompleteParam, times, delay, 0, -1, true);\n        };\n        Transition.prototype.changePlayTimes = function (value) {\n            this._totalTimes = value;\n        };\n        Transition.prototype.setAutoPlay = function (value, times, delay) {\n            if (times == undefined)\n                times = -1;\n            if (delay == undefined)\n                delay = 0;\n            if (this._autoPlay != value) {\n                this._autoPlay = value;\n                this._autoPlayTimes = times;\n                this._autoPlayDelay = delay;\n                if (this._autoPlay) {\n                    if (this._owner.onStage)\n                        this.play(null, null, this._autoPlayTimes, this._autoPlayDelay);\n                }\n                else {\n                    if (!this._owner.onStage)\n                        this.stop(false, true);\n                }\n            }\n        };\n        Transition.prototype._play = function (onComplete, onCompleteCaller, onCompleteParam, times, delay, startTime, endTime, reversed) {\n            if (times == undefined)\n                times = 1;\n            if (delay == undefined)\n                delay = 0;\n            if (startTime == undefined)\n                startTime = 0;\n            if (endTime == undefined)\n                endTime = -1;\n            this.stop(true, true);\n            this._totalTimes = times;\n            this._reversed = reversed;\n            this._startTime = startTime;\n            this._endTime = endTime;\n            this._playing = true;\n            this._paused = false;\n            this._onComplete = onComplete;\n            this._onCompleteParam = onCompleteParam;\n            this._onCompleteCaller = onCompleteCaller;\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (!item.target) {\n                    if (item.targetId)\n                        item.target = this._owner.getChildById(item.targetId);\n                    else\n                        item.target = this._owner;\n                }\n                else if (item.target != this._owner && item.target.parent != this._owner)\n                    item.target = null;\n                if (item.target && item.type == ActionType.Transition) {\n                    var trans = item.target.getTransition(item.value.transName);\n                    if (trans == this)\n                        trans = null;\n                    if (trans) {\n                        if (item.value.playTimes == 0) {\n                            var j;\n                            for (j = i - 1; j >= 0; j--) {\n                                var item2 = this._items[j];\n                                if (item2.type == ActionType.Transition) {\n                                    if (item2.value.trans == trans) {\n                                        item2.value.stopTime = item.time - item2.time;\n                                        break;\n                                    }\n                                }\n                            }\n                            if (j < 0)\n                                item.value.stopTime = 0;\n                            else\n                                trans = null;\n                        }\n                        else\n                            item.value.stopTime = -1;\n                    }\n                    item.value.trans = trans;\n                }\n            }\n            if (delay == 0)\n                this.onDelayedPlay();\n            else\n                fgui.GTween.delayedCall(delay).setTarget(this).onComplete(this.onDelayedPlay, this);\n        };\n        Transition.prototype.stop = function (setToComplete, processCallback) {\n            if (setToComplete == undefined)\n                setToComplete = true;\n            if (!this._playing)\n                return;\n            this._playing = false;\n            this._totalTasks = 0;\n            this._totalTimes = 0;\n            var func = this._onComplete;\n            var param = this._onCompleteParam;\n            var thisObj = this._onCompleteCaller;\n            this._onComplete = null;\n            this._onCompleteParam = null;\n            this._onCompleteCaller = null;\n            fgui.GTween.kill(this);\n            var cnt = this._items.length;\n            if (this._reversed) {\n                for (var i = cnt - 1; i >= 0; i--) {\n                    var item = this._items[i];\n                    if (!item.target)\n                        continue;\n                    this.stopItem(item, setToComplete);\n                }\n            }\n            else {\n                for (i = 0; i < cnt; i++) {\n                    item = this._items[i];\n                    if (!item.target)\n                        continue;\n                    this.stopItem(item, setToComplete);\n                }\n            }\n            if (processCallback && func != null) {\n                func.call(thisObj, param);\n            }\n        };\n        Transition.prototype.stopItem = function (item, setToComplete) {\n            if (item.displayLockToken != 0) {\n                item.target.releaseDisplayLock(item.displayLockToken);\n                item.displayLockToken = 0;\n            }\n            if (item.tweener) {\n                item.tweener.kill(setToComplete);\n                item.tweener = null;\n                if (item.type == ActionType.Shake && !setToComplete) {\n                    item.target._gearLocked = true;\n                    item.target.setXY(item.target.x - item.value.lastOffsetX, item.target.y - item.value.lastOffsetY);\n                    item.target._gearLocked = false;\n                }\n            }\n            if (item.type == ActionType.Transition) {\n                var trans = item.value.trans;\n                if (trans)\n                    trans.stop(setToComplete, false);\n            }\n        };\n        Transition.prototype.setPaused = function (paused) {\n            if (!this._playing || this._paused == paused)\n                return;\n            this._paused = paused;\n            var tweener = fgui.GTween.getTween(this);\n            if (tweener)\n                tweener.setPaused(paused);\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (!item.target)\n                    continue;\n                if (item.type == ActionType.Transition) {\n                    if (item.value.trans)\n                        item.value.trans.setPaused(paused);\n                }\n                else if (item.type == ActionType.Animation) {\n                    if (paused) {\n                        item.value.flag = item.target.getProp(fgui.ObjectPropID.Playing);\n                        item.target.setProp(fgui.ObjectPropID.Playing, false);\n                    }\n                    else\n                        item.target.setProp(fgui.ObjectPropID.Playing, item.value.flag);\n                }\n                if (item.tweener)\n                    item.tweener.setPaused(paused);\n            }\n        };\n        Transition.prototype.dispose = function () {\n            if (this._playing)\n                fgui.GTween.kill(this);\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (item.tweener) {\n                    item.tweener.kill();\n                    item.tweener = null;\n                }\n                item.target = null;\n                item.hook = null;\n                if (item.tweenConfig)\n                    item.tweenConfig.endHook = null;\n            }\n            this._items.length = 0;\n            this._playing = false;\n            this._onComplete = null;\n            this._onCompleteCaller = null;\n            this._onCompleteParam = null;\n        };\n        Object.defineProperty(Transition.prototype, \"playing\", {\n            get: function () {\n                return this._playing;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Transition.prototype.setValue = function (label) {\n            var args = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                args[_i - 1] = arguments[_i];\n            }\n            var cnt = this._items.length;\n            var value;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (item.label == label) {\n                    if (item.tweenConfig)\n                        value = item.tweenConfig.startValue;\n                    else\n                        value = item.value;\n                }\n                else if (item.tweenConfig && item.tweenConfig.endLabel == label) {\n                    value = item.tweenConfig.endValue;\n                }\n                else\n                    continue;\n                switch (item.type) {\n                    case ActionType.XY:\n                    case ActionType.Size:\n                    case ActionType.Pivot:\n                    case ActionType.Scale:\n                    case ActionType.Skew:\n                        value.b1 = true;\n                        value.b2 = true;\n                        value.f1 = parseFloat(args[0]);\n                        value.f2 = parseFloat(args[1]);\n                        break;\n                    case ActionType.Alpha:\n                        value.f1 = parseFloat(args[0]);\n                        break;\n                    case ActionType.Rotation:\n                        value.f1 = parseFloat(args[0]);\n                        break;\n                    case ActionType.Color:\n                        value.f1 = parseFloat(args[0]);\n                        break;\n                    case ActionType.Animation:\n                        value.frame = parseInt(args[0]);\n                        if (args.length > 1)\n                            value.playing = args[1];\n                        break;\n                    case ActionType.Visible:\n                        value.visible = args[0];\n                        break;\n                    case ActionType.Sound:\n                        value.sound = args[0];\n                        if (args.length > 1)\n                            value.volume = parseFloat(args[1]);\n                        break;\n                    case ActionType.Transition:\n                        value.transName = args[0];\n                        if (args.length > 1)\n                            value.playTimes = parseInt(args[1]);\n                        break;\n                    case ActionType.Shake:\n                        value.amplitude = parseFloat(args[0]);\n                        if (args.length > 1)\n                            value.duration = parseFloat(args[1]);\n                        break;\n                    case ActionType.ColorFilter:\n                        value.f1 = parseFloat(args[0]);\n                        value.f2 = parseFloat(args[1]);\n                        value.f3 = parseFloat(args[2]);\n                        value.f4 = parseFloat(args[3]);\n                        break;\n                    case ActionType.Text:\n                    case ActionType.Icon:\n                        value.text = args[0];\n                        break;\n                }\n            }\n        };\n        Transition.prototype.setHook = function (label, callback, caller) {\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (item.label == label) {\n                    item.hook = callback;\n                    item.hookCaller = caller;\n                    break;\n                }\n                else if (item.tweenConfig && item.tweenConfig.endLabel == label) {\n                    item.tweenConfig.endHook = callback;\n                    item.tweenConfig.endHookCaller = caller;\n                    break;\n                }\n            }\n        };\n        Transition.prototype.clearHooks = function () {\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                item.hook = null;\n                item.hookCaller = null;\n                if (item.tweenConfig) {\n                    item.tweenConfig.endHook = null;\n                    item.tweenConfig.endHookCaller = null;\n                }\n            }\n        };\n        Transition.prototype.setTarget = function (label, newTarget) {\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (item.label == label) {\n                    item.targetId = (newTarget == this._owner || !newTarget) ? \"\" : newTarget.id;\n                    if (this._playing) {\n                        if (item.targetId.length > 0)\n                            item.target = this._owner.getChildById(item.targetId);\n                        else\n                            item.target = this._owner;\n                    }\n                    else\n                        item.target = null;\n                }\n            }\n        };\n        Transition.prototype.setDuration = function (label, value) {\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (item.tweenConfig && item.label == label)\n                    item.tweenConfig.duration = value;\n            }\n        };\n        Transition.prototype.getLabelTime = function (label) {\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (item.label == label)\n                    return item.time;\n                else if (item.tweenConfig && item.tweenConfig.endLabel == label)\n                    return item.time + item.tweenConfig.duration;\n            }\n            return Number.NaN;\n        };\n        Object.defineProperty(Transition.prototype, \"timeScale\", {\n            get: function () {\n                return this._timeScale;\n            },\n            set: function (value) {\n                if (this._timeScale != value) {\n                    this._timeScale = value;\n                    if (this._playing) {\n                        var cnt = this._items.length;\n                        for (var i = 0; i < cnt; i++) {\n                            var item = this._items[i];\n                            if (item.tweener)\n                                item.tweener.setTimeScale(value);\n                            else if (item.type == ActionType.Transition) {\n                                if (item.value.trans)\n                                    item.value.trans.timeScale = value;\n                            }\n                            else if (item.type == ActionType.Animation) {\n                                if (item.target)\n                                    item.target.setProp(fgui.ObjectPropID.TimeScale, value);\n                            }\n                        }\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Transition.prototype.updateFromRelations = function (targetId, dx, dy) {\n            var cnt = this._items.length;\n            if (cnt == 0)\n                return;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (item.type == ActionType.XY && item.targetId == targetId) {\n                    if (item.tweenConfig) {\n                        item.tweenConfig.startValue.f1 += dx;\n                        item.tweenConfig.startValue.f2 += dy;\n                        item.tweenConfig.endValue.f1 += dx;\n                        item.tweenConfig.endValue.f2 += dy;\n                    }\n                    else {\n                        item.value.f1 += dx;\n                        item.value.f2 += dy;\n                    }\n                }\n            }\n        };\n        Transition.prototype.onOwnerAddedToStage = function () {\n            if (this._autoPlay && !this._playing)\n                this.play(null, null, null, this._autoPlayTimes, this._autoPlayDelay);\n        };\n        Transition.prototype.onOwnerRemovedFromStage = function () {\n            if ((this._options & OPTION_AUTO_STOP_DISABLED) == 0)\n                this.stop((this._options & OPTION_AUTO_STOP_AT_END) != 0 ? true : false, false);\n        };\n        Transition.prototype.onDelayedPlay = function () {\n            this.internalPlay();\n            this._playing = this._totalTasks > 0;\n            if (this._playing) {\n                if ((this._options & OPTION_IGNORE_DISPLAY_CONTROLLER) != 0) {\n                    var cnt = this._items.length;\n                    for (var i = 0; i < cnt; i++) {\n                        var item = this._items[i];\n                        if (item.target && item.target != this._owner)\n                            item.displayLockToken = item.target.addDisplayLock();\n                    }\n                }\n            }\n            else if (this._onComplete != null) {\n                var func = this._onComplete;\n                var param = this._onCompleteParam;\n                var thisObj = this._onCompleteCaller;\n                this._onComplete = null;\n                this._onCompleteParam = null;\n                this._onCompleteCaller = null;\n                func.call(thisObj, param);\n            }\n        };\n        Transition.prototype.internalPlay = function () {\n            this._ownerBaseX = this._owner.x;\n            this._ownerBaseY = this._owner.y;\n            this._totalTasks = 1;\n            var cnt = this._items.length;\n            var item;\n            var needSkipAnimations = false;\n            var i;\n            if (!this._reversed) {\n                for (i = 0; i < cnt; i++) {\n                    item = this._items[i];\n                    if (!item.target)\n                        continue;\n                    if (item.type == ActionType.Animation && this._startTime != 0 && item.time <= this._startTime) {\n                        needSkipAnimations = true;\n                        item.value.flag = false;\n                    }\n                    else\n                        this.playItem(item);\n                }\n            }\n            else {\n                for (i = cnt - 1; i >= 0; i--) {\n                    item = this._items[i];\n                    if (!item.target)\n                        continue;\n                    this.playItem(item);\n                }\n            }\n            if (needSkipAnimations)\n                this.skipAnimations();\n            this._totalTasks--;\n        };\n        Transition.prototype.playItem = function (item) {\n            var time;\n            if (item.tweenConfig) {\n                if (this._reversed)\n                    time = (this._totalDuration - item.time - item.tweenConfig.duration);\n                else\n                    time = item.time;\n                if (this._endTime == -1 || time <= this._endTime) {\n                    var startValue;\n                    var endValue;\n                    if (this._reversed) {\n                        startValue = item.tweenConfig.endValue;\n                        endValue = item.tweenConfig.startValue;\n                    }\n                    else {\n                        startValue = item.tweenConfig.startValue;\n                        endValue = item.tweenConfig.endValue;\n                    }\n                    item.value.b1 = startValue.b1 || endValue.b1;\n                    item.value.b2 = startValue.b2 || endValue.b2;\n                    switch (item.type) {\n                        case ActionType.XY:\n                        case ActionType.Size:\n                        case ActionType.Scale:\n                        case ActionType.Skew:\n                            item.tweener = fgui.GTween.to2(startValue.f1, startValue.f2, endValue.f1, endValue.f2, item.tweenConfig.duration);\n                            break;\n                        case ActionType.Alpha:\n                        case ActionType.Rotation:\n                            item.tweener = fgui.GTween.to(startValue.f1, endValue.f1, item.tweenConfig.duration);\n                            break;\n                        case ActionType.Color:\n                            item.tweener = fgui.GTween.toColor(startValue.f1, endValue.f1, item.tweenConfig.duration);\n                            break;\n                        case ActionType.ColorFilter:\n                            item.tweener = fgui.GTween.to4(startValue.f1, startValue.f2, startValue.f3, startValue.f4, endValue.f1, endValue.f2, endValue.f3, endValue.f4, item.tweenConfig.duration);\n                            break;\n                    }\n                    item.tweener.setDelay(time)\n                        .setEase(item.tweenConfig.easeType)\n                        .setRepeat(item.tweenConfig.repeat, item.tweenConfig.yoyo)\n                        .setTimeScale(this._timeScale)\n                        .setTarget(item)\n                        .onStart(this.onTweenStart, this)\n                        .onUpdate(this.onTweenUpdate, this)\n                        .onComplete(this.onTweenComplete, this);\n                    if (this._endTime >= 0)\n                        item.tweener.setBreakpoint(this._endTime - time);\n                    this._totalTasks++;\n                }\n            }\n            else if (item.type == ActionType.Shake) {\n                if (this._reversed)\n                    time = (this._totalDuration - item.time - item.value.duration);\n                else\n                    time = item.time;\n                item.value.offsetX = item.value.offsetY = 0;\n                item.value.lastOffsetX = item.value.lastOffsetY = 0;\n                item.tweener = fgui.GTween.shake(0, 0, item.value.amplitude, item.value.duration)\n                    .setDelay(time)\n                    .setTimeScale(this._timeScale)\n                    .setTarget(item)\n                    .onUpdate(this.onTweenUpdate, this)\n                    .onComplete(this.onTweenComplete, this);\n                if (this._endTime >= 0)\n                    item.tweener.setBreakpoint(this._endTime - item.time);\n                this._totalTasks++;\n            }\n            else {\n                if (this._reversed)\n                    time = (this._totalDuration - item.time);\n                else\n                    time = item.time;\n                if (time <= this._startTime) {\n                    this.applyValue(item);\n                    this.callHook(item, false);\n                }\n                else if (this._endTime == -1 || time <= this._endTime) {\n                    this._totalTasks++;\n                    item.tweener = fgui.GTween.delayedCall(time)\n                        .setTimeScale(this._timeScale)\n                        .setTarget(item)\n                        .onComplete(this.onDelayedPlayItem, this);\n                }\n            }\n            if (item.tweener != null)\n                item.tweener.seek(this._startTime);\n        };\n        Transition.prototype.skipAnimations = function () {\n            var frame;\n            var playStartTime;\n            var playTotalTime;\n            var value;\n            var target;\n            var item;\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                item = this._items[i];\n                if (item.type != ActionType.Animation || item.time > this._startTime)\n                    continue;\n                value = item.value;\n                if (value.flag)\n                    continue;\n                target = item.target;\n                frame = target.getProp(fgui.ObjectPropID.Frame);\n                playStartTime = target.getProp(fgui.ObjectPropID.Playing) ? 0 : -1;\n                playTotalTime = 0;\n                for (var j = i; j < cnt; j++) {\n                    item = this._items[j];\n                    if (item.type != ActionType.Animation || item.target != target || item.time > this._startTime)\n                        continue;\n                    value = item.value;\n                    value.flag = true;\n                    if (value.frame != -1) {\n                        frame = value.frame;\n                        if (value.playing)\n                            playStartTime = item.time;\n                        else\n                            playStartTime = -1;\n                        playTotalTime = 0;\n                    }\n                    else {\n                        if (value.playing) {\n                            if (playStartTime < 0)\n                                playStartTime = item.time;\n                        }\n                        else {\n                            if (playStartTime >= 0)\n                                playTotalTime += (item.time - playStartTime);\n                            playStartTime = -1;\n                        }\n                    }\n                    this.callHook(item, false);\n                }\n                if (playStartTime >= 0)\n                    playTotalTime += (this._startTime - playStartTime);\n                target.setProp(fgui.ObjectPropID.Playing, playStartTime >= 0);\n                target.setProp(fgui.ObjectPropID.Frame, frame);\n                if (playTotalTime > 0)\n                    target.setProp(fgui.ObjectPropID.DeltaTime, playTotalTime * 1000);\n            }\n        };\n        Transition.prototype.onDelayedPlayItem = function (tweener) {\n            var item = tweener.target;\n            item.tweener = null;\n            this._totalTasks--;\n            this.applyValue(item);\n            this.callHook(item, false);\n            this.checkAllComplete();\n        };\n        Transition.prototype.onTweenStart = function (tweener) {\n            var item = tweener.target;\n            if (item.type == ActionType.XY || item.type == ActionType.Size) {\n                var startValue;\n                var endValue;\n                if (this._reversed) {\n                    startValue = item.tweenConfig.endValue;\n                    endValue = item.tweenConfig.startValue;\n                }\n                else {\n                    startValue = item.tweenConfig.startValue;\n                    endValue = item.tweenConfig.endValue;\n                }\n                if (item.type == ActionType.XY) {\n                    if (item.target != this._owner) {\n                        if (!startValue.b1)\n                            tweener.startValue.x = item.target.x;\n                        else if (startValue.b3)\n                            tweener.startValue.x = startValue.f1 * this._owner.width;\n                        if (!startValue.b2)\n                            tweener.startValue.y = item.target.y;\n                        else if (startValue.b3)\n                            tweener.startValue.y = startValue.f2 * this._owner.height;\n                        if (!endValue.b1)\n                            tweener.endValue.x = tweener.startValue.x;\n                        else if (endValue.b3)\n                            tweener.endValue.x = endValue.f1 * this._owner.width;\n                        if (!endValue.b2)\n                            tweener.endValue.y = tweener.startValue.y;\n                        else if (endValue.b3)\n                            tweener.endValue.y = endValue.f2 * this._owner.height;\n                    }\n                    else {\n                        if (!startValue.b1)\n                            tweener.startValue.x = item.target.x - this._ownerBaseX;\n                        if (!startValue.b2)\n                            tweener.startValue.y = item.target.y - this._ownerBaseY;\n                        if (!endValue.b1)\n                            tweener.endValue.x = tweener.startValue.x;\n                        if (!endValue.b2)\n                            tweener.endValue.y = tweener.startValue.y;\n                    }\n                }\n                else {\n                    if (!startValue.b1)\n                        tweener.startValue.x = item.target.width;\n                    if (!startValue.b2)\n                        tweener.startValue.y = item.target.height;\n                    if (!endValue.b1)\n                        tweener.endValue.x = tweener.startValue.x;\n                    if (!endValue.b2)\n                        tweener.endValue.y = tweener.startValue.y;\n                }\n                if (item.tweenConfig.path) {\n                    item.value.b1 = item.value.b2 = true;\n                    tweener.setPath(item.tweenConfig.path);\n                }\n            }\n            this.callHook(item, false);\n        };\n        Transition.prototype.onTweenUpdate = function (tweener) {\n            var item = tweener.target;\n            switch (item.type) {\n                case ActionType.XY:\n                case ActionType.Size:\n                case ActionType.Scale:\n                case ActionType.Skew:\n                    item.value.f1 = tweener.value.x;\n                    item.value.f2 = tweener.value.y;\n                    if (item.tweenConfig.path) {\n                        item.value.f1 += tweener.startValue.x;\n                        item.value.f2 += tweener.startValue.y;\n                    }\n                    break;\n                case ActionType.Alpha:\n                case ActionType.Rotation:\n                    item.value.f1 = tweener.value.x;\n                    break;\n                case ActionType.Color:\n                    item.value.f1 = tweener.value.color;\n                    break;\n                case ActionType.ColorFilter:\n                    item.value.f1 = tweener.value.x;\n                    item.value.f2 = tweener.value.y;\n                    item.value.f3 = tweener.value.z;\n                    item.value.f4 = tweener.value.w;\n                    break;\n                case ActionType.Shake:\n                    item.value.offsetX = tweener.deltaValue.x;\n                    item.value.offsetY = tweener.deltaValue.y;\n                    break;\n            }\n            this.applyValue(item);\n        };\n        Transition.prototype.onTweenComplete = function (tweener) {\n            var item = tweener.target;\n            item.tweener = null;\n            this._totalTasks--;\n            if (tweener.allCompleted)\n                this.callHook(item, true);\n            this.checkAllComplete();\n        };\n        Transition.prototype.onPlayTransCompleted = function (item) {\n            this._totalTasks--;\n            this.checkAllComplete();\n        };\n        Transition.prototype.callHook = function (item, tweenEnd) {\n            if (tweenEnd) {\n                if (item.tweenConfig && item.tweenConfig.endHook)\n                    item.tweenConfig.endHook.call(item.tweenConfig.endHookCaller);\n            }\n            else {\n                if (item.time >= this._startTime && item.hook != null)\n                    item.hook.call(item.hookCaller);\n            }\n        };\n        Transition.prototype.checkAllComplete = function () {\n            if (this._playing && this._totalTasks == 0) {\n                if (this._totalTimes < 0) {\n                    this.internalPlay();\n                    if (this._totalTasks == 0)\n                        fgui.GTween.delayedCall(0).setTarget(this).onComplete(this.checkAllComplete, this);\n                }\n                else {\n                    this._totalTimes--;\n                    if (this._totalTimes > 0) {\n                        this.internalPlay();\n                        if (this._totalTasks == 0)\n                            fgui.GTween.delayedCall(0).setTarget(this).onComplete(this.checkAllComplete, this);\n                    }\n                    else {\n                        this._playing = false;\n                        var cnt = this._items.length;\n                        for (var i = 0; i < cnt; i++) {\n                            var item = this._items[i];\n                            if (item.target && item.displayLockToken != 0) {\n                                item.target.releaseDisplayLock(item.displayLockToken);\n                                item.displayLockToken = 0;\n                            }\n                        }\n                        if (this._onComplete != null) {\n                            var func = this._onComplete;\n                            var param = this._onCompleteParam;\n                            var thisObj = this._onCompleteCaller;\n                            this._onComplete = null;\n                            this._onCompleteParam = null;\n                            this._onCompleteCaller = null;\n                            func.call(thisObj, param);\n                        }\n                    }\n                }\n            }\n        };\n        Transition.prototype.applyValue = function (item) {\n            item.target._gearLocked = true;\n            var value = item.value;\n            switch (item.type) {\n                case ActionType.XY:\n                    if (item.target == this._owner) {\n                        if (value.b1 && value.b2)\n                            item.target.setXY(value.f1 + this._ownerBaseX, value.f2 + this._ownerBaseY);\n                        else if (value.b1)\n                            item.target.x = value.f1 + this._ownerBaseX;\n                        else\n                            item.target.y = value.f2 + this._ownerBaseY;\n                    }\n                    else {\n                        if (value.b3) {\n                            if (value.b1 && value.b2)\n                                item.target.setXY(value.f1 * this._owner.width, value.f2 * this._owner.height);\n                            else if (value.b1)\n                                item.target.x = value.f1 * this._owner.width;\n                            else if (value.b2)\n                                item.target.y = value.f2 * this._owner.height;\n                        }\n                        else {\n                            if (value.b1 && value.b2)\n                                item.target.setXY(value.f1, value.f2);\n                            else if (value.b1)\n                                item.target.x = value.f1;\n                            else if (value.b2)\n                                item.target.y = value.f2;\n                        }\n                    }\n                    break;\n                case ActionType.Size:\n                    if (!value.b1)\n                        value.f1 = item.target.width;\n                    if (!value.b2)\n                        value.f2 = item.target.height;\n                    item.target.setSize(value.f1, value.f2);\n                    break;\n                case ActionType.Pivot:\n                    item.target.setPivot(value.f1, value.f2, item.target.pivotAsAnchor);\n                    break;\n                case ActionType.Alpha:\n                    item.target.alpha = value.f1;\n                    break;\n                case ActionType.Rotation:\n                    item.target.rotation = value.f1;\n                    break;\n                case ActionType.Scale:\n                    item.target.setScale(value.f1, value.f2);\n                    break;\n                case ActionType.Skew:\n                    item.target.setSkew(value.f1, value.f2);\n                    break;\n                case ActionType.Color:\n                    item.target.setProp(fgui.ObjectPropID.Color, value.f1);\n                    break;\n                case ActionType.Animation:\n                    if (value.frame >= 0)\n                        item.target.setProp(fgui.ObjectPropID.Frame, value.frame);\n                    item.target.setProp(fgui.ObjectPropID.Playing, value.playing);\n                    item.target.setProp(fgui.ObjectPropID.TimeScale, this._timeScale);\n                    break;\n                case ActionType.Visible:\n                    item.target.visible = value.visible;\n                    break;\n                case ActionType.Transition:\n                    if (this._playing) {\n                        var trans = value.trans;\n                        if (trans) {\n                            this._totalTasks++;\n                            var startTime = this._startTime > item.time ? (this._startTime - item.time) : 0;\n                            var endTime = this._endTime >= 0 ? (this._endTime - item.time) : -1;\n                            if (value.stopTime >= 0 && (endTime < 0 || endTime > value.stopTime))\n                                endTime = value.stopTime;\n                            trans.timeScale = this._timeScale;\n                            trans._play(this.onPlayTransCompleted, this, item, value.playTimes, 0, startTime, endTime, this._reversed);\n                        }\n                    }\n                    break;\n                case ActionType.Sound:\n                    if (this._playing && item.time >= this._startTime) {\n                        if (!value.audioClip) {\n                            var pi = fgui.UIPackage.getItemByURL(value.sound);\n                            if (pi)\n                                value.audioClip = pi.owner.getItemAsset(pi);\n                        }\n                        if (value.audioClip)\n                            fgui.GRoot.inst.playOneShotSound(value.audioClip, value.volume);\n                    }\n                    break;\n                case ActionType.Shake:\n                    item.target.setXY(item.target.x - value.lastOffsetX + value.offsetX, item.target.y - value.lastOffsetY + value.offsetY);\n                    value.lastOffsetX = value.offsetX;\n                    value.lastOffsetY = value.offsetY;\n                    break;\n                case ActionType.ColorFilter:\n                    {\n                        fgui.ToolSet.setColorFilter(item.target.displayObject, [value.f1, value.f2, value.f3, value.f4]);\n                        break;\n                    }\n                case ActionType.Text:\n                    item.target.text = value.text;\n                    break;\n                case ActionType.Icon:\n                    item.target.icon = value.text;\n                    break;\n            }\n            item.target._gearLocked = false;\n        };\n        Transition.prototype.setup = function (buffer) {\n            this.name = buffer.readS();\n            this._options = buffer.readInt();\n            this._autoPlay = buffer.readBool();\n            this._autoPlayTimes = buffer.readInt();\n            this._autoPlayDelay = buffer.readFloat();\n            var cnt = buffer.readShort();\n            for (var i = 0; i < cnt; i++) {\n                var dataLen = buffer.readShort();\n                var curPos = buffer.position;\n                buffer.seek(curPos, 0);\n                var item = new Item(buffer.readByte());\n                this._items[i] = item;\n                item.time = buffer.readFloat();\n                var targetId = buffer.readShort();\n                if (targetId < 0)\n                    item.targetId = \"\";\n                else\n                    item.targetId = this._owner.getChildAt(targetId).id;\n                item.label = buffer.readS();\n                if (buffer.readBool()) {\n                    buffer.seek(curPos, 1);\n                    item.tweenConfig = new TweenConfig();\n                    item.tweenConfig.duration = buffer.readFloat();\n                    if (item.time + item.tweenConfig.duration > this._totalDuration)\n                        this._totalDuration = item.time + item.tweenConfig.duration;\n                    item.tweenConfig.easeType = buffer.readByte();\n                    item.tweenConfig.repeat = buffer.readInt();\n                    item.tweenConfig.yoyo = buffer.readBool();\n                    item.tweenConfig.endLabel = buffer.readS();\n                    buffer.seek(curPos, 2);\n                    this.decodeValue(item, buffer, item.tweenConfig.startValue);\n                    buffer.seek(curPos, 3);\n                    this.decodeValue(item, buffer, item.tweenConfig.endValue);\n                    if (buffer.version >= 2) {\n                        var pathLen = buffer.readInt();\n                        if (pathLen > 0) {\n                            item.tweenConfig.path = new fgui.GPath();\n                            var pts = new Array();\n                            for (var j = 0; j < pathLen; j++) {\n                                var curveType = buffer.readByte();\n                                switch (curveType) {\n                                    case fgui.CurveType.Bezier:\n                                        pts.push(fgui.GPathPoint.newBezierPoint(buffer.readFloat(), buffer.readFloat(), buffer.readFloat(), buffer.readFloat()));\n                                        break;\n                                    case fgui.CurveType.CubicBezier:\n                                        pts.push(fgui.GPathPoint.newCubicBezierPoint(buffer.readFloat(), buffer.readFloat(), buffer.readFloat(), buffer.readFloat(), buffer.readFloat(), buffer.readFloat()));\n                                        break;\n                                    default:\n                                        pts.push(fgui.GPathPoint.newPoint(buffer.readFloat(), buffer.readFloat(), curveType));\n                                        break;\n                                }\n                            }\n                            item.tweenConfig.path.create(pts);\n                        }\n                    }\n                }\n                else {\n                    if (item.time > this._totalDuration)\n                        this._totalDuration = item.time;\n                    buffer.seek(curPos, 2);\n                    this.decodeValue(item, buffer, item.value);\n                }\n                buffer.position = curPos + dataLen;\n            }\n        };\n        Transition.prototype.decodeValue = function (item, buffer, value) {\n            switch (item.type) {\n                case ActionType.XY:\n                case ActionType.Size:\n                case ActionType.Pivot:\n                case ActionType.Skew:\n                    value.b1 = buffer.readBool();\n                    value.b2 = buffer.readBool();\n                    value.f1 = buffer.readFloat();\n                    value.f2 = buffer.readFloat();\n                    if (buffer.version >= 2 && item.type == ActionType.XY)\n                        value.b3 = buffer.readBool();\n                    break;\n                case ActionType.Alpha:\n                case ActionType.Rotation:\n                    value.f1 = buffer.readFloat();\n                    break;\n                case ActionType.Scale:\n                    value.f1 = buffer.readFloat();\n                    value.f2 = buffer.readFloat();\n                    break;\n                case ActionType.Color:\n                    value.f1 = buffer.readColor();\n                    break;\n                case ActionType.Animation:\n                    value.playing = buffer.readBool();\n                    value.frame = buffer.readInt();\n                    break;\n                case ActionType.Visible:\n                    value.visible = buffer.readBool();\n                    break;\n                case ActionType.Sound:\n                    value.sound = buffer.readS();\n                    value.volume = buffer.readFloat();\n                    break;\n                case ActionType.Transition:\n                    value.transName = buffer.readS();\n                    value.playTimes = buffer.readInt();\n                    break;\n                case ActionType.Shake:\n                    value.amplitude = buffer.readFloat();\n                    value.duration = buffer.readFloat();\n                    break;\n                case ActionType.ColorFilter:\n                    value.f1 = buffer.readFloat();\n                    value.f2 = buffer.readFloat();\n                    value.f3 = buffer.readFloat();\n                    value.f4 = buffer.readFloat();\n                    break;\n                case ActionType.Text:\n                case ActionType.Icon:\n                    value.text = buffer.readS();\n                    break;\n            }\n        };\n        return Transition;\n    }());\n    fgui.Transition = Transition;\n    var OPTION_IGNORE_DISPLAY_CONTROLLER = 1;\n    var OPTION_AUTO_STOP_DISABLED = 2;\n    var OPTION_AUTO_STOP_AT_END = 4;\n    var ActionType = (function () {\n        function ActionType() {\n        }\n        ActionType.XY = 0;\n        ActionType.Size = 1;\n        ActionType.Scale = 2;\n        ActionType.Pivot = 3;\n        ActionType.Alpha = 4;\n        ActionType.Rotation = 5;\n        ActionType.Color = 6;\n        ActionType.Animation = 7;\n        ActionType.Visible = 8;\n        ActionType.Sound = 9;\n        ActionType.Transition = 10;\n        ActionType.Shake = 11;\n        ActionType.ColorFilter = 12;\n        ActionType.Skew = 13;\n        ActionType.Text = 14;\n        ActionType.Icon = 15;\n        ActionType.Unknown = 16;\n        return ActionType;\n    }());\n    var Item = (function () {\n        function Item(type) {\n            this.type = type;\n            this.value = {};\n            this.displayLockToken = 0;\n        }\n        return Item;\n    }());\n    var TweenConfig = (function () {\n        function TweenConfig() {\n            this.duration = 0;\n            this.repeat = 0;\n            this.easeType = fgui.EaseType.QuadOut;\n            this.startValue = { b1: true, b2: true };\n            this.endValue = { b1: true, b2: true };\n        }\n        return TweenConfig;\n    }());\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var TranslationHelper = (function () {\n        function TranslationHelper() {\n        }\n        TranslationHelper.loadFromXML = function (source) {\n            var strings = {};\n            TranslationHelper.strings = strings;\n            var xml = egret.XML.parse(source);\n            var nodes = xml.children;\n            var length1 = nodes.length;\n            for (var i1 = 0; i1 < length1; i1++) {\n                var cxml = nodes[i1];\n                if (cxml.name == \"string\") {\n                    var key = cxml.attributes.name;\n                    var text = cxml.children.length > 0 ? cxml.children[0].text : \"\";\n                    var i = key.indexOf(\"-\");\n                    if (i == -1)\n                        continue;\n                    var key2 = key.substr(0, i);\n                    var key3 = key.substr(i + 1);\n                    var col = strings[key2];\n                    if (!col) {\n                        col = {};\n                        strings[key2] = col;\n                    }\n                    col[key3] = text;\n                }\n            }\n        };\n        TranslationHelper.translateComponent = function (item) {\n            if (TranslationHelper.strings == null)\n                return;\n            var compStrings = TranslationHelper.strings[item.owner.id + item.id];\n            if (compStrings == null)\n                return;\n            var elementId, value;\n            var buffer = item.rawData;\n            var nextPos;\n            var itemCount;\n            var i, j, k;\n            var dataLen;\n            var curPos;\n            var valueCnt;\n            var page;\n            buffer.seek(0, 2);\n            var childCount = buffer.readShort();\n            for (i = 0; i < childCount; i++) {\n                dataLen = buffer.readShort();\n                curPos = buffer.position;\n                buffer.seek(curPos, 0);\n                var baseType = buffer.readByte();\n                var type = baseType;\n                buffer.skip(4);\n                elementId = buffer.readS();\n                if (type == fgui.ObjectType.Component) {\n                    if (buffer.seek(curPos, 6))\n                        type = buffer.readByte();\n                }\n                buffer.seek(curPos, 1);\n                if ((value = compStrings[elementId + \"-tips\"]) != null)\n                    buffer.writeS(value);\n                buffer.seek(curPos, 2);\n                var gearCnt = buffer.readShort();\n                for (j = 0; j < gearCnt; j++) {\n                    nextPos = buffer.readShort();\n                    nextPos += buffer.position;\n                    if (buffer.readByte() == 6) {\n                        buffer.skip(2);\n                        valueCnt = buffer.readShort();\n                        for (k = 0; k < valueCnt; k++) {\n                            page = buffer.readS();\n                            if (page != null) {\n                                if ((value = compStrings[elementId + \"-texts_\" + k]) != null)\n                                    buffer.writeS(value);\n                                else\n                                    buffer.skip(2);\n                            }\n                        }\n                        if (buffer.readBool() && (value = compStrings[elementId + \"-texts_def\"]) != null)\n                            buffer.writeS(value);\n                    }\n                    if (baseType == fgui.ObjectType.Component && buffer.version >= 2) {\n                        buffer.seek(curPos, 4);\n                        buffer.skip(2);\n                        buffer.skip(4 * buffer.readShort());\n                        var cpCount = buffer.readShort();\n                        for (var k = 0; k < cpCount; k++) {\n                            var target = buffer.readS();\n                            var propertyId = buffer.readShort();\n                            if (propertyId == 0 && (value = compStrings[elementId + \"-cp-\" + target]) != null)\n                                buffer.writeS(value);\n                            else\n                                buffer.skip(2);\n                        }\n                    }\n                    buffer.position = nextPos;\n                }\n                switch (type) {\n                    case fgui.ObjectType.Text:\n                    case fgui.ObjectType.RichText:\n                    case fgui.ObjectType.InputText:\n                        {\n                            if ((value = compStrings[elementId]) != null) {\n                                buffer.seek(curPos, 6);\n                                buffer.writeS(value);\n                            }\n                            if ((value = compStrings[elementId + \"-prompt\"]) != null) {\n                                buffer.seek(curPos, 4);\n                                buffer.writeS(value);\n                            }\n                            break;\n                        }\n                    case fgui.ObjectType.List:\n                    case fgui.ObjectType.Tree:\n                        {\n                            buffer.seek(curPos, 8);\n                            buffer.skip(2);\n                            itemCount = buffer.readShort();\n                            for (j = 0; j < itemCount; j++) {\n                                nextPos = buffer.readShort();\n                                nextPos += buffer.position;\n                                buffer.skip(2);\n                                if (type == fgui.ObjectType.Tree)\n                                    buffer.skip(2);\n                                if ((value = compStrings[elementId + \"-\" + j]) != null)\n                                    buffer.writeS(value);\n                                else\n                                    buffer.skip(2);\n                                if ((value = compStrings[elementId + \"-\" + j + \"-0\"]) != null)\n                                    buffer.writeS(value);\n                                else\n                                    buffer.skip(2);\n                                if (buffer.version >= 2) {\n                                    buffer.skip(6);\n                                    buffer.skip(buffer.readUnsignedShort() * 4);\n                                    var cpCount = buffer.readUnsignedShort();\n                                    for (var k = 0; k < cpCount; k++) {\n                                        var target = buffer.readS();\n                                        var propertyId = buffer.readUnsignedShort();\n                                        if (propertyId == 0 && (value = compStrings[elementId + \"-\" + j + \"-\" + target]) != null)\n                                            buffer.writeS(value);\n                                        else\n                                            buffer.skip(2);\n                                    }\n                                }\n                                buffer.position = nextPos;\n                            }\n                            break;\n                        }\n                    case fgui.ObjectType.Label:\n                        {\n                            if (buffer.seek(curPos, 6) && buffer.readByte() == type) {\n                                if ((value = compStrings[elementId]) != null)\n                                    buffer.writeS(value);\n                                else\n                                    buffer.skip(2);\n                                buffer.skip(2);\n                                if (buffer.readBool())\n                                    buffer.skip(4);\n                                buffer.skip(4);\n                                if (buffer.readBool() && (value = compStrings[elementId + \"-prompt\"]) != null)\n                                    buffer.writeS(value);\n                            }\n                            break;\n                        }\n                    case fgui.ObjectType.Button:\n                        {\n                            if (buffer.seek(curPos, 6) && buffer.readByte() == type) {\n                                if ((value = compStrings[elementId]) != null)\n                                    buffer.writeS(value);\n                                else\n                                    buffer.skip(2);\n                                if ((value = compStrings[elementId + \"-0\"]) != null)\n                                    buffer.writeS(value);\n                            }\n                            break;\n                        }\n                    case fgui.ObjectType.ComboBox:\n                        {\n                            if (buffer.seek(curPos, 6) && buffer.readByte() == type) {\n                                itemCount = buffer.readShort();\n                                for (j = 0; j < itemCount; j++) {\n                                    nextPos = buffer.readShort();\n                                    nextPos += buffer.position;\n                                    if ((value = compStrings[elementId + \"-\" + j]) != null)\n                                        buffer.writeS(value);\n                                    buffer.position = nextPos;\n                                }\n                                if ((value = compStrings[elementId]) != null)\n                                    buffer.writeS(value);\n                            }\n                            break;\n                        }\n                }\n                buffer.position = curPos + dataLen;\n            }\n        };\n        return TranslationHelper;\n    }());\n    fgui.TranslationHelper = TranslationHelper;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var UIConfig = (function () {\n        function UIConfig() {\n        }\n        UIConfig.defaultFont = \"SimSun\";\n        UIConfig.modalLayerColor = 0x333333;\n        UIConfig.modalLayerAlpha = 0.2;\n        UIConfig.buttonSoundVolumeScale = 1;\n        UIConfig.defaultScrollStep = 25;\n        UIConfig.defaultScrollDecelerationRate = 0.967;\n        UIConfig.defaultScrollBarDisplay = fgui.ScrollBarDisplayType.Visible;\n        UIConfig.defaultScrollTouchEffect = true;\n        UIConfig.defaultScrollBounceEffect = true;\n        UIConfig.defaultComboBoxVisibleItemCount = 10;\n        UIConfig.touchScrollSensitivity = 20;\n        UIConfig.touchDragSensitivity = 10;\n        UIConfig.clickDragSensitivity = 2;\n        UIConfig.bringWindowToFrontOnClick = true;\n        UIConfig.frameTimeForAsyncUIConstruction = 2;\n        return UIConfig;\n    }());\n    fgui.UIConfig = UIConfig;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var UIObjectFactory = (function () {\n        function UIObjectFactory() {\n        }\n        UIObjectFactory.setExtension = function (url, type) {\n            if (url == null)\n                throw \"Invaild url: \" + url;\n            var pi = fgui.UIPackage.getItemByURL(url);\n            if (pi)\n                pi.extensionType = type;\n            UIObjectFactory.extensions[url] = type;\n        };\n        UIObjectFactory.setPackageItemExtension = function (url, type) {\n            UIObjectFactory.setExtension(url, type);\n        };\n        UIObjectFactory.setLoaderExtension = function (type) {\n            UIObjectFactory.loaderType = type;\n        };\n        UIObjectFactory.resolvePackageItemExtension = function (pi) {\n            var extensionType = UIObjectFactory.extensions[\"ui://\" + pi.owner.id + pi.id];\n            if (!extensionType)\n                extensionType = UIObjectFactory.extensions[\"ui://\" + pi.owner.name + \"/\" + pi.name];\n            if (extensionType)\n                pi.extensionType = extensionType;\n        };\n        UIObjectFactory.newObject = function (type, userClass) {\n            var obj;\n            if (typeof type === 'number') {\n                switch (type) {\n                    case fgui.ObjectType.Image:\n                        return new fgui.GImage();\n                    case fgui.ObjectType.MovieClip:\n                        return new fgui.GMovieClip();\n                    case fgui.ObjectType.Component:\n                        return new fgui.GComponent();\n                    case fgui.ObjectType.Text:\n                        return new fgui.GTextField();\n                    case fgui.ObjectType.RichText:\n                        return new fgui.GRichTextField();\n                    case fgui.ObjectType.InputText:\n                        return new fgui.GTextInput();\n                    case fgui.ObjectType.Group:\n                        return new fgui.GGroup();\n                    case fgui.ObjectType.List:\n                        return new fgui.GList();\n                    case fgui.ObjectType.Graph:\n                        return new fgui.GGraph();\n                    case fgui.ObjectType.Loader:\n                        if (UIObjectFactory.loaderType)\n                            return new UIObjectFactory.loaderType();\n                        else\n                            return new fgui.GLoader();\n                    case fgui.ObjectType.Button:\n                        return new fgui.GButton();\n                    case fgui.ObjectType.Label:\n                        return new fgui.GLabel();\n                    case fgui.ObjectType.ProgressBar:\n                        return new fgui.GProgressBar();\n                    case fgui.ObjectType.Slider:\n                        return new fgui.GSlider();\n                    case fgui.ObjectType.ScrollBar:\n                        return new fgui.GScrollBar();\n                    case fgui.ObjectType.ComboBox:\n                        return new fgui.GComboBox();\n                    case fgui.ObjectType.Tree:\n                        return new fgui.GTree();\n                    case fgui.ObjectType.Loader3D:\n                        return new fgui.GLoader3D();\n                    default:\n                        return null;\n                }\n            }\n            else {\n                if (type.type == fgui.PackageItemType.Component) {\n                    if (userClass)\n                        obj = new userClass();\n                    else if (type.extensionType)\n                        obj = new type.extensionType();\n                    else\n                        obj = UIObjectFactory.newObject(type.objectType);\n                }\n                else\n                    obj = UIObjectFactory.newObject(type.objectType);\n                if (obj)\n                    obj.packageItem = type;\n            }\n            return obj;\n        };\n        UIObjectFactory.extensions = {};\n        return UIObjectFactory;\n    }());\n    fgui.UIObjectFactory = UIObjectFactory;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var UIPackage = (function () {\n        function UIPackage() {\n            this._items = [];\n            this._itemsById = {};\n            this._itemsByName = {};\n            this._sprites = {};\n            this._dependencies = [];\n            this._branches = [];\n            this._branchIndex = -1;\n        }\n        Object.defineProperty(UIPackage, \"branch\", {\n            get: function () {\n                return UIPackage._branch;\n            },\n            set: function (value) {\n                UIPackage._branch = value;\n                for (var pkgId in UIPackage._instById) {\n                    var pkg = UIPackage._instById[pkgId];\n                    if (pkg._branches) {\n                        pkg._branchIndex = pkg._branches.indexOf(value);\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        UIPackage.getVar = function (key) {\n            return UIPackage._vars[key];\n        };\n        UIPackage.setVar = function (key, value) {\n            UIPackage._vars[key] = value;\n        };\n        UIPackage.getById = function (id) {\n            return UIPackage._instById[id];\n        };\n        UIPackage.getByName = function (name) {\n            return UIPackage._instByName[name];\n        };\n        UIPackage.loadPackage = function (resKey) {\n            return __awaiter(this, void 0, void 0, function () {\n                var _this = this;\n                return __generator(this, function (_a) {\n                    return [2, new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {\n                            var pkg, asset, cnt, tasks, i, pi;\n                            return __generator(this, function (_a) {\n                                switch (_a.label) {\n                                    case 0:\n                                        pkg = UIPackage._instById[resKey];\n                                        if (pkg) {\n                                            resolve(pkg);\n                                            return [2];\n                                        }\n                                        return [4, RES.getResAsync(getAssetResKey(resKey, \"fui\"))];\n                                    case 1:\n                                        asset = _a.sent();\n                                        pkg = new UIPackage();\n                                        pkg._resKey = resKey;\n                                        pkg.loadPackage(new fgui.ByteBuffer(asset));\n                                        cnt = pkg._items.length;\n                                        tasks = [];\n                                        for (i = 0; i < cnt; i++) {\n                                            pi = pkg._items[i];\n                                            if (pi.type == fgui.PackageItemType.Atlas || pi.type == fgui.PackageItemType.Sound) {\n                                                tasks.push(RES.getResAsync(pi.file));\n                                            }\n                                        }\n                                        if (!(tasks.length > 0)) return [3, 3];\n                                        return [4, Promise.all(tasks)];\n                                    case 2:\n                                        _a.sent();\n                                        _a.label = 3;\n                                    case 3:\n                                        UIPackage._instById[pkg.id] = pkg;\n                                        UIPackage._instByName[pkg.name] = pkg;\n                                        UIPackage._instById[pkg._resKey] = pkg;\n                                        resolve(pkg);\n                                        return [2];\n                                }\n                            });\n                        }); })];\n                });\n            });\n        };\n        UIPackage.addPackage = function (resKey, descData) {\n            if (!descData) {\n                descData = RES.getRes(resKey);\n                if (!descData)\n                    throw \"Resource '\" + resKey + \"' not found, please check default.res.json!\";\n            }\n            var pkg = new UIPackage();\n            pkg._resKey = resKey;\n            pkg.loadPackage(new fgui.ByteBuffer(descData));\n            UIPackage._instById[pkg.id] = pkg;\n            UIPackage._instByName[pkg.name] = pkg;\n            UIPackage._instById[resKey] = pkg;\n            return pkg;\n        };\n        UIPackage.removePackage = function (packageIdOrName) {\n            var pkg = UIPackage._instById[packageIdOrName];\n            if (!pkg)\n                pkg = UIPackage._instByName[packageIdOrName];\n            if (!pkg)\n                throw new Error(\"unknown package: \" + packageIdOrName);\n            pkg.dispose();\n            delete UIPackage._instById[pkg.id];\n            delete UIPackage._instByName[pkg.name];\n            delete UIPackage._instById[pkg._resKey];\n            if (pkg._customId != null)\n                delete UIPackage._instById[pkg._customId];\n        };\n        UIPackage.createObject = function (pkgName, resName, userClass) {\n            var pkg = UIPackage.getByName(pkgName);\n            if (pkg)\n                return pkg.createObject(resName, userClass);\n            else\n                return null;\n        };\n        UIPackage.createObjectFromURL = function (url, userClass) {\n            var pi = UIPackage.getItemByURL(url);\n            if (pi)\n                return pi.owner.internalCreateObject(pi, userClass);\n            else\n                return null;\n        };\n        UIPackage.getItemURL = function (pkgName, resName) {\n            var pkg = UIPackage.getByName(pkgName);\n            if (!pkg)\n                return null;\n            var pi = pkg._itemsByName[resName];\n            if (!pi)\n                return null;\n            return \"ui://\" + pkg.id + pi.id;\n        };\n        UIPackage.getItemByURL = function (url) {\n            var pos1 = url.indexOf(\"//\");\n            if (pos1 == -1)\n                return null;\n            var pos2 = url.indexOf(\"/\", pos1 + 2);\n            if (pos2 == -1) {\n                if (url.length > 13) {\n                    var pkgId = url.substr(5, 8);\n                    var pkg = UIPackage.getById(pkgId);\n                    if (pkg != null) {\n                        var srcId = url.substr(13);\n                        return pkg.getItemById(srcId);\n                    }\n                }\n            }\n            else {\n                var pkgName = url.substr(pos1 + 2, pos2 - pos1 - 2);\n                pkg = UIPackage.getByName(pkgName);\n                if (pkg != null) {\n                    var srcName = url.substr(pos2 + 1);\n                    return pkg.getItemByName(srcName);\n                }\n            }\n            return null;\n        };\n        UIPackage.normalizeURL = function (url) {\n            if (url == null)\n                return null;\n            var pos1 = url.indexOf(\"//\");\n            if (pos1 == -1)\n                return null;\n            var pos2 = url.indexOf(\"/\", pos1 + 2);\n            if (pos2 == -1)\n                return url;\n            var pkgName = url.substr(pos1 + 2, pos2 - pos1 - 2);\n            var srcName = url.substr(pos2 + 1);\n            return UIPackage.getItemURL(pkgName, srcName);\n        };\n        UIPackage.setStringsSource = function (source) {\n            fgui.TranslationHelper.loadFromXML(source);\n        };\n        UIPackage.prototype.loadPackage = function (buffer) {\n            if (buffer.readUnsignedInt() != 0x46475549)\n                throw \"FairyGUI: old package format found in '\" + this._resKey + \"'\";\n            buffer.version = buffer.readInt();\n            var compressed = buffer.readBool();\n            this._id = buffer.readUTF();\n            this._name = buffer.readUTF();\n            buffer.skip(20);\n            if (compressed) {\n                var buf = new Uint8Array(buffer.buffer, buffer.position, buffer.length - buffer.position);\n                var inflater = new Zlib.RawInflate(buf);\n                var buffer2 = new fgui.ByteBuffer(inflater.decompress());\n                buffer2.version = buffer.version;\n                buffer = buffer2;\n            }\n            var ver2 = buffer.version >= 2;\n            var indexTablePos = buffer.position;\n            var cnt;\n            var i;\n            var nextPos;\n            var str;\n            var branchIncluded;\n            buffer.seek(indexTablePos, 4);\n            cnt = buffer.readInt();\n            var stringTable = new Array(cnt);\n            stringTable.reduceRight;\n            for (i = 0; i < cnt; i++)\n                stringTable[i] = buffer.readUTF();\n            buffer.stringTable = stringTable;\n            buffer.seek(indexTablePos, 0);\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++)\n                this._dependencies.push({ id: buffer.readS(), name: buffer.readS() });\n            if (ver2) {\n                cnt = buffer.readShort();\n                if (cnt > 0) {\n                    this._branches = buffer.readSArray(cnt);\n                    if (UIPackage._branch)\n                        this._branchIndex = this._branches.indexOf(UIPackage._branch);\n                }\n                branchIncluded = cnt > 0;\n            }\n            buffer.seek(indexTablePos, 1);\n            var pi;\n            var path = this._resKey;\n            var pos = path.lastIndexOf('/');\n            var shortPath = pos == -1 ? \"\" : path.substr(0, pos + 1);\n            path = path + \"_\";\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++) {\n                nextPos = buffer.readInt();\n                nextPos += buffer.position;\n                pi = new fgui.PackageItem();\n                pi.owner = this;\n                pi.type = buffer.readByte();\n                pi.id = buffer.readS();\n                pi.name = buffer.readS();\n                buffer.readS();\n                pi.file = buffer.readS();\n                buffer.readBool();\n                pi.width = buffer.readInt();\n                pi.height = buffer.readInt();\n                switch (pi.type) {\n                    case fgui.PackageItemType.Image:\n                        {\n                            pi.objectType = fgui.ObjectType.Image;\n                            var scaleOption = buffer.readByte();\n                            if (scaleOption == 1) {\n                                pi.scale9Grid = new egret.Rectangle();\n                                pi.scale9Grid.x = buffer.readInt();\n                                pi.scale9Grid.y = buffer.readInt();\n                                pi.scale9Grid.width = buffer.readInt();\n                                pi.scale9Grid.height = buffer.readInt();\n                                pi.tileGridIndice = buffer.readInt();\n                            }\n                            else if (scaleOption == 2)\n                                pi.scaleByTile = true;\n                            pi.smoothing = buffer.readBool();\n                            break;\n                        }\n                    case fgui.PackageItemType.MovieClip:\n                        {\n                            pi.smoothing = buffer.readBool();\n                            pi.objectType = fgui.ObjectType.MovieClip;\n                            pi.rawData = buffer.readBuffer();\n                            break;\n                        }\n                    case fgui.PackageItemType.Font:\n                        {\n                            pi.rawData = buffer.readBuffer();\n                            break;\n                        }\n                    case fgui.PackageItemType.Component:\n                        {\n                            var extension = buffer.readByte();\n                            if (extension > 0)\n                                pi.objectType = extension;\n                            else\n                                pi.objectType = fgui.ObjectType.Component;\n                            pi.rawData = buffer.readBuffer();\n                            fgui.UIObjectFactory.resolvePackageItemExtension(pi);\n                            break;\n                        }\n                    case fgui.PackageItemType.Atlas:\n                    case fgui.PackageItemType.Sound:\n                    case fgui.PackageItemType.Misc:\n                        {\n                            var pos_1 = pi.file.lastIndexOf(\".\");\n                            pi.file = path + (pos_1 == -1 ? pi.file : getAssetResKey(pi.file.substring(0, pos_1), pi.file.substring(pos_1 + 1)));\n                            break;\n                        }\n                    case fgui.PackageItemType.Spine:\n                    case fgui.PackageItemType.DragonBones:\n                        {\n                            var pos_2 = pi.file.lastIndexOf(\".\");\n                            pi.file = shortPath + (pos_2 == -1 ? pi.file : pi.file.substring(0, pos_2));\n                            pi.skeletonAnchor = new egret.Point();\n                            pi.skeletonAnchor.x = buffer.readFloat();\n                            pi.skeletonAnchor.y = buffer.readFloat();\n                            break;\n                        }\n                }\n                if (ver2) {\n                    str = buffer.readS();\n                    if (str)\n                        pi.name = str + \"/\" + pi.name;\n                    var branchCnt = buffer.readUnsignedByte();\n                    if (branchCnt > 0) {\n                        if (branchIncluded)\n                            pi.branches = buffer.readSArray(branchCnt);\n                        else\n                            this._itemsById[buffer.readS()] = pi;\n                    }\n                    var highResCnt = buffer.readUnsignedByte();\n                    if (highResCnt > 0)\n                        pi.highResolution = buffer.readSArray(highResCnt);\n                }\n                this._items.push(pi);\n                this._itemsById[pi.id] = pi;\n                if (pi.name != null)\n                    this._itemsByName[pi.name] = pi;\n                buffer.position = nextPos;\n            }\n            buffer.seek(indexTablePos, 2);\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                var itemId = buffer.readS();\n                pi = this._itemsById[buffer.readS()];\n                var sprite = { atlas: pi, rect: new egret.Rectangle(), offset: new egret.Point(), originalSize: new egret.Point() };\n                sprite.rect.x = buffer.readInt();\n                sprite.rect.y = buffer.readInt();\n                sprite.rect.width = buffer.readInt();\n                sprite.rect.height = buffer.readInt();\n                sprite.rotated = buffer.readBool();\n                if (ver2 && buffer.readBool()) {\n                    sprite.offset.x = buffer.readInt();\n                    sprite.offset.y = buffer.readInt();\n                    sprite.originalSize.x = buffer.readInt();\n                    sprite.originalSize.y = buffer.readInt();\n                }\n                else {\n                    sprite.originalSize.x = sprite.rect.width;\n                    sprite.originalSize.y = sprite.rect.height;\n                }\n                this._sprites[itemId] = sprite;\n                buffer.position = nextPos;\n            }\n            if (buffer.seek(indexTablePos, 3)) {\n                cnt = buffer.readShort();\n                for (i = 0; i < cnt; i++) {\n                    nextPos = buffer.readInt();\n                    nextPos += buffer.position;\n                    pi = this._itemsById[buffer.readS()];\n                    if (pi && pi.type == fgui.PackageItemType.Image) {\n                        pi.pixelHitTestData = new fgui.PixelHitTestData();\n                        pi.pixelHitTestData.load(buffer);\n                    }\n                    buffer.position = nextPos;\n                }\n            }\n        };\n        UIPackage.prototype.dispose = function () {\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var pi = this._items[i];\n                if (pi.type == fgui.PackageItemType.Atlas) {\n                    RES.destroyRes(pi.file, false);\n                }\n                else if (pi.type == fgui.PackageItemType.Sound) {\n                }\n            }\n        };\n        Object.defineProperty(UIPackage.prototype, \"id\", {\n            get: function () {\n                return this._id;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(UIPackage.prototype, \"name\", {\n            get: function () {\n                return this._name;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(UIPackage.prototype, \"customId\", {\n            get: function () {\n                return this._customId;\n            },\n            set: function (value) {\n                if (this._customId != null)\n                    delete UIPackage._instById[this._customId];\n                this._customId = value;\n                if (this._customId != null)\n                    UIPackage._instById[this._customId] = this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        UIPackage.prototype.createObject = function (resName, userClass) {\n            var pi = this._itemsByName[resName];\n            if (pi)\n                return this.internalCreateObject(pi, userClass);\n            else\n                return null;\n        };\n        UIPackage.prototype.internalCreateObject = function (item, userClass) {\n            var g = fgui.UIObjectFactory.newObject(item, userClass);\n            if (g == null)\n                return null;\n            UIPackage._constructing++;\n            g.constructFromResource();\n            UIPackage._constructing--;\n            return g;\n        };\n        UIPackage.prototype.getItemById = function (itemId) {\n            return this._itemsById[itemId];\n        };\n        UIPackage.prototype.getItemByName = function (resName) {\n            return this._itemsByName[resName];\n        };\n        UIPackage.prototype.getItemAssetByName = function (resName) {\n            var pi = this._itemsByName[resName];\n            if (pi == null) {\n                throw \"Resource not found -\" + resName;\n            }\n            return this.getItemAsset(pi);\n        };\n        UIPackage.prototype.getItemAsset = function (item) {\n            switch (item.type) {\n                case fgui.PackageItemType.Image:\n                    if (!item.decoded) {\n                        item.decoded = true;\n                        var sprite = this._sprites[item.id];\n                        if (sprite) {\n                            var atlas = this.getItemAsset(sprite.atlas);\n                            item.asset = new egret.Texture();\n                            item.asset.bitmapData = atlas.bitmapData;\n                            item.asset.$initData(atlas.$bitmapX + sprite.rect.x, atlas.$bitmapY + sprite.rect.y, sprite.rect.width, sprite.rect.height, sprite.offset.x, sprite.offset.y, sprite.originalSize.x, sprite.originalSize.y, atlas.$sourceWidth, atlas.$sourceHeight, sprite.rotated);\n                        }\n                    }\n                    return item.asset;\n                case fgui.PackageItemType.Atlas:\n                case fgui.PackageItemType.Sound:\n                    if (!item.decoded) {\n                        item.decoded = true;\n                        item.asset = RES.getRes(item.file);\n                        if (!item.asset)\n                            console.log(\"Resource '\" + item.file + \"' not found, please check default.res.json!\");\n                    }\n                    return item.asset;\n                case fgui.PackageItemType.Font:\n                    if (!item.decoded) {\n                        item.decoded = true;\n                        this.loadFont(item);\n                    }\n                    return item.bitmapFont;\n                case fgui.PackageItemType.MovieClip:\n                    if (!item.decoded) {\n                        item.decoded = true;\n                        this.loadMovieClip(item);\n                    }\n                    return item.frames;\n                case fgui.PackageItemType.Misc:\n                    if (item.file)\n                        return RES.getRes(item.file);\n                    else\n                        return null;\n                default:\n                    return null;\n            }\n        };\n        UIPackage.prototype.getItemAssetAsync = function (item, onComplete) {\n            if (item.decoded) {\n                onComplete(null, item);\n                return;\n            }\n            if (item.loading) {\n                item.loading.push(onComplete);\n                return;\n            }\n            switch (item.type) {\n                case fgui.PackageItemType.DragonBones:\n                    item.loading = [onComplete];\n                    this.loadDragonBones(item);\n                    break;\n                default:\n                    this.getItemAsset(item);\n                    onComplete(null, item);\n                    break;\n            }\n        };\n        UIPackage.prototype.loadMovieClip = function (item) {\n            var buffer = item.rawData;\n            buffer.seek(0, 0);\n            item.interval = buffer.readInt();\n            item.swing = buffer.readBool();\n            item.repeatDelay = buffer.readInt();\n            buffer.seek(0, 1);\n            var frameCount = buffer.readShort();\n            item.frames = Array(frameCount);\n            var spriteId;\n            var sprite;\n            var fx;\n            var fy;\n            for (var i = 0; i < frameCount; i++) {\n                var nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                var frame = {};\n                fx = buffer.readInt();\n                fy = buffer.readInt();\n                buffer.readInt();\n                buffer.readInt();\n                frame.addDelay = buffer.readInt();\n                spriteId = buffer.readS();\n                if (spriteId != null && (sprite = this._sprites[spriteId]) != null) {\n                    var atlas = this.getItemAsset(sprite.atlas);\n                    frame.texture = new egret.Texture();\n                    frame.texture.bitmapData = atlas.bitmapData;\n                    frame.texture.$initData(atlas.$bitmapX + sprite.rect.x, atlas.$bitmapY + sprite.rect.y, sprite.rect.width, sprite.rect.height, fx, fy, item.width, item.height, atlas.$sourceWidth, atlas.$sourceHeight, sprite.rotated);\n                }\n                item.frames[i] = frame;\n                buffer.position = nextPos;\n            }\n        };\n        UIPackage.prototype.loadFont = function (item) {\n            var font = new fgui.BitmapFont();\n            item.bitmapFont = font;\n            var buffer = item.rawData;\n            buffer.seek(0, 0);\n            font.ttf = buffer.readBool();\n            font.tint = buffer.readBool();\n            font.resizable = buffer.readBool();\n            buffer.readBool();\n            font.size = buffer.readInt();\n            var xadvance = buffer.readInt();\n            var lineHeight = buffer.readInt();\n            var mainTexture;\n            var mainSprite = this._sprites[item.id];\n            if (mainSprite)\n                mainTexture = (this.getItemAsset(mainSprite.atlas));\n            buffer.seek(0, 1);\n            var bg;\n            var cnt = buffer.readInt();\n            for (var i = 0; i < cnt; i++) {\n                var nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                bg = {};\n                var ch = buffer.readChar();\n                font.glyphs[ch] = bg;\n                var img = buffer.readS();\n                var bx = buffer.readInt();\n                var by = buffer.readInt();\n                bg.x = buffer.readInt();\n                bg.y = buffer.readInt();\n                bg.width = buffer.readInt();\n                bg.height = buffer.readInt();\n                bg.advance = buffer.readInt();\n                bg.channel = buffer.readByte();\n                if (bg.channel == 1)\n                    bg.channel = 3;\n                else if (bg.channel == 2)\n                    bg.channel = 2;\n                else if (bg.channel == 3)\n                    bg.channel = 1;\n                if (font.ttf) {\n                    bg.texture = new egret.Texture();\n                    bg.texture.bitmapData = mainTexture.bitmapData;\n                    bg.texture.$initData(mainTexture.$bitmapX + bx + mainSprite.rect.x, mainTexture.$bitmapY + by + mainSprite.rect.y, bg.width, bg.height, mainSprite.offset.x, mainSprite.offset.y, mainSprite.originalSize.x, mainSprite.originalSize.y, mainTexture.$sourceWidth, mainTexture.$sourceHeight, mainSprite.rotated);\n                    bg.lineHeight = lineHeight;\n                }\n                else {\n                    var charImg = this._itemsById[img];\n                    if (charImg) {\n                        this.getItemAsset(charImg);\n                        bg.width = charImg.width;\n                        bg.height = charImg.height;\n                        bg.texture = charImg.asset;\n                    }\n                    if (bg.advance == 0) {\n                        if (xadvance == 0)\n                            bg.advance = bg.x + bg.width;\n                        else\n                            bg.advance = xadvance;\n                    }\n                    bg.lineHeight = bg.y < 0 ? bg.height : (bg.y + bg.height);\n                    if (bg.lineHeight < font.size)\n                        bg.lineHeight = font.size;\n                }\n                buffer.position = nextPos;\n            }\n        };\n        UIPackage.prototype.loadDragonBones = function (item) {\n            var jsonFile = getAssetResKey(item.file, [\"json\", \"dbbin\"]);\n            var str = item.file.replace(\"_ske\", \"_tex\");\n            var atlasFile = getAssetResKey(str, \"json\");\n            var texFile = getAssetResKey(str, \"png\");\n            var task1 = RES.getResAsync(jsonFile);\n            var task2 = RES.getResAsync(atlasFile);\n            var task3 = RES.getResAsync(texFile);\n            Promise.all([task1, task2, task3]).then(function (values) {\n                var egretFactory = dragonBones.EgretFactory.factory;\n                var asset = {\n                    data: egretFactory.parseDragonBonesData(values[0]),\n                    atlasData: egretFactory.parseTextureAtlasData(values[1], values[2])\n                };\n                item.asset = asset;\n                item.armatureName = asset.data.armatureNames[0];\n                var arr = item.loading;\n                delete item.loading;\n                arr.forEach(function (e) { return e(null, item); });\n            }).catch(function (reason) {\n                var arr = item.loading;\n                delete item.loading;\n                arr.forEach(function (e) { return e(reason, item); });\n            });\n        };\n        UIPackage._constructing = 0;\n        UIPackage._instById = {};\n        UIPackage._instByName = {};\n        UIPackage._branch = \"\";\n        UIPackage._vars = {};\n        return UIPackage;\n    }());\n    fgui.UIPackage = UIPackage;\n    function getAssetResKey(file, types) {\n        if (Array.isArray(types)) {\n            for (var i = 0; i < types.length; i++) {\n                var key = file + \"_\" + types[i];\n                if (RES.hasRes(key))\n                    return key;\n            }\n            return file;\n        }\n        else {\n            var key = file + \"_\" + types;\n            if (RES.hasRes(key))\n                return key;\n            return file;\n        }\n    }\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var Window = (function (_super_1) {\n        __extends(Window, _super_1);\n        function Window() {\n            var _this = _super_1.call(this) || this;\n            _this._requestingCmd = 0;\n            _this._uiSources = new Array();\n            _this.bringToFontOnClick = fgui.UIConfig.bringWindowToFrontOnClick;\n            _this.displayObject.addEventListener(egret.Event.ADDED_TO_STAGE, _this.__onShown, _this);\n            _this.displayObject.addEventListener(egret.Event.REMOVED_FROM_STAGE, _this.__onHidden, _this);\n            _this.displayObject.addEventListener(egret.TouchEvent.TOUCH_BEGIN, _this.__mouseDown, _this, true);\n            return _this;\n        }\n        Window.prototype.addUISource = function (source) {\n            this._uiSources.push(source);\n        };\n        Object.defineProperty(Window.prototype, \"contentPane\", {\n            get: function () {\n                return this._contentPane;\n            },\n            set: function (val) {\n                if (this._contentPane != val) {\n                    if (this._contentPane)\n                        this.removeChild(this._contentPane);\n                    this._contentPane = val;\n                    if (this._contentPane) {\n                        this.addChild(this._contentPane);\n                        this.setSize(this._contentPane.width, this._contentPane.height);\n                        this._contentPane.addRelation(this, fgui.RelationType.Size);\n                        this._frame = (this._contentPane.getChild(\"frame\"));\n                        if (this._frame) {\n                            this.closeButton = this._frame.getChild(\"closeButton\");\n                            this.dragArea = this._frame.getChild(\"dragArea\");\n                            this.contentArea = this._frame.getChild(\"contentArea\");\n                        }\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Window.prototype, \"frame\", {\n            get: function () {\n                return this._frame;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Window.prototype, \"closeButton\", {\n            get: function () {\n                return this._closeButton;\n            },\n            set: function (value) {\n                if (this._closeButton)\n                    this._closeButton.removeClickListener(this.closeEventHandler, this);\n                this._closeButton = value;\n                if (this._closeButton)\n                    this._closeButton.addClickListener(this.closeEventHandler, this);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Window.prototype, \"dragArea\", {\n            get: function () {\n                return this._dragArea;\n            },\n            set: function (value) {\n                if (this._dragArea != value) {\n                    if (this._dragArea) {\n                        this._dragArea.draggable = false;\n                        this._dragArea.removeEventListener(fgui.DragEvent.DRAG_START, this.__dragStart, this);\n                    }\n                    this._dragArea = value;\n                    if (this._dragArea) {\n                        if ((this._dragArea instanceof fgui.GGraph) && this._dragArea.displayObject == null)\n                            this._dragArea.asGraph.drawRect(0, 0, 0, 0, 0);\n                        this._dragArea.draggable = true;\n                        this._dragArea.addEventListener(fgui.DragEvent.DRAG_START, this.__dragStart, this);\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Window.prototype, \"contentArea\", {\n            get: function () {\n                return this._contentArea;\n            },\n            set: function (value) {\n                this._contentArea = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Window.prototype.show = function () {\n            fgui.GRoot.inst.showWindow(this);\n        };\n        Window.prototype.showOn = function (root) {\n            root.showWindow(this);\n        };\n        Window.prototype.hide = function () {\n            if (this.isShowing)\n                this.doHideAnimation();\n        };\n        Window.prototype.hideImmediately = function () {\n            var r = (this.parent instanceof fgui.GRoot) ? this.parent : null;\n            if (!r)\n                r = fgui.GRoot.inst;\n            r.hideWindowImmediately(this);\n        };\n        Window.prototype.centerOn = function (r, restraint) {\n            this.setXY(Math.round((r.width - this.width) / 2), Math.round((r.height - this.height) / 2));\n            if (restraint) {\n                this.addRelation(r, fgui.RelationType.Center_Center);\n                this.addRelation(r, fgui.RelationType.Middle_Middle);\n            }\n        };\n        Window.prototype.toggleStatus = function () {\n            if (this.isTop)\n                this.hide();\n            else\n                this.show();\n        };\n        Object.defineProperty(Window.prototype, \"isShowing\", {\n            get: function () {\n                return this.parent != null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Window.prototype, \"isTop\", {\n            get: function () {\n                return this.parent != null && this.parent.getChildIndex(this) == this.parent.numChildren - 1;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Window.prototype, \"modal\", {\n            get: function () {\n                return this._modal;\n            },\n            set: function (val) {\n                this._modal = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Window.prototype.bringToFront = function () {\n            this.root.bringToFront(this);\n        };\n        Window.prototype.showModalWait = function (requestingCmd) {\n            if (requestingCmd != undefined)\n                this._requestingCmd = requestingCmd;\n            if (fgui.UIConfig.windowModalWaiting) {\n                if (!this._modalWaitPane)\n                    this._modalWaitPane = fgui.UIPackage.createObjectFromURL(fgui.UIConfig.windowModalWaiting);\n                this.layoutModalWaitPane();\n                this.addChild(this._modalWaitPane);\n            }\n        };\n        Window.prototype.layoutModalWaitPane = function () {\n            if (this._contentArea) {\n                var pt = this._frame.localToGlobal();\n                pt = this.globalToLocal(pt.x, pt.y, pt);\n                this._modalWaitPane.setXY(pt.x + this._contentArea.x, pt.y + this._contentArea.y);\n                this._modalWaitPane.setSize(this._contentArea.width, this._contentArea.height);\n            }\n            else\n                this._modalWaitPane.setSize(this.width, this.height);\n        };\n        Window.prototype.closeModalWait = function (requestingCmd) {\n            if (requestingCmd != null && requestingCmd != 0) {\n                if (this._requestingCmd != requestingCmd)\n                    return false;\n            }\n            this._requestingCmd = 0;\n            if (this._modalWaitPane && this._modalWaitPane.parent != null)\n                this.removeChild(this._modalWaitPane);\n            return true;\n        };\n        Object.defineProperty(Window.prototype, \"modalWaiting\", {\n            get: function () {\n                return this._modalWaitPane && this._modalWaitPane.parent != null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Window.prototype.init = function () {\n            if (this._inited || this._loading)\n                return;\n            if (this._uiSources.length > 0) {\n                this._loading = false;\n                var cnt = this._uiSources.length;\n                for (var i = 0; i < cnt; i++) {\n                    var lib = this._uiSources[i];\n                    if (!lib.loaded) {\n                        lib.load(this.__uiLoadComplete, this);\n                        this._loading = true;\n                    }\n                }\n                if (!this._loading)\n                    this._init();\n            }\n            else\n                this._init();\n        };\n        Window.prototype.onInit = function () {\n        };\n        Window.prototype.onShown = function () {\n        };\n        Window.prototype.onHide = function () {\n        };\n        Window.prototype.doShowAnimation = function () {\n            this.onShown();\n        };\n        Window.prototype.doHideAnimation = function () {\n            this.hideImmediately();\n        };\n        Window.prototype.__uiLoadComplete = function () {\n            var cnt = this._uiSources.length;\n            for (var i = 0; i < cnt; i++) {\n                var lib = this._uiSources[i];\n                if (!lib.loaded)\n                    return;\n            }\n            this._loading = false;\n            this._init();\n        };\n        Window.prototype._init = function () {\n            this._inited = true;\n            this.onInit();\n            if (this.isShowing)\n                this.doShowAnimation();\n        };\n        Window.prototype.dispose = function () {\n            this.displayObject.removeEventListener(egret.Event.ADDED_TO_STAGE, this.__onShown, this);\n            this.displayObject.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.__onHidden, this);\n            if (this.parent)\n                this.hideImmediately();\n            _super_1.prototype.dispose.call(this);\n        };\n        Window.prototype.closeEventHandler = function (evt) {\n            this.hide();\n        };\n        Window.prototype.__onShown = function (evt) {\n            if (!this._inited)\n                this.init();\n            else\n                this.doShowAnimation();\n        };\n        Window.prototype.__onHidden = function (evt) {\n            this.closeModalWait();\n            this.onHide();\n        };\n        Window.prototype.__mouseDown = function (evt) {\n            if (this.isShowing && this.bringToFontOnClick)\n                this.bringToFront();\n        };\n        Window.prototype.__dragStart = function (evt) {\n            evt.preventDefault();\n            this.startDrag(evt.touchPointID, evt.stageX, evt.stageY);\n        };\n        return Window;\n    }(fgui.GComponent));\n    fgui.Window = Window;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ControllerAction = (function () {\n        function ControllerAction() {\n        }\n        ControllerAction.createAction = function (type) {\n            switch (type) {\n                case 0:\n                    return new fgui.PlayTransitionAction();\n                case 1:\n                    return new fgui.ChangePageAction();\n            }\n            return null;\n        };\n        ControllerAction.prototype.run = function (controller, prevPage, curPage) {\n            if ((this.fromPage == null || this.fromPage.length == 0 || this.fromPage.indexOf(prevPage) != -1)\n                && (this.toPage == null || this.toPage.length == 0 || this.toPage.indexOf(curPage) != -1))\n                this.enter(controller);\n            else\n                this.leave(controller);\n        };\n        ControllerAction.prototype.enter = function (controller) {\n        };\n        ControllerAction.prototype.leave = function (controller) {\n        };\n        ControllerAction.prototype.setup = function (buffer) {\n            var cnt;\n            var i;\n            cnt = buffer.readShort();\n            this.fromPage = [];\n            for (i = 0; i < cnt; i++)\n                this.fromPage[i] = buffer.readS();\n            cnt = buffer.readShort();\n            this.toPage = [];\n            for (i = 0; i < cnt; i++)\n                this.toPage[i] = buffer.readS();\n        };\n        return ControllerAction;\n    }());\n    fgui.ControllerAction = ControllerAction;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ChangePageAction = (function (_super_1) {\n        __extends(ChangePageAction, _super_1);\n        function ChangePageAction() {\n            return _super_1.call(this) || this;\n        }\n        ChangePageAction.prototype.enter = function (controller) {\n            if (!this.controllerName)\n                return;\n            var gcom;\n            if (this.objectId) {\n                var obj = controller.parent.getChildById(this.objectId);\n                if (obj instanceof fgui.GComponent)\n                    gcom = obj;\n                else\n                    return;\n            }\n            else\n                gcom = controller.parent;\n            if (gcom) {\n                var cc = gcom.getController(this.controllerName);\n                if (cc && cc != controller && !cc.changing) {\n                    if (this.targetPage == \"~1\") {\n                        if (controller.selectedIndex < cc.pageCount)\n                            cc.selectedIndex = controller.selectedIndex;\n                    }\n                    else if (this.targetPage == \"~2\")\n                        cc.selectedPage = controller.selectedPage;\n                    else\n                        cc.selectedPageId = this.targetPage;\n                }\n            }\n        };\n        ChangePageAction.prototype.setup = function (buffer) {\n            _super_1.prototype.setup.call(this, buffer);\n            this.objectId = buffer.readS();\n            this.controllerName = buffer.readS();\n            this.targetPage = buffer.readS();\n        };\n        return ChangePageAction;\n    }(fgui.ControllerAction));\n    fgui.ChangePageAction = ChangePageAction;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var PlayTransitionAction = (function (_super_1) {\n        __extends(PlayTransitionAction, _super_1);\n        function PlayTransitionAction() {\n            var _this = _super_1.call(this) || this;\n            _this.playTimes = 1;\n            _this.delay = 0;\n            _this.stopOnExit = false;\n            return _this;\n        }\n        PlayTransitionAction.prototype.enter = function (controller) {\n            var trans = controller.parent.getTransition(this.transitionName);\n            if (trans) {\n                if (this._currentTransition && this._currentTransition.playing)\n                    trans.changePlayTimes(this.playTimes);\n                else\n                    trans.play(null, null, null, this.playTimes, this.delay);\n                this._currentTransition = trans;\n            }\n        };\n        PlayTransitionAction.prototype.leave = function (controller) {\n            if (this.stopOnExit && this._currentTransition) {\n                this._currentTransition.stop();\n                this._currentTransition = null;\n            }\n        };\n        PlayTransitionAction.prototype.setup = function (buffer) {\n            _super_1.prototype.setup.call(this, buffer);\n            this.transitionName = buffer.readS();\n            this.playTimes = buffer.readInt();\n            this.delay = buffer.readFloat();\n            this.stopOnExit = buffer.readBool();\n        };\n        return PlayTransitionAction;\n    }(fgui.ControllerAction));\n    fgui.PlayTransitionAction = PlayTransitionAction;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var BitmapFont = (function () {\n        function BitmapFont() {\n            this.size = 0;\n            this.glyphs = {};\n        }\n        return BitmapFont;\n    }());\n    fgui.BitmapFont = BitmapFont;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    function fillImage(w, h, method, origin, clockwise, amount) {\n        if (amount <= 0)\n            return null;\n        else if (amount >= 0.9999)\n            return [0, 0, w, 0, w, h, 0, h];\n        var points;\n        switch (method) {\n            case fgui.FillMethod.Horizontal:\n                points = fillHorizontal(w, h, origin, amount);\n                break;\n            case fgui.FillMethod.Vertical:\n                points = fillVertical(w, h, origin, amount);\n                break;\n            case fgui.FillMethod.Radial90:\n                points = fillRadial90(w, h, origin, clockwise, amount);\n                break;\n            case fgui.FillMethod.Radial180:\n                points = fillRadial180(w, h, origin, clockwise, amount);\n                break;\n            case fgui.FillMethod.Radial360:\n                points = fillRadial360(w, h, origin, clockwise, amount);\n                break;\n        }\n        return points;\n    }\n    fgui.fillImage = fillImage;\n    function fillHorizontal(w, h, origin, amount) {\n        var w2 = w * amount;\n        if (origin == fgui.FillOrigin.Left || origin == fgui.FillOrigin.Top)\n            return [0, 0, w2, 0, w2, h, 0, h];\n        else\n            return [w, 0, w, h, w - w2, h, w - w2, 0];\n    }\n    function fillVertical(w, h, origin, amount) {\n        var h2 = h * amount;\n        if (origin == fgui.FillOrigin.Left || origin == fgui.FillOrigin.Top)\n            return [0, 0, 0, h2, w, h2, w, 0];\n        else\n            return [0, h, w, h, w, h - h2, 0, h - h2];\n    }\n    function fillRadial90(w, h, origin, clockwise, amount) {\n        if (clockwise && (origin == fgui.FillOrigin.TopRight || origin == fgui.FillOrigin.BottomLeft)\n            || !clockwise && (origin == fgui.FillOrigin.TopLeft || origin == fgui.FillOrigin.BottomRight)) {\n            amount = 1 - amount;\n        }\n        var v, v2, h2;\n        v = Math.tan(Math.PI / 2 * amount);\n        h2 = w * v;\n        v2 = (h2 - h) / h2;\n        var points;\n        switch (origin) {\n            case fgui.FillOrigin.TopLeft:\n                if (clockwise) {\n                    if (h2 <= h)\n                        points = [0, 0, w, h2, w, 0];\n                    else\n                        points = [0, 0, w * (1 - v2), h, w, h, w, 0];\n                }\n                else {\n                    if (h2 <= h)\n                        points = [0, 0, w, h2, w, h, 0, h];\n                    else\n                        points = [0, 0, w * (1 - v2), h, 0, h];\n                }\n                break;\n            case fgui.FillOrigin.TopRight:\n                if (clockwise) {\n                    if (h2 <= h)\n                        points = [w, 0, 0, h2, 0, h, w, h];\n                    else\n                        points = [w, 0, w * v2, h, w, h];\n                }\n                else {\n                    if (h2 <= h)\n                        points = [w, 0, 0, h2, 0, 0];\n                    else\n                        points = [w, 0, w * v2, h, 0, h, 0, 0];\n                }\n                break;\n            case fgui.FillOrigin.BottomLeft:\n                if (clockwise) {\n                    if (h2 <= h)\n                        points = [0, h, w, h - h2, w, 0, 0, 0];\n                    else\n                        points = [0, h, w * (1 - v2), 0, 0, 0];\n                }\n                else {\n                    if (h2 <= h)\n                        points = [0, h, w, h - h2, w, h];\n                    else\n                        points = [0, h, w * (1 - v2), 0, w, 0, w, h];\n                }\n                break;\n            case fgui.FillOrigin.BottomRight:\n                if (clockwise) {\n                    if (h2 <= h)\n                        points = [w, h, 0, h - h2, 0, h];\n                    else\n                        points = [w, h, w * v2, 0, 0, 0, 0, h];\n                }\n                else {\n                    if (h2 <= h)\n                        points = [w, h, 0, h - h2, 0, 0, w, 0];\n                    else\n                        points = [w, h, w * v2, 0, w, 0];\n                }\n                break;\n        }\n        return points;\n    }\n    function movePoints(points, offsetX, offsetY) {\n        var cnt = points.length;\n        for (var i = 0; i < cnt; i += 2) {\n            points[i] += offsetX;\n            points[i + 1] += offsetY;\n        }\n    }\n    function fillRadial180(w, h, origin, clockwise, amount) {\n        var points;\n        switch (origin) {\n            case fgui.FillOrigin.Top:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial90(w / 2, h, clockwise ? fgui.FillOrigin.TopLeft : fgui.FillOrigin.TopRight, clockwise, amount);\n                    if (clockwise)\n                        movePoints(points, w / 2, 0);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial90(w / 2, h, clockwise ? fgui.FillOrigin.TopRight : fgui.FillOrigin.TopLeft, clockwise, amount);\n                    if (clockwise)\n                        points.push(w, h, w, 0);\n                    else {\n                        movePoints(points, w / 2, 0);\n                        points.push(0, h, 0, 0);\n                    }\n                }\n                break;\n            case fgui.FillOrigin.Bottom:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial90(w / 2, h, clockwise ? fgui.FillOrigin.BottomRight : fgui.FillOrigin.BottomLeft, clockwise, amount);\n                    if (!clockwise)\n                        movePoints(points, w / 2, 0);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial90(w / 2, h, clockwise ? fgui.FillOrigin.BottomLeft : fgui.FillOrigin.BottomRight, clockwise, amount);\n                    if (clockwise) {\n                        movePoints(points, w / 2, 0);\n                        points.push(0, 0, 0, h);\n                    }\n                    else\n                        points.push(w, 0, w, h);\n                }\n                break;\n            case fgui.FillOrigin.Left:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial90(w, h / 2, clockwise ? fgui.FillOrigin.BottomLeft : fgui.FillOrigin.TopLeft, clockwise, amount);\n                    if (!clockwise)\n                        movePoints(points, 0, h / 2);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial90(w, h / 2, clockwise ? fgui.FillOrigin.TopLeft : fgui.FillOrigin.BottomLeft, clockwise, amount);\n                    if (clockwise) {\n                        movePoints(points, 0, h / 2);\n                        points.push(w, 0, 0, 0);\n                    }\n                    else\n                        points.push(w, h, 0, h);\n                }\n                break;\n            case fgui.FillOrigin.Right:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial90(w, h / 2, clockwise ? fgui.FillOrigin.TopRight : fgui.FillOrigin.BottomRight, clockwise, amount);\n                    if (clockwise)\n                        movePoints(points, 0, h / 2);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial90(w, h / 2, clockwise ? fgui.FillOrigin.BottomRight : fgui.FillOrigin.TopRight, clockwise, amount);\n                    if (clockwise)\n                        points.push(0, h, w, h);\n                    else {\n                        movePoints(points, 0, h / 2);\n                        points.push(0, 0, w, 0);\n                    }\n                }\n                break;\n        }\n        return points;\n    }\n    function fillRadial360(w, h, origin, clockwise, amount) {\n        var points;\n        switch (origin) {\n            case fgui.FillOrigin.Top:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial180(w / 2, h, clockwise ? fgui.FillOrigin.Left : fgui.FillOrigin.Right, clockwise, amount);\n                    if (clockwise)\n                        movePoints(points, w / 2, 0);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial180(w / 2, h, clockwise ? fgui.FillOrigin.Right : fgui.FillOrigin.Left, clockwise, amount);\n                    if (clockwise)\n                        points.push(w, h, w, 0, w / 2, 0);\n                    else {\n                        movePoints(points, w / 2, 0);\n                        points.push(0, h, 0, 0, w / 2, 0);\n                    }\n                }\n                break;\n            case fgui.FillOrigin.Bottom:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial180(w / 2, h, clockwise ? fgui.FillOrigin.Right : fgui.FillOrigin.Left, clockwise, amount);\n                    if (!clockwise)\n                        movePoints(points, w / 2, 0);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial180(w / 2, h, clockwise ? fgui.FillOrigin.Left : fgui.FillOrigin.Right, clockwise, amount);\n                    if (clockwise) {\n                        movePoints(points, w / 2, 0);\n                        points.push(0, 0, 0, h, w / 2, h);\n                    }\n                    else\n                        points.push(w, 0, w, h, w / 2, h);\n                }\n                break;\n            case fgui.FillOrigin.Left:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial180(w, h / 2, clockwise ? fgui.FillOrigin.Bottom : fgui.FillOrigin.Top, clockwise, amount);\n                    if (!clockwise)\n                        movePoints(points, 0, h / 2);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial180(w, h / 2, clockwise ? fgui.FillOrigin.Top : fgui.FillOrigin.Bottom, clockwise, amount);\n                    if (clockwise) {\n                        movePoints(points, 0, h / 2);\n                        points.push(w, 0, 0, 0, 0, h / 2);\n                    }\n                    else\n                        points.push(w, h, 0, h, 0, h / 2);\n                }\n                break;\n            case fgui.FillOrigin.Right:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial180(w, h / 2, clockwise ? fgui.FillOrigin.Top : fgui.FillOrigin.Bottom, clockwise, amount);\n                    if (clockwise)\n                        movePoints(points, 0, h / 2);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial180(w, h / 2, clockwise ? fgui.FillOrigin.Bottom : fgui.FillOrigin.Top, clockwise, amount);\n                    if (clockwise)\n                        points.push(0, h, w, h, w, h / 2);\n                    else {\n                        movePoints(points, 0, h / 2);\n                        points.push(0, 0, w, 0, w, h / 2);\n                    }\n                }\n                break;\n        }\n        return points;\n    }\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var Image = (function (_super_1) {\n        __extends(Image, _super_1);\n        function Image() {\n            var _this = _super_1.call(this) || this;\n            _this._fillMethod = 0;\n            _this._fillOrigin = 0;\n            _this._fillAmount = 0;\n            _this._color = 0xFFFFFF;\n            return _this;\n        }\n        Object.defineProperty(Image.prototype, \"color\", {\n            get: function () {\n                return this._color;\n            },\n            set: function (value) {\n                if (this._color != value) {\n                    this._color = value;\n                    if (this.tint == undefined)\n                        fgui.ToolSet.setColorFilter(this, value);\n                    else\n                        this.tint = value;\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Image.prototype.$setX = function (value) {\n            if (this.mask)\n                this.mask.x = value;\n            return _super_1.prototype.$setX.call(this, value);\n        };\n        Image.prototype.$setY = function (value) {\n            if (this.mask)\n                this.mask.y = value;\n            return _super_1.prototype.$setY.call(this, value);\n        };\n        Object.defineProperty(Image.prototype, \"fillMethod\", {\n            get: function () {\n                return this._fillMethod;\n            },\n            set: function (value) {\n                if (this._fillMethod != value) {\n                    this._fillMethod = value;\n                    if (this._fillMethod != 0) {\n                        if (!this._mask) {\n                            this._mask = new egret.Shape();\n                            this._mask.touchEnabled = false;\n                        }\n                        this.mask = this._mask;\n                        this._mask.x = this.x;\n                        this._mask.y = this.y;\n                        this.addEventListener(egret.Event.RESIZE, this.markChanged, this);\n                        this.markChanged();\n                    }\n                    else if (this.mask) {\n                        this._mask.graphics.clear();\n                        this.mask = null;\n                        this.removeEventListener(egret.Event.RESIZE, this.markChanged, this);\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Image.prototype, \"fillOrigin\", {\n            get: function () {\n                return this._fillOrigin;\n            },\n            set: function (value) {\n                if (this._fillOrigin != value) {\n                    this._fillOrigin = value;\n                    if (this._fillMethod != 0)\n                        this.markChanged();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Image.prototype, \"fillClockwise\", {\n            get: function () {\n                return this._fillClockwise;\n            },\n            set: function (value) {\n                if (this._fillClockwise != value) {\n                    this._fillClockwise = value;\n                    if (this._fillMethod != 0)\n                        this.markChanged();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Image.prototype, \"fillAmount\", {\n            get: function () {\n                return this._fillAmount;\n            },\n            set: function (value) {\n                if (this._fillAmount != value) {\n                    this._fillAmount = value;\n                    if (this._fillMethod != 0)\n                        this.markChanged();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Image.prototype.markChanged = function () {\n            if (!this._maskDirtyFlag) {\n                this._maskDirtyFlag = true;\n                fgui.GTimers.inst.callLater(this.doFill, this);\n            }\n        };\n        Image.prototype.doFill = function () {\n            this._maskDirtyFlag = false;\n            if (!this._mask.parent && this.parent)\n                this.parent.addChild(this._mask);\n            var w = this.width;\n            var h = this.height;\n            var g = this._mask.graphics;\n            g.clear();\n            if (w == 0 || h == 0)\n                return;\n            var points = fgui.fillImage(w, h, this._fillMethod, this._fillOrigin, this._fillClockwise, this._fillAmount);\n            if (!points)\n                return;\n            g.beginFill(0, 1);\n            fgui.ToolSet.fillPath(g, points, 0, 0);\n            g.endFill();\n        };\n        return Image;\n    }(egret.Bitmap));\n    fgui.Image = Image;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var MovieClip = (function (_super_1) {\n        __extends(MovieClip, _super_1);\n        function MovieClip() {\n            var _this = _super_1.call(this) || this;\n            _this.interval = 0;\n            _this.repeatDelay = 0;\n            _this.timeScale = 1;\n            _this._playing = true;\n            _this._frameCount = 0;\n            _this._frame = 0;\n            _this._start = 0;\n            _this._end = 0;\n            _this._times = 0;\n            _this._endAt = 0;\n            _this._status = 0;\n            _this._frameElapsed = 0;\n            _this._reversed = false;\n            _this._repeatedCount = 0;\n            _this.touchEnabled = false;\n            _this.setPlaySettings();\n            return _this;\n        }\n        Object.defineProperty(MovieClip.prototype, \"frames\", {\n            get: function () {\n                return this._frames;\n            },\n            set: function (value) {\n                this._frames = value;\n                this.scale9Grid = null;\n                this.fillMode = egret.BitmapFillMode.SCALE;\n                if (this._frames)\n                    this._frameCount = this._frames.length;\n                else\n                    this._frameCount = 0;\n                if (this._end == -1 || this._end > this._frameCount - 1)\n                    this._end = this._frameCount - 1;\n                if (this._endAt == -1 || this._endAt > this._frameCount - 1)\n                    this._endAt = this._frameCount - 1;\n                if (this._frame < 0 || this._frame > this._frameCount - 1)\n                    this._frame = this._frameCount - 1;\n                this.drawFrame();\n                this._frameElapsed = 0;\n                this._repeatedCount = 0;\n                this._reversed = false;\n                this.checkTimer();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClip.prototype, \"frameCount\", {\n            get: function () {\n                return this._frameCount;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClip.prototype, \"frame\", {\n            get: function () {\n                return this._frame;\n            },\n            set: function (value) {\n                if (this._frame != value) {\n                    if (this._frames && value >= this._frameCount)\n                        value = this._frameCount - 1;\n                    this._frame = value;\n                    this._frameElapsed = 0;\n                    this.drawFrame();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClip.prototype, \"playing\", {\n            get: function () {\n                return this._playing;\n            },\n            set: function (value) {\n                if (this._playing != value) {\n                    this._playing = value;\n                    this.checkTimer();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClip.prototype, \"smoothing\", {\n            get: function () {\n                return this._smoothing;\n            },\n            set: function (value) {\n                this._smoothing = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        MovieClip.prototype.rewind = function () {\n            this._frame = 0;\n            this._frameElapsed = 0;\n            this._reversed = false;\n            this._repeatedCount = 0;\n            this.drawFrame();\n        };\n        MovieClip.prototype.syncStatus = function (anotherMc) {\n            this._frame = anotherMc._frame;\n            this._frameElapsed = anotherMc._frameElapsed;\n            this._reversed = anotherMc._reversed;\n            this._repeatedCount = anotherMc._repeatedCount;\n            this.drawFrame();\n        };\n        MovieClip.prototype.advance = function (timeInMiniseconds) {\n            var beginFrame = this._frame;\n            var beginReversed = this._reversed;\n            var backupTime = timeInMiniseconds;\n            while (true) {\n                var tt = this.interval + this._frames[this._frame].addDelay;\n                if (this._frame == 0 && this._repeatedCount > 0)\n                    tt += this.repeatDelay;\n                if (timeInMiniseconds < tt) {\n                    this._frameElapsed = 0;\n                    break;\n                }\n                timeInMiniseconds -= tt;\n                if (this.swing) {\n                    if (this._reversed) {\n                        this._frame--;\n                        if (this._frame <= 0) {\n                            this._frame = 0;\n                            this._repeatedCount++;\n                            this._reversed = !this._reversed;\n                        }\n                    }\n                    else {\n                        this._frame++;\n                        if (this._frame > this._frameCount - 1) {\n                            this._frame = Math.max(0, this._frameCount - 2);\n                            this._repeatedCount++;\n                            this._reversed = !this._reversed;\n                        }\n                    }\n                }\n                else {\n                    this._frame++;\n                    if (this._frame > this._frameCount - 1) {\n                        this._frame = 0;\n                        this._repeatedCount++;\n                    }\n                }\n                if (this._frame == beginFrame && this._reversed == beginReversed) {\n                    var roundTime = backupTime - timeInMiniseconds;\n                    timeInMiniseconds -= Math.floor(timeInMiniseconds / roundTime) * roundTime;\n                }\n            }\n            this.drawFrame();\n        };\n        MovieClip.prototype.setPlaySettings = function (start, end, times, endAt, endCallback, callbackObj) {\n            if (start == undefined)\n                start = 0;\n            if (end == undefined)\n                end = -1;\n            if (times == undefined)\n                times = 0;\n            if (endAt == undefined)\n                endAt = -1;\n            this._start = start;\n            this._end = end;\n            if (this._end == -1 || this._end > this._frameCount - 1)\n                this._end = this._frameCount - 1;\n            this._times = times;\n            this._endAt = endAt;\n            if (this._endAt == -1)\n                this._endAt = this._end;\n            this._status = 0;\n            this._callback = endCallback;\n            this._callbackObj = callbackObj;\n            this.frame = start;\n        };\n        MovieClip.prototype.update = function () {\n            if (!this._playing || this._frameCount == 0 || this._status == 3)\n                return;\n            var dt = fgui.GTimers.deltaTime;\n            if (this.timeScale != 1)\n                dt *= this.timeScale;\n            this._frameElapsed += dt;\n            var tt = this.interval + this._frames[this._frame].addDelay;\n            if (this._frame == 0 && this._repeatedCount > 0)\n                tt += this.repeatDelay;\n            if (this._frameElapsed < tt)\n                return;\n            this._frameElapsed -= tt;\n            if (this._frameElapsed > this.interval)\n                this._frameElapsed = this.interval;\n            if (this.swing) {\n                if (this._reversed) {\n                    this._frame--;\n                    if (this._frame <= 0) {\n                        this._frame = 0;\n                        this._repeatedCount++;\n                        this._reversed = !this._reversed;\n                    }\n                }\n                else {\n                    this._frame++;\n                    if (this._frame > this._frameCount - 1) {\n                        this._frame = Math.max(0, this._frameCount - 2);\n                        this._repeatedCount++;\n                        this._reversed = !this._reversed;\n                    }\n                }\n            }\n            else {\n                this._frame++;\n                if (this._frame > this._frameCount - 1) {\n                    this._frame = 0;\n                    this._repeatedCount++;\n                }\n            }\n            if (this._status == 1) {\n                this._frame = this._start;\n                this._frameElapsed = 0;\n                this._status = 0;\n            }\n            else if (this._status == 2) {\n                this._frame = this._endAt;\n                this._frameElapsed = 0;\n                this._status = 3;\n                if (this._callback != null) {\n                    var callback = this._callback;\n                    var caller = this._callbackObj;\n                    this._callback = null;\n                    this._callbackObj = null;\n                    callback.call(caller);\n                }\n            }\n            else {\n                if (this._frame == this._end) {\n                    if (this._times > 0) {\n                        this._times--;\n                        if (this._times == 0)\n                            this._status = 2;\n                        else\n                            this._status = 1;\n                    }\n                    else if (this._start != 0)\n                        this._status = 1;\n                }\n            }\n            this.drawFrame();\n        };\n        MovieClip.prototype.drawFrame = function () {\n            if (this._frameCount > 0 && this._frame < this._frames.length) {\n                var frame = this._frames[this._frame];\n                this.texture = frame.texture;\n            }\n            else\n                this.texture = null;\n        };\n        MovieClip.prototype.checkTimer = function () {\n            if (this._playing && this._frameCount > 0 && this.stage != null)\n                fgui.GTimers.inst.add(1, 0, this.update, this);\n            else\n                fgui.GTimers.inst.remove(this.update, this);\n        };\n        MovieClip.prototype.$onAddToStage = function (stage, nestLevel) {\n            _super_1.prototype.$onAddToStage.call(this, stage, nestLevel);\n            if (this._playing && this._frameCount > 0)\n                fgui.GTimers.inst.add(1, 0, this.update, this);\n        };\n        MovieClip.prototype.$onRemoveFromStage = function () {\n            _super_1.prototype.$onRemoveFromStage.call(this);\n            fgui.GTimers.inst.remove(this.update, this);\n        };\n        return MovieClip;\n    }(fgui.Image));\n    fgui.MovieClip = MovieClip;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var UIContainer = (function (_super_1) {\n        __extends(UIContainer, _super_1);\n        function UIContainer() {\n            var _this = _super_1.call(this) || this;\n            _this.touchEnabled = true;\n            _this.touchChildren = true;\n            return _this;\n        }\n        UIContainer.prototype.cacheHitArea = function (value) {\n            this._cachedHitArea = value;\n            if (value) {\n                if (!this._cachedMatrix)\n                    this._cachedMatrix = new egret.Matrix();\n                this._cachedMatrix.copyFrom(this.$getInvertedConcatenatedMatrix());\n            }\n        };\n        Object.defineProperty(UIContainer.prototype, \"hitArea\", {\n            get: function () {\n                return this._hitArea;\n            },\n            set: function (value) {\n                this._hitArea = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(UIContainer.prototype, \"opaque\", {\n            get: function () {\n                return this._opaque;\n            },\n            set: function (value) {\n                this._opaque = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        UIContainer.prototype.$hitTest = function (stageX, stageY) {\n            if (!this.$visible)\n                return null;\n            if (this._hitArea) {\n                if (!this.touchEnabled)\n                    return null;\n                if (this._hitArea.$graphics) {\n                    if (!this._hitArea.$graphics.$hitTest(stageX, stageY))\n                        return null;\n                }\n                else {\n                    var m = this._cachedHitArea ? this._cachedMatrix : this.$getInvertedConcatenatedMatrix();\n                    var localX = m.a * stageX + m.c * stageY + m.tx;\n                    var localY = m.b * stageX + m.d * stageY + m.ty;\n                    if (!this._hitArea.contains(localX, localY))\n                        return null;\n                }\n                return this;\n            }\n            var ret = _super_1.prototype.$hitTest.call(this, stageX, stageY);\n            if (ret == this && !this.touchEnabled)\n                return null;\n            if (ret == null && this._opaque) {\n                var m = this._cachedHitArea ? this._cachedMatrix : this.$getInvertedConcatenatedMatrix();\n                var localX = m.a * stageX + m.c * stageY + m.tx;\n                var localY = m.b * stageX + m.d * stageY + m.ty;\n                if (localX >= 0 && localY >= 0 && localX <= this.$explicitWidth && localY <= this.$explicitHeight)\n                    return this;\n                else\n                    return null;\n            }\n            else if (ret == this && !this._opaque)\n                return null;\n            else\n                return ret;\n        };\n        return UIContainer;\n    }(egret.DisplayObjectContainer));\n    fgui.UIContainer = UIContainer;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var DragEvent = (function (_super_1) {\n        __extends(DragEvent, _super_1);\n        function DragEvent(type, stageX, stageY, touchPointID) {\n            if (stageX === void 0) { stageX = 0; }\n            if (stageY === void 0) { stageY = 0; }\n            if (touchPointID === void 0) { touchPointID = -1; }\n            var _this = _super_1.call(this, type, false) || this;\n            _this.touchPointID = 0;\n            _this.stageX = stageX;\n            _this.stageY = stageY;\n            _this.touchPointID = touchPointID;\n            return _this;\n        }\n        DragEvent.prototype.preventDefault = function () {\n            this._prevented = true;\n        };\n        DragEvent.prototype.isDefaultPrevented = function () {\n            return this._prevented;\n        };\n        DragEvent.DRAG_START = \"__dragStart\";\n        DragEvent.DRAG_END = \"__dragEnd\";\n        DragEvent.DRAG_MOVING = \"__dragMoving\";\n        return DragEvent;\n    }(egret.Event));\n    fgui.DragEvent = DragEvent;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var DropEvent = (function (_super_1) {\n        __extends(DropEvent, _super_1);\n        function DropEvent(type, source) {\n            var _this = _super_1.call(this, type, false) || this;\n            _this.source = source;\n            return _this;\n        }\n        DropEvent.DROP = \"__drop\";\n        return DropEvent;\n    }(egret.Event));\n    fgui.DropEvent = DropEvent;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ItemEvent = (function (_super_1) {\n        __extends(ItemEvent, _super_1);\n        function ItemEvent(type, itemObject, stageX, stageY) {\n            if (itemObject === void 0) { itemObject = null; }\n            if (stageX === void 0) { stageX = 0; }\n            if (stageY === void 0) { stageY = 0; }\n            var _this = _super_1.call(this, type, false) || this;\n            _this.itemObject = itemObject;\n            _this.stageX = stageX;\n            _this.stageY = stageY;\n            return _this;\n        }\n        ItemEvent.CLICK = \"___itemClick\";\n        return ItemEvent;\n    }(egret.Event));\n    fgui.ItemEvent = ItemEvent;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var StateChangeEvent = (function (_super_1) {\n        __extends(StateChangeEvent, _super_1);\n        function StateChangeEvent(type) {\n            return _super_1.call(this, type, false) || this;\n        }\n        StateChangeEvent.CHANGED = \"___stateChanged\";\n        return StateChangeEvent;\n    }(egret.Event));\n    fgui.StateChangeEvent = StateChangeEvent;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearBase = (function () {\n        function GearBase(owner) {\n            this._owner = owner;\n        }\n        GearBase.create = function (owner, index) {\n            if (!Classes)\n                Classes = [\n                    fgui.GearDisplay, fgui.GearXY, fgui.GearSize, fgui.GearLook, fgui.GearColor,\n                    fgui.GearAnimation, fgui.GearText, fgui.GearIcon, fgui.GearDisplay2, fgui.GearFontSize\n                ];\n            return new (Classes[index])(owner);\n        };\n        GearBase.prototype.dispose = function () {\n            if (this._tweenConfig && this._tweenConfig._tweener) {\n                this._tweenConfig._tweener.kill();\n                this._tweenConfig._tweener = null;\n            }\n        };\n        Object.defineProperty(GearBase.prototype, \"controller\", {\n            get: function () {\n                return this._controller;\n            },\n            set: function (val) {\n                if (val != this._controller) {\n                    this._controller = val;\n                    if (this._controller)\n                        this.init();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GearBase.prototype, \"tweenConfig\", {\n            get: function () {\n                if (!this._tweenConfig)\n                    this._tweenConfig = new GearTweenConfig();\n                return this._tweenConfig;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GearBase.prototype.setup = function (buffer) {\n            this._controller = this._owner.parent.getControllerAt(buffer.readShort());\n            this.init();\n            var i;\n            var page;\n            var cnt = buffer.readShort();\n            if (this instanceof fgui.GearDisplay) {\n                this.pages = buffer.readSArray(cnt);\n            }\n            else if (this instanceof fgui.GearDisplay2) {\n                this.pages = buffer.readSArray(cnt);\n            }\n            else {\n                for (i = 0; i < cnt; i++) {\n                    page = buffer.readS();\n                    if (page == null)\n                        continue;\n                    this.addStatus(page, buffer);\n                }\n                if (buffer.readBool())\n                    this.addStatus(null, buffer);\n            }\n            if (buffer.readBool()) {\n                this._tweenConfig = new GearTweenConfig();\n                this._tweenConfig.easeType = buffer.readByte();\n                this._tweenConfig.duration = buffer.readFloat();\n                this._tweenConfig.delay = buffer.readFloat();\n            }\n            if (buffer.version >= 2) {\n                if (this instanceof fgui.GearXY) {\n                    if (buffer.readBool()) {\n                        this.positionsInPercent = true;\n                        for (i = 0; i < cnt; i++) {\n                            page = buffer.readS();\n                            if (page == null)\n                                continue;\n                            this.addExtStatus(page, buffer);\n                        }\n                        if (buffer.readBool())\n                            this.addExtStatus(null, buffer);\n                    }\n                }\n                else if (this instanceof fgui.GearDisplay2)\n                    this.condition = buffer.readByte();\n            }\n        };\n        GearBase.prototype.updateFromRelations = function (dx, dy) {\n        };\n        GearBase.prototype.addStatus = function (pageId, buffer) {\n        };\n        GearBase.prototype.init = function () {\n        };\n        GearBase.prototype.apply = function () {\n        };\n        GearBase.prototype.updateState = function () {\n        };\n        return GearBase;\n    }());\n    fgui.GearBase = GearBase;\n    var Classes;\n    var GearTweenConfig = (function () {\n        function GearTweenConfig() {\n            this.tween = true;\n            this.easeType = fgui.EaseType.QuadOut;\n            this.duration = 0.3;\n            this.delay = 0;\n        }\n        return GearTweenConfig;\n    }());\n    fgui.GearTweenConfig = GearTweenConfig;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearAnimation = (function (_super_1) {\n        __extends(GearAnimation, _super_1);\n        function GearAnimation(owner) {\n            return _super_1.call(this, owner) || this;\n        }\n        GearAnimation.prototype.init = function () {\n            this._default = {\n                playing: this._owner.getProp(fgui.ObjectPropID.Playing),\n                frame: this._owner.getProp(fgui.ObjectPropID.Frame)\n            };\n            this._storage = {};\n        };\n        GearAnimation.prototype.addStatus = function (pageId, buffer) {\n            var gv;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n            gv.playing = buffer.readBool();\n            gv.frame = buffer.readInt();\n        };\n        GearAnimation.prototype.apply = function () {\n            this._owner._gearLocked = true;\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n            this._owner.setProp(fgui.ObjectPropID.Playing, gv.playing);\n            this._owner.setProp(fgui.ObjectPropID.Frame, gv.frame);\n            this._owner._gearLocked = false;\n        };\n        GearAnimation.prototype.updateState = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n            gv.playing = this._owner.getProp(fgui.ObjectPropID.Playing);\n            gv.frame = this._owner.getProp(fgui.ObjectPropID.Frame);\n        };\n        return GearAnimation;\n    }(fgui.GearBase));\n    fgui.GearAnimation = GearAnimation;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearColor = (function (_super_1) {\n        __extends(GearColor, _super_1);\n        function GearColor(owner) {\n            return _super_1.call(this, owner) || this;\n        }\n        GearColor.prototype.init = function () {\n            this._default = {\n                color: this._owner.getProp(fgui.ObjectPropID.Color),\n                strokeColor: this._owner.getProp(fgui.ObjectPropID.OutlineColor)\n            };\n            this._storage = {};\n        };\n        GearColor.prototype.addStatus = function (pageId, buffer) {\n            var gv;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n            gv.color = buffer.readColor();\n            gv.strokeColor = buffer.readColor();\n        };\n        GearColor.prototype.apply = function () {\n            this._owner._gearLocked = true;\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n            this._owner.setProp(fgui.ObjectPropID.Color, gv.color);\n            this._owner.setProp(fgui.ObjectPropID.OutlineColor, gv.strokeColor);\n            this._owner._gearLocked = false;\n        };\n        GearColor.prototype.updateState = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n            gv.color = this._owner.getProp(fgui.ObjectPropID.Color);\n            gv.strokeColor = this._owner.getProp(fgui.ObjectPropID.OutlineColor);\n        };\n        return GearColor;\n    }(fgui.GearBase));\n    fgui.GearColor = GearColor;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearDisplay = (function (_super_1) {\n        __extends(GearDisplay, _super_1);\n        function GearDisplay(owner) {\n            var _this = _super_1.call(this, owner) || this;\n            _this._displayLockToken = 1;\n            _this._visible = 0;\n            return _this;\n        }\n        GearDisplay.prototype.init = function () {\n            this.pages = null;\n        };\n        GearDisplay.prototype.apply = function () {\n            this._displayLockToken++;\n            if (this._displayLockToken == 0)\n                this._displayLockToken = 1;\n            if (this.pages == null || this.pages.length == 0\n                || this.pages.indexOf(this._controller.selectedPageId) != -1)\n                this._visible = 1;\n            else\n                this._visible = 0;\n        };\n        GearDisplay.prototype.addLock = function () {\n            this._visible++;\n            return this._displayLockToken;\n        };\n        GearDisplay.prototype.releaseLock = function (token) {\n            if (token == this._displayLockToken)\n                this._visible--;\n        };\n        Object.defineProperty(GearDisplay.prototype, \"connected\", {\n            get: function () {\n                return this._controller == null || this._visible > 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        return GearDisplay;\n    }(fgui.GearBase));\n    fgui.GearDisplay = GearDisplay;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearDisplay2 = (function (_super_1) {\n        __extends(GearDisplay2, _super_1);\n        function GearDisplay2(owner) {\n            var _this = _super_1.call(this, owner) || this;\n            _this._visible = 0;\n            return _this;\n        }\n        GearDisplay2.prototype.init = function () {\n            this.pages = null;\n        };\n        GearDisplay2.prototype.apply = function () {\n            if (this.pages == null || this.pages.length == 0\n                || this.pages.indexOf(this._controller.selectedPageId) != -1)\n                this._visible = 1;\n            else\n                this._visible = 0;\n        };\n        GearDisplay2.prototype.evaluate = function (connected) {\n            var v = this._controller == null || this._visible > 0;\n            if (this.condition == 0)\n                v = v && connected;\n            else\n                v = v || connected;\n            return v;\n        };\n        return GearDisplay2;\n    }(fgui.GearBase));\n    fgui.GearDisplay2 = GearDisplay2;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearFontSize = (function (_super_1) {\n        __extends(GearFontSize, _super_1);\n        function GearFontSize(owner) {\n            var _this = _super_1.call(this, owner) || this;\n            _this._default = 0;\n            return _this;\n        }\n        GearFontSize.prototype.init = function () {\n            this._default = this._owner.getProp(fgui.ObjectPropID.FontSize);\n            this._storage = {};\n        };\n        GearFontSize.prototype.addStatus = function (pageId, buffer) {\n            if (pageId == null)\n                this._default = buffer.readInt();\n            else\n                this._storage[pageId] = buffer.readInt();\n        };\n        GearFontSize.prototype.apply = function () {\n            this._owner._gearLocked = true;\n            var data = this._storage[this._controller.selectedPageId];\n            if (data != undefined)\n                this._owner.setProp(fgui.ObjectPropID.FontSize, data);\n            else\n                this._owner.setProp(fgui.ObjectPropID.FontSize, this._default);\n            this._owner._gearLocked = false;\n        };\n        GearFontSize.prototype.updateState = function () {\n            this._storage[this._controller.selectedPageId] = this._owner.getProp(fgui.ObjectPropID.FontSize);\n        };\n        return GearFontSize;\n    }(fgui.GearBase));\n    fgui.GearFontSize = GearFontSize;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearIcon = (function (_super_1) {\n        __extends(GearIcon, _super_1);\n        function GearIcon(owner) {\n            return _super_1.call(this, owner) || this;\n        }\n        GearIcon.prototype.init = function () {\n            this._default = this._owner.icon;\n            this._storage = {};\n        };\n        GearIcon.prototype.addStatus = function (pageId, buffer) {\n            if (pageId == null)\n                this._default = buffer.readS();\n            else\n                this._storage[pageId] = buffer.readS();\n        };\n        GearIcon.prototype.apply = function () {\n            this._owner._gearLocked = true;\n            var data = this._storage[this._controller.selectedPageId];\n            if (data !== undefined)\n                this._owner.icon = data;\n            else\n                this._owner.icon = this._default;\n            this._owner._gearLocked = false;\n        };\n        GearIcon.prototype.updateState = function () {\n            this._storage[this._controller.selectedPageId] = this._owner.icon;\n        };\n        return GearIcon;\n    }(fgui.GearBase));\n    fgui.GearIcon = GearIcon;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearLook = (function (_super_1) {\n        __extends(GearLook, _super_1);\n        function GearLook(owner) {\n            return _super_1.call(this, owner) || this;\n        }\n        GearLook.prototype.init = function () {\n            this._default = {\n                alpha: this._owner.alpha,\n                rotation: this._owner.rotation,\n                grayed: this._owner.grayed,\n                touchable: this._owner.touchable\n            };\n            this._storage = {};\n        };\n        GearLook.prototype.addStatus = function (pageId, buffer) {\n            var gv;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n            gv.alpha = buffer.readFloat();\n            gv.rotation = buffer.readFloat();\n            gv.grayed = buffer.readBool();\n            gv.touchable = buffer.readBool();\n        };\n        GearLook.prototype.apply = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n            if (this._tweenConfig && this._tweenConfig.tween && !fgui.UIPackage._constructing && !fgui.GearBase.disableAllTweenEffect) {\n                this._owner._gearLocked = true;\n                this._owner.grayed = gv.grayed;\n                this._owner.touchable = gv.touchable;\n                this._owner._gearLocked = false;\n                if (this._tweenConfig._tweener) {\n                    if (this._tweenConfig._tweener.endValue.x != gv.alpha || this._tweenConfig._tweener.endValue.y != gv.rotation) {\n                        this._tweenConfig._tweener.kill(true);\n                        this._tweenConfig._tweener = null;\n                    }\n                    else\n                        return;\n                }\n                var a = gv.alpha != this._owner.alpha;\n                var b = gv.rotation != this._owner.rotation;\n                if (a || b) {\n                    if (this._owner.checkGearController(0, this._controller))\n                        this._tweenConfig._displayLockToken = this._owner.addDisplayLock();\n                    this._tweenConfig._tweener = fgui.GTween.to2(this._owner.alpha, this._owner.rotation, gv.alpha, gv.rotation, this._tweenConfig.duration)\n                        .setDelay(this._tweenConfig.delay)\n                        .setEase(this._tweenConfig.easeType)\n                        .setUserData((a ? 1 : 0) + (b ? 2 : 0))\n                        .setTarget(this)\n                        .onUpdate(this.__tweenUpdate, this)\n                        .onComplete(this.__tweenComplete, this);\n                }\n            }\n            else {\n                this._owner._gearLocked = true;\n                this._owner.grayed = gv.grayed;\n                this._owner.touchable = gv.touchable;\n                this._owner.alpha = gv.alpha;\n                this._owner.rotation = gv.rotation;\n                this._owner._gearLocked = false;\n            }\n        };\n        GearLook.prototype.__tweenUpdate = function (tweener) {\n            var flag = tweener.userData;\n            this._owner._gearLocked = true;\n            if ((flag & 1) != 0)\n                this._owner.alpha = tweener.value.x;\n            if ((flag & 2) != 0)\n                this._owner.rotation = tweener.value.y;\n            this._owner._gearLocked = false;\n        };\n        GearLook.prototype.__tweenComplete = function () {\n            if (this._tweenConfig._displayLockToken != 0) {\n                this._owner.releaseDisplayLock(this._tweenConfig._displayLockToken);\n                this._tweenConfig._displayLockToken = 0;\n            }\n            this._tweenConfig._tweener = null;\n        };\n        GearLook.prototype.updateState = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n            gv.alpha = this._owner.alpha;\n            gv.rotation = this._owner.rotation;\n            gv.grayed = this._owner.grayed;\n            gv.touchable = this._owner.touchable;\n        };\n        return GearLook;\n    }(fgui.GearBase));\n    fgui.GearLook = GearLook;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearSize = (function (_super_1) {\n        __extends(GearSize, _super_1);\n        function GearSize(owner) {\n            return _super_1.call(this, owner) || this;\n        }\n        GearSize.prototype.init = function () {\n            this._default = {\n                width: this._owner.width,\n                height: this._owner.height,\n                scaleX: this._owner.scaleX,\n                scaleY: this._owner.scaleY\n            };\n            this._storage = {};\n        };\n        GearSize.prototype.addStatus = function (pageId, buffer) {\n            var gv;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n            gv.width = buffer.readInt();\n            gv.height = buffer.readInt();\n            gv.scaleX = buffer.readFloat();\n            gv.scaleY = buffer.readFloat();\n        };\n        GearSize.prototype.apply = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n            if (this._tweenConfig && this._tweenConfig.tween && !fgui.UIPackage._constructing && !fgui.GearBase.disableAllTweenEffect) {\n                if (this._tweenConfig._tweener) {\n                    if (this._tweenConfig._tweener.endValue.x != gv.width || this._tweenConfig._tweener.endValue.y != gv.height\n                        || this._tweenConfig._tweener.endValue.z != gv.scaleX || this._tweenConfig._tweener.endValue.w != gv.scaleY) {\n                        this._tweenConfig._tweener.kill(true);\n                        this._tweenConfig._tweener = null;\n                    }\n                    else\n                        return;\n                }\n                var a = gv.width != this._owner.width || gv.height != this._owner.height;\n                var b = gv.scaleX != this._owner.scaleX || gv.scaleY != this._owner.scaleY;\n                if (a || b) {\n                    if (this._owner.checkGearController(0, this._controller))\n                        this._tweenConfig._displayLockToken = this._owner.addDisplayLock();\n                    this._tweenConfig._tweener = fgui.GTween.to4(this._owner.width, this._owner.height, this._owner.scaleX, this._owner.scaleY, gv.width, gv.height, gv.scaleX, gv.scaleY, this._tweenConfig.duration)\n                        .setDelay(this._tweenConfig.delay)\n                        .setEase(this._tweenConfig.easeType)\n                        .setUserData((a ? 1 : 0) + (b ? 2 : 0))\n                        .setTarget(this)\n                        .onUpdate(this.__tweenUpdate, this)\n                        .onComplete(this.__tweenComplete, this);\n                }\n            }\n            else {\n                this._owner._gearLocked = true;\n                this._owner.setSize(gv.width, gv.height, this._owner.gearXY.controller == this._controller);\n                this._owner.setScale(gv.scaleX, gv.scaleY);\n                this._owner._gearLocked = false;\n            }\n        };\n        GearSize.prototype.__tweenUpdate = function (tweener) {\n            var flag = tweener.userData;\n            this._owner._gearLocked = true;\n            if ((flag & 1) != 0)\n                this._owner.setSize(tweener.value.x, tweener.value.y, this._owner.checkGearController(1, this._controller));\n            if ((flag & 2) != 0)\n                this._owner.setScale(tweener.value.z, tweener.value.w);\n            this._owner._gearLocked = false;\n        };\n        GearSize.prototype.__tweenComplete = function () {\n            if (this._tweenConfig._displayLockToken != 0) {\n                this._owner.releaseDisplayLock(this._tweenConfig._displayLockToken);\n                this._tweenConfig._displayLockToken = 0;\n            }\n            this._tweenConfig._tweener = null;\n        };\n        GearSize.prototype.updateState = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n            gv.width = this._owner.width;\n            gv.height = this._owner.height;\n            gv.scaleX = this._owner.scaleX;\n            gv.scaleY = this._owner.scaleY;\n        };\n        GearSize.prototype.updateFromRelations = function (dx, dy) {\n            if (this._controller == null || this._storage == null)\n                return;\n            for (var key in this._storage) {\n                var gv = this._storage[key];\n                gv.width += dx;\n                gv.height += dy;\n            }\n            this._default.width += dx;\n            this._default.height += dy;\n            this.updateState();\n        };\n        return GearSize;\n    }(fgui.GearBase));\n    fgui.GearSize = GearSize;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearText = (function (_super_1) {\n        __extends(GearText, _super_1);\n        function GearText(owner) {\n            return _super_1.call(this, owner) || this;\n        }\n        GearText.prototype.init = function () {\n            this._default = this._owner.text;\n            this._storage = {};\n        };\n        GearText.prototype.addStatus = function (pageId, buffer) {\n            if (pageId == null)\n                this._default = buffer.readS();\n            else\n                this._storage[pageId] = buffer.readS();\n        };\n        GearText.prototype.apply = function () {\n            this._owner._gearLocked = true;\n            var data = this._storage[this._controller.selectedPageId];\n            if (data !== undefined)\n                this._owner.text = data;\n            else\n                this._owner.text = this._default;\n            this._owner._gearLocked = false;\n        };\n        GearText.prototype.updateState = function () {\n            this._storage[this._controller.selectedPageId] = this._owner.text;\n        };\n        return GearText;\n    }(fgui.GearBase));\n    fgui.GearText = GearText;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearXY = (function (_super_1) {\n        __extends(GearXY, _super_1);\n        function GearXY(owner) {\n            return _super_1.call(this, owner) || this;\n        }\n        GearXY.prototype.init = function () {\n            this._default = {\n                x: this._owner.x,\n                y: this._owner.y,\n                px: this._owner.x / this._owner.parent.width,\n                py: this._owner.y / this._owner.parent.height\n            };\n            this._storage = {};\n        };\n        GearXY.prototype.addStatus = function (pageId, buffer) {\n            var gv;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n            gv.x = buffer.readInt();\n            gv.y = buffer.readInt();\n        };\n        GearXY.prototype.addExtStatus = function (pageId, buffer) {\n            var gv;\n            if (pageId == null)\n                gv = this._default;\n            else\n                gv = this._storage[pageId];\n            gv.px = buffer.readFloat();\n            gv.py = buffer.readFloat();\n        };\n        GearXY.prototype.apply = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n            var ex;\n            var ey;\n            if (this.positionsInPercent && this._owner.parent) {\n                ex = gv.px * this._owner.parent.width;\n                ey = gv.py * this._owner.parent.height;\n            }\n            else {\n                ex = gv.x;\n                ey = gv.y;\n            }\n            if (this._tweenConfig && this._tweenConfig.tween && !fgui.UIPackage._constructing && !fgui.GearBase.disableAllTweenEffect) {\n                if (this._tweenConfig._tweener) {\n                    if (this._tweenConfig._tweener.endValue.x != ex || this._tweenConfig._tweener.endValue.y != ey) {\n                        this._tweenConfig._tweener.kill(true);\n                        this._tweenConfig._tweener = null;\n                    }\n                    else\n                        return;\n                }\n                var ox = this._owner.x;\n                var oy = this._owner.y;\n                if (ox != ex || oy != ey) {\n                    if (this._owner.checkGearController(0, this._controller))\n                        this._tweenConfig._displayLockToken = this._owner.addDisplayLock();\n                    this._tweenConfig._tweener = fgui.GTween.to2(ox, oy, ex, ey, this._tweenConfig.duration)\n                        .setDelay(this._tweenConfig.delay)\n                        .setEase(this._tweenConfig.easeType)\n                        .setTarget(this)\n                        .onUpdate(this.__tweenUpdate, this)\n                        .onComplete(this.__tweenComplete, this);\n                }\n            }\n            else {\n                this._owner._gearLocked = true;\n                this._owner.setXY(ex, ey);\n                this._owner._gearLocked = false;\n            }\n        };\n        GearXY.prototype.__tweenUpdate = function (tweener) {\n            this._owner._gearLocked = true;\n            this._owner.setXY(tweener.value.x, tweener.value.y);\n            this._owner._gearLocked = false;\n        };\n        GearXY.prototype.__tweenComplete = function () {\n            if (this._tweenConfig._displayLockToken != 0) {\n                this._owner.releaseDisplayLock(this._tweenConfig._displayLockToken);\n                this._tweenConfig._displayLockToken = 0;\n            }\n            this._tweenConfig._tweener = null;\n        };\n        GearXY.prototype.updateState = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n            gv.x = this._owner.x;\n            gv.y = this._owner.y;\n            gv.px = this._owner.x / this._owner.parent.width;\n            gv.py = this._owner.y / this._owner.parent.height;\n        };\n        GearXY.prototype.updateFromRelations = function (dx, dy) {\n            if (this._controller == null || this._storage == null || this.positionsInPercent)\n                return;\n            for (var key in this._storage) {\n                var pt = this._storage[key];\n                pt.x += dx;\n                pt.y += dy;\n            }\n            this._default.x += dx;\n            this._default.y += dy;\n            this.updateState();\n        };\n        return GearXY;\n    }(fgui.GearBase));\n    fgui.GearXY = GearXY;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var _PiOver2 = Math.PI * 0.5;\n    var _TwoPi = Math.PI * 2;\n    function evaluateEase(easeType, time, duration, overshootOrAmplitude, period) {\n        switch (easeType) {\n            case fgui.EaseType.Linear:\n                return time / duration;\n            case fgui.EaseType.SineIn:\n                return -Math.cos(time / duration * _PiOver2) + 1;\n            case fgui.EaseType.SineOut:\n                return Math.sin(time / duration * _PiOver2);\n            case fgui.EaseType.SineInOut:\n                return -0.5 * (Math.cos(Math.PI * time / duration) - 1);\n            case fgui.EaseType.QuadIn:\n                return (time /= duration) * time;\n            case fgui.EaseType.QuadOut:\n                return -(time /= duration) * (time - 2);\n            case fgui.EaseType.QuadInOut:\n                if ((time /= duration * 0.5) < 1)\n                    return 0.5 * time * time;\n                return -0.5 * ((--time) * (time - 2) - 1);\n            case fgui.EaseType.CubicIn:\n                return (time /= duration) * time * time;\n            case fgui.EaseType.CubicOut:\n                return ((time = time / duration - 1) * time * time + 1);\n            case fgui.EaseType.CubicInOut:\n                if ((time /= duration * 0.5) < 1)\n                    return 0.5 * time * time * time;\n                return 0.5 * ((time -= 2) * time * time + 2);\n            case fgui.EaseType.QuartIn:\n                return (time /= duration) * time * time * time;\n            case fgui.EaseType.QuartOut:\n                return -((time = time / duration - 1) * time * time * time - 1);\n            case fgui.EaseType.QuartInOut:\n                if ((time /= duration * 0.5) < 1)\n                    return 0.5 * time * time * time * time;\n                return -0.5 * ((time -= 2) * time * time * time - 2);\n            case fgui.EaseType.QuintIn:\n                return (time /= duration) * time * time * time * time;\n            case fgui.EaseType.QuintOut:\n                return ((time = time / duration - 1) * time * time * time * time + 1);\n            case fgui.EaseType.QuintInOut:\n                if ((time /= duration * 0.5) < 1)\n                    return 0.5 * time * time * time * time * time;\n                return 0.5 * ((time -= 2) * time * time * time * time + 2);\n            case fgui.EaseType.ExpoIn:\n                return (time == 0) ? 0 : Math.pow(2, 10 * (time / duration - 1));\n            case fgui.EaseType.ExpoOut:\n                if (time == duration)\n                    return 1;\n                return (-Math.pow(2, -10 * time / duration) + 1);\n            case fgui.EaseType.ExpoInOut:\n                if (time == 0)\n                    return 0;\n                if (time == duration)\n                    return 1;\n                if ((time /= duration * 0.5) < 1)\n                    return 0.5 * Math.pow(2, 10 * (time - 1));\n                return 0.5 * (-Math.pow(2, -10 * --time) + 2);\n            case fgui.EaseType.CircIn:\n                return -(Math.sqrt(1 - (time /= duration) * time) - 1);\n            case fgui.EaseType.CircOut:\n                return Math.sqrt(1 - (time = time / duration - 1) * time);\n            case fgui.EaseType.CircInOut:\n                if ((time /= duration * 0.5) < 1)\n                    return -0.5 * (Math.sqrt(1 - time * time) - 1);\n                return 0.5 * (Math.sqrt(1 - (time -= 2) * time) + 1);\n            case fgui.EaseType.ElasticIn:\n                var s0;\n                if (time == 0)\n                    return 0;\n                if ((time /= duration) == 1)\n                    return 1;\n                if (period == 0)\n                    period = duration * 0.3;\n                if (overshootOrAmplitude < 1) {\n                    overshootOrAmplitude = 1;\n                    s0 = period / 4;\n                }\n                else\n                    s0 = period / _TwoPi * Math.asin(1 / overshootOrAmplitude);\n                return -(overshootOrAmplitude * Math.pow(2, 10 * (time -= 1)) * Math.sin((time * duration - s0) * _TwoPi / period));\n            case fgui.EaseType.ElasticOut:\n                var s1;\n                if (time == 0)\n                    return 0;\n                if ((time /= duration) == 1)\n                    return 1;\n                if (period == 0)\n                    period = duration * 0.3;\n                if (overshootOrAmplitude < 1) {\n                    overshootOrAmplitude = 1;\n                    s1 = period / 4;\n                }\n                else\n                    s1 = period / _TwoPi * Math.asin(1 / overshootOrAmplitude);\n                return (overshootOrAmplitude * Math.pow(2, -10 * time) * Math.sin((time * duration - s1) * _TwoPi / period) + 1);\n            case fgui.EaseType.ElasticInOut:\n                var s;\n                if (time == 0)\n                    return 0;\n                if ((time /= duration * 0.5) == 2)\n                    return 1;\n                if (period == 0)\n                    period = duration * (0.3 * 1.5);\n                if (overshootOrAmplitude < 1) {\n                    overshootOrAmplitude = 1;\n                    s = period / 4;\n                }\n                else\n                    s = period / _TwoPi * Math.asin(1 / overshootOrAmplitude);\n                if (time < 1)\n                    return -0.5 * (overshootOrAmplitude * Math.pow(2, 10 * (time -= 1)) * Math.sin((time * duration - s) * _TwoPi / period));\n                return overshootOrAmplitude * Math.pow(2, -10 * (time -= 1)) * Math.sin((time * duration - s) * _TwoPi / period) * 0.5 + 1;\n            case fgui.EaseType.BackIn:\n                return (time /= duration) * time * ((overshootOrAmplitude + 1) * time - overshootOrAmplitude);\n            case fgui.EaseType.BackOut:\n                return ((time = time / duration - 1) * time * ((overshootOrAmplitude + 1) * time + overshootOrAmplitude) + 1);\n            case fgui.EaseType.BackInOut:\n                if ((time /= duration * 0.5) < 1)\n                    return 0.5 * (time * time * (((overshootOrAmplitude *= (1.525)) + 1) * time - overshootOrAmplitude));\n                return 0.5 * ((time -= 2) * time * (((overshootOrAmplitude *= (1.525)) + 1) * time + overshootOrAmplitude) + 2);\n            case fgui.EaseType.BounceIn:\n                return bounce_easeIn(time, duration);\n            case fgui.EaseType.BounceOut:\n                return bounce_easeOut(time, duration);\n            case fgui.EaseType.BounceInOut:\n                return bounce_easeInOut(time, duration);\n            default:\n                return -(time /= duration) * (time - 2);\n        }\n    }\n    fgui.evaluateEase = evaluateEase;\n    function bounce_easeIn(time, duration) {\n        return 1 - bounce_easeOut(duration - time, duration);\n    }\n    function bounce_easeOut(time, duration) {\n        if ((time /= duration) < (1 / 2.75)) {\n            return (7.5625 * time * time);\n        }\n        if (time < (2 / 2.75)) {\n            return (7.5625 * (time -= (1.5 / 2.75)) * time + 0.75);\n        }\n        if (time < (2.5 / 2.75)) {\n            return (7.5625 * (time -= (2.25 / 2.75)) * time + 0.9375);\n        }\n        return (7.5625 * (time -= (2.625 / 2.75)) * time + 0.984375);\n    }\n    function bounce_easeInOut(time, duration) {\n        if (time < duration * 0.5) {\n            return bounce_easeIn(time * 2, duration) * 0.5;\n        }\n        return bounce_easeOut(time * 2 - duration, duration) * 0.5 + 0.5;\n    }\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var EaseType = (function () {\n        function EaseType() {\n        }\n        EaseType.Linear = 0;\n        EaseType.SineIn = 1;\n        EaseType.SineOut = 2;\n        EaseType.SineInOut = 3;\n        EaseType.QuadIn = 4;\n        EaseType.QuadOut = 5;\n        EaseType.QuadInOut = 6;\n        EaseType.CubicIn = 7;\n        EaseType.CubicOut = 8;\n        EaseType.CubicInOut = 9;\n        EaseType.QuartIn = 10;\n        EaseType.QuartOut = 11;\n        EaseType.QuartInOut = 12;\n        EaseType.QuintIn = 13;\n        EaseType.QuintOut = 14;\n        EaseType.QuintInOut = 15;\n        EaseType.ExpoIn = 16;\n        EaseType.ExpoOut = 17;\n        EaseType.ExpoInOut = 18;\n        EaseType.CircIn = 19;\n        EaseType.CircOut = 20;\n        EaseType.CircInOut = 21;\n        EaseType.ElasticIn = 22;\n        EaseType.ElasticOut = 23;\n        EaseType.ElasticInOut = 24;\n        EaseType.BackIn = 25;\n        EaseType.BackOut = 26;\n        EaseType.BackInOut = 27;\n        EaseType.BounceIn = 28;\n        EaseType.BounceOut = 29;\n        EaseType.BounceInOut = 30;\n        EaseType.Custom = 31;\n        return EaseType;\n    }());\n    fgui.EaseType = EaseType;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GPath = (function () {\n        function GPath() {\n            this._segments = new Array();\n            this._points = new Array();\n        }\n        Object.defineProperty(GPath.prototype, \"length\", {\n            get: function () {\n                return this._fullLength;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GPath.prototype.create = function (pt1, pt2, pt3, pt4) {\n            var points;\n            if (Array.isArray(pt1))\n                points = pt1;\n            else {\n                points = new Array();\n                points.push(pt1);\n                points.push(pt2);\n                if (pt3)\n                    points.push(pt3);\n                if (pt4)\n                    points.push(pt4);\n            }\n            this._segments.length = 0;\n            this._points.length = 0;\n            this._fullLength = 0;\n            var cnt = points.length;\n            if (cnt == 0)\n                return;\n            var splinePoints = s_points;\n            splinePoints.length = 0;\n            var prev = points[0];\n            if (prev.curveType == fgui.CurveType.CRSpline)\n                splinePoints.push(new egret.Point(prev.x, prev.y));\n            for (var i = 1; i < cnt; i++) {\n                var current = points[i];\n                if (prev.curveType != fgui.CurveType.CRSpline) {\n                    var seg = {};\n                    seg.type = prev.curveType;\n                    seg.ptStart = this._points.length;\n                    if (prev.curveType == fgui.CurveType.Straight) {\n                        seg.ptCount = 2;\n                        this._points.push(new egret.Point(prev.x, prev.y));\n                        this._points.push(new egret.Point(current.x, current.y));\n                    }\n                    else if (prev.curveType == fgui.CurveType.Bezier) {\n                        seg.ptCount = 3;\n                        this._points.push(new egret.Point(prev.x, prev.y));\n                        this._points.push(new egret.Point(current.x, current.y));\n                        this._points.push(new egret.Point(prev.control1_x, prev.control1_y));\n                    }\n                    else if (prev.curveType == fgui.CurveType.CubicBezier) {\n                        seg.ptCount = 4;\n                        this._points.push(new egret.Point(prev.x, prev.y));\n                        this._points.push(new egret.Point(current.x, current.y));\n                        this._points.push(new egret.Point(prev.control1_x, prev.control1_y));\n                        this._points.push(new egret.Point(prev.control2_x, prev.control2_y));\n                    }\n                    seg.length = fgui.ToolSet.distance(prev.x, prev.y, current.x, current.y);\n                    this._fullLength += seg.length;\n                    this._segments.push(seg);\n                }\n                if (current.curveType != fgui.CurveType.CRSpline) {\n                    if (splinePoints.length > 0) {\n                        splinePoints.push(new egret.Point(current.x, current.y));\n                        this.createSplineSegment();\n                    }\n                }\n                else\n                    splinePoints.push(new egret.Point(current.x, current.y));\n                prev = current;\n            }\n            if (splinePoints.length > 1)\n                this.createSplineSegment();\n        };\n        GPath.prototype.createSplineSegment = function () {\n            var splinePoints = s_points;\n            var cnt = splinePoints.length;\n            splinePoints.splice(0, 0, splinePoints[0]);\n            splinePoints.push(splinePoints[cnt]);\n            splinePoints.push(splinePoints[cnt]);\n            cnt += 3;\n            var seg = {};\n            seg.type = fgui.CurveType.CRSpline;\n            seg.ptStart = this._points.length;\n            seg.ptCount = cnt;\n            this._points = this._points.concat(splinePoints);\n            seg.length = 0;\n            for (var i = 1; i < cnt; i++) {\n                seg.length += fgui.ToolSet.distance(splinePoints[i - 1].x, splinePoints[i - 1].y, splinePoints[i].x, splinePoints[i].y);\n            }\n            this._fullLength += seg.length;\n            this._segments.push(seg);\n            splinePoints.length = 0;\n        };\n        GPath.prototype.clear = function () {\n            this._segments.length = 0;\n            this._points.length = 0;\n        };\n        GPath.prototype.getPointAt = function (t, result) {\n            if (!result)\n                result = new egret.Point();\n            else\n                result.x = result.y = 0;\n            t = fgui.ToolSet.clamp01(t);\n            var cnt = this._segments.length;\n            if (cnt == 0) {\n                return result;\n            }\n            var seg;\n            if (t == 1) {\n                seg = this._segments[cnt - 1];\n                if (seg.type == fgui.CurveType.Straight) {\n                    result.x = fgui.ToolSet.lerp(this._points[seg.ptStart].x, this._points[seg.ptStart + 1].x, t);\n                    result.y = fgui.ToolSet.lerp(this._points[seg.ptStart].y, this._points[seg.ptStart + 1].y, t);\n                    return result;\n                }\n                else if (seg.type == fgui.CurveType.Bezier || seg.type == fgui.CurveType.CubicBezier)\n                    return this.onBezierCurve(seg.ptStart, seg.ptCount, t, result);\n                else\n                    return this.onCRSplineCurve(seg.ptStart, seg.ptCount, t, result);\n            }\n            var len = t * this._fullLength;\n            for (var i = 0; i < cnt; i++) {\n                seg = this._segments[i];\n                len -= seg.length;\n                if (len < 0) {\n                    t = 1 + len / seg.length;\n                    if (seg.type == fgui.CurveType.Straight) {\n                        result.x = fgui.ToolSet.lerp(this._points[seg.ptStart].x, this._points[seg.ptStart + 1].x, t);\n                        result.y = fgui.ToolSet.lerp(this._points[seg.ptStart].y, this._points[seg.ptStart + 1].y, t);\n                    }\n                    else if (seg.type == fgui.CurveType.Bezier || seg.type == fgui.CurveType.CubicBezier)\n                        result = this.onBezierCurve(seg.ptStart, seg.ptCount, t, result);\n                    else\n                        result = this.onCRSplineCurve(seg.ptStart, seg.ptCount, t, result);\n                    break;\n                }\n            }\n            return result;\n        };\n        Object.defineProperty(GPath.prototype, \"segmentCount\", {\n            get: function () {\n                return this._segments.length;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GPath.prototype.getAnchorsInSegment = function (segmentIndex, points) {\n            if (points == null)\n                points = new Array();\n            var seg = this._segments[segmentIndex];\n            for (var i = 0; i < seg.ptCount; i++)\n                points.push(new egret.Point(this._points[seg.ptStart + i].x, this._points[seg.ptStart + i].y));\n            return points;\n        };\n        GPath.prototype.getPointsInSegment = function (segmentIndex, t0, t1, points, ts, pointDensity) {\n            if (points == null)\n                points = new Array();\n            if (!pointDensity || isNaN(pointDensity))\n                pointDensity = 0.1;\n            if (ts)\n                ts.push(t0);\n            var seg = this._segments[segmentIndex];\n            if (seg.type == fgui.CurveType.Straight) {\n                points.push(new egret.Point(fgui.ToolSet.lerp(this._points[seg.ptStart].x, this._points[seg.ptStart + 1].x, t0), fgui.ToolSet.lerp(this._points[seg.ptStart].y, this._points[seg.ptStart + 1].y, t0)));\n                points.push(new egret.Point(fgui.ToolSet.lerp(this._points[seg.ptStart].x, this._points[seg.ptStart + 1].x, t1), fgui.ToolSet.lerp(this._points[seg.ptStart].y, this._points[seg.ptStart + 1].y, t1)));\n            }\n            else {\n                var func;\n                if (seg.type == fgui.CurveType.Bezier || seg.type == fgui.CurveType.CubicBezier)\n                    func = this.onBezierCurve;\n                else\n                    func = this.onCRSplineCurve;\n                points.push(func.call(this, seg.ptStart, seg.ptCount, t0, new egret.Point()));\n                var SmoothAmount = Math.min(seg.length * pointDensity, 50);\n                for (var j = 0; j <= SmoothAmount; j++) {\n                    var t = j / SmoothAmount;\n                    if (t > t0 && t < t1) {\n                        points.push(func.call(this, seg.ptStart, seg.ptCount, t, new egret.Point()));\n                        if (ts != null)\n                            ts.push(t);\n                    }\n                }\n                points.push(func.call(this, seg.ptStart, seg.ptCount, t1, new egret.Point()));\n            }\n            if (ts != null)\n                ts.push(t1);\n            return points;\n        };\n        GPath.prototype.getAllPoints = function (points, ts, pointDensity) {\n            if (points == null)\n                points = new Array();\n            if (!pointDensity || isNaN(pointDensity))\n                pointDensity = 0.1;\n            var cnt = this._segments.length;\n            for (var i = 0; i < cnt; i++)\n                this.getPointsInSegment(i, 0, 1, points, ts, pointDensity);\n            return points;\n        };\n        GPath.prototype.onCRSplineCurve = function (ptStart, ptCount, t, result) {\n            var adjustedIndex = Math.floor(t * (ptCount - 4)) + ptStart;\n            var p0x = this._points[adjustedIndex].x;\n            var p0y = this._points[adjustedIndex].y;\n            var p1x = this._points[adjustedIndex + 1].x;\n            var p1y = this._points[adjustedIndex + 1].y;\n            var p2x = this._points[adjustedIndex + 2].x;\n            var p2y = this._points[adjustedIndex + 2].y;\n            var p3x = this._points[adjustedIndex + 3].x;\n            var p3y = this._points[adjustedIndex + 3].y;\n            var adjustedT = (t == 1) ? 1 : fgui.ToolSet.repeat(t * (ptCount - 4), 1);\n            var t0 = ((-adjustedT + 2) * adjustedT - 1) * adjustedT * 0.5;\n            var t1 = (((3 * adjustedT - 5) * adjustedT) * adjustedT + 2) * 0.5;\n            var t2 = ((-3 * adjustedT + 4) * adjustedT + 1) * adjustedT * 0.5;\n            var t3 = ((adjustedT - 1) * adjustedT * adjustedT) * 0.5;\n            result.x = p0x * t0 + p1x * t1 + p2x * t2 + p3x * t3;\n            result.y = p0y * t0 + p1y * t1 + p2y * t2 + p3y * t3;\n            return result;\n        };\n        GPath.prototype.onBezierCurve = function (ptStart, ptCount, t, result) {\n            var t2 = 1 - t;\n            var p0x = this._points[ptStart].x;\n            var p0y = this._points[ptStart].y;\n            var p1x = this._points[ptStart + 1].x;\n            var p1y = this._points[ptStart + 1].y;\n            var cp0x = this._points[ptStart + 2].x;\n            var cp0y = this._points[ptStart + 2].y;\n            if (ptCount == 4) {\n                var cp1x = this._points[ptStart + 3].x;\n                var cp1y = this._points[ptStart + 3].y;\n                result.x = t2 * t2 * t2 * p0x + 3 * t2 * t2 * t * cp0x + 3 * t2 * t * t * cp1x + t * t * t * p1x;\n                result.y = t2 * t2 * t2 * p0y + 3 * t2 * t2 * t * cp0y + 3 * t2 * t * t * cp1y + t * t * t * p1y;\n            }\n            else {\n                result.x = t2 * t2 * p0x + 2 * t2 * t * cp0x + t * t * p1x;\n                result.y = t2 * t2 * p0y + 2 * t2 * t * cp0y + t * t * p1y;\n            }\n            return result;\n        };\n        return GPath;\n    }());\n    fgui.GPath = GPath;\n    var s_points = new Array();\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var CurveType;\n    (function (CurveType) {\n        CurveType[CurveType[\"CRSpline\"] = 0] = \"CRSpline\";\n        CurveType[CurveType[\"Bezier\"] = 1] = \"Bezier\";\n        CurveType[CurveType[\"CubicBezier\"] = 2] = \"CubicBezier\";\n        CurveType[CurveType[\"Straight\"] = 3] = \"Straight\";\n    })(CurveType = fgui.CurveType || (fgui.CurveType = {}));\n    var GPathPoint = (function () {\n        function GPathPoint() {\n            this.x = 0;\n            this.y = 0;\n            this.control1_x = 0;\n            this.control1_y = 0;\n            this.control2_x = 0;\n            this.control2_y = 0;\n            this.curveType = 0;\n        }\n        GPathPoint.newPoint = function (x, y, curveType) {\n            if (x === void 0) { x = 0; }\n            if (y === void 0) { y = 0; }\n            if (curveType === void 0) { curveType = 0; }\n            var pt = new GPathPoint();\n            pt.x = x;\n            pt.y = y;\n            pt.control1_x = 0;\n            pt.control1_y = 0;\n            pt.control2_x = 0;\n            pt.control2_y = 0;\n            pt.curveType = curveType;\n            return pt;\n        };\n        GPathPoint.newBezierPoint = function (x, y, control1_x, control1_y) {\n            if (x === void 0) { x = 0; }\n            if (y === void 0) { y = 0; }\n            if (control1_x === void 0) { control1_x = 0; }\n            if (control1_y === void 0) { control1_y = 0; }\n            var pt = new GPathPoint();\n            pt.x = x;\n            pt.y = y;\n            pt.control1_x = control1_x;\n            pt.control1_y = control1_y;\n            pt.control2_x = 0;\n            pt.control2_y = 0;\n            pt.curveType = CurveType.Bezier;\n            return pt;\n        };\n        GPathPoint.newCubicBezierPoint = function (x, y, control1_x, control1_y, control2_x, control2_y) {\n            if (x === void 0) { x = 0; }\n            if (y === void 0) { y = 0; }\n            if (control1_x === void 0) { control1_x = 0; }\n            if (control1_y === void 0) { control1_y = 0; }\n            if (control2_x === void 0) { control2_x = 0; }\n            if (control2_y === void 0) { control2_y = 0; }\n            var pt = new GPathPoint();\n            pt.x = x;\n            pt.y = y;\n            pt.control1_x = control1_x;\n            pt.control1_y = control1_y;\n            pt.control2_x = control2_x;\n            pt.control2_y = control2_y;\n            pt.curveType = CurveType.CubicBezier;\n            return pt;\n        };\n        GPathPoint.prototype.clone = function () {\n            var ret = new GPathPoint();\n            ret.x = this.x;\n            ret.y = this.y;\n            ret.control1_x = this.control1_x;\n            ret.control1_y = this.control1_y;\n            ret.control2_x = this.control2_x;\n            ret.control2_y = this.control2_y;\n            ret.curveType = this.curveType;\n            return ret;\n        };\n        return GPathPoint;\n    }());\n    fgui.GPathPoint = GPathPoint;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GTween = (function () {\n        function GTween() {\n        }\n        GTween.to = function (start, end, duration) {\n            return fgui.TweenManager.createTween()._to(start, end, duration);\n        };\n        GTween.to2 = function (start, start2, end, end2, duration) {\n            return fgui.TweenManager.createTween()._to2(start, start2, end, end2, duration);\n        };\n        GTween.to3 = function (start, start2, start3, end, end2, end3, duration) {\n            return fgui.TweenManager.createTween()._to3(start, start2, start3, end, end2, end3, duration);\n        };\n        GTween.to4 = function (start, start2, start3, start4, end, end2, end3, end4, duration) {\n            return fgui.TweenManager.createTween()._to4(start, start2, start3, start4, end, end2, end3, end4, duration);\n        };\n        GTween.toColor = function (start, end, duration) {\n            return fgui.TweenManager.createTween()._toColor(start, end, duration);\n        };\n        GTween.delayedCall = function (delay) {\n            return fgui.TweenManager.createTween().setDelay(delay);\n        };\n        GTween.shake = function (startX, startY, amplitude, duration) {\n            return fgui.TweenManager.createTween()._shake(startX, startY, amplitude, duration);\n        };\n        GTween.isTweening = function (target, propType) {\n            return fgui.TweenManager.isTweening(target, propType);\n        };\n        GTween.kill = function (target, complete, propType) {\n            fgui.TweenManager.killTweens(target, complete, propType);\n        };\n        GTween.getTween = function (target, propType) {\n            return fgui.TweenManager.getTween(target, propType);\n        };\n        GTween.catchCallbackExceptions = true;\n        return GTween;\n    }());\n    fgui.GTween = GTween;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GTweener = (function () {\n        function GTweener() {\n            this._startValue = new fgui.TweenValue();\n            this._endValue = new fgui.TweenValue();\n            this._value = new fgui.TweenValue();\n            this._deltaValue = new fgui.TweenValue();\n            this._reset();\n        }\n        GTweener.prototype.setDelay = function (value) {\n            this._delay = value;\n            return this;\n        };\n        Object.defineProperty(GTweener.prototype, \"delay\", {\n            get: function () {\n                return this._delay;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTweener.prototype.setDuration = function (value) {\n            this._duration = value;\n            return this;\n        };\n        Object.defineProperty(GTweener.prototype, \"duration\", {\n            get: function () {\n                return this._duration;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTweener.prototype.setBreakpoint = function (value) {\n            this._breakpoint = value;\n            return this;\n        };\n        GTweener.prototype.setEase = function (value) {\n            this._easeType = value;\n            return this;\n        };\n        GTweener.prototype.setEasePeriod = function (value) {\n            this._easePeriod = value;\n            return this;\n        };\n        GTweener.prototype.setEaseOvershootOrAmplitude = function (value) {\n            this._easeOvershootOrAmplitude = value;\n            return this;\n        };\n        GTweener.prototype.setRepeat = function (repeat, yoyo) {\n            this._repeat = repeat;\n            this._yoyo = yoyo;\n            return this;\n        };\n        Object.defineProperty(GTweener.prototype, \"repeat\", {\n            get: function () {\n                return this._repeat;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTweener.prototype.setTimeScale = function (value) {\n            this._timeScale = value;\n            return this;\n        };\n        GTweener.prototype.setSnapping = function (value) {\n            this._snapping = value;\n            return this;\n        };\n        GTweener.prototype.setTarget = function (value, propType) {\n            this._target = value;\n            this._propType = propType;\n            return this;\n        };\n        Object.defineProperty(GTweener.prototype, \"target\", {\n            get: function () {\n                return this._target;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTweener.prototype.setUserData = function (value) {\n            this._userData = value;\n            return this;\n        };\n        Object.defineProperty(GTweener.prototype, \"userData\", {\n            get: function () {\n                return this._userData;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTweener.prototype.setPath = function (value) {\n            this._path = value;\n            return this;\n        };\n        GTweener.prototype.onUpdate = function (callback, caller) {\n            this._onUpdate = callback;\n            this._onUpdateCaller = caller;\n            return this;\n        };\n        GTweener.prototype.onStart = function (callback, caller) {\n            this._onStart = callback;\n            this._onStartCaller = caller;\n            return this;\n        };\n        GTweener.prototype.onComplete = function (callback, caller) {\n            this._onComplete = callback;\n            this._onCompleteCaller = caller;\n            return this;\n        };\n        Object.defineProperty(GTweener.prototype, \"startValue\", {\n            get: function () {\n                return this._startValue;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTweener.prototype, \"endValue\", {\n            get: function () {\n                return this._endValue;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTweener.prototype, \"value\", {\n            get: function () {\n                return this._value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTweener.prototype, \"deltaValue\", {\n            get: function () {\n                return this._deltaValue;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTweener.prototype, \"normalizedTime\", {\n            get: function () {\n                return this._normalizedTime;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTweener.prototype, \"completed\", {\n            get: function () {\n                return this._ended != 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTweener.prototype, \"allCompleted\", {\n            get: function () {\n                return this._ended == 1;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTweener.prototype.setPaused = function (paused) {\n            this._paused = paused;\n            return this;\n        };\n        GTweener.prototype.seek = function (time) {\n            if (this._killed)\n                return;\n            this._elapsedTime = time;\n            if (this._elapsedTime < this._delay) {\n                if (this._started)\n                    this._elapsedTime = this._delay;\n                else\n                    return;\n            }\n            this.update();\n        };\n        GTweener.prototype.kill = function (complete) {\n            if (this._killed)\n                return;\n            if (complete) {\n                if (this._ended == 0) {\n                    if (this._breakpoint >= 0)\n                        this._elapsedTime = this._delay + this._breakpoint;\n                    else if (this._repeat >= 0)\n                        this._elapsedTime = this._delay + this._duration * (this._repeat + 1);\n                    else\n                        this._elapsedTime = this._delay + this._duration * 2;\n                    this.update();\n                }\n                this.callCompleteCallback();\n            }\n            this._killed = true;\n        };\n        GTweener.prototype._to = function (start, end, duration) {\n            this._valueSize = 1;\n            this._startValue.x = start;\n            this._endValue.x = end;\n            this._value.x = start;\n            this._duration = duration;\n            return this;\n        };\n        GTweener.prototype._to2 = function (start, start2, end, end2, duration) {\n            this._valueSize = 2;\n            this._startValue.x = start;\n            this._endValue.x = end;\n            this._startValue.y = start2;\n            this._endValue.y = end2;\n            this._value.x = start;\n            this._value.y = start2;\n            this._duration = duration;\n            return this;\n        };\n        GTweener.prototype._to3 = function (start, start2, start3, end, end2, end3, duration) {\n            this._valueSize = 3;\n            this._startValue.x = start;\n            this._endValue.x = end;\n            this._startValue.y = start2;\n            this._endValue.y = end2;\n            this._startValue.z = start3;\n            this._endValue.z = end3;\n            this._value.x = start;\n            this._value.y = start2;\n            this._value.z = start3;\n            this._duration = duration;\n            return this;\n        };\n        GTweener.prototype._to4 = function (start, start2, start3, start4, end, end2, end3, end4, duration) {\n            this._valueSize = 4;\n            this._startValue.x = start;\n            this._endValue.x = end;\n            this._startValue.y = start2;\n            this._endValue.y = end2;\n            this._startValue.z = start3;\n            this._endValue.z = end3;\n            this._startValue.w = start4;\n            this._endValue.w = end4;\n            this._value.x = start;\n            this._value.y = start2;\n            this._value.z = start3;\n            this._value.w = start4;\n            this._duration = duration;\n            return this;\n        };\n        GTweener.prototype._toColor = function (start, end, duration) {\n            this._valueSize = 4;\n            this._startValue.color = start;\n            this._endValue.color = end;\n            this._value.color = start;\n            this._duration = duration;\n            return this;\n        };\n        GTweener.prototype._shake = function (startX, startY, amplitude, duration) {\n            this._valueSize = 5;\n            this._startValue.x = startX;\n            this._startValue.y = startY;\n            this._startValue.w = amplitude;\n            this._duration = duration;\n            return this;\n        };\n        GTweener.prototype._init = function () {\n            this._delay = 0;\n            this._duration = 0;\n            this._breakpoint = -1;\n            this._easeType = fgui.EaseType.QuadOut;\n            this._timeScale = 1;\n            this._easePeriod = 0;\n            this._easeOvershootOrAmplitude = 1.70158;\n            this._snapping = false;\n            this._repeat = 0;\n            this._yoyo = false;\n            this._valueSize = 0;\n            this._started = false;\n            this._paused = false;\n            this._killed = false;\n            this._elapsedTime = 0;\n            this._normalizedTime = 0;\n            this._ended = 0;\n        };\n        GTweener.prototype._reset = function () {\n            this._target = null;\n            this._propType = null;\n            this._userData = null;\n            this._path = null;\n            this._onStart = this._onUpdate = this._onComplete = null;\n            this._onStartCaller = this._onUpdateCaller = this._onCompleteCaller = null;\n        };\n        GTweener.prototype._update = function (dt) {\n            if (this._timeScale != 1)\n                dt *= this._timeScale;\n            if (dt == 0)\n                return;\n            if (this._ended != 0) {\n                this.callCompleteCallback();\n                this._killed = true;\n                return;\n            }\n            this._elapsedTime += dt;\n            this.update();\n            if (this._ended != 0) {\n                if (!this._killed) {\n                    this.callCompleteCallback();\n                    this._killed = true;\n                }\n            }\n        };\n        GTweener.prototype.update = function () {\n            this._ended = 0;\n            if (this._valueSize == 0) {\n                if (this._elapsedTime >= this._delay + this._duration)\n                    this._ended = 1;\n                return;\n            }\n            if (!this._started) {\n                if (this._elapsedTime < this._delay)\n                    return;\n                this._started = true;\n                this.callStartCallback();\n                if (this._killed)\n                    return;\n            }\n            var reversed = false;\n            var tt = this._elapsedTime - this._delay;\n            if (this._breakpoint >= 0 && tt >= this._breakpoint) {\n                tt = this._breakpoint;\n                this._ended = 2;\n            }\n            if (this._repeat != 0) {\n                var round = Math.floor(tt / this._duration);\n                tt -= this._duration * round;\n                if (this._yoyo)\n                    reversed = round % 2 == 1;\n                if (this._repeat > 0 && this._repeat - round < 0) {\n                    if (this._yoyo)\n                        reversed = this._repeat % 2 == 1;\n                    tt = this._duration;\n                    this._ended = 1;\n                }\n            }\n            else if (tt >= this._duration) {\n                tt = this._duration;\n                this._ended = 1;\n            }\n            this._normalizedTime = fgui.evaluateEase(this._easeType, reversed ? (this._duration - tt) : tt, this._duration, this._easeOvershootOrAmplitude, this._easePeriod);\n            this._value.setZero();\n            this._deltaValue.setZero();\n            if (this._valueSize == 5) {\n                if (this._ended == 0) {\n                    var r = this._startValue.w * (1 - this._normalizedTime);\n                    var rx = r * (Math.random() > 0.5 ? 1 : -1);\n                    var ry = r * (Math.random() > 0.5 ? 1 : -1);\n                    this._deltaValue.x = rx;\n                    this._deltaValue.y = ry;\n                    this._value.x = this._startValue.x + rx;\n                    this._value.y = this._startValue.y + ry;\n                }\n                else {\n                    this._value.x = this._startValue.x;\n                    this._value.y = this._startValue.y;\n                }\n            }\n            else if (this._path) {\n                var pt = s_vec2;\n                this._path.getPointAt(this._normalizedTime, pt);\n                if (this._snapping) {\n                    pt.x = Math.round(pt.x);\n                    pt.y = Math.round(pt.y);\n                }\n                this._deltaValue.x = pt.x - this._value.x;\n                this._deltaValue.y = pt.y - this._value.y;\n                this._value.x = pt.x;\n                this._value.y = pt.y;\n            }\n            else {\n                for (var i = 0; i < this._valueSize; i++) {\n                    var n1 = this._startValue.getField(i);\n                    var n2 = this._endValue.getField(i);\n                    var f = n1 + (n2 - n1) * this._normalizedTime;\n                    if (this._snapping)\n                        f = Math.round(f);\n                    this._deltaValue.setField(i, f - this._value.getField(i));\n                    this._value.setField(i, f);\n                }\n            }\n            if (this._target != null && this._propType != null) {\n                if (this._propType instanceof Function) {\n                    switch (this._valueSize) {\n                        case 1:\n                            this._propType.call(this._target, this._value.x);\n                            break;\n                        case 2:\n                            this._propType.call(this._target, this._value.x, this._value.y);\n                            break;\n                        case 3:\n                            this._propType.call(this._target, this._value.x, this._value.y, this._value.z);\n                            break;\n                        case 4:\n                            this._propType.call(this._target, this._value.x, this._value.y, this._value.z, this._value.w);\n                            break;\n                        case 5:\n                            this._propType.call(this._target, this._value.color);\n                            break;\n                        case 6:\n                            this._propType.call(this._target, this._value.x, this._value.y);\n                            break;\n                    }\n                }\n                else {\n                    if (this._valueSize == 5)\n                        this._target[this._propType] = this._value.color;\n                    else\n                        this._target[this._propType] = this._value.x;\n                }\n            }\n            this.callUpdateCallback();\n        };\n        GTweener.prototype.callStartCallback = function () {\n            if (this._onStart != null) {\n                try {\n                    this._onStart.call(this._onStartCaller, this);\n                }\n                catch (err) {\n                    console.log(\"FairyGUI: error in start callback > \" + err);\n                }\n            }\n        };\n        GTweener.prototype.callUpdateCallback = function () {\n            if (this._onUpdate != null) {\n                try {\n                    this._onUpdate.call(this._onUpdateCaller, this);\n                }\n                catch (err) {\n                    console.log(\"FairyGUI: error in update callback > \" + err);\n                }\n            }\n        };\n        GTweener.prototype.callCompleteCallback = function () {\n            if (this._onComplete != null) {\n                try {\n                    this._onComplete.call(this._onCompleteCaller, this);\n                }\n                catch (err) {\n                    console.log(\"FairyGUI: error in complete callback > \" + err);\n                }\n            }\n        };\n        return GTweener;\n    }());\n    fgui.GTweener = GTweener;\n    var s_vec2 = new egret.Point();\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var TweenManager = (function () {\n        function TweenManager() {\n        }\n        TweenManager.createTween = function () {\n            if (!_inited) {\n                egret.startTick(TweenManager.update, null);\n                _inited = true;\n                _lastTime = egret.getTimer();\n            }\n            var tweener;\n            var cnt = _tweenerPool.length;\n            if (cnt > 0) {\n                tweener = _tweenerPool.pop();\n            }\n            else\n                tweener = new fgui.GTweener();\n            tweener._init();\n            _activeTweens[_totalActiveTweens++] = tweener;\n            if (_totalActiveTweens == _activeTweens.length)\n                _activeTweens.length = _activeTweens.length + Math.ceil(_activeTweens.length * 0.5);\n            return tweener;\n        };\n        TweenManager.isTweening = function (target, propType) {\n            if (target == null)\n                return false;\n            var anyType = propType == null;\n            for (var i = 0; i < _totalActiveTweens; i++) {\n                var tweener = _activeTweens[i];\n                if (tweener != null && tweener.target == target && !tweener._killed\n                    && (anyType || tweener._propType == propType))\n                    return true;\n            }\n            return false;\n        };\n        TweenManager.killTweens = function (target, completed, propType) {\n            if (target == null)\n                return false;\n            var flag = false;\n            var cnt = _totalActiveTweens;\n            var anyType = propType == null;\n            for (var i = 0; i < cnt; i++) {\n                var tweener = _activeTweens[i];\n                if (tweener != null && tweener.target == target && !tweener._killed\n                    && (anyType || tweener._propType == propType)) {\n                    tweener.kill(completed);\n                    flag = true;\n                }\n            }\n            return flag;\n        };\n        TweenManager.getTween = function (target, propType) {\n            if (target == null)\n                return null;\n            var cnt = _totalActiveTweens;\n            var anyType = propType == null;\n            for (var i = 0; i < cnt; i++) {\n                var tweener = _activeTweens[i];\n                if (tweener != null && tweener.target == target && !tweener._killed\n                    && (anyType || tweener._propType == propType)) {\n                    return tweener;\n                }\n            }\n            return null;\n        };\n        TweenManager.update = function (timestamp) {\n            var dt = timestamp - _lastTime;\n            _lastTime = timestamp;\n            dt /= 1000;\n            var cnt = _totalActiveTweens;\n            var freePosStart = -1;\n            var freePosCount = 0;\n            for (var i = 0; i < cnt; i++) {\n                var tweener = _activeTweens[i];\n                if (tweener == null) {\n                    if (freePosStart == -1)\n                        freePosStart = i;\n                    freePosCount++;\n                }\n                else if (tweener._killed) {\n                    tweener._reset();\n                    _tweenerPool.push(tweener);\n                    _activeTweens[i] = null;\n                    if (freePosStart == -1)\n                        freePosStart = i;\n                    freePosCount++;\n                }\n                else {\n                    if ((tweener._target instanceof fgui.GObject) && (tweener._target).isDisposed)\n                        tweener._killed = true;\n                    else if (!tweener._paused)\n                        tweener._update(dt);\n                    if (freePosStart != -1) {\n                        _activeTweens[freePosStart] = tweener;\n                        _activeTweens[i] = null;\n                        freePosStart++;\n                    }\n                }\n            }\n            if (freePosStart >= 0) {\n                if (_totalActiveTweens != cnt) {\n                    var j = cnt;\n                    cnt = _totalActiveTweens - cnt;\n                    for (i = 0; i < cnt; i++)\n                        _activeTweens[freePosStart++] = _activeTweens[j++];\n                }\n                _totalActiveTweens = freePosStart;\n            }\n            return false;\n        };\n        return TweenManager;\n    }());\n    fgui.TweenManager = TweenManager;\n    var _activeTweens = new Array(30);\n    var _tweenerPool = new Array();\n    var _totalActiveTweens = 0;\n    var _lastTime = 0;\n    var _inited;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var TweenValue = (function () {\n        function TweenValue() {\n            this.x = this.y = this.z = this.w = 0;\n        }\n        Object.defineProperty(TweenValue.prototype, \"color\", {\n            get: function () {\n                return (this.w << 24) + (this.x << 16) + (this.y << 8) + this.z;\n            },\n            set: function (value) {\n                this.x = (value & 0xFF0000) >> 16;\n                this.y = (value & 0x00FF00) >> 8;\n                this.z = (value & 0x0000FF);\n                this.w = (value & 0xFF000000) >> 24;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        TweenValue.prototype.getField = function (index) {\n            switch (index) {\n                case 0:\n                    return this.x;\n                case 1:\n                    return this.y;\n                case 2:\n                    return this.z;\n                case 3:\n                    return this.w;\n                default:\n                    throw new Error(\"Index out of bounds: \" + index);\n            }\n        };\n        TweenValue.prototype.setField = function (index, value) {\n            switch (index) {\n                case 0:\n                    this.x = value;\n                    break;\n                case 1:\n                    this.y = value;\n                    break;\n                case 2:\n                    this.z = value;\n                    break;\n                case 3:\n                    this.w = value;\n                    break;\n                default:\n                    throw new Error(\"Index out of bounds: \" + index);\n            }\n        };\n        TweenValue.prototype.setZero = function () {\n            this.x = this.y = this.z = this.w = 0;\n        };\n        return TweenValue;\n    }());\n    fgui.TweenValue = TweenValue;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ByteBuffer = (function (_super_1) {\n        __extends(ByteBuffer, _super_1);\n        function ByteBuffer(buffer, bufferExtSize) {\n            var _this = _super_1.call(this, buffer, bufferExtSize) || this;\n            _this.version = 0;\n            return _this;\n        }\n        ByteBuffer.prototype.skip = function (count) {\n            this.position += count;\n        };\n        ByteBuffer.prototype.readBool = function () {\n            return this.readByte() == 1;\n        };\n        ByteBuffer.prototype.readS = function () {\n            var index = this.readUnsignedShort();\n            if (index == 65534)\n                return null;\n            else if (index == 65533)\n                return \"\";\n            else\n                return this.stringTable[index];\n        };\n        ByteBuffer.prototype.readSArray = function (cnt) {\n            var ret = new Array(cnt);\n            for (var i = 0; i < cnt; i++)\n                ret[i] = this.readS();\n            return ret;\n        };\n        ByteBuffer.prototype.writeS = function (value) {\n            var index = this.readUnsignedShort();\n            if (index != 65534 && index != 65533)\n                this.stringTable[index] = value;\n        };\n        ByteBuffer.prototype.readColor = function (hasAlpha) {\n            var r = this.readUnsignedByte();\n            var g = this.readUnsignedByte();\n            var b = this.readUnsignedByte();\n            var a = this.readUnsignedByte();\n            return (hasAlpha ? (a << 24) : 0) + (r << 16) + (g << 8) + b;\n        };\n        ByteBuffer.prototype.readChar = function () {\n            var i = this.readUnsignedShort();\n            return String.fromCharCode(i);\n        };\n        ByteBuffer.prototype.readBuffer = function () {\n            var count = this.readUnsignedInt();\n            var ba = new ByteBuffer(new Uint8Array(this.buffer, this.position, count));\n            ba.stringTable = this.stringTable;\n            ba.version = this.version;\n            this.position += count;\n            return ba;\n        };\n        ByteBuffer.prototype.seek = function (indexTablePos, blockIndex) {\n            var tmp = this.position;\n            this.position = indexTablePos;\n            var segCount = this.readByte();\n            if (blockIndex < segCount) {\n                var useShort = this.readByte() == 1;\n                var newPos;\n                if (useShort) {\n                    this.position += 2 * blockIndex;\n                    newPos = this.readUnsignedShort();\n                }\n                else {\n                    this.position += 4 * blockIndex;\n                    newPos = this.readUnsignedInt();\n                }\n                if (newPos > 0) {\n                    this.position = indexTablePos + newPos;\n                    return true;\n                }\n                else {\n                    this.position = tmp;\n                    return false;\n                }\n            }\n            else {\n                this.position = tmp;\n                return false;\n            }\n        };\n        return ByteBuffer;\n    }(egret.ByteArray));\n    fgui.ByteBuffer = ByteBuffer;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ColorMatrix = (function () {\n        function ColorMatrix(p_brightness, p_contrast, p_saturation, p_hue) {\n            this.matrix = new Array(LENGTH);\n            this.reset();\n            if (p_brightness !== undefined || p_contrast !== undefined || p_saturation !== undefined || p_hue !== undefined)\n                this.adjustColor(p_brightness, p_contrast, p_saturation, p_hue);\n        }\n        ColorMatrix.prototype.reset = function () {\n            for (var i = 0; i < LENGTH; i++) {\n                this.matrix[i] = IDENTITY_MATRIX[i];\n            }\n        };\n        ColorMatrix.prototype.invert = function () {\n            this.multiplyMatrix([-1, 0, 0, 0, 255,\n                0, -1, 0, 0, 255,\n                0, 0, -1, 0, 255,\n                0, 0, 0, 1, 0]);\n        };\n        ColorMatrix.prototype.adjustColor = function (p_brightness, p_contrast, p_saturation, p_hue) {\n            this.adjustHue(p_hue || 0);\n            this.adjustContrast(p_contrast || 0);\n            this.adjustBrightness(p_brightness || 0);\n            this.adjustSaturation(p_saturation || 0);\n        };\n        ColorMatrix.prototype.adjustBrightness = function (p_val) {\n            p_val = this.cleanValue(p_val, 1) * 255;\n            this.multiplyMatrix([\n                1, 0, 0, 0, p_val,\n                0, 1, 0, 0, p_val,\n                0, 0, 1, 0, p_val,\n                0, 0, 0, 1, 0\n            ]);\n        };\n        ColorMatrix.prototype.adjustContrast = function (p_val) {\n            p_val = this.cleanValue(p_val, 1);\n            var s = p_val + 1;\n            var o = 128 * (1 - s);\n            this.multiplyMatrix([\n                s, 0, 0, 0, o,\n                0, s, 0, 0, o,\n                0, 0, s, 0, o,\n                0, 0, 0, 1, 0\n            ]);\n        };\n        ColorMatrix.prototype.adjustSaturation = function (p_val) {\n            p_val = this.cleanValue(p_val, 1);\n            p_val += 1;\n            var invSat = 1 - p_val;\n            var invLumR = invSat * LUMA_R;\n            var invLumG = invSat * LUMA_G;\n            var invLumB = invSat * LUMA_B;\n            this.multiplyMatrix([\n                (invLumR + p_val), invLumG, invLumB, 0, 0,\n                invLumR, (invLumG + p_val), invLumB, 0, 0,\n                invLumR, invLumG, (invLumB + p_val), 0, 0,\n                0, 0, 0, 1, 0\n            ]);\n        };\n        ColorMatrix.prototype.adjustHue = function (p_val) {\n            p_val = this.cleanValue(p_val, 1);\n            p_val *= Math.PI;\n            var cos = Math.cos(p_val);\n            var sin = Math.sin(p_val);\n            this.multiplyMatrix([\n                ((LUMA_R + (cos * (1 - LUMA_R))) + (sin * -(LUMA_R))), ((LUMA_G + (cos * -(LUMA_G))) + (sin * -(LUMA_G))), ((LUMA_B + (cos * -(LUMA_B))) + (sin * (1 - LUMA_B))), 0, 0,\n                ((LUMA_R + (cos * -(LUMA_R))) + (sin * 0.143)), ((LUMA_G + (cos * (1 - LUMA_G))) + (sin * 0.14)), ((LUMA_B + (cos * -(LUMA_B))) + (sin * -0.283)), 0, 0,\n                ((LUMA_R + (cos * -(LUMA_R))) + (sin * -((1 - LUMA_R)))), ((LUMA_G + (cos * -(LUMA_G))) + (sin * LUMA_G)), ((LUMA_B + (cos * (1 - LUMA_B))) + (sin * LUMA_B)), 0, 0,\n                0, 0, 0, 1, 0\n            ]);\n        };\n        ColorMatrix.prototype.concat = function (p_matrix) {\n            if (p_matrix.length != LENGTH) {\n                return;\n            }\n            this.multiplyMatrix(p_matrix);\n        };\n        ColorMatrix.prototype.clone = function () {\n            var result = new ColorMatrix();\n            result.copyMatrix(this.matrix);\n            return result;\n        };\n        ColorMatrix.prototype.copyMatrix = function (p_matrix) {\n            var l = LENGTH;\n            for (var i = 0; i < l; i++) {\n                this.matrix[i] = p_matrix[i];\n            }\n        };\n        ColorMatrix.prototype.multiplyMatrix = function (p_matrix) {\n            var col = [];\n            var i = 0;\n            for (var y = 0; y < 4; ++y) {\n                for (var x = 0; x < 5; ++x) {\n                    col[i + x] = p_matrix[i] * this.matrix[x] +\n                        p_matrix[i + 1] * this.matrix[x + 5] +\n                        p_matrix[i + 2] * this.matrix[x + 10] +\n                        p_matrix[i + 3] * this.matrix[x + 15] +\n                        (x == 4 ? p_matrix[i + 4] : 0);\n                }\n                i += 5;\n            }\n            this.copyMatrix(col);\n        };\n        ColorMatrix.prototype.cleanValue = function (p_val, p_limit) {\n            return Math.min(p_limit, Math.max(-p_limit, p_val));\n        };\n        return ColorMatrix;\n    }());\n    fgui.ColorMatrix = ColorMatrix;\n    var IDENTITY_MATRIX = [\n        1, 0, 0, 0, 0,\n        0, 1, 0, 0, 0,\n        0, 0, 1, 0, 0,\n        0, 0, 0, 1, 0\n    ];\n    var LENGTH = IDENTITY_MATRIX.length;\n    var LUMA_R = 0.299;\n    var LUMA_G = 0.587;\n    var LUMA_B = 0.114;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GTimers = (function () {\n        function GTimers() {\n            this._enumI = 0;\n            this._enumCount = 0;\n            this._lastTime = 0;\n            this._items = new Array();\n            this._itemPool = new Array();\n            this._lastTime = egret.getTimer();\n            GTimers.time = this._lastTime;\n            egret.startTick(this.__timer, this);\n        }\n        GTimers.prototype.getItem = function () {\n            if (this._itemPool.length)\n                return this._itemPool.pop();\n            else\n                return new TimerItem();\n        };\n        GTimers.prototype.findItem = function (callback, thisObj) {\n            var len = this._items.length;\n            for (var i = 0; i < len; i++) {\n                var item = this._items[i];\n                if (item.callback == callback && item.thisObj == thisObj)\n                    return item;\n            }\n            return null;\n        };\n        GTimers.prototype.add = function (delayInMiniseconds, repeat, callback, thisObj, callbackParam) {\n            var item = this.findItem(callback, thisObj);\n            if (!item) {\n                item = this.getItem();\n                item.callback = callback;\n                item.hasParam = callback.length == 1;\n                item.thisObj = thisObj;\n                this._items.push(item);\n            }\n            item.delay = delayInMiniseconds;\n            item.counter = 0;\n            item.repeat = repeat;\n            item.param = callbackParam;\n            item.end = false;\n        };\n        GTimers.prototype.callLater = function (callback, thisObj, callbackParam) {\n            this.add(1, 1, callback, thisObj, callbackParam);\n        };\n        GTimers.prototype.callDelay = function (delay, callback, thisObj, callbackParam) {\n            this.add(delay, 1, callback, thisObj, callbackParam);\n        };\n        GTimers.prototype.exists = function (callback, thisObj) {\n            var item = this.findItem(callback, thisObj);\n            return item != null;\n        };\n        GTimers.prototype.remove = function (callback, thisObj) {\n            var item = this.findItem(callback, thisObj);\n            if (item) {\n                var i = this._items.indexOf(item);\n                this._items.splice(i, 1);\n                if (i < this._enumI)\n                    this._enumI--;\n                this._enumCount--;\n                item.reset();\n                this._itemPool.push(item);\n            }\n        };\n        GTimers.prototype.__timer = function (timeStamp) {\n            GTimers.time = timeStamp;\n            GTimers.deltaTime = timeStamp - this._lastTime;\n            this._lastTime = timeStamp;\n            this._enumI = 0;\n            this._enumCount = this._items.length;\n            while (this._enumI < this._enumCount) {\n                var item = this._items[this._enumI];\n                this._enumI++;\n                if (item.advance(GTimers.deltaTime)) {\n                    if (item.end) {\n                        this._enumI--;\n                        this._enumCount--;\n                        this._items.splice(this._enumI, 1);\n                    }\n                    if (item.hasParam)\n                        item.callback.call(item.thisObj, item.param);\n                    else\n                        item.callback.call(item.thisObj);\n                    if (item.end) {\n                        item.reset();\n                        this._itemPool.push(item);\n                    }\n                }\n            }\n            return false;\n        };\n        GTimers.deltaTime = 0;\n        GTimers.time = 0;\n        GTimers.inst = new GTimers();\n        return GTimers;\n    }());\n    fgui.GTimers = GTimers;\n    var TimerItem = (function () {\n        function TimerItem() {\n            this.delay = 0;\n            this.counter = 0;\n            this.repeat = 0;\n        }\n        TimerItem.prototype.advance = function (elapsed) {\n            this.counter += elapsed;\n            if (this.counter >= this.delay) {\n                this.counter -= this.delay;\n                if (this.counter > this.delay)\n                    this.counter = this.delay;\n                if (this.repeat > 0) {\n                    this.repeat--;\n                    if (this.repeat == 0)\n                        this.end = true;\n                }\n                return true;\n            }\n            else\n                return false;\n        };\n        TimerItem.prototype.reset = function () {\n            this.callback = null;\n            this.thisObj = null;\n            this.param = null;\n        };\n        return TimerItem;\n    }());\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var UBBParser = (function () {\n        function UBBParser() {\n            this._readPos = 0;\n            this.smallFontSize = 12;\n            this.normalFontSize = 14;\n            this.largeFontSize = 16;\n            this.defaultImgWidth = 0;\n            this.defaultImgHeight = 0;\n            this._handlers = {};\n            this._handlers[\"url\"] = this.onTag_URL;\n            this._handlers[\"img\"] = this.onTag_IMG;\n            this._handlers[\"b\"] = this.onTag_Simple;\n            this._handlers[\"i\"] = this.onTag_Simple;\n            this._handlers[\"u\"] = this.onTag_Simple;\n            this._handlers[\"sup\"] = this.onTag_Simple;\n            this._handlers[\"sub\"] = this.onTag_Simple;\n            this._handlers[\"color\"] = this.onTag_COLOR;\n            this._handlers[\"font\"] = this.onTag_FONT;\n            this._handlers[\"size\"] = this.onTag_SIZE;\n        }\n        UBBParser.prototype.onTag_URL = function (tagName, end, attr) {\n            if (!end) {\n                if (attr != null)\n                    return \"<a href=\\\"\" + attr + \"\\\" target=\\\"_blank\\\">\";\n                else {\n                    var href = this.getTagText();\n                    return \"<a href=\\\"\" + href + \"\\\" target=\\\"_blank\\\">\";\n                }\n            }\n            else\n                return \"</a>\";\n        };\n        UBBParser.prototype.onTag_IMG = function (tagName, end, attr) {\n            if (!end) {\n                var src = this.getTagText(true);\n                if (!src)\n                    return null;\n                if (this.defaultImgWidth)\n                    return \"<img src=\\\"\" + src + \"\\\" width=\\\"\" + this.defaultImgWidth + \"\\\" height=\\\"\" + this.defaultImgHeight + \"\\\"/>\";\n                else\n                    return \"<img src=\\\"\" + src + \"\\\"/>\";\n            }\n            else\n                return null;\n        };\n        UBBParser.prototype.onTag_Simple = function (tagName, end, attr) {\n            return end ? (\"</\" + tagName + \">\") : (\"<\" + tagName + \">\");\n        };\n        UBBParser.prototype.onTag_COLOR = function (tagName, end, attr) {\n            if (!end)\n                return \"<font color=\\\"\" + attr + \"\\\">\";\n            else\n                return \"</font>\";\n        };\n        UBBParser.prototype.onTag_FONT = function (tagName, end, attr) {\n            if (!end)\n                return \"<font face=\\\"\" + attr + \"\\\">\";\n            else\n                return \"</font>\";\n        };\n        UBBParser.prototype.onTag_SIZE = function (tagName, end, attr) {\n            if (!end) {\n                if (attr == \"normal\")\n                    attr = \"\" + this.normalFontSize;\n                else if (attr == \"small\")\n                    attr = \"\" + this.smallFontSize;\n                else if (attr == \"large\")\n                    attr = \"\" + this.largeFontSize;\n                else if (attr.length && attr.charAt(0) == \"+\")\n                    attr = \"\" + (this.smallFontSize + parseInt(attr.substr(1)));\n                else if (attr.length && attr.charAt(0) == \"-\")\n                    attr = \"\" + (this.smallFontSize - parseInt(attr.substr(1)));\n                return \"<font size=\\\"\" + attr + \"\\\">\";\n            }\n            else\n                return \"</font>\";\n        };\n        UBBParser.prototype.getTagText = function (remove) {\n            if (remove === void 0) { remove = false; }\n            var pos1 = this._readPos;\n            var pos2;\n            var result = \"\";\n            while ((pos2 = this._text.indexOf(\"[\", pos1)) != -1) {\n                if (this._text.charCodeAt(pos2 - 1) == 92) {\n                    result += this._text.substring(pos1, pos2 - 1);\n                    result += \"[\";\n                    pos1 = pos2 + 1;\n                }\n                else {\n                    result += this._text.substring(pos1, pos2);\n                    break;\n                }\n            }\n            if (pos2 == -1)\n                return null;\n            if (remove)\n                this._readPos = pos2;\n            return result;\n        };\n        UBBParser.prototype.parse = function (text, remove) {\n            this._text = text;\n            var pos1 = 0, pos2, pos3;\n            var end;\n            var tag, attr;\n            var repl;\n            var func;\n            var result = \"\";\n            while ((pos2 = this._text.indexOf(\"[\", pos1)) != -1) {\n                if (pos2 > 0 && this._text.charCodeAt(pos2 - 1) == 92) {\n                    result += this._text.substring(pos1, pos2 - 1);\n                    result += \"[\";\n                    pos1 = pos2 + 1;\n                    continue;\n                }\n                result += this._text.substring(pos1, pos2);\n                pos1 = pos2;\n                pos2 = this._text.indexOf(\"]\", pos1);\n                if (pos2 == -1)\n                    break;\n                end = this._text.charAt(pos1 + 1) == '/';\n                tag = this._text.substring(end ? pos1 + 2 : pos1 + 1, pos2);\n                this._readPos = pos2 + 1;\n                attr = null;\n                repl = null;\n                pos3 = tag.indexOf(\"=\");\n                if (pos3 != -1) {\n                    attr = tag.substring(pos3 + 1);\n                    tag = tag.substring(0, pos3);\n                }\n                tag = tag.toLowerCase();\n                func = this._handlers[tag];\n                if (func != null) {\n                    if (!remove) {\n                        repl = func.call(this, tag, end, attr);\n                        if (repl != null)\n                            result += repl;\n                    }\n                }\n                else\n                    result += this._text.substring(pos1, this._readPos);\n                pos1 = this._readPos;\n            }\n            if (pos1 < this._text.length)\n                result += this._text.substr(pos1);\n            this._text = null;\n            return result;\n        };\n        UBBParser.inst = new UBBParser();\n        return UBBParser;\n    }());\n    fgui.UBBParser = UBBParser;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ToolSet = (function () {\n        function ToolSet() {\n        }\n        ToolSet.startsWith = function (source, str, ignoreCase) {\n            if (!source)\n                return false;\n            else if (source.length < str.length)\n                return false;\n            else {\n                source = source.substring(0, str.length);\n                if (!ignoreCase)\n                    return source == str;\n                else\n                    return source.toLowerCase() == str.toLowerCase();\n            }\n        };\n        ToolSet.trimRight = function (targetString) {\n            var tempChar = \"\";\n            for (var i = targetString.length - 1; i >= 0; i--) {\n                tempChar = targetString.charAt(i);\n                if (tempChar != \" \" && tempChar != \"\\n\" && tempChar != \"\\r\") {\n                    break;\n                }\n            }\n            return targetString.substring(0, i + 1);\n        };\n        ToolSet.convertToHtmlColor = function (argb, hasAlpha) {\n            var alpha;\n            if (hasAlpha)\n                alpha = (argb >> 24 & 0xFF).toString(16);\n            else\n                alpha = \"\";\n            var red = (argb >> 16 & 0xFF).toString(16);\n            var green = (argb >> 8 & 0xFF).toString(16);\n            var blue = (argb & 0xFF).toString(16);\n            if (alpha.length == 1)\n                alpha = \"0\" + alpha;\n            if (red.length == 1)\n                red = \"0\" + red;\n            if (green.length == 1)\n                green = \"0\" + green;\n            if (blue.length == 1)\n                blue = \"0\" + blue;\n            return \"#\" + alpha + red + green + blue;\n        };\n        ToolSet.convertFromHtmlColor = function (str, hasAlpha) {\n            if (str.length < 1)\n                return 0;\n            if (str.charAt(0) == \"#\")\n                str = str.substr(1);\n            if (str.length == 8)\n                return (parseInt(str.substr(0, 2), 16) << 24) + parseInt(str.substr(2), 16);\n            else if (hasAlpha)\n                return 0xFF000000 + parseInt(str, 16);\n            else\n                return parseInt(str, 16);\n        };\n        ToolSet.displayObjectToGObject = function (obj) {\n            while (obj && !(obj instanceof egret.Stage)) {\n                if (obj[\"$owner\"])\n                    return fgui.GObject.cast(obj);\n                obj = obj.parent;\n            }\n            return null;\n        };\n        ToolSet.encodeHTML = function (str) {\n            if (!str)\n                return \"\";\n            else\n                return str.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\")\n                    .replace(/>/g, \"&gt;\").replace(/'/g, \"&apos;\").replace(/\"/g, \"&quot;\");\n        };\n        ToolSet.clamp = function (value, min, max) {\n            if (value < min)\n                value = min;\n            else if (value > max)\n                value = max;\n            return value;\n        };\n        ToolSet.clamp01 = function (value) {\n            if (value > 1)\n                value = 1;\n            else if (value < 0)\n                value = 0;\n            return value;\n        };\n        ToolSet.lerp = function (start, end, percent) {\n            return (start + percent * (end - start));\n        };\n        ToolSet.repeat = function (t, length) {\n            return t - Math.floor(t / length) * length;\n        };\n        ToolSet.distance = function (x1, y1, x2, y2) {\n            return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));\n        };\n        ToolSet.fillPath = function (ctx, points, px, py) {\n            var cnt = points.length;\n            ctx.moveTo(points[0] + px, points[1] + py);\n            for (var i = 2; i < cnt; i += 2)\n                ctx.lineTo(points[i] + px, points[i + 1] + py);\n            ctx.lineTo(points[0] + px, points[1] + py);\n        };\n        ToolSet.setColorFilter = function (obj, color) {\n            var filter = obj.$_colorFilter_;\n            var filters = obj.filters;\n            var toApplyColor;\n            var toApplyGray;\n            var tp = typeof (color);\n            if (tp == \"boolean\") {\n                toApplyColor = filter ? filter.$_color_ : null;\n                toApplyGray = color;\n            }\n            else {\n                toApplyColor = color == 0xFFFFFF ? null : color;\n                toApplyGray = filter ? filter.$_grayed_ : false;\n            }\n            if ((!toApplyColor && toApplyColor !== 0) && !toApplyGray) {\n                if (filters && filter) {\n                    var i = filters.indexOf(filter);\n                    if (i != -1) {\n                        filters.splice(i, 1);\n                        if (filters.length > 0)\n                            obj.filters = filters;\n                        else\n                            obj.filters = null;\n                    }\n                }\n                return;\n            }\n            if (!filter) {\n                filter = new egret.ColorMatrixFilter();\n                obj.$_colorFilter_ = filter;\n            }\n            if (!filters)\n                filters = [filter];\n            else {\n                var i_1 = filters.indexOf(filter);\n                if (i_1 == -1)\n                    filters.push(filter);\n            }\n            obj.filters = filters;\n            filter.$_color_ = toApplyColor;\n            filter.$_grayed_ = toApplyGray;\n            var mat = filter.matrix;\n            if (toApplyGray) {\n                for (var i_2 = 0; i_2 < 20; i_2++)\n                    mat[i_2] = grayScaleMatrix[i_2];\n            }\n            else if (toApplyColor instanceof Array) {\n                getColorMatrix(toApplyColor[0], toApplyColor[1], toApplyColor[2], toApplyColor[3], mat);\n            }\n            else {\n                for (var i_3 = 0; i_3 < 20; i_3++) {\n                    mat[i_3] = (i_3 == 0 || i_3 == 6 || i_3 == 12 || i_3 == 18) ? 1 : 0;\n                }\n                mat[0] = ((color >> 16) & 0xFF) / 255;\n                mat[6] = ((color >> 8) & 0xFF) / 255;\n                mat[12] = (color & 0xFF) / 255;\n            }\n            filter.matrix = mat;\n        };\n        return ToolSet;\n    }());\n    fgui.ToolSet = ToolSet;\n    var grayScaleMatrix = [\n        0.3, 0.6, 0, 0, 0,\n        0.3, 0.6, 0, 0, 0,\n        0.3, 0.6, 0, 0, 0,\n        0, 0, 0, 1, 0\n    ];\n    var helper = new fgui.ColorMatrix();\n    function getColorMatrix(p_brightness, p_contrast, p_saturation, p_hue, result) {\n        if (!result)\n            result = new Array(fgui.ColorMatrix.length);\n        helper.reset();\n        helper.adjustColor(p_brightness, p_contrast, p_saturation, p_hue);\n        helper.matrix.forEach(function (e, i) { return result[i] = e; });\n    }\n})(fgui || (fgui = {}));\n"
  },
  {
    "path": "demo/libs/modules/assetsmanager/assetsmanager.d.ts",
    "content": "declare namespace RES {\n    /**\n     * Version control loading interface\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/version/VersionControl.ts\n     * @language en_US\n     */\n    /**\n     * 版本控制加载的接口\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/version/VersionControl.ts\n     * @language zh_CN\n     */\n    interface IVersionController {\n        /**\n         * Get the version information data.<br/>\n         * Before calling this method requires the application of any resource load, we recommend starting at the application entry class (Main) The first call processing. This method is only responsible for acquiring version information, is not responsible for downloaded resources.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取版本信息数据。<br/>\n         * 这个方法的调用需要在应用程序进行任何资源加载之前，建议在应用程序的入口类（Main）的开始最先进行调用处理。此方法只负责获取版本信息，不负责资源的下载。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        init(): Promise<any>;\n        /**\n         * Get the actual URL of the resource file.<br/>\n         * Because this method needs to be called to control the actual version of the URL have the original resource files were changed, so would like to get the specified resource file the actual URL.<br/>\n         * In the development and debugging phase, this method will directly return value passed.\n         * @param url Url used in the game\n         * @returns Actual loaded url\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取资源文件实际的URL地址。<br/>\n         * 由于版本控制实际已经对原来的资源文件的URL进行了改变，因此想获取指定资源文件实际的URL时需要调用此方法。<br/>\n         * 在开发调试阶段，这个方法会直接返回传入的参数值。\n         * @param url 游戏中使用的url\n         * @returns 实际加载的url\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getVirtualUrl(url: string): string;\n    }\n    /**\n     * Manage version control class\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @event egret.Event.COMPLETE Version control loading is complete when thrown\n     * @event egret.IOErrorEvent.IO_ERROR Version control failed to load when thrown\n     * @includeExample extension/version/VersionControl.ts\n     * @language en_US\n     */\n    /**\n     * 管理版本控制的类\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @event egret.Event.COMPLETE 版本控制加载完成时抛出\n     * @event egret.IOErrorEvent.IO_ERROR 版本控制加载失败时抛出\n     * @includeExample extension/version/VersionControl.ts\n     * @language zh_CN\n     */\n    interface VersionController extends IVersionController {\n    }\n    /**\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    let VersionController: {\n        /**\n         * Constructor initialization\n         * @language en_US\n         */\n        /**\n         * 初始化构造函数\n         * @language zh_CN\n         */\n        new (): VersionController;\n    };\n}\ndeclare type ResourceRootSelector<T extends string> = () => T;\ndeclare type ResourceNameSelector = (file: string) => string;\ndeclare type ResourceMergerSelector = (file: string) => {\n    path: string;\n    alias: string;\n};\ndeclare module RES {\n    /**\n     * Get resource information through file path\n     * @param path file path\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 通过文件路径获取资源信息\n     * @param path 文件路径\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getResourceInfo(path: string): File | null;\n    /**\n    * @private\n    */\n    interface ResourceInfo {\n        url: string;\n        type: string;\n        root: string;\n        crc32?: string;\n        size?: number;\n        extra?: 1 | undefined;\n        name: string;\n        soundType?: string;\n        scale9grid?: string;\n        groupNames?: string[];\n        promise?: Promise<any>;\n    }\n    /**\n    * @private\n    */\n    interface Data {\n        resourceRoot: string;\n        mergeSelector: ResourceMergerSelector | null;\n        fileSystem: FileSystem;\n        groups: {\n            [groupName: string]: string[];\n        };\n        alias: {\n            [aliasName: string]: string;\n        };\n        loadGroup: string[];\n    }\n    /**\n     * @class RES.ResourceConfig\n     * @classdesc\n     * @private\n     */\n    class ResourceConfig {\n        config: Data;\n        constructor();\n        init(): Promise<any>;\n        /**\n         * 根据组名获取组加载项列表\n         * @method RES.ResourceConfig#getGroupByName\n         * @param name {string} 组名\n         * @returns {Array<egret.ResourceItem>}\n         */\n        getGroupByName(name: string): ResourceInfo[];\n        __temp__get__type__via__url(url_or_alias: string): string;\n        getResourceWithSubkey(key: string): {\n            r: ResourceInfo;\n            key: string;\n            subkey: string;\n        } | null;\n        getKeyByAlias(aliasName: string): string;\n        getResource(path_or_alias: string): ResourceInfo | null;\n        /**\n         * 创建自定义的加载资源组,注意：此方法仅在资源配置文件加载完成后执行才有效。\n         * 可以监听ResourceEvent.CONFIG_COMPLETE事件来确认配置加载完成。\n         * @method RES.ResourceConfig#createGroup\n         * @param name {string} 要创建的加载资源组的组名\n         * @param keys {egret.Array<string>} 要包含的键名列表，key对应配置文件里的name属性或sbuKeys属性的一项或一个资源组名。\n         * @param override {boolean} 是否覆盖已经存在的同名资源组,默认false。\n         * @returns {boolean}\n         */\n        createGroup(name: string, keys: Array<string>, override?: boolean): boolean;\n        /**\n         * 添加一个二级键名到配置列表。\n         * @method RES.ResourceConfig#addSubkey\n         * @param subkey {string} 要添加的二级键名\n         * @param name {string} 二级键名所属的资源name属性\n         */\n        addSubkey(subkey: string, name: string): void;\n        addAlias(alias: any, key: any): void;\n        addResourceData(data: {\n            name: string;\n            type: string;\n            url: string;\n            root?: string;\n            extra?: 1 | undefined;\n        }): void;\n        removeResourceData(data: {\n            name: string;\n            type?: string;\n            url: string;\n            root?: string;\n            extra?: 1 | undefined;\n        }): void;\n    }\n}\ndeclare module RES {\n    /**\n     * @class RES.ResourceLoader\n     * @classdesc\n     * @private\n     */\n    class ResourceLoader {\n        /**\n         * 当前组加载的项总个数,key为groupName\n         */\n        private groupTotalDic;\n        /**\n         * 已经加载的项个数,key为groupName\n         */\n        private numLoadedDic;\n        /**\n         * 加载失败的组,key为groupName\n         */\n        private groupErrorDic;\n        private retryTimesDic;\n        maxRetryTimes: number;\n        private reporterDic;\n        private dispatcherDic;\n        private failedList;\n        private loadItemErrorDic;\n        private errorDic;\n        /**\n         * 资源优先级队列，key为资源，value为优先级\n         */\n        private itemListPriorityDic;\n        /**\n         * 资源是否在加载\n         */\n        private itemLoadDic;\n        private promiseHash;\n        /**\n         * 延迟加载队列,getResByUrl ,getResAsync等方法存储队列\n         */\n        private lazyLoadList;\n        pushResItem(resInfo: ResourceInfo): Promise<any>;\n        /**\n         * 加载队列,存储组的队列\n         */\n        pushResGroup(list: ResourceInfo[], groupName: string, priority: number, reporter?: PromiseTaskReporter): Promise<any>;\n        /**\n         * 更新组的优先级顺序\n         * @param list 存储数据的队列\n         * @param priority 优先级\n         */\n        private updatelistPriority(list, priority);\n        /**\n         * 搜索单项资源的优先级\n         * @param item 单项资源\n         */\n        private findPriorityInDic(item);\n        private loadingCount;\n        /**\n         * 最大线程数目\n         */\n        thread: number;\n        /**\n         * 加载下一项资源，线程控制\n         */\n        private loadNextResource();\n        /**\n         * 加载单向资源\n         */\n        private loadSingleResource();\n        /**\n         * 获取下一个待加载项\n         */\n        private getOneResourceInfoInGroup();\n        /**\n         * 设置组的加载进度，同时返回当前组是否加载完成\n         * @param groupName 组名\n         * @param r 加载完成的资源\n         */\n        private setGroupProgress(groupName, r);\n        /**\n         * 加载组的最后一项，同时派发事件\n         * @param groupName 组名\n         * @param lastError 最后一项是否成功，此项为错误信息\n         */\n        private loadGroupEnd(groupName, lastError?);\n        /**\n         * 删除事件派发器，Promise的缓存，返回事件派发器\n         * @param groupName 组名或是root+name\n         */\n        private deleteDispatcher(groupName);\n        /**\n         * 加载资源\n         * @param r 资源信息\n         * @param p 加载处理器\n         */\n        private loadResource(r, p?);\n        /**\n         * 释放资源\n         * @param r 资源信息\n         */\n        unloadResource(r: ResourceInfo): boolean;\n    }\n}\ndeclare module RES {\n}\ndeclare module RES {\n    type GetResAsyncCallback = (value?: any, key?: string) => any;\n    /**\n    * Convert the file name of the resource to the Key value used in the project.\n    * @param url Resource Name.\n    * @returns The key value used in the project\n    * @version Egret 5.2\n    * @platform Web,Native\n    * @language en_US\n    */\n    /**\n     * 将资源的文件名称转换为项目中所使用的Key值。\n     * 在加载合并图集的时候使用，例如图集加载A_json，需要加载对应A_png，这里就是转换的机制\n     * 一般项目中无需更改，只有没有使用默认的key和文件对应的需要修改\n     * @param url 资源名称。\n     * @returns 项目中所用的key值\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function nameSelector(url: any): string;\n    /**\n    * Get the read type of the file.\n    * When using getResByUrl does not specify the type of the read file, it will find the corresponding type according to this method.\n    * File types not found are loaded by default in binary format\n    * @param path file path.\n    * @returns Processor type used to read the file\n    * @version Egret 5.2\n    * @platform Web,Native\n    * @language en_US\n    */\n    /**\n     * 获取文件的读取类型\n     * 在使用getResByUrl没有指定读取文件的类型，会根据这个方法寻找对应的类型\n     * 没有查找到的文件类型以二进制格式默认加载\n     * @param path 文件路径\n     * @returns 读取文件所用的Processor类型\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function typeSelector(path: string): string;\n    /**\n     * Conduct mapping injection with class definition as the value, Deprecated.\n     * @deprecated\n     * @see RES.processor.map\n     * @language en_US\n     */\n    /**\n     * 以类定义为值进行映射注入，已废弃。\n     * @deprecated\n     * @see RES.processor.map\n     * @language zh_CN\n     */\n    function registerAnalyzer(type: string, analyzerClass: any): void;\n    /**\n    * Set whether it is compatible mode\n    * When the value is true, the assetsManager will output the design of Res. When it is false, all the loaded resources will be returned as promises.\n    * The default is false, run in strict assetsManager mode\n    * @version Egret 5.2.9\n    * @platform Web,Native\n    * @language en_US\n    */\n    /**\n     * 设置是否为兼容模式\n     * 当值为true时，assetsManager会以Res的设计输出，当为false时候，所有的加载资源都会以promise的方式返回\n     * 默认是false，以严格assetsManager方式运行\n     * @version Egret 5.2.9\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function setIsCompatible(value: boolean): void;\n    /**\n     * Load configuration file and parse.\n     * @param url The url address of the resource config\n     * @param resourceRoot The root address of the resource config\n     * @returns Promise\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 加载配置文件并解析。\n     * @param url 资源配置的url地址\n     * @param resourceRoot 资源配置的根地址\n     * @returns Promise\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function loadConfig(url: string, resourceRoot: string): Promise<void>;\n    /**\n     * Load a set of resources according to the group name.\n     * @param name Group name to load the resource group.\n     * @param priority Load priority can be negative, the default value is 0.\n     * <br>A low priority group must wait for the high priority group to complete the end of the load to start, and the same priority group will be loaded at the same time.\n     * @param reporter Resource group loading progress prompt\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 根据组名加载一组资源。\n     * @param name 要加载资源组的组名。\n     * @param priority 加载优先级,可以为负数,默认值为 0。\n     * <br>低优先级的组必须等待高优先级组完全加载结束才能开始，同一优先级的组会同时加载。\n     * @param reporter 资源组的加载进度提示\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function loadGroup(name: string, priority?: number, reporter?: PromiseTaskReporter): Promise<void>;\n    /**\n     * Check whether a resource group has been loaded.\n     * @param name Group name。\n     * @returns Is loading or not.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 检查某个资源组是否已经加载完成。\n     * @param name 组名。\n     * @returns 是否正在加载。\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function isGroupLoaded(name: string): boolean;\n    /**\n     * A list of groups of loading is obtained according to the group name.\n     * @param name Group name.\n     * @returns The resource item array of group.\n     * @see RES.ResourceItem\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 根据组名获取组加载项列表。\n     * @param name 组名。\n     * @returns 加载项列表。\n     * @see RES.ResourceItem\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getGroupByName(name: string): Array<ResourceItem>;\n    /**\n     * Create a custom load resource group, note that this method is valid only after the resource configuration file is loaded.\n     * <br>You can monitor the ResourceEvent.CONFIG_COMPLETE event to verify that the configuration is complete.\n     * @param name Group name to create the load resource group.\n     * @param keys To be included in the list of key keys, the corresponding configuration file in the name or sbuKeys property one or a resource group name.\n     * @param override Is the default false for the same name resource group already exists.\n     * @returns Create success or fail.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 创建自定义的加载资源组,注意：此方法仅在资源配置文件加载完成后执行才有效。\n     * <br>可以监听 ResourceEvent.CONFIG_COMPLETE 事件来确认配置加载完成。\n     * @param name 要创建的加载资源组的组名。\n     * @param keys 要包含的键名列表，key 对应配置文件里的 name 属性或 sbuKeys 属性的一项或一个资源组名。\n     * @param override 是否覆盖已经存在的同名资源组,默认 false。\n     * @returns 是否创建成功。\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function createGroup(name: string, keys: Array<string>, override?: boolean): boolean;\n    /**\n     * Check whether the configuration file contains the specified resources.\n     * @param key A sbuKeys attribute or name property in a configuration file.\n     * @returns Whether you have the specified resource\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 检查配置文件里是否含有指定的资源。\n     * @param key 对应配置文件里的 name 属性或 sbuKeys 属性的一项。\n     * @returns 是否拥有指定资源\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function hasRes(key: string): boolean;\n    /**\n     * The synchronization method for obtaining the cache has been loaded with the success of the resource.\n     * <br>The type of resource and the corresponding return value types are as follows:\n     * <br>RES.ResourceItem.TYPE_BIN : ArrayBuffer JavaScript primary object\n     * <br>RES.ResourceItem.TYPE_IMAGE : img Html Object，or egret.BitmapData interface。\n     * <br>RES.ResourceItem.TYPE_JSON : Object\n     * <br>RES.ResourceItem.TYPE_SHEET : Object\n     * <br>  1. If the incoming parameter is the name of the entire SpriteSheet is returned is {image1: Texture, \"image2\": Texture}.\n     * <br>  2. If the incoming is \"sheet.image1\", the return is a single resource.\n     * <br>  3. If the incoming is the name of the \"image1\" single resource, the return is a single resource.\n     * But if there are two SpriteSheet in a single picture of the same name, the return of the image after the load.\n     * <br>RES.ResourceItem.TYPE_SOUND : HtmlSound Html Object\n     * <br>RES.ResourceItem.TYPE_TEXT : string\n     * @param key A subKeys attribute or name property in a configuration file.\n     * @see RES.ResourceItem\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 同步方式获取缓存的已经加载成功的资源。\n     * <br>资源类型和对应的返回值类型关系如下：\n     * <br>RES.ResourceItem.TYPE_BIN : ArrayBuffer JavaScript 原生对象\n     * <br>RES.ResourceItem.TYPE_IMAGE : img Html 对象，或者 egret.BitmapData 接口。\n     * <br>RES.ResourceItem.TYPE_JSON : Object\n     * <br>RES.ResourceItem.TYPE_SHEET : Object\n     * <br>  1. 如果传入的参数是整个 SpriteSheet 的名称返回的是 {\"image1\":Texture,\"image2\":Texture} 这样的格式。\n     * <br>  2. 如果传入的是 \"sheet.image1\"，返回的是单个资源。\n     * <br>  3. 如果传入的是 \"image1\" 单个资源的名称，返回的是单个资源。但是如果有两张 SpriteSheet 中有单个图片资源名称相同，返回的是后加载的那个图片资源。\n     * <br>RES.ResourceItem.TYPE_SOUND : HtmlSound Html 对象\n     * <br>RES.ResourceItem.TYPE_TEXT : string\n     * @param key 对应配置文件里的 name 属性或 subKeys 属性的一项。\n     * @see RES.ResourceItem\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getRes(key: string): any;\n    /**\n     * Asynchronous mode to get the resources in the configuration. As long as the resources exist in the configuration file, you can get it in an asynchronous way.\n     * @param key A sbuKeys attribute or name property in a configuration file.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n    */\n    /**\n     * 异步方式获取配置里的资源。只要是配置文件里存在的资源，都可以通过异步方式获取。\n     * @param key 对应配置文件里的 name 属性或 sbuKeys 属性的一项。\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getResAsync(key: string): Promise<any>;\n    /**\n     * Asynchronous mode to get the resources in the configuration. As long as the resources exist in the configuration file, you can get it in an asynchronous way.\n     * @param key A sbuKeys attribute or name property in a configuration file.\n     * @param compFunc Call back function. Example：compFunc(data,key):void.\n     * @param thisObject This pointer of call back function.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 异步方式获取配置里的资源。只要是配置文件里存在的资源，都可以通过异步方式获取。\n     * @param key 对应配置文件里的 name 属性或 sbuKeys 属性的一项。\n     * @param compFunc 回调函数。示例：compFunc(data,key):void。\n     * @param thisObject 回调函数的 this 引用。\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getResAsync(key: string, compFunc: GetResAsyncCallback, thisObject: any): Promise<any> | void;\n    /**\n     * Access to external resources through the full URL.\n     * @param url The external path to load the file.\n     * @param compFunc Call back function. Example：compFunc(data,url):void。\n     * @param thisObject This pointer of call back function.\n     * @param type File type (optional). Use the static constants defined in the ResourceItem class. If you do not set the file name extension.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 通过完整URL方式获取外部资源。\n     * @param url 要加载文件的外部路径。\n     * @param compFunc 回调函数。示例：compFunc(data,url):void。\n     * @param thisObject 回调函数的 this 引用。\n     * @param type 文件类型(可选)。请使用 ResourceItem 类中定义的静态常量。若不设置将根据文件扩展名生成。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getResByUrl(url: string, compFunc?: Function, thisObject?: any, type?: string): Promise<any>;\n    /**\n     * Destroy a single resource file or a set of resources to the cache data, to return whether to delete success.\n     * @param name Name attribute or resource group name of the load item in the configuration file.\n     * @param force Destruction of a resource group when the other resources groups have the same resource situation whether the resources will be deleted, the default value true.\n     * @returns Are successful destruction.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 销毁单个资源文件或一组资源的缓存数据,返回是否删除成功。\n     * @param name 配置文件中加载项的name属性或资源组名。\n     * @param force 销毁一个资源组时其他资源组有同样资源情况资源是否会被删除，默认值 true。\n     * @see #setMaxRetryTimes\n     * @returns 是否销毁成功。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function destroyRes(name: string, force?: boolean): boolean;\n    /**\n     * Sets the maximum number of concurrent load threads, the default value is 4.\n     * @param thread The number of concurrent loads to be set.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 设置最大并发加载线程数量，默认值是 4。\n     * @param thread 要设置的并发加载数。\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function setMaxLoadingThread(thread: number): void;\n    /**\n     * Sets the number of retry times when the resource failed to load, and the default value is 3.\n     * @param retry To set the retry count.\n     * @includeExample extension/resource/Resource.ts\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 设置资源加载失败时的重试次数，默认值是 3。\n     * @param retry 要设置的重试次数。\n     * @includeExample extension/resource/Resource.ts\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function setMaxRetryTimes(retry: number): void;\n    /**\n     * Add event listeners, reference ResourceEvent defined constants.\n     * @param type Event name。\n     * @param listener Listener functions for handling events. This function must accept the Event object as its only parameter, and can't return any results,\n     * As shown in the following example: function (evt:Event):void can have any name.\n     * @param thisObject The this object that is bound to a function.\n     * @param useCapture Determine the listener is running on the capture or running on the target and the bubbling phase. Set useCapture to true,\n     * then the listener in the capture phase processing events, but not in the target or the bubbling phase processing events.\n     * If useCapture is false, then the listener only in the target or the bubbling phase processing events.\n     * To listen for events in all three stages, please call addEventListener two times: once the useCapture is set to true, once the useCapture is set to false.\n     * @param priority Event listener priority. Priority is specified by a 32 - bit integer with a symbol. The higher the number, the higher the priority.\n     * All listeners with a priority for n will be processed before the -1 n listener.\n     * If two or more listeners share the same priority, they are processed in accordance with the order of their added. The default priority is 0.\n     * @see RES.ResourceEvent\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 添加事件侦听器,参考 ResourceEvent 定义的常量。\n     * @param type 事件的类型。\n     * @param listener 处理事件的侦听器函数。此函数必须接受 Event 对象作为其唯一的参数，并且不能返回任何结果，\n     * 如下面的示例所示： function(evt:Event):void 函数可以有任何名称。\n     * @param thisObject 侦听函数绑定的 this 对象。\n     * @param useCapture 确定侦听器是运行于捕获阶段还是运行于目标和冒泡阶段。如果将 useCapture 设置为 true，\n     * 则侦听器只在捕获阶段处理事件，而不在目标或冒泡阶段处理事件。如果 useCapture 为 false，则侦听器只在目标或冒泡阶段处理事件。\n     * 要在所有三个阶段都侦听事件，请调用 addEventListener 两次：一次将 useCapture 设置为 true，一次将 useCapture 设置为 false。\n     * @param priority 事件侦听器的优先级。优先级由一个带符号的 32 位整数指定。数字越大，优先级越高。优先级为 n 的所有侦听器会在\n     * 优先级为 n -1 的侦听器之前得到处理。如果两个或更多个侦听器共享相同的优先级，则按照它们的添加顺序进行处理。默认优先级为 0。\n     * @see RES.ResourceEvent\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function addEventListener(type: string, listener: (event: egret.Event) => void, thisObject: any, useCapture?: boolean, priority?: number): void;\n    /**\n     * Remove event listeners, reference ResourceEvent defined constants.\n     * @param type Event name。\n     * @param listener Listening function。\n     * @param thisObject The this object that is bound to a function.\n     * @param useCapture Is used to capture, and this property is only valid in the display list.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 移除事件侦听器,参考ResourceEvent定义的常量。\n     * @param type 事件名。\n     * @param listener 侦听函数。\n     * @param thisObject 侦听函数绑定的this对象。\n     * @param useCapture 是否使用捕获，这个属性只在显示列表中生效。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function removeEventListener(type: string, listener: (event: egret.Event) => void, thisObject: any, useCapture?: boolean): void;\n    /**\n     * Adding a custom resource configuration.\n     * @param data To add configuration.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 自定义添加一项资源配置。\n     * @param data 要添加的配置。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function $addResourceData(data: {\n        name: string;\n        type: string;\n        url: string;\n    }): void;\n    /**\n    * Returns the VersionController\n    * @version Egret 5.2\n    * @platform Web,Native\n    * @language en_US\n    */\n    /**\n     * 获得版本控制器.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getVersionController(): VersionController;\n    /**\n     * Register the VersionController\n     * @param vcs The VersionController to register.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 注册版本控制器,通过RES模块加载资源时会从版本控制器获取真实url\n     * @param vcs 注入的版本控制器。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function registerVersionController(vcs: VersionController): void;\n    /**\n     * Convert the address of the loaded resource (via version controller conversion)\n     * @param url path to the original resource\n     * @returns converted address\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 转换加载资源的地址（经过版本控制器的转换）\n     * @param url 原始资源的路径\n     * @returns 转换后的地址\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getVirtualUrl(url: any): any;\n    /**\n     * @private\n     */\n    class Resource extends egret.EventDispatcher {\n        vcs: VersionController;\n        isVcsInit: boolean;\n        constructor();\n        registerVersionController(vcs: VersionController): void;\n        /**\n         * 开始加载配置\n         * @method RES.loadConfig\n         */\n        loadConfig(): Promise<void>;\n        /**\n         * @private\n         * 版本控制器加载后的加载配置\n         */\n        private normalLoadConfig;\n        /**\n         * 检查某个资源组是否已经加载完成\n         * @method RES.isGroupLoaded\n         * @param name {string}\n         */\n        isGroupLoaded(name: string): boolean;\n        /**\n         * 根据组名获取组加载项列表\n         * @method RES.getGroupByName\n         * @param name {string}\n         */\n        getGroupByName(name: string): Array<ResourceInfo>;\n        /**\n         * 根据组名加载一组资源\n         * @method RES.loadGroup\n         * @param name {string}\n         * @param priority {number}\n         */\n        loadGroup(name: string, priority?: number, reporter?: PromiseTaskReporter): Promise<any>;\n        private _loadGroup(name, priority?, reporter?);\n        /**\n         * 创建自定义的加载资源组,注意：此方法仅在资源配置文件加载完成后执行才有效。\n         * 可以监听ResourceEvent.CONFIG_COMPLETE事件来确认配置加载完成。\n         * @method RES.ResourceConfig#createGroup\n         * @param name {string} 要创建的加载资源组的组名\n         * @param keys {egret.Array<string>} 要包含的键名列表，key对应配置文件里的name属性或一个资源组名。\n         * @param override {boolean} 是否覆盖已经存在的同名资源组,默认false。\n         * @returns {boolean}\n         */\n        createGroup(name: string, keys: Array<string>, override?: boolean): boolean;\n        /**\n         * 检查配置文件里是否含有指定的资源\n         * @method RES.hasRes\n         * @param key {string} 对应配置文件里的name属性或subKeys属性的一项。\n         * @returns {boolean}\n         */\n        hasRes(key: string): boolean;\n        /**\n         * 通过key同步获取资源\n         * @method RES.getRes\n         * @param key {string}\n         * @returns {any}\n         */\n        getRes(resKey: string): any;\n        /**\n         * 通过key异步获取资源\n         * @method RES.getResAsync\n         * @param key {string}\n         * @param compFunc {Function} 回调函数。示例：compFunc(data,url):void。\n         * @param thisObject {any}\n         */\n        getResAsync(key: string): Promise<any>;\n        getResAsync(key: string, compFunc: GetResAsyncCallback, thisObject: any): Promise<any>;\n        /**\n         * 通过url获取资源\n         * @method RES.getResByUrl\n         * @param url {string}\n         * @param compFunc {Function}\n         * @param thisObject {any}\n         * @param type {string}\n         */\n        getResByUrl(url: string, compFunc?: Function, thisObject?: any, type?: string): Promise<any>;\n        /**\n         * 销毁单个资源文件或一组资源的缓存数据,返回是否删除成功。\n         * @method RES.destroyRes\n         * @param name {string} 配置文件中加载项的name属性或资源组名\n         * @param force {boolean} 销毁一个资源组时其他资源组有同样资源情况资源是否会被删除，默认值true\n         * @returns {boolean}\n         */\n        destroyRes(name: string, force?: boolean): boolean;\n        /**\n         * 设置最大并发加载线程数量，默认值是4.\n         * @method RES.setMaxLoadingThread\n         * @param thread {number} 要设置的并发加载数。\n         */\n        setMaxLoadingThread(thread: number): void;\n        /**\n         * 设置资源加载失败时的重试次数。\n         * @param retry 要设置的重试次数。\n         */\n        setMaxRetryTimes(retry: number): void;\n        addResourceData(data: {\n            name: string;\n            type: string;\n            url: string;\n        }): void;\n    }\n}\ndeclare namespace RES {\n    /**\n     * Print the memory occupied by the picture.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 对文件路径的一些操作，针对的是 C:/A/B/C/D/example.ts这种格式\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    namespace path {\n        /**\n         * Format the file path,\"C:/A/B//C//D//example.ts\"=>\"C:/A/B/C/D/example.ts\"\n         * @param filename Incoming file path\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 格式化文件路径，\"C:/A/B//C//D//example.ts\"=>\"C:/A/B/C/D/example.ts\"\n         * @param filename 传入的文件路径\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function normalize(filename: string): string;\n        /**\n         * Get the file name according to the file path, \"C:/A/B/example.ts\"=>\"example.ts\"\n         * @param filename Incoming file path\n         * @return File name\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 根据文件路径得到文件名字，\"C:/A/B/example.ts\"=>\"example.ts\"\n         * @param filename 传入的文件路径\n         * @return 文件的名字\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function basename(filename: string): string;\n        /**\n         * The path to the folder where the file is located,\"C:/A/B/example.ts\"=>\"C:/A/B\"\n         * @param filename Incoming file path\n         * @return The address of the folder where the file is located\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文件所在文件夹路径，\"C:/A/B/example.ts\"=>\"C:/A/B\"\n         * @param filename 传入的文件路径\n         * @return 文件所在文件夹的地址\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function dirname(path: string): string;\n    }\n}\ndeclare namespace RES {\n    /**\n     * @private\n     */\n    class NativeVersionController implements IVersionController {\n        private versionInfo;\n        init(): Promise<void>;\n        getVirtualUrl(url: string): string;\n        private getLocalData(filePath);\n    }\n}\ndeclare module RES.processor {\n    interface Processor {\n        /**\n         * Start loading a single resource\n         * @param host Load the processor, you can use the processor to load resources, directly use http to get the resources back\n         * @param resource Resource information\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 开始加载单项资源\n         * @param host 加载处理器，可以不使用这个处理器加载资源，直接用http获取资源返回即可\n         * @param resource 资源的信息\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        onLoadStart(host: ProcessHost, resource: ResourceInfo): Promise<any>;\n        /**\n         * Remove a single resource, usually call host.unload (resource);\n         * @param host Load the processor\n         * @param resource Resource information\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 移除单项资源，一般调用host.unload(resource);\n         * @param host 加载处理器\n         * @param resource 资源的信息\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        onRemoveStart(host: ProcessHost, resource: ResourceInfo): void;\n        /**\n        * Get the submap of the merged atlas\n        * @param host Load the processor\n        * @param resource Resource information\n        * @param key The key value of the resource\n        * @param subkey  Collection of subset names\n        * @version Egret 5.2\n        * @platform Web,Native\n        * @language en_US\n        */\n        /**\n         * 获取合并图集的子图\n         * @param host 加载处理器\n         * @param resource 资源的信息\n         * @param key 资源的key值\n         * @param subkey  子集名称的集合\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getData?(host: ProcessHost, resource: ResourceInfo, key: string, subkey: string): any;\n    }\n    /**\n     * Register the processor that loads the resource\n     * @param type Load resource type\n     * @param processor Loaded processor, an instance that implements the Processor interface\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 注册加载资源的处理器\n     * @param type 加载资源类型\n     * @param processor 加载的处理器，一个实现Processor接口的实例\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function map(type: string, processor: Processor): void;\n    /**\n     * @private\n     * @param url\n     * @param file\n     */\n    function getRelativePath(url: string, file: string): string;\n    var ImageProcessor: Processor;\n    const KTXTextureProcessor: RES.processor.Processor;\n    /**\n    *\n    */\n    function makeEtc1SeperatedAlphaResourceInfo(resource: ResourceInfo): ResourceInfo;\n    /**\n    *\n    */\n    const ETC1KTXProcessor: Processor;\n    var BinaryProcessor: Processor;\n    var TextProcessor: Processor;\n    var JsonProcessor: Processor;\n    var SoundProcessor: Processor;\n}\ndeclare module RES {\n    /**\n     * The events of resource loading.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 资源加载事件。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class ResourceEvent extends egret.Event {\n        /**\n         * Failure event for a load item.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个加载项加载失败事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ITEM_LOAD_ERROR: string;\n        /**\n         * Configure file to load and parse the completion event. Note: if a configuration file is loaded, it will not be thrown out, and if you want to handle the configuration loading failure, monitor the CONFIG_LOAD_ERROR event.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 配置文件加载并解析完成事件。注意：若有配置文件加载失败，将不会抛出此事件，若要处理配置加载失败，请同时监听 CONFIG_LOAD_ERROR 事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static CONFIG_COMPLETE: string;\n        /**\n         * Configuration file failed to load.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 配置文件加载失败事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static CONFIG_LOAD_ERROR: string;\n        /**\n         * Delay load group resource loading progress event.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 延迟加载组资源加载进度事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static GROUP_PROGRESS: string;\n        /**\n         * Delay load group resource to complete event. Note: if you have a resource item loading failure, the event will not be thrown, if you want to handle the group load failure, please listen to the GROUP_LOAD_ERROR event.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 延迟加载组资源加载完成事件。注意：若组内有资源项加载失败，将不会抛出此事件，若要处理组加载失败，请同时监听 GROUP_LOAD_ERROR 事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static GROUP_COMPLETE: string;\n        /**\n         * Delayed load group resource failed event.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 延迟加载组资源加载失败事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static GROUP_LOAD_ERROR: string;\n        /**\n         * Creates an Event object to pass as a parameter to event listeners.\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @private\n         * @language en_US\n         */\n        /**\n         * 创建一个作为参数传递给事件侦听器的 Event 对象。\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @private\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean);\n        /**\n         * File number that has been loaded.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 已经加载的文件数。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        itemsLoaded: number;\n        /**\n         * Total file number to load.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 要加载的总文件数。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        itemsTotal: number;\n        /**\n         * Resource group name.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 资源组名。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        groupName: string;\n        /**\n         * An item of information that is finished by the end of a load.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一次加载项加载结束的项信息对象。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        resItem: ResourceItem;\n    }\n}\ndeclare module RES {\n    /**\n     * Resource term. One of the resources arrays in resource.json.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 资源项。对应 resource.json 中 resources 数组中的一项。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    namespace ResourceItem {\n        /**\n         * XML file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * XML 文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const TYPE_XML: string;\n        /**\n         * Picture file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 图片文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const TYPE_IMAGE: string;\n        /**\n         * Binary file.\n         * @version Egret 5.2\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 二进制文件。\n         * @version Egret 5.2\n         * @platform Web\n         * @language zh_CN\n         */\n        const TYPE_BIN: string;\n        /**\n         * Text file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const TYPE_TEXT: string;\n        /**\n         * JSON file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * JSON 文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const TYPE_JSON: string;\n        /**\n         * SpriteSheet file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * SpriteSheet 文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const TYPE_SHEET: string;\n        /**\n         * BitmapTextSpriteSheet file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * BitmapTextSpriteSheet 文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const TYPE_FONT: string;\n        /**\n         * Sound file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 声音文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const TYPE_SOUND: string;\n        function convertToResItem(r: ResourceInfo): ResourceItem;\n    }\n    interface ResourceItem extends ResourceInfo {\n        /**\n         * Name of resource term.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 加载项名称。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * URL of resource term.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 要加载的文件地址。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        url: string;\n        /**\n         * Type of resource term.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 加载项文件类型。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        type: string;\n        /**\n         * The raw data object to be referenced.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 被引用的原始数据对象。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        data: ResourceInfo;\n        crc32?: string;\n        size?: number;\n        soundType?: string;\n    }\n}\ndeclare module RES {\n    /**\n     * assetsManager underlying storage resource information\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * assetsManager底层存储资源信息\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface File {\n        url: string;\n        type: string;\n        name: string;\n        root: string;\n    }\n    /**\n    * @private\n    */\n    interface FileSystem {\n        addFile(data: {\n            name: string;\n            type: string;\n            url: string;\n            root?: string;\n            extra?: 1 | undefined;\n        }): any;\n        getFile(filename: string): File | null;\n        profile(): void;\n        removeFile(filename: string): any;\n    }\n}\ndeclare module RES {\n    /**\n     * Print the memory occupied by the picture.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 打印图片所占内存\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function profile(): void;\n    /**\n    * @private\n    */\n    interface ProcessHost {\n        state: {\n            [index: string]: number;\n        };\n        resourceConfig: ResourceConfig;\n        load: (resource: ResourceInfo, processor?: string | processor.Processor) => Promise<any>;\n        unload: (resource: ResourceInfo) => void;\n        save: (rexource: ResourceInfo, data: any) => void;\n        get: (resource: ResourceInfo) => any;\n        remove: (resource: ResourceInfo) => void;\n    }\n    /**\n    * @private\n    */\n    class ResourceManagerError extends Error {\n        static errorMessage: {\n            1001: string;\n            1002: string;\n            2001: string;\n            2002: string;\n            2003: string;\n            2004: string;\n            2005: string;\n            2006: string;\n        };\n        /**\n         * why instanceof e  != ResourceManagerError ???\n         * see link : https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work\n         */\n        private __resource_manager_error__;\n        constructor(code: number, replacer?: Object, replacer2?: Object);\n    }\n}\ndeclare namespace RES {\n    /**\n     * Resource group loading progress prompt\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 资源组的加载进度提示\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface PromiseTaskReporter {\n        /**\n         * Progress callback, asynchronous execution, load number and order have nothing to do\n         * @param current The number of currently loaded\n         * @param total Total resources required in the current resource bundle\n         * @param resItem currently loading resource information\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 进度回调，异步执行，加载数目和顺序无关\n         * @param current 当前已经加载数目\n         * @param total 当前资源包内需要资源总数\n         * @param resItem 当前加载资源信息\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        onProgress?(current: number, total: number, resItem: ResourceInfo | undefined): void;\n    }\n}\n"
  },
  {
    "path": "demo/libs/modules/assetsmanager/assetsmanager.js",
    "content": "var __reflect = (this && this.__reflect) || function (p, c, t) {\n    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;\n};\nvar __extends = this && this.__extends || function __extends(t, e) { \n function r() { \n this.constructor = t;\n}\nfor (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);\nr.prototype = e.prototype, t.prototype = new r();\n};\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n    if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n    return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar RES;\n(function (RES) {\n})(RES || (RES = {}));\nvar RES;\n(function (RES) {\n    /**\n     * @internal\n     */\n    RES.resourceNameSelector = function (p) { return p; };\n    /**\n     * Get resource information through file path\n     * @param path file path\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 通过文件路径获取资源信息\n     * @param path 文件路径\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getResourceInfo(path) {\n        var result = RES.config.config.fileSystem.getFile(path);\n        if (!result) {\n            path = RES.resourceNameSelector(path);\n            result = RES.config.config.fileSystem.getFile(path);\n        }\n        return result;\n    }\n    RES.getResourceInfo = getResourceInfo;\n    var configItem;\n    /**\n     * 注册config的相关配置\n     * @internal\n     * @param url config的地址\n     * @param root 根路径\n     */\n    function setConfigURL(url, root) {\n        var type;\n        if (url.indexOf(\".json\") >= 0) {\n            type = \"legacyResourceConfig\";\n        }\n        else {\n            type = \"resourceConfig\";\n        }\n        configItem = { type: type, root: root, url: url, name: url };\n    }\n    RES.setConfigURL = setConfigURL;\n    /**\n     * @class RES.ResourceConfig\n     * @classdesc\n     * @private\n     */\n    var ResourceConfig = (function () {\n        function ResourceConfig() {\n        }\n        ResourceConfig.prototype.init = function () {\n            if (!this.config) {\n                this.config = {\n                    alias: {}, groups: {}, resourceRoot: configItem.root,\n                    mergeSelector: null,\n                    fileSystem: null,\n                    loadGroup: []\n                };\n            }\n            return RES.queue.pushResItem(configItem).catch(function (e) {\n                if (!RES.isCompatible) {\n                    if (!e.__resource_manager_error__) {\n                        if (e.error) {\n                            console.error(e.error.stack);\n                        }\n                        else {\n                            console.error(e.stack);\n                        }\n                        e = new RES.ResourceManagerError(1002);\n                    }\n                }\n                RES.host.remove(configItem);\n                return Promise.reject(e);\n            });\n        };\n        /**\n         * 根据组名获取组加载项列表\n         * @method RES.ResourceConfig#getGroupByName\n         * @param name {string} 组名\n         * @returns {Array<egret.ResourceItem>}\n         */\n        ResourceConfig.prototype.getGroupByName = function (name) {\n            var group = this.config.groups[name];\n            var result = [];\n            if (!group) {\n                return result;\n            }\n            for (var _i = 0, group_1 = group; _i < group_1.length; _i++) {\n                var paramKey = group_1[_i];\n                var tempResult = void 0;\n                tempResult = RES.config.getResourceWithSubkey(paramKey);\n                if (tempResult == null) {\n                    continue;\n                }\n                var r = tempResult.r, key = tempResult.key;\n                if (r == null) {\n                    /** 加载组里面的资源，可能不存在 */\n                    throw new RES.ResourceManagerError(2005, key);\n                    continue;\n                }\n                if (result.indexOf(r) == -1) {\n                    result.push(r);\n                }\n            }\n            return result;\n        };\n        ResourceConfig.prototype.__temp__get__type__via__url = function (url_or_alias) {\n            var url = this.config.alias[url_or_alias];\n            if (!url) {\n                url = url_or_alias;\n            }\n            if (RES.typeSelector) {\n                var type = RES.typeSelector(url);\n                if (!type) {\n                    throw new RES.ResourceManagerError(2004, url);\n                }\n                return type;\n            }\n            else {\n                console.warn(\"RES.mapConfig 并未设置 typeSelector\");\n                return \"unknown\";\n            }\n        };\n        ResourceConfig.prototype.getResourceWithSubkey = function (key) {\n            key = this.getKeyByAlias(key);\n            var index = key.indexOf(\"#\");\n            var subkey = \"\";\n            if (index >= 0) {\n                subkey = key.substr(index + 1);\n                key = key.substr(0, index);\n            }\n            var r = this.getResource(key);\n            if (!r) {\n                return null;\n            }\n            else {\n                return {\n                    r: r, key: key, subkey: subkey\n                };\n            }\n        };\n        ResourceConfig.prototype.getKeyByAlias = function (aliasName) {\n            if (this.config.alias[aliasName]) {\n                return this.config.alias[aliasName];\n            }\n            else {\n                return aliasName;\n            }\n        };\n        ResourceConfig.prototype.getResource = function (path_or_alias) {\n            var path = this.config.alias[path_or_alias];\n            if (!path) {\n                path = path_or_alias;\n            }\n            var r = getResourceInfo(path);\n            if (!r) {\n                return null;\n            }\n            else {\n                return r;\n            }\n        };\n        /**\n         * 创建自定义的加载资源组,注意：此方法仅在资源配置文件加载完成后执行才有效。\n         * 可以监听ResourceEvent.CONFIG_COMPLETE事件来确认配置加载完成。\n         * @method RES.ResourceConfig#createGroup\n         * @param name {string} 要创建的加载资源组的组名\n         * @param keys {egret.Array<string>} 要包含的键名列表，key对应配置文件里的name属性或sbuKeys属性的一项或一个资源组名。\n         * @param override {boolean} 是否覆盖已经存在的同名资源组,默认false。\n         * @returns {boolean}\n         */\n        ResourceConfig.prototype.createGroup = function (name, keys, override) {\n            if (override === void 0) { override = false; }\n            if ((!override && this.config.groups[name]) || !keys || keys.length == 0) {\n                return false;\n            }\n            var group = [];\n            for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n                var key = keys_1[_i];\n                if (this.config.groups[key]) {\n                    var groupInfo = this.config.groups[key];\n                    group = group.concat(groupInfo);\n                }\n                else {\n                    group.push(key);\n                }\n            }\n            this.config.groups[name] = group;\n            return true;\n            // var groupDic: any = this.groupDic;\n            // var group: Array<any> = [];\n            // var length: number = keys.length;\n            // for (var i: number = 0; i < length; i++) {\n            //     var key: string = keys[i];\n            //     var g: Array<any> = groupDic[key];\n            //     if (g) {\n            //         var len: number = g.length;\n            //         for (var j: number = 0; j < len; j++) {\n            //             var item: any = g[j];\n            //             if (group.indexOf(item) == -1)\n            //                 group.push(item);\n            //         }\n            //     }\n            //     else {\n            //         item = this.keyMap[key];\n            //         if (item) {\n            //             if (group.indexOf(item) == -1)\n            //                 group.push(item);\n            //         }\n            //         else {\n            //             egret.$warn(3200, key);\n            //         }\n            //     }\n            // }\n            // if (group.length == 0)\n            //     return false;\n            // this.groupDic[name] = group;\n            // return true;\n        };\n        /**\n         * 添加一个二级键名到配置列表。\n         * @method RES.ResourceConfig#addSubkey\n         * @param subkey {string} 要添加的二级键名\n         * @param name {string} 二级键名所属的资源name属性\n         */\n        ResourceConfig.prototype.addSubkey = function (subkey, name) {\n            this.addAlias(subkey, name + \"#\" + subkey);\n        };\n        ResourceConfig.prototype.addAlias = function (alias, key) {\n            if (this.config.alias[key]) {\n                key = this.config.alias[key];\n            }\n            this.config.alias[alias] = key;\n        };\n        ResourceConfig.prototype.addResourceData = function (data) {\n            if (RES.hasRes(data.name)) {\n                return;\n            }\n            if (!data.type) {\n                data.type = this.__temp__get__type__via__url(data.url);\n            }\n            RES.config.config.fileSystem.addFile(data);\n        };\n        ResourceConfig.prototype.removeResourceData = function (data) {\n            if (!RES.hasRes(data.name)) {\n                return;\n            }\n            RES.config.config.fileSystem.removeFile(data.url);\n            if (this.config.alias[data.name]) {\n                delete this.config.alias[data.name];\n            }\n        };\n        return ResourceConfig;\n    }());\n    RES.ResourceConfig = ResourceConfig;\n    __reflect(ResourceConfig.prototype, \"RES.ResourceConfig\");\n})(RES || (RES = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar RES;\n(function (RES) {\n    /**\n     * @class RES.ResourceLoader\n     * @classdesc\n     * @private\n     */\n    var ResourceLoader = (function () {\n        function ResourceLoader() {\n            /**\n             * 当前组加载的项总个数,key为groupName\n             */\n            this.groupTotalDic = {};\n            /**\n             * 已经加载的项个数,key为groupName\n             */\n            this.numLoadedDic = {};\n            /**\n             * 加载失败的组,key为groupName\n             */\n            this.groupErrorDic = {};\n            this.retryTimesDic = {};\n            this.maxRetryTimes = 3;\n            this.reporterDic = {};\n            this.dispatcherDic = {};\n            this.failedList = new Array();\n            this.loadItemErrorDic = {};\n            this.errorDic = {};\n            /**\n             * 资源优先级队列，key为资源，value为优先级\n             */\n            this.itemListPriorityDic = {};\n            /**\n             * 资源是否在加载\n             */\n            this.itemLoadDic = {};\n            this.promiseHash = {};\n            /**\n             * 延迟加载队列,getResByUrl ,getResAsync等方法存储队列\n             */\n            this.lazyLoadList = new Array();\n            this.loadingCount = 0;\n            /**\n             * 最大线程数目\n             */\n            this.thread = 4;\n        }\n        ResourceLoader.prototype.pushResItem = function (resInfo) {\n            if (this.promiseHash[resInfo.root + resInfo.name]) {\n                return this.promiseHash[resInfo.root + resInfo.name];\n            }\n            this.lazyLoadList.push(resInfo);\n            this.itemListPriorityDic[Number.NEGATIVE_INFINITY] = this.lazyLoadList;\n            this.updatelistPriority(this.lazyLoadList, Number.NEGATIVE_INFINITY);\n            var dispatcher = new egret.EventDispatcher();\n            this.dispatcherDic[resInfo.root + resInfo.name] = dispatcher;\n            var promise = new Promise(function (resolve, reject) {\n                dispatcher.addEventListener(\"complete\", function (e) {\n                    resolve(e.data);\n                }, null);\n                dispatcher.addEventListener(\"error\", function (e) {\n                    reject(e.data);\n                }, null);\n            });\n            this.promiseHash[resInfo.root + resInfo.name] = promise;\n            this.loadNextResource();\n            return promise;\n        };\n        /**\n         * 加载队列,存储组的队列\n         */\n        ResourceLoader.prototype.pushResGroup = function (list, groupName, priority, reporter) {\n            if (this.promiseHash[groupName]) {\n                return this.promiseHash[groupName];\n            }\n            var total = list.length;\n            for (var i = 0; i < total; i++) {\n                var resInfo = list[i];\n                if (!resInfo.groupNames) {\n                    resInfo.groupNames = [];\n                }\n                resInfo.groupNames.push(groupName);\n            }\n            this.groupTotalDic[groupName] = list.length;\n            this.numLoadedDic[groupName] = 0;\n            this.updatelistPriority(list, priority);\n            this.reporterDic[groupName] = reporter;\n            var dispatcher = new egret.EventDispatcher();\n            this.dispatcherDic[groupName] = dispatcher;\n            var promise = new Promise(function (resolve, reject) {\n                dispatcher.addEventListener(\"complete\", resolve, null);\n                dispatcher.addEventListener(\"error\", function (e) {\n                    reject(e.data);\n                }, null);\n            });\n            this.promiseHash[groupName] = promise;\n            this.loadNextResource();\n            return promise;\n        };\n        /**\n         * 更新组的优先级顺序\n         * @param list 存储数据的队列\n         * @param priority 优先级\n         */\n        ResourceLoader.prototype.updatelistPriority = function (list, priority) {\n            if (this.itemListPriorityDic[priority] == undefined) {\n                this.itemListPriorityDic[priority] = [];\n            }\n            for (var _i = 0, list_1 = list; _i < list_1.length; _i++) {\n                var item = list_1[_i];\n                if (this.itemLoadDic[item.root + item.name] == 1) {\n                    continue;\n                }\n                var oldPriority = this.findPriorityInDic(item);\n                if (oldPriority == undefined) {\n                    this.itemListPriorityDic[priority].push(item);\n                }\n                else {\n                    if (oldPriority < priority) {\n                        this.itemListPriorityDic[priority].push(item);\n                        var index = this.itemListPriorityDic[oldPriority].indexOf(item);\n                        this.itemListPriorityDic[oldPriority].splice(index, 1);\n                    }\n                }\n            }\n        };\n        /**\n         * 搜索单项资源的优先级\n         * @param item 单项资源\n         */\n        ResourceLoader.prototype.findPriorityInDic = function (item) {\n            for (var priority in this.itemListPriorityDic) {\n                if (this.itemListPriorityDic[priority].indexOf(item) > -1)\n                    return parseInt(priority);\n            }\n            return undefined;\n        };\n        /**\n         * 加载下一项资源，线程控制\n         */\n        ResourceLoader.prototype.loadNextResource = function () {\n            while (this.loadingCount < this.thread) {\n                var isload = this.loadSingleResource();\n                if (!isload) {\n                    break;\n                }\n            }\n        };\n        /**\n         * 加载单向资源\n         */\n        ResourceLoader.prototype.loadSingleResource = function () {\n            var _this = this;\n            var r = this.getOneResourceInfoInGroup();\n            if (!r)\n                return false;\n            this.itemLoadDic[r.root + r.name] = 1;\n            this.loadingCount++;\n            this.loadResource(r)\n                .then(function (response) {\n                _this.loadingCount--;\n                delete _this.itemLoadDic[r.root + r.name];\n                RES.host.save(r, response);\n                if (_this.promiseHash[r.root + r.name]) {\n                    var dispatcher = _this.deleteDispatcher(r.root + r.name);\n                    dispatcher.dispatchEventWith(\"complete\", false, response);\n                }\n                var groupNames = r.groupNames;\n                if (groupNames) {\n                    delete r.groupNames;\n                    for (var _i = 0, groupNames_1 = groupNames; _i < groupNames_1.length; _i++) {\n                        var groupName = groupNames_1[_i];\n                        if (_this.setGroupProgress(groupName, r)) {\n                            _this.loadGroupEnd(groupName);\n                        }\n                    }\n                }\n                _this.loadNextResource();\n            }).catch(function (error) {\n                if (!error) {\n                    throw r.name + \" load fail\";\n                }\n                if (!error.__resource_manager_error__) {\n                    throw error;\n                }\n                delete _this.itemLoadDic[r.root + r.name];\n                _this.loadingCount--;\n                delete RES.host.state[r.root + r.name];\n                var times = _this.retryTimesDic[r.name] || 1;\n                if (times > _this.maxRetryTimes) {\n                    delete _this.retryTimesDic[r.name];\n                    if (_this.promiseHash[r.root + r.name]) {\n                        var dispatcher = _this.deleteDispatcher(r.root + r.name);\n                        dispatcher.dispatchEventWith(\"error\", false, { r: r, error: error });\n                    }\n                    var groupNames = r.groupNames;\n                    if (groupNames) {\n                        delete r.groupNames;\n                        for (var _i = 0, groupNames_2 = groupNames; _i < groupNames_2.length; _i++) {\n                            var groupName = groupNames_2[_i];\n                            if (!_this.loadItemErrorDic[groupName]) {\n                                _this.loadItemErrorDic[groupName] = [];\n                            }\n                            if (_this.loadItemErrorDic[groupName].indexOf(r) == -1) {\n                                _this.loadItemErrorDic[groupName].push(r);\n                            }\n                            _this.groupErrorDic[groupName] = true;\n                            if (_this.setGroupProgress(groupName, r)) {\n                                _this.loadGroupEnd(groupName, error);\n                            }\n                            else {\n                                _this.errorDic[groupName] = error;\n                            }\n                        }\n                    }\n                    _this.loadNextResource();\n                }\n                else {\n                    _this.retryTimesDic[r.name] = times + 1;\n                    _this.failedList.push(r);\n                    _this.loadNextResource();\n                    return;\n                }\n            });\n            return true;\n        };\n        /**\n         * 获取下一个待加载项\n         */\n        ResourceLoader.prototype.getOneResourceInfoInGroup = function () {\n            if (this.failedList.length > 0)\n                return this.failedList.shift();\n            var maxPriority = Number.NEGATIVE_INFINITY;\n            for (var p in this.itemListPriorityDic) {\n                maxPriority = Math.max(maxPriority, p);\n            }\n            var list = this.itemListPriorityDic[maxPriority];\n            if (!list) {\n                return undefined;\n            }\n            if (list.length == 0) {\n                delete this.itemListPriorityDic[maxPriority];\n                return this.getOneResourceInfoInGroup();\n            }\n            return list.shift();\n        };\n        /**\n         * 设置组的加载进度，同时返回当前组是否加载完成\n         * @param groupName 组名\n         * @param r 加载完成的资源\n         */\n        ResourceLoader.prototype.setGroupProgress = function (groupName, r) {\n            var reporter = this.reporterDic[groupName];\n            this.numLoadedDic[groupName]++;\n            var current = this.numLoadedDic[groupName];\n            var total = this.groupTotalDic[groupName];\n            if (reporter && reporter.onProgress) {\n                reporter.onProgress(current, total, r);\n            }\n            return current == total;\n        };\n        /**\n         * 加载组的最后一项，同时派发事件\n         * @param groupName 组名\n         * @param lastError 最后一项是否成功，此项为错误信息\n         */\n        ResourceLoader.prototype.loadGroupEnd = function (groupName, lastError) {\n            delete this.groupTotalDic[groupName];\n            delete this.numLoadedDic[groupName];\n            delete this.reporterDic[groupName];\n            var dispatcher = this.deleteDispatcher(groupName);\n            if (!lastError) {\n                var groupError = this.groupErrorDic[groupName];\n                delete this.groupErrorDic[groupName];\n                if (groupError) {\n                    var itemList = this.loadItemErrorDic[groupName];\n                    delete this.loadItemErrorDic[groupName];\n                    var error = this.errorDic[groupName];\n                    delete this.errorDic[groupName];\n                    dispatcher.dispatchEventWith(\"error\", false, { itemList: itemList, error: error });\n                }\n                else {\n                    dispatcher.dispatchEventWith(\"complete\");\n                }\n            }\n            else {\n                delete this.groupErrorDic[groupName];\n                var itemList = this.loadItemErrorDic[groupName];\n                delete this.loadItemErrorDic[groupName];\n                dispatcher.dispatchEventWith(\"error\", false, { itemList: itemList, lastError: lastError });\n            }\n        };\n        /**\n         * 删除事件派发器，Promise的缓存，返回事件派发器\n         * @param groupName 组名或是root+name\n         */\n        ResourceLoader.prototype.deleteDispatcher = function (groupName) {\n            delete this.promiseHash[groupName];\n            var dispatcher = this.dispatcherDic[groupName];\n            delete this.dispatcherDic[groupName];\n            return dispatcher;\n        };\n        /**\n         * 加载资源\n         * @param r 资源信息\n         * @param p 加载处理器\n         */\n        ResourceLoader.prototype.loadResource = function (r, p) {\n            if (!p) {\n                if (RES.FEATURE_FLAG.FIX_DUPLICATE_LOAD == 1) {\n                    var s = RES.host.state[r.root + r.name];\n                    if (s == 2) {\n                        return Promise.resolve(RES.host.get(r));\n                    }\n                    if (s == 1) {\n                        return r.promise;\n                    }\n                }\n                p = RES.processor.isSupport(r);\n            }\n            if (!p) {\n                throw new RES.ResourceManagerError(2001, r.name, r.type);\n            }\n            RES.host.state[r.root + r.name] = 1;\n            var promise = p.onLoadStart(RES.host, r);\n            r.promise = promise;\n            return promise;\n        };\n        /**\n         * 释放资源\n         * @param r 资源信息\n         */\n        ResourceLoader.prototype.unloadResource = function (r) {\n            var data = RES.host.get(r);\n            if (!data) {\n                console.warn(\"尝试释放不存在的资源:\", r.name);\n                return false;\n            }\n            var p = RES.processor.isSupport(r);\n            if (p) {\n                p.onRemoveStart(RES.host, r);\n                RES.host.remove(r);\n                if (r.extra == 1) {\n                    RES.config.removeResourceData(r);\n                }\n                return true;\n            }\n            else {\n                return true;\n            }\n        };\n        return ResourceLoader;\n    }());\n    RES.ResourceLoader = ResourceLoader;\n    __reflect(ResourceLoader.prototype, \"RES.ResourceLoader\");\n})(RES || (RES = {}));\nvar RES;\n(function (RES) {\n    /**\n     * Decorator, determine if the parameter is null\n     * @internal\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 装饰器，判断参数是否为null\n     * @internal\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    RES.checkNull = function (target, propertyKey, descriptor) {\n        var method = descriptor.value;\n        descriptor.value = function () {\n            var arg = [];\n            for (var _i = 0; _i < arguments.length; _i++) {\n                arg[_i] = arguments[_i];\n            }\n            if (!arg[0]) {\n                console.warn(\"\\u65B9\\u6CD5\" + propertyKey + \"\\u7684\\u53C2\\u6570\\u4E0D\\u80FD\\u4E3Anull\");\n                return null;\n            }\n            else {\n                return method.apply(this, arg);\n            }\n        };\n    };\n    /**\n     * 功能开关\n     * LOADING_STATE：处理重复加载\n     * @internal\n     */\n    RES.FEATURE_FLAG = {\n        FIX_DUPLICATE_LOAD: 1\n    };\n    /**\n     * @internal\n     */\n    var upgrade;\n    (function (upgrade) {\n        var _level = \"warning\";\n        function setUpgradeGuideLevel(level) {\n            _level = level;\n        }\n        upgrade.setUpgradeGuideLevel = setUpgradeGuideLevel;\n    })(upgrade = RES.upgrade || (RES.upgrade = {}));\n})(RES || (RES = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar RES;\n(function (RES) {\n    /**\n    * Convert the file name of the resource to the Key value used in the project.\n    * @param url Resource Name.\n    * @returns The key value used in the project\n    * @version Egret 5.2\n    * @platform Web,Native\n    * @language en_US\n    */\n    /**\n     * 将资源的文件名称转换为项目中所使用的Key值。\n     * 在加载合并图集的时候使用，例如图集加载A_json，需要加载对应A_png，这里就是转换的机制\n     * 一般项目中无需更改，只有没有使用默认的key和文件对应的需要修改\n     * @param url 资源名称。\n     * @returns 项目中所用的key值\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function nameSelector(url) {\n        return RES.path.basename(url).split(\".\").join(\"_\");\n    }\n    RES.nameSelector = nameSelector;\n    /**\n    * Get the read type of the file.\n    * When using getResByUrl does not specify the type of the read file, it will find the corresponding type according to this method.\n    * File types not found are loaded by default in binary format\n    * @param path file path.\n    * @returns Processor type used to read the file\n    * @version Egret 5.2\n    * @platform Web,Native\n    * @language en_US\n    */\n    /**\n     * 获取文件的读取类型\n     * 在使用getResByUrl没有指定读取文件的类型，会根据这个方法寻找对应的类型\n     * 没有查找到的文件类型以二进制格式默认加载\n     * @param path 文件路径\n     * @returns 读取文件所用的Processor类型\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function typeSelector(path) {\n        var ext = path.substr(path.lastIndexOf(\".\") + 1);\n        var type;\n        switch (ext) {\n            case RES.ResourceItem.TYPE_XML:\n            case RES.ResourceItem.TYPE_JSON:\n            case RES.ResourceItem.TYPE_SHEET:\n                type = ext;\n                break;\n            case \"png\":\n            case \"jpg\":\n            case \"gif\":\n            case \"jpeg\":\n            case \"bmp\":\n                type = RES.ResourceItem.TYPE_IMAGE;\n                break;\n            case \"fnt\":\n                type = RES.ResourceItem.TYPE_FONT;\n                break;\n            case \"txt\":\n                type = RES.ResourceItem.TYPE_TEXT;\n                break;\n            case \"mp3\":\n            case \"ogg\":\n            case \"mpeg\":\n            case \"wav\":\n            case \"m4a\":\n            case \"mp4\":\n            case \"aiff\":\n            case \"wma\":\n            case \"mid\":\n                type = RES.ResourceItem.TYPE_SOUND;\n                break;\n            case \"mergeJson\":\n            case \"zip\":\n            case \"pvr\":\n                type = ext;\n                break;\n            default:\n                type = RES.ResourceItem.TYPE_BIN;\n                break;\n        }\n        return type;\n    }\n    RES.typeSelector = typeSelector;\n    /**\n     * Conduct mapping injection with class definition as the value, Deprecated.\n     * @deprecated\n     * @see RES.processor.map\n     * @language en_US\n     */\n    /**\n     * 以类定义为值进行映射注入，已废弃。\n     * @deprecated\n     * @see RES.processor.map\n     * @language zh_CN\n     */\n    function registerAnalyzer(type, analyzerClass) {\n        throw new RES.ResourceManagerError(2002);\n    }\n    RES.registerAnalyzer = registerAnalyzer;\n    /**\n    * Set whether it is compatible mode\n    * When the value is true, the assetsManager will output the design of Res. When it is false, all the loaded resources will be returned as promises.\n    * The default is false, run in strict assetsManager mode\n    * @version Egret 5.2.9\n    * @platform Web,Native\n    * @language en_US\n    */\n    /**\n     * 设置是否为兼容模式\n     * 当值为true时，assetsManager会以Res的设计输出，当为false时候，所有的加载资源都会以promise的方式返回\n     * 默认是false，以严格assetsManager方式运行\n     * @version Egret 5.2.9\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function setIsCompatible(value) {\n        RES.isCompatible = value;\n    }\n    RES.setIsCompatible = setIsCompatible;\n    /**\n     * @internal\n     */\n    RES.isCompatible = false;\n    /**\n     * Load configuration file and parse.\n     * @param url The url address of the resource config\n     * @param resourceRoot The root address of the resource config\n     * @returns Promise\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 加载配置文件并解析。\n     * @param url 资源配置的url地址\n     * @param resourceRoot 资源配置的根地址\n     * @returns Promise\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function loadConfig(url, resourceRoot) {\n        if (resourceRoot.indexOf('://') >= 0) {\n            var temp = resourceRoot.split('://');\n            resourceRoot = temp[0] + '://' + RES.path.normalize(temp[1] + '/');\n            url = url.replace(resourceRoot, '');\n        }\n        else {\n            resourceRoot = RES.path.normalize(resourceRoot + \"/\");\n            url = url.replace(resourceRoot, '');\n        }\n        RES.setConfigURL(url, resourceRoot);\n        if (!instance)\n            instance = new Resource();\n        return compatiblePromise(instance.loadConfig());\n    }\n    RES.loadConfig = loadConfig;\n    function compatiblePromise(promise) {\n        if (RES.isCompatible) {\n            promise.catch(function (e) { }).then();\n            return undefined;\n        }\n        else {\n            return promise;\n        }\n    }\n    /**\n     * Load a set of resources according to the group name.\n     * @param name Group name to load the resource group.\n     * @param priority Load priority can be negative, the default value is 0.\n     * <br>A low priority group must wait for the high priority group to complete the end of the load to start, and the same priority group will be loaded at the same time.\n     * @param reporter Resource group loading progress prompt\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 根据组名加载一组资源。\n     * @param name 要加载资源组的组名。\n     * @param priority 加载优先级,可以为负数,默认值为 0。\n     * <br>低优先级的组必须等待高优先级组完全加载结束才能开始，同一优先级的组会同时加载。\n     * @param reporter 资源组的加载进度提示\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function loadGroup(name, priority, reporter) {\n        if (priority === void 0) { priority = 0; }\n        return compatiblePromise(instance.loadGroup(name, priority, reporter));\n    }\n    RES.loadGroup = loadGroup;\n    /**\n     * Check whether a resource group has been loaded.\n     * @param name Group name。\n     * @returns Is loading or not.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 检查某个资源组是否已经加载完成。\n     * @param name 组名。\n     * @returns 是否正在加载。\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function isGroupLoaded(name) {\n        return instance.isGroupLoaded(name);\n    }\n    RES.isGroupLoaded = isGroupLoaded;\n    /**\n     * A list of groups of loading is obtained according to the group name.\n     * @param name Group name.\n     * @returns The resource item array of group.\n     * @see RES.ResourceItem\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 根据组名获取组加载项列表。\n     * @param name 组名。\n     * @returns 加载项列表。\n     * @see RES.ResourceItem\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getGroupByName(name) {\n        return instance.getGroupByName(name).map(function (r) { return RES.ResourceItem.convertToResItem(r); });\n    }\n    RES.getGroupByName = getGroupByName;\n    /**\n     * Create a custom load resource group, note that this method is valid only after the resource configuration file is loaded.\n     * <br>You can monitor the ResourceEvent.CONFIG_COMPLETE event to verify that the configuration is complete.\n     * @param name Group name to create the load resource group.\n     * @param keys To be included in the list of key keys, the corresponding configuration file in the name or sbuKeys property one or a resource group name.\n     * @param override Is the default false for the same name resource group already exists.\n     * @returns Create success or fail.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 创建自定义的加载资源组,注意：此方法仅在资源配置文件加载完成后执行才有效。\n     * <br>可以监听 ResourceEvent.CONFIG_COMPLETE 事件来确认配置加载完成。\n     * @param name 要创建的加载资源组的组名。\n     * @param keys 要包含的键名列表，key 对应配置文件里的 name 属性或 sbuKeys 属性的一项或一个资源组名。\n     * @param override 是否覆盖已经存在的同名资源组,默认 false。\n     * @returns 是否创建成功。\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function createGroup(name, keys, override) {\n        if (override === void 0) { override = false; }\n        return instance.createGroup(name, keys, override);\n    }\n    RES.createGroup = createGroup;\n    /**\n     * Check whether the configuration file contains the specified resources.\n     * @param key A sbuKeys attribute or name property in a configuration file.\n     * @returns Whether you have the specified resource\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 检查配置文件里是否含有指定的资源。\n     * @param key 对应配置文件里的 name 属性或 sbuKeys 属性的一项。\n     * @returns 是否拥有指定资源\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function hasRes(key) {\n        return instance.hasRes(key);\n    }\n    RES.hasRes = hasRes;\n    /**\n     * The synchronization method for obtaining the cache has been loaded with the success of the resource.\n     * <br>The type of resource and the corresponding return value types are as follows:\n     * <br>RES.ResourceItem.TYPE_BIN : ArrayBuffer JavaScript primary object\n     * <br>RES.ResourceItem.TYPE_IMAGE : img Html Object，or egret.BitmapData interface。\n     * <br>RES.ResourceItem.TYPE_JSON : Object\n     * <br>RES.ResourceItem.TYPE_SHEET : Object\n     * <br>  1. If the incoming parameter is the name of the entire SpriteSheet is returned is {image1: Texture, \"image2\": Texture}.\n     * <br>  2. If the incoming is \"sheet.image1\", the return is a single resource.\n     * <br>  3. If the incoming is the name of the \"image1\" single resource, the return is a single resource.\n     * But if there are two SpriteSheet in a single picture of the same name, the return of the image after the load.\n     * <br>RES.ResourceItem.TYPE_SOUND : HtmlSound Html Object\n     * <br>RES.ResourceItem.TYPE_TEXT : string\n     * @param key A subKeys attribute or name property in a configuration file.\n     * @see RES.ResourceItem\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 同步方式获取缓存的已经加载成功的资源。\n     * <br>资源类型和对应的返回值类型关系如下：\n     * <br>RES.ResourceItem.TYPE_BIN : ArrayBuffer JavaScript 原生对象\n     * <br>RES.ResourceItem.TYPE_IMAGE : img Html 对象，或者 egret.BitmapData 接口。\n     * <br>RES.ResourceItem.TYPE_JSON : Object\n     * <br>RES.ResourceItem.TYPE_SHEET : Object\n     * <br>  1. 如果传入的参数是整个 SpriteSheet 的名称返回的是 {\"image1\":Texture,\"image2\":Texture} 这样的格式。\n     * <br>  2. 如果传入的是 \"sheet.image1\"，返回的是单个资源。\n     * <br>  3. 如果传入的是 \"image1\" 单个资源的名称，返回的是单个资源。但是如果有两张 SpriteSheet 中有单个图片资源名称相同，返回的是后加载的那个图片资源。\n     * <br>RES.ResourceItem.TYPE_SOUND : HtmlSound Html 对象\n     * <br>RES.ResourceItem.TYPE_TEXT : string\n     * @param key 对应配置文件里的 name 属性或 subKeys 属性的一项。\n     * @see RES.ResourceItem\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getRes(key) {\n        return instance.getRes(key);\n    }\n    RES.getRes = getRes;\n    /**\n     * Asynchronous mode to get the resources in the configuration. As long as the resources exist in the configuration file, you can get it in an asynchronous way.\n     * @param key A sbuKeys attribute or name property in a configuration file.\n     * @param compFunc Call back function. Example：compFunc(data,key):void.\n     * @param thisObject This pointer of call back function.\n     * @see #setMaxRetryTimes\n     * @example The following code demonstrates how to load a resource via getResAsync\n     * <pre>\n     *       RES.getResAsync(\"resource/example.json\");//Only pass the key value to get the resource\n     *\n     *       RES.getResAsync(\"resource/example.json\", (data) => {\n     *          console.log(data)\n     *       }, this) //Pass in the key value, compFunc and thisObject get the resource, the latter two must appear at the same time\n     * </pre>\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 异步方式获取配置里的资源。只要是配置文件里存在的资源，都可以通过异步方式获取。\n     * @param key 对应配置文件里的 name 属性或 sbuKeys 属性的一项。\n     * @param compFunc 回调函数。示例：compFunc(data,key):void。\n     * @param thisObject 回调函数的 this 引用。\n     * @see #setMaxRetryTimes\n     * @example 以下代码演示了如何通过getResAsync加载资源\n     * <pre>\n     *       RES.getResAsync(\"resource/example.json\");//只传入key值获取资源\n     *\n     *       RES.getResAsync(\"resource/example.json\", (data) => {\n     *          console.log(data)\n     *       }, this) //传入key值，compFunc和thisObject获取资源，后两个必须同时出现\n     * </pre>\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getResAsync(key, compFunc, thisObject) {\n        return compatiblePromise(instance.getResAsync.apply(instance, arguments));\n    }\n    RES.getResAsync = getResAsync;\n    /**\n     * Access to external resources through the full URL.\n     * @param url The external path to load the file.\n     * @param compFunc Call back function. Example：compFunc(data,url):void。\n     * @param thisObject This pointer of call back function.\n     * @param type File type (optional). Use the static constants defined in the ResourceItem class. If you do not set the file name extension.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 通过完整URL方式获取外部资源。\n     * @param url 要加载文件的外部路径。\n     * @param compFunc 回调函数。示例：compFunc(data,url):void。\n     * @param thisObject 回调函数的 this 引用。\n     * @param type 文件类型(可选)。请使用 ResourceItem 类中定义的静态常量。若不设置将根据文件扩展名生成。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getResByUrl(url, compFunc, thisObject, type) {\n        if (type === void 0) { type = \"\"; }\n        if (!instance) {\n            var message = egret.sys.tr(3200);\n            egret.warn(message);\n            return Promise.reject(message);\n        }\n        return compatiblePromise(instance.getResByUrl(url, compFunc, thisObject, type));\n    }\n    RES.getResByUrl = getResByUrl;\n    /**\n     * Destroy a single resource file or a set of resources to the cache data, to return whether to delete success.\n     * @param name Name attribute or resource group name of the load item in the configuration file.\n     * @param force Destruction of a resource group when the other resources groups have the same resource situation whether the resources will be deleted, the default value true.\n     * @returns Are successful destruction.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 销毁单个资源文件或一组资源的缓存数据,返回是否删除成功。\n     * @param name 配置文件中加载项的name属性或资源组名。\n     * @param force 销毁一个资源组时其他资源组有同样资源情况资源是否会被删除，默认值 true。\n     * @see #setMaxRetryTimes\n     * @returns 是否销毁成功。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function destroyRes(name, force) {\n        return instance.destroyRes(name, force);\n    }\n    RES.destroyRes = destroyRes;\n    /**\n     * Sets the maximum number of concurrent load threads, the default value is 4.\n     * @param thread The number of concurrent loads to be set.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 设置最大并发加载线程数量，默认值是 4。\n     * @param thread 要设置的并发加载数。\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function setMaxLoadingThread(thread) {\n        if (!instance)\n            instance = new Resource();\n        instance.setMaxLoadingThread(thread);\n    }\n    RES.setMaxLoadingThread = setMaxLoadingThread;\n    /**\n     * Sets the number of retry times when the resource failed to load, and the default value is 3.\n     * @param retry To set the retry count.\n     * @includeExample extension/resource/Resource.ts\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 设置资源加载失败时的重试次数，默认值是 3。\n     * @param retry 要设置的重试次数。\n     * @includeExample extension/resource/Resource.ts\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function setMaxRetryTimes(retry) {\n        instance.setMaxRetryTimes(retry);\n    }\n    RES.setMaxRetryTimes = setMaxRetryTimes;\n    /**\n     * Add event listeners, reference ResourceEvent defined constants.\n     * @param type Event name。\n     * @param listener Listener functions for handling events. This function must accept the Event object as its only parameter, and can't return any results,\n     * As shown in the following example: function (evt:Event):void can have any name.\n     * @param thisObject The this object that is bound to a function.\n     * @param useCapture Determine the listener is running on the capture or running on the target and the bubbling phase. Set useCapture to true,\n     * then the listener in the capture phase processing events, but not in the target or the bubbling phase processing events.\n     * If useCapture is false, then the listener only in the target or the bubbling phase processing events.\n     * To listen for events in all three stages, please call addEventListener two times: once the useCapture is set to true, once the useCapture is set to false.\n     * @param priority Event listener priority. Priority is specified by a 32 - bit integer with a symbol. The higher the number, the higher the priority.\n     * All listeners with a priority for n will be processed before the -1 n listener.\n     * If two or more listeners share the same priority, they are processed in accordance with the order of their added. The default priority is 0.\n     * @see RES.ResourceEvent\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 添加事件侦听器,参考 ResourceEvent 定义的常量。\n     * @param type 事件的类型。\n     * @param listener 处理事件的侦听器函数。此函数必须接受 Event 对象作为其唯一的参数，并且不能返回任何结果，\n     * 如下面的示例所示： function(evt:Event):void 函数可以有任何名称。\n     * @param thisObject 侦听函数绑定的 this 对象。\n     * @param useCapture 确定侦听器是运行于捕获阶段还是运行于目标和冒泡阶段。如果将 useCapture 设置为 true，\n     * 则侦听器只在捕获阶段处理事件，而不在目标或冒泡阶段处理事件。如果 useCapture 为 false，则侦听器只在目标或冒泡阶段处理事件。\n     * 要在所有三个阶段都侦听事件，请调用 addEventListener 两次：一次将 useCapture 设置为 true，一次将 useCapture 设置为 false。\n     * @param priority 事件侦听器的优先级。优先级由一个带符号的 32 位整数指定。数字越大，优先级越高。优先级为 n 的所有侦听器会在\n     * 优先级为 n -1 的侦听器之前得到处理。如果两个或更多个侦听器共享相同的优先级，则按照它们的添加顺序进行处理。默认优先级为 0。\n     * @see RES.ResourceEvent\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function addEventListener(type, listener, thisObject, useCapture, priority) {\n        if (useCapture === void 0) { useCapture = false; }\n        if (priority === void 0) { priority = 0; }\n        if (!instance)\n            instance = new Resource();\n        instance.addEventListener(type, listener, thisObject, useCapture, priority);\n    }\n    RES.addEventListener = addEventListener;\n    /**\n     * Remove event listeners, reference ResourceEvent defined constants.\n     * @param type Event name。\n     * @param listener Listening function。\n     * @param thisObject The this object that is bound to a function.\n     * @param useCapture Is used to capture, and this property is only valid in the display list.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 移除事件侦听器,参考ResourceEvent定义的常量。\n     * @param type 事件名。\n     * @param listener 侦听函数。\n     * @param thisObject 侦听函数绑定的this对象。\n     * @param useCapture 是否使用捕获，这个属性只在显示列表中生效。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function removeEventListener(type, listener, thisObject, useCapture) {\n        if (useCapture === void 0) { useCapture = false; }\n        instance.removeEventListener(type, listener, thisObject, useCapture);\n    }\n    RES.removeEventListener = removeEventListener;\n    /**\n     * Adding a custom resource configuration.\n     * @param data To add configuration.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 自定义添加一项资源配置。\n     * @param data 要添加的配置。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function $addResourceData(data) {\n        //这里可能需要其他配置\n        instance.addResourceData(data);\n    }\n    RES.$addResourceData = $addResourceData;\n    /**\n    * Returns the VersionController\n    * @version Egret 5.2\n    * @platform Web,Native\n    * @language en_US\n    */\n    /**\n     * 获得版本控制器.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getVersionController() {\n        if (!instance)\n            instance = new Resource();\n        return instance.vcs;\n    }\n    RES.getVersionController = getVersionController;\n    /**\n     * Register the VersionController\n     * @param vcs The VersionController to register.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 注册版本控制器,通过RES模块加载资源时会从版本控制器获取真实url\n     * @param vcs 注入的版本控制器。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function registerVersionController(vcs) {\n        if (!instance)\n            instance = new Resource();\n        instance.registerVersionController(vcs);\n    }\n    RES.registerVersionController = registerVersionController;\n    /**\n     * Convert the address of the loaded resource (via version controller conversion)\n     * @param url path to the original resource\n     * @returns converted address\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 转换加载资源的地址（经过版本控制器的转换）\n     * @param url 原始资源的路径\n     * @returns 转换后的地址\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getVirtualUrl(url) {\n        if (instance.vcs) {\n            return instance.vcs.getVirtualUrl(url);\n        }\n        else {\n            return url;\n        }\n    }\n    RES.getVirtualUrl = getVirtualUrl;\n    /**\n     * @private\n     */\n    var Resource = (function (_super) {\n        __extends(Resource, _super);\n        function Resource() {\n            var _this = _super.call(this) || this;\n            _this.isVcsInit = false;\n            /**\n             * @private\n             * 版本控制器加载后的加载配置\n             */\n            _this.normalLoadConfig = function () {\n                return RES.config.init().then(function (data) {\n                    RES.ResourceEvent.dispatchResourceEvent(_this, RES.ResourceEvent.CONFIG_COMPLETE);\n                }, function (error) {\n                    RES.ResourceEvent.dispatchResourceEvent(_this, RES.ResourceEvent.CONFIG_LOAD_ERROR);\n                    return Promise.reject(error);\n                });\n            };\n            if (RES.VersionController) {\n                _this.vcs = new RES.VersionController();\n            }\n            return _this;\n        }\n        Resource.prototype.registerVersionController = function (vcs) {\n            this.vcs = vcs;\n            this.isVcsInit = false;\n        };\n        /**\n         * 开始加载配置\n         * @method RES.loadConfig\n         */\n        Resource.prototype.loadConfig = function () {\n            var _this = this;\n            if (!this.isVcsInit && this.vcs) {\n                this.isVcsInit = true;\n                return this.vcs.init().then(function () {\n                    return _this.normalLoadConfig();\n                });\n            }\n            else {\n                return this.normalLoadConfig();\n            }\n        };\n        /**\n         * 检查某个资源组是否已经加载完成\n         * @method RES.isGroupLoaded\n         * @param name {string}\n         */\n        Resource.prototype.isGroupLoaded = function (name) {\n            var resources = RES.config.getGroupByName(name);\n            return resources.every(function (r) { return RES.host.get(r) != null; });\n        };\n        /**\n         * 根据组名获取组加载项列表\n         * @method RES.getGroupByName\n         * @param name {string}\n         */\n        Resource.prototype.getGroupByName = function (name) {\n            return RES.config.getGroupByName(name);\n        };\n        /**\n         * 根据组名加载一组资源\n         * @method RES.loadGroup\n         * @param name {string}\n         * @param priority {number}\n         */\n        Resource.prototype.loadGroup = function (name, priority, reporter) {\n            var _this = this;\n            if (priority === void 0) { priority = 0; }\n            var reporterDelegate = {\n                onProgress: function (current, total, resItem) {\n                    if (reporter && reporter.onProgress) {\n                        reporter.onProgress(current, total, resItem);\n                    }\n                    RES.ResourceEvent.dispatchResourceEvent(_this, RES.ResourceEvent.GROUP_PROGRESS, name, resItem, current, total);\n                }\n            };\n            return this._loadGroup(name, priority, reporterDelegate).then(function (data) {\n                if (RES.config.config.loadGroup.indexOf(name) == -1) {\n                    RES.config.config.loadGroup.push(name);\n                }\n                RES.ResourceEvent.dispatchResourceEvent(_this, RES.ResourceEvent.GROUP_COMPLETE, name);\n            }, function (error) {\n                if (RES.config.config.loadGroup.indexOf(name) == -1) {\n                    RES.config.config.loadGroup.push(name);\n                }\n                if (error.itemList) {\n                    var itemList = error.itemList;\n                    var length_1 = itemList.length;\n                    for (var i = 0; i < length_1; i++) {\n                        var item = itemList[i];\n                        delete item.promise;\n                        RES.ResourceEvent.dispatchResourceEvent(_this, RES.ResourceEvent.ITEM_LOAD_ERROR, name, item);\n                    }\n                }\n                if (RES.isCompatible) {\n                    console.warn(error.error.message);\n                }\n                RES.ResourceEvent.dispatchResourceEvent(_this, RES.ResourceEvent.GROUP_LOAD_ERROR, name);\n                return Promise.reject(error.error);\n            });\n        };\n        Resource.prototype._loadGroup = function (name, priority, reporter) {\n            if (priority === void 0) { priority = 0; }\n            var resources = RES.config.getGroupByName(name);\n            if (resources.length == 0) {\n                return new Promise(function (resolve, reject) {\n                    reject({ error: new RES.ResourceManagerError(2005, name) });\n                });\n            }\n            return RES.queue.pushResGroup(resources, name, priority, reporter);\n        };\n        /**\n         * 创建自定义的加载资源组,注意：此方法仅在资源配置文件加载完成后执行才有效。\n         * 可以监听ResourceEvent.CONFIG_COMPLETE事件来确认配置加载完成。\n         * @method RES.ResourceConfig#createGroup\n         * @param name {string} 要创建的加载资源组的组名\n         * @param keys {egret.Array<string>} 要包含的键名列表，key对应配置文件里的name属性或一个资源组名。\n         * @param override {boolean} 是否覆盖已经存在的同名资源组,默认false。\n         * @returns {boolean}\n         */\n        Resource.prototype.createGroup = function (name, keys, override) {\n            if (override === void 0) { override = false; }\n            return RES.config.createGroup(name, keys, override);\n        };\n        /**\n         * 检查配置文件里是否含有指定的资源\n         * @method RES.hasRes\n         * @param key {string} 对应配置文件里的name属性或subKeys属性的一项。\n         * @returns {boolean}\n         */\n        Resource.prototype.hasRes = function (key) {\n            return RES.config.getResourceWithSubkey(key) != null;\n        };\n        /**\n         * 通过key同步获取资源\n         * @method RES.getRes\n         * @param key {string}\n         * @returns {any}\n         */\n        Resource.prototype.getRes = function (resKey) {\n            var result = RES.config.getResourceWithSubkey(resKey);\n            if (result) {\n                var r = result.r;\n                var key = result.key;\n                var subkey = result.subkey;\n                var p = RES.processor.isSupport(r);\n                if (p && p.getData && subkey) {\n                    return p.getData(RES.host, r, key, subkey);\n                }\n                else {\n                    return RES.host.get(r);\n                }\n            }\n            else {\n                return null;\n            }\n        };\n        Resource.prototype.getResAsync = function (key, compFunc, thisObject) {\n            var _this = this;\n            var paramKey = key;\n            var tempResult = RES.config.getResourceWithSubkey(key);\n            if (tempResult == null) {\n                if (compFunc) {\n                    compFunc.call(thisObject, null, paramKey);\n                }\n                return Promise.reject(new RES.ResourceManagerError(2006, key));\n            }\n            var data = this.getRes(key);\n            if (data) {\n                if (compFunc) {\n                    egret.callLater(function () {\n                        compFunc.call(thisObject, data, paramKey);\n                    }, this);\n                }\n                return Promise.resolve(data);\n            }\n            var r = tempResult.r, subkey = tempResult.subkey;\n            return RES.queue.pushResItem(r).then(function (value) {\n                RES.host.save(r, value);\n                var p = RES.processor.isSupport(r);\n                if (p && p.getData && subkey) {\n                    value = p.getData(RES.host, r, key, subkey);\n                }\n                if (compFunc) {\n                    compFunc.call(thisObject, value, paramKey);\n                }\n                return value;\n            }, function (error) {\n                RES.host.remove(r);\n                RES.ResourceEvent.dispatchResourceEvent(_this, RES.ResourceEvent.ITEM_LOAD_ERROR, \"\", r);\n                if (compFunc) {\n                    compFunc.call(thisObject, null, paramKey);\n                    return Promise.reject(null);\n                }\n                return Promise.reject(error);\n            });\n        };\n        /**\n         * 通过url获取资源\n         * @method RES.getResByUrl\n         * @param url {string}\n         * @param compFunc {Function}\n         * @param thisObject {any}\n         * @param type {string}\n         */\n        Resource.prototype.getResByUrl = function (url, compFunc, thisObject, type) {\n            var _this = this;\n            if (type === void 0) { type = \"\"; }\n            var r = RES.config.getResource(url);\n            if (!r) {\n                if (!type) {\n                    type = RES.config.__temp__get__type__via__url(url);\n                }\n                // manager.config.addResourceData({ name: url, url: url });\n                r = { name: url, url: url, type: type, root: '', extra: 1 };\n                RES.config.addResourceData(r);\n                r = RES.config.getResource(url);\n                if (!r) {\n                    throw 'never';\n                }\n            }\n            return RES.queue.pushResItem(r).then(function (value) {\n                RES.host.save(r, value);\n                if (compFunc && r) {\n                    compFunc.call(thisObject, value, r.url);\n                }\n                return value;\n            }, function (error) {\n                RES.host.remove(r);\n                RES.ResourceEvent.dispatchResourceEvent(_this, RES.ResourceEvent.ITEM_LOAD_ERROR, \"\", r);\n                if (compFunc) {\n                    compFunc.call(thisObject, null, url);\n                    return Promise.reject(null);\n                }\n                return Promise.reject(error);\n            });\n        };\n        /**\n         * 销毁单个资源文件或一组资源的缓存数据,返回是否删除成功。\n         * @method RES.destroyRes\n         * @param name {string} 配置文件中加载项的name属性或资源组名\n         * @param force {boolean} 销毁一个资源组时其他资源组有同样资源情况资源是否会被删除，默认值true\n         * @returns {boolean}\n         */\n        Resource.prototype.destroyRes = function (name, force) {\n            if (force === void 0) { force = true; }\n            var group = RES.config.getGroupByName(name);\n            if (group && group.length > 0) {\n                var index = RES.config.config.loadGroup.indexOf(name);\n                if (index == -1) {\n                    return false;\n                }\n                if (force || (RES.config.config.loadGroup.length == 1 && RES.config.config.loadGroup[0] == name)) {\n                    for (var _i = 0, group_2 = group; _i < group_2.length; _i++) {\n                        var item = group_2[_i];\n                        RES.queue.unloadResource(item);\n                    }\n                    RES.config.config.loadGroup.splice(index, 1);\n                }\n                else {\n                    var removeItemHash = {};\n                    for (var _a = 0, _b = RES.config.config.loadGroup; _a < _b.length; _a++) {\n                        var groupName = _b[_a];\n                        for (var key in RES.config.config.groups[groupName]) {\n                            var tmpname = RES.config.config.groups[groupName][key];\n                            if (removeItemHash[tmpname]) {\n                                removeItemHash[tmpname]++;\n                            }\n                            else {\n                                removeItemHash[tmpname] = 1;\n                            }\n                        }\n                    }\n                    for (var _c = 0, group_3 = group; _c < group_3.length; _c++) {\n                        var item = group_3[_c];\n                        if (removeItemHash[item.name] && removeItemHash[item.name] == 1) {\n                            RES.queue.unloadResource(item);\n                        }\n                    }\n                    RES.config.config.loadGroup.splice(index, 1);\n                }\n                return true;\n            }\n            else {\n                var item = RES.config.getResource(name);\n                if (item) {\n                    return RES.queue.unloadResource(item);\n                }\n                else {\n                    console.warn(\"\\u5728\\u5185\\u5B58\" + name + \"\\u8D44\\u6E90\\u4E0D\\u5B58\\u5728\");\n                    return false;\n                }\n            }\n        };\n        /**\n         * 设置最大并发加载线程数量，默认值是4.\n         * @method RES.setMaxLoadingThread\n         * @param thread {number} 要设置的并发加载数。\n         */\n        Resource.prototype.setMaxLoadingThread = function (thread) {\n            if (thread < 1) {\n                thread = 1;\n            }\n            RES.queue.thread = thread;\n        };\n        /**\n         * 设置资源加载失败时的重试次数。\n         * @param retry 要设置的重试次数。\n         */\n        Resource.prototype.setMaxRetryTimes = function (retry) {\n            retry = Math.max(retry, 0);\n            RES.queue.maxRetryTimes = retry;\n        };\n        Resource.prototype.addResourceData = function (data) {\n            data[\"root\"] = '';\n            RES.config.addResourceData(data);\n        };\n        __decorate([\n            RES.checkNull\n        ], Resource.prototype, \"hasRes\", null);\n        __decorate([\n            RES.checkNull\n        ], Resource.prototype, \"getRes\", null);\n        __decorate([\n            RES.checkNull\n        ], Resource.prototype, \"getResAsync\", null);\n        __decorate([\n            RES.checkNull\n        ], Resource.prototype, \"getResByUrl\", null);\n        return Resource;\n    }(egret.EventDispatcher));\n    RES.Resource = Resource;\n    __reflect(Resource.prototype, \"RES.Resource\");\n    /**\n     * Resource单例\n     */\n    var instance;\n})(RES || (RES = {}));\nvar RES;\n(function (RES) {\n    /**\n     * Print the memory occupied by the picture.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 对文件路径的一些操作，针对的是 C:/A/B/C/D/example.ts这种格式\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var path;\n    (function (path_1) {\n        /**\n         * Format the file path,\"C:/A/B//C//D//example.ts\"=>\"C:/A/B/C/D/example.ts\"\n         * @param filename Incoming file path\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 格式化文件路径，\"C:/A/B//C//D//example.ts\"=>\"C:/A/B/C/D/example.ts\"\n         * @param filename 传入的文件路径\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function normalize(filename) {\n            var arr = filename.split(\"/\");\n            return arr.filter(function (value, index) { return !!value || index == arr.length - 1; }).join(\"/\");\n        }\n        path_1.normalize = normalize;\n        /**\n         * Get the file name according to the file path, \"C:/A/B/example.ts\"=>\"example.ts\"\n         * @param filename Incoming file path\n         * @return File name\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 根据文件路径得到文件名字，\"C:/A/B/example.ts\"=>\"example.ts\"\n         * @param filename 传入的文件路径\n         * @return 文件的名字\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function basename(filename) {\n            return filename.substr(filename.lastIndexOf(\"/\") + 1);\n        }\n        path_1.basename = basename;\n        /**\n         * The path to the folder where the file is located,\"C:/A/B/example.ts\"=>\"C:/A/B\"\n         * @param filename Incoming file path\n         * @return The address of the folder where the file is located\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文件所在文件夹路径，\"C:/A/B/example.ts\"=>\"C:/A/B\"\n         * @param filename 传入的文件路径\n         * @return 文件所在文件夹的地址\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function dirname(path) {\n            return path.substr(0, path.lastIndexOf(\"/\"));\n        }\n        path_1.dirname = dirname;\n    })(path = RES.path || (RES.path = {}));\n})(RES || (RES = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar RES;\n(function (RES) {\n    /**\n     * @private\n     */\n    var NativeVersionController = (function () {\n        function NativeVersionController() {\n        }\n        NativeVersionController.prototype.init = function () {\n            this.versionInfo = this.getLocalData(\"all.manifest\");\n            return Promise.resolve();\n        };\n        NativeVersionController.prototype.getVirtualUrl = function (url) {\n            return url;\n        };\n        NativeVersionController.prototype.getLocalData = function (filePath) {\n            if (egret_native.readUpdateFileSync && egret_native.readResourceFileSync) {\n                //先取更新目录\n                var content = egret_native.readUpdateFileSync(filePath);\n                if (content != null) {\n                    return JSON.parse(content);\n                }\n                //再取资源目录\n                content = egret_native.readResourceFileSync(filePath);\n                if (content != null) {\n                    return JSON.parse(content);\n                }\n            }\n            return null;\n        };\n        return NativeVersionController;\n    }());\n    RES.NativeVersionController = NativeVersionController;\n    __reflect(NativeVersionController.prototype, \"RES.NativeVersionController\", [\"RES.IVersionController\"]);\n    if (egret.Capabilities.runtimeType == egret.RuntimeType.NATIVE) {\n        RES.VersionController = NativeVersionController;\n    }\n})(RES || (RES = {}));\nvar RES;\n(function (RES) {\n    var processor;\n    (function (processor_1) {\n        /**\n         * @internal\n         * @param resource 对应的资源接口，需要type属性\n         */\n        function isSupport(resource) {\n            return processor_1._map[resource.type];\n        }\n        processor_1.isSupport = isSupport;\n        /**\n         * Register the processor that loads the resource\n         * @param type Load resource type\n         * @param processor Loaded processor, an instance that implements the Processor interface\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 注册加载资源的处理器\n         * @param type 加载资源类型\n         * @param processor 加载的处理器，一个实现Processor接口的实例\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function map(type, processor) {\n            processor_1._map[type] = processor;\n        }\n        processor_1.map = map;\n        /**\n        * @internal\n        */\n        function promisify(loader, resource) {\n            var _this = this;\n            return new Promise(function (resolve, reject) {\n                var onSuccess = function () {\n                    var texture = loader['data'] ? loader['data'] : loader['response'];\n                    resolve(texture);\n                };\n                var onError = function () {\n                    var e = new RES.ResourceManagerError(1001, resource.url);\n                    reject(e);\n                };\n                loader.addEventListener(egret.Event.COMPLETE, onSuccess, _this);\n                loader.addEventListener(egret.IOErrorEvent.IO_ERROR, onError, _this);\n            });\n        }\n        /**\n         * @private\n         * @param url\n         * @param file\n         */\n        function getRelativePath(url, file) {\n            if (file.indexOf(\"://\") != -1) {\n                return file;\n            }\n            url = url.split(\"\\\\\").join(\"/\");\n            var params = url.match(/#.*|\\?.*/);\n            var paramUrl = \"\";\n            if (params) {\n                paramUrl = params[0];\n            }\n            var index = url.lastIndexOf(\"/\");\n            if (index != -1) {\n                url = url.substring(0, index + 1) + file;\n            }\n            else {\n                url = file;\n            }\n            return url + paramUrl;\n        }\n        processor_1.getRelativePath = getRelativePath;\n        processor_1.ImageProcessor = {\n            onLoadStart: function (host, resource) {\n                var loader = new egret.ImageLoader();\n                loader.load(RES.getVirtualUrl(resource.root + resource.url));\n                return promisify(loader, resource)\n                    .then(function (bitmapData) {\n                    var texture = new egret.Texture();\n                    texture._setBitmapData(bitmapData);\n                    var r = host.resourceConfig.getResource(resource.name);\n                    if (r && r.scale9grid) {\n                        var list = r.scale9grid.split(\",\");\n                        texture[\"scale9Grid\"] = new egret.Rectangle(parseInt(list[0]), parseInt(list[1]), parseInt(list[2]), parseInt(list[3]));\n                    }\n                    return texture;\n                });\n            },\n            onRemoveStart: function (host, resource) {\n                var texture = host.get(resource);\n                texture.dispose();\n            }\n        };\n        processor_1.KTXTextureProcessor = {\n            onLoadStart: function (host, resource) {\n                return host.load(resource, 'bin').then(function (data) {\n                    if (!data) {\n                        console.error('ktx:' + resource.root + resource.url + ' is null');\n                        return null;\n                    }\n                    var ktx = new egret.KTXContainer(data, 1);\n                    if (ktx.isInvalid) {\n                        console.error('ktx:' + resource.root + resource.url + ' is invalid');\n                        return null;\n                    }\n                    //\n                    var bitmapData = new egret.BitmapData(data);\n                    bitmapData.debugCompressedTextureURL = resource.root + resource.url;\n                    bitmapData.format = 'ktx';\n                    ktx.uploadLevels(bitmapData, false);\n                    //\n                    var texture = new egret.Texture();\n                    texture._setBitmapData(bitmapData);\n                    var r = host.resourceConfig.getResource(resource.name);\n                    if (r && r.scale9grid) {\n                        var list = r.scale9grid.split(\",\");\n                        texture[\"scale9Grid\"] = new egret.Rectangle(parseInt(list[0]), parseInt(list[1]), parseInt(list[2]), parseInt(list[3]));\n                    }\n                    //\n                    host.save(resource, texture);\n                    return texture;\n                }, function (e) {\n                    host.remove(resource);\n                    throw e;\n                });\n            },\n            onRemoveStart: function (host, resource) {\n                var texture = host.get(resource);\n                if (texture) {\n                    texture.dispose();\n                }\n            }\n        };\n        /**\n        *\n        */\n        function makeEtc1SeperatedAlphaResourceInfo(resource) {\n            return { name: resource.name + '_alpha', url: resource['etc1_alpha_url'], type: 'ktx', root: resource.root };\n        }\n        processor_1.makeEtc1SeperatedAlphaResourceInfo = makeEtc1SeperatedAlphaResourceInfo;\n        /**\n        *\n        */\n        processor_1.ETC1KTXProcessor = {\n            onLoadStart: function (host, resource) {\n                return host.load(resource, \"ktx\").then(function (colorTex) {\n                    if (!colorTex) {\n                        return null;\n                    }\n                    if (resource['etc1_alpha_url']) {\n                        var r_1 = makeEtc1SeperatedAlphaResourceInfo(resource);\n                        return host.load(r_1, \"ktx\")\n                            .then(function (alphaMaskTex) {\n                            if (colorTex && colorTex.$bitmapData && alphaMaskTex.$bitmapData) {\n                                colorTex.$bitmapData.etcAlphaMask = alphaMaskTex.$bitmapData;\n                                host.save(r_1, alphaMaskTex);\n                            }\n                            else {\n                                host.remove(r_1);\n                            }\n                            return colorTex;\n                        }, function (e) {\n                            host.remove(r_1);\n                            throw e;\n                        });\n                    }\n                    return colorTex;\n                }, function (e) {\n                    host.remove(resource);\n                    throw e;\n                });\n            },\n            onRemoveStart: function (host, resource) {\n                var colorTex = host.get(resource);\n                if (colorTex) {\n                    colorTex.dispose();\n                }\n                if (resource['etc1_alpha_url']) {\n                    var r = makeEtc1SeperatedAlphaResourceInfo(resource);\n                    var alphaMaskTex = host.get(r);\n                    if (alphaMaskTex) {\n                        alphaMaskTex.dispose();\n                    }\n                    host.unload(r); //这里其实还会再删除一次，不过无所谓了。alphaMaskTex已经显示删除了\n                }\n            }\n        };\n        processor_1.BinaryProcessor = {\n            onLoadStart: function (host, resource) {\n                var request = new egret.HttpRequest();\n                request.responseType = egret.HttpResponseType.ARRAY_BUFFER;\n                request.open(RES.getVirtualUrl(resource.root + resource.url), \"get\");\n                request.send();\n                return promisify(request, resource);\n            },\n            onRemoveStart: function (host, resource) {\n            }\n        };\n        processor_1.TextProcessor = {\n            onLoadStart: function (host, resource) {\n                var request = new egret.HttpRequest();\n                request.responseType = egret.HttpResponseType.TEXT;\n                request.open(RES.getVirtualUrl(resource.root + resource.url), \"get\");\n                request.send();\n                return promisify(request, resource);\n            },\n            onRemoveStart: function (host, resource) {\n                return true;\n            }\n        };\n        processor_1.JsonProcessor = {\n            onLoadStart: function (host, resource) {\n                return host.load(resource, 'text').then(function (text) {\n                    var data = JSON.parse(text);\n                    return data;\n                });\n            },\n            onRemoveStart: function (host, request) {\n            }\n        };\n        /**\n        * @internal\n        */\n        processor_1.XMLProcessor = {\n            onLoadStart: function (host, resource) {\n                return host.load(resource, 'text').then(function (text) {\n                    var data = egret.XML.parse(text);\n                    return data;\n                });\n            },\n            onRemoveStart: function (host, resource) {\n                return true;\n            }\n        };\n        /**\n        * @internal\n        */\n        processor_1.CommonJSProcessor = {\n            onLoadStart: function (host, resource) {\n                // let text = await host.load(resource, 'text');\n                return host.load(resource, 'text').then(function (text) {\n                    var f = new Function('require', 'exports', text);\n                    var require = function () { };\n                    var exports = {};\n                    try {\n                        f(require, exports);\n                    }\n                    catch (e) {\n                        throw new RES.ResourceManagerError(2003, resource.name, e.message);\n                    }\n                    return exports;\n                });\n            },\n            onRemoveStart: function (host, resource) {\n            }\n        };\n        /**\n        * @internal\n        */\n        processor_1.SheetProcessor = {\n            onLoadStart: function (host, resource) {\n                return host.load(resource, \"json\").then(function (data) {\n                    var r = host.resourceConfig.getResource(RES.nameSelector(data.file));\n                    if (!r) {\n                        var imageName = getRelativePath(resource.url, data.file);\n                        r = { name: imageName, url: imageName, type: 'image', root: resource.root };\n                    }\n                    return host.load(r)\n                        .then(function (bitmapData) {\n                        if (!bitmapData) {\n                            return null;\n                        }\n                        var frames = data.frames;\n                        var spriteSheet = new egret.SpriteSheet(bitmapData);\n                        spriteSheet[\"$resourceInfo\"] = r;\n                        for (var subkey in frames) {\n                            var config = frames[subkey];\n                            var texture = spriteSheet.createTexture(subkey, config.x, config.y, config.w, config.h, config.offX, config.offY, config.sourceW, config.sourceH);\n                            if (config[\"scale9grid\"]) {\n                                var str = config[\"scale9grid\"];\n                                var list = str.split(\",\");\n                                texture[\"scale9Grid\"] = new egret.Rectangle(parseInt(list[0]), parseInt(list[1]), parseInt(list[2]), parseInt(list[3]));\n                            }\n                        }\n                        host.save(r, bitmapData);\n                        return spriteSheet;\n                    }, function (e) {\n                        host.remove(r);\n                        throw e;\n                    });\n                });\n            },\n            getData: function (host, resource, key, subkey) {\n                var data = host.get(resource);\n                if (data) {\n                    return data.getTexture(subkey);\n                }\n                else {\n                    return null;\n                }\n            },\n            onRemoveStart: function (host, resource) {\n                var sheet = host.get(resource);\n                var r = sheet[\"$resourceInfo\"];\n                sheet.dispose();\n                host.unload(r);\n            }\n        };\n        var fontGetTexturePath = function (url, fntText) {\n            var file = \"\";\n            var lines = fntText.split(\"\\n\");\n            var pngLine = lines[2];\n            var index = pngLine.indexOf(\"file=\\\"\");\n            if (index != -1) {\n                pngLine = pngLine.substring(index + 6);\n                index = pngLine.indexOf(\"\\\"\");\n                file = pngLine.substring(0, index);\n            }\n            url = url.split(\"\\\\\").join(\"/\");\n            var index = url.lastIndexOf(\"/\");\n            if (index != -1) {\n                url = url.substring(0, index + 1) + file;\n            }\n            else {\n                url = file;\n            }\n            return url;\n        };\n        /**\n        * @internal\n        */\n        processor_1.FontProcessor = {\n            onLoadStart: function (host, resource) {\n                // let data: string = await host.load(resource, 'text');\n                return host.load(resource, 'text').then(function (data) {\n                    var config;\n                    try {\n                        config = JSON.parse(data);\n                    }\n                    catch (e) {\n                        config = data;\n                    }\n                    var imageName;\n                    if (typeof config === 'string') {\n                        imageName = fontGetTexturePath(resource.url, config);\n                    }\n                    else {\n                        imageName = getRelativePath(resource.url, config.file);\n                    }\n                    var r = host.resourceConfig.getResource(RES.nameSelector(imageName));\n                    if (!r) {\n                        r = { name: imageName, url: imageName, type: 'image', root: resource.root };\n                    }\n                    // var texture: egret.Texture = await host.load(r);\n                    return host.load(r).then(function (texture) {\n                        var font = new egret.BitmapFont(texture, config);\n                        font[\"$resourceInfo\"] = r;\n                        // todo refactor\n                        host.save(r, texture);\n                        return font;\n                    }, function (e) {\n                        host.remove(r);\n                        throw e;\n                    });\n                });\n            },\n            onRemoveStart: function (host, resource) {\n                var font = host.get(resource);\n                var r = font[\"$resourceInfo\"];\n                host.unload(r);\n            }\n        };\n        processor_1.SoundProcessor = {\n            onLoadStart: function (host, resource) {\n                var sound = new egret.Sound();\n                sound.load(RES.getVirtualUrl(resource.root + resource.url));\n                return promisify(sound, resource).then(function () {\n                    return sound;\n                });\n            },\n            onRemoveStart: function (host, resource) {\n                var sound = host.get(resource);\n                sound.close();\n            }\n        };\n        /**\n        * @internal\n        */\n        processor_1.MovieClipProcessor = {\n            onLoadStart: function (host, resource) {\n                var mcData;\n                var imageResource;\n                return host.load(resource, 'json')\n                    .then(function (value) {\n                    mcData = value;\n                    var jsonPath = resource.name;\n                    var imagePath = jsonPath.substring(0, jsonPath.lastIndexOf(\".\")) + \".png\";\n                    imageResource = host.resourceConfig.getResource(imagePath);\n                    if (!imageResource) {\n                        throw new RES.ResourceManagerError(1001, imagePath);\n                    }\n                    return host.load(imageResource);\n                }).then(function (value) {\n                    host.save(imageResource, value);\n                    var mcTexture = value;\n                    var mcDataFactory = new egret.MovieClipDataFactory(mcData, mcTexture);\n                    return mcDataFactory;\n                });\n            },\n            onRemoveStart: function (host, resource) {\n                var mcFactory = host.get(resource);\n                mcFactory.clearCache();\n                mcFactory.$spriteSheet.dispose();\n                // refactor\n                var jsonPath = resource.name;\n                var imagePath = jsonPath.substring(0, jsonPath.lastIndexOf(\".\")) + \".png\";\n                var imageResource = host.resourceConfig.getResource(imagePath);\n                if (imageResource) {\n                    host.unload(imageResource);\n                }\n            }\n        };\n        /**\n        * @internal\n        */\n        processor_1.MergeJSONProcessor = {\n            onLoadStart: function (host, resource) {\n                // let data = await host.load(resource, 'json');\n                return host.load(resource, 'json').then(function (data) {\n                    for (var key in data) {\n                        RES.config.addSubkey(key, resource.name);\n                    }\n                    return data;\n                });\n            },\n            getData: function (host, resource, key, subkey) {\n                var data = host.get(resource);\n                if (data) {\n                    return data[subkey];\n                }\n                else {\n                    console.error(\"missing resource :\" + resource.name);\n                    return null;\n                }\n            },\n            onRemoveStart: function (host, resource) {\n            }\n        };\n        /**\n        * @internal\n        */\n        processor_1.LegacyResourceConfigProcessor = {\n            onLoadStart: function (host, resource) {\n                return host.load(resource, 'json').then(function (data) {\n                    var resConfigData = RES.config.config;\n                    var root = resource.root;\n                    var fileSystem = resConfigData.fileSystem;\n                    if (!fileSystem) {\n                        fileSystem = {\n                            fsData: {},\n                            getFile: function (filename) {\n                                return fsData[filename];\n                            },\n                            addFile: function (data) {\n                                if (!data.type)\n                                    data.type = \"\";\n                                if (root == undefined) {\n                                    data.root = \"\";\n                                }\n                                fsData[data.name] = data;\n                            },\n                            profile: function () {\n                                console.log(fsData);\n                            },\n                            removeFile: function (filename) {\n                                delete fsData[filename];\n                            }\n                        };\n                        resConfigData.fileSystem = fileSystem;\n                    }\n                    var groups = resConfigData.groups;\n                    for (var _i = 0, _a = data.groups; _i < _a.length; _i++) {\n                        var g = _a[_i];\n                        if (g.keys == \"\") {\n                            groups[g.name] = [];\n                        }\n                        else {\n                            groups[g.name] = g.keys.split(\",\");\n                        }\n                    }\n                    var alias = resConfigData.alias;\n                    var fsData = fileSystem['fsData'];\n                    var _loop_1 = function (resource_1) {\n                        fsData[resource_1.name] = resource_1;\n                        fsData[resource_1.name].root = root;\n                        if (resource_1.subkeys) {\n                            resource_1.subkeys.split(\",\").forEach(function (subkey) {\n                                alias[subkey] = resource_1.name + \"#\" + subkey;\n                                alias[resource_1.name + \".\" + subkey] = resource_1.name + \"#\" + subkey;\n                            });\n                            // ResourceConfig.\n                        }\n                    };\n                    for (var _b = 0, _c = data.resources; _b < _c.length; _b++) {\n                        var resource_1 = _c[_b];\n                        _loop_1(resource_1);\n                    }\n                    host.save(resource, data);\n                    return data;\n                });\n            },\n            onRemoveStart: function () {\n            }\n        };\n        /**\n        * @internal\n        */\n        processor_1._map = {\n            \"image\": processor_1.ImageProcessor,\n            \"json\": processor_1.JsonProcessor,\n            \"text\": processor_1.TextProcessor,\n            \"xml\": processor_1.XMLProcessor,\n            \"sheet\": processor_1.SheetProcessor,\n            \"font\": processor_1.FontProcessor,\n            \"bin\": processor_1.BinaryProcessor,\n            \"commonjs\": processor_1.CommonJSProcessor,\n            \"sound\": processor_1.SoundProcessor,\n            \"movieclip\": processor_1.MovieClipProcessor,\n            \"mergeJson\": processor_1.MergeJSONProcessor,\n            \"legacyResourceConfig\": processor_1.LegacyResourceConfigProcessor,\n            \"ktx\": processor_1.KTXTextureProcessor,\n            \"etc1.ktx\": processor_1.ETC1KTXProcessor,\n            \"pvrtc.ktx\": processor_1.KTXTextureProcessor,\n        };\n    })(processor = RES.processor || (RES.processor = {}));\n})(RES || (RES = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar RES;\n(function (RES) {\n    /**\n     * The events of resource loading.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 资源加载事件。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var ResourceEvent = (function (_super) {\n        __extends(ResourceEvent, _super);\n        /**\n         * Creates an Event object to pass as a parameter to event listeners.\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @private\n         * @language en_US\n         */\n        /**\n         * 创建一个作为参数传递给事件侦听器的 Event 对象。\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @private\n         * @language zh_CN\n         */\n        function ResourceEvent(type, bubbles, cancelable) {\n            if (bubbles === void 0) { bubbles = false; }\n            if (cancelable === void 0) { cancelable = false; }\n            var _this = _super.call(this, type, bubbles, cancelable) || this;\n            /**\n             * File number that has been loaded.\n             * @version Egret 5.2\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 已经加载的文件数。\n             * @version Egret 5.2\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.itemsLoaded = 0;\n            /**\n             * Total file number to load.\n             * @version Egret 5.2\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 要加载的总文件数。\n             * @version Egret 5.2\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.itemsTotal = 0;\n            /**\n             * Resource group name.\n             * @version Egret 5.2\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 资源组名。\n             * @version Egret 5.2\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.groupName = \"\";\n            return _this;\n        }\n        /**\n         * 使用指定的EventDispatcher对象来抛出事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @method RES.ResourceEvent.dispatchResourceEvent\n         * @param target {egret.IEventDispatcher}\n         * @param type {string}\n         * @param groupName {string}\n         * @param resItem {egret.ResourceItem}\n         * @param itemsLoaded {number}\n         * @param itemsTotal {number}\n         * @internal\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_CN\n         */\n        ResourceEvent.dispatchResourceEvent = function (target, type, groupName, resItem, itemsLoaded, itemsTotal) {\n            if (groupName === void 0) { groupName = \"\"; }\n            if (resItem === void 0) { resItem = undefined; }\n            if (itemsLoaded === void 0) { itemsLoaded = 0; }\n            if (itemsTotal === void 0) { itemsTotal = 0; }\n            var event = egret.Event.create(ResourceEvent, type);\n            event.groupName = groupName;\n            if (resItem) {\n                event.resItem = RES.ResourceItem.convertToResItem(resItem);\n            }\n            event.itemsLoaded = itemsLoaded;\n            event.itemsTotal = itemsTotal;\n            var result = target.dispatchEvent(event);\n            egret.Event.release(event);\n            return result;\n        };\n        /**\n         * Failure event for a load item.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个加载项加载失败事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ResourceEvent.ITEM_LOAD_ERROR = \"itemLoadError\";\n        /**\n         * Configure file to load and parse the completion event. Note: if a configuration file is loaded, it will not be thrown out, and if you want to handle the configuration loading failure, monitor the CONFIG_LOAD_ERROR event.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 配置文件加载并解析完成事件。注意：若有配置文件加载失败，将不会抛出此事件，若要处理配置加载失败，请同时监听 CONFIG_LOAD_ERROR 事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ResourceEvent.CONFIG_COMPLETE = \"configComplete\";\n        /**\n         * Configuration file failed to load.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 配置文件加载失败事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ResourceEvent.CONFIG_LOAD_ERROR = \"configLoadError\";\n        /**\n         * Delay load group resource loading progress event.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 延迟加载组资源加载进度事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ResourceEvent.GROUP_PROGRESS = \"groupProgress\";\n        /**\n         * Delay load group resource to complete event. Note: if you have a resource item loading failure, the event will not be thrown, if you want to handle the group load failure, please listen to the GROUP_LOAD_ERROR event.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 延迟加载组资源加载完成事件。注意：若组内有资源项加载失败，将不会抛出此事件，若要处理组加载失败，请同时监听 GROUP_LOAD_ERROR 事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ResourceEvent.GROUP_COMPLETE = \"groupComplete\";\n        /**\n         * Delayed load group resource failed event.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 延迟加载组资源加载失败事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ResourceEvent.GROUP_LOAD_ERROR = \"groupLoadError\";\n        return ResourceEvent;\n    }(egret.Event));\n    RES.ResourceEvent = ResourceEvent;\n    __reflect(ResourceEvent.prototype, \"RES.ResourceEvent\");\n})(RES || (RES = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar RES;\n(function (RES) {\n    /**\n     * Resource term. One of the resources arrays in resource.json.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 资源项。对应 resource.json 中 resources 数组中的一项。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var ResourceItem;\n    (function (ResourceItem) {\n        /**\n         * XML file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * XML 文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ResourceItem.TYPE_XML = \"xml\";\n        /**\n         * Picture file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 图片文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ResourceItem.TYPE_IMAGE = \"image\";\n        /**\n         * Binary file.\n         * @version Egret 5.2\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 二进制文件。\n         * @version Egret 5.2\n         * @platform Web\n         * @language zh_CN\n         */\n        ResourceItem.TYPE_BIN = \"bin\";\n        /**\n         * Text file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ResourceItem.TYPE_TEXT = \"text\";\n        /**\n         * JSON file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * JSON 文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ResourceItem.TYPE_JSON = \"json\";\n        /**\n         * SpriteSheet file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * SpriteSheet 文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ResourceItem.TYPE_SHEET = \"sheet\";\n        /**\n         * BitmapTextSpriteSheet file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * BitmapTextSpriteSheet 文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ResourceItem.TYPE_FONT = \"font\";\n        /**\n         * Sound file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 声音文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ResourceItem.TYPE_SOUND = \"sound\";\n        function convertToResItem(r) {\n            var name = r.name;\n            if (!RES.config.config) {\n                name = r.url;\n            }\n            else {\n                for (var aliasName in RES.config.config.alias) {\n                    if (RES.config.config.alias[aliasName] == r.url) {\n                        name = aliasName;\n                    }\n                }\n            }\n            var result = {\n                name: name,\n                url: r.url,\n                type: r.type,\n                data: r,\n                root: r.root\n            };\n            return result;\n        }\n        ResourceItem.convertToResItem = convertToResItem;\n    })(ResourceItem = RES.ResourceItem || (RES.ResourceItem = {}));\n})(RES || (RES = {}));\nvar RES;\n(function (RES) {\n    /**\n    * @internal\n    */\n    var NewFileSystem = (function () {\n        function NewFileSystem(data) {\n            this.data = data;\n        }\n        NewFileSystem.prototype.profile = function () {\n            console.log(this.data);\n        };\n        NewFileSystem.prototype.addFile = function (filename, type) {\n            if (!type)\n                type = \"\";\n            filename = RES.path.normalize(filename);\n            var basefilename = RES.path.basename(filename);\n            var folder = RES.path.dirname(filename);\n            if (!this.exists(folder)) {\n                this.mkdir(folder);\n            }\n            var d = this.resolve(folder);\n            d[basefilename] = { url: filename, type: type };\n        };\n        NewFileSystem.prototype.getFile = function (filename) {\n            var result = this.resolve(filename);\n            if (result) {\n                result.name = filename;\n            }\n            return result;\n        };\n        NewFileSystem.prototype.resolve = function (dirpath) {\n            if (dirpath == \"\") {\n                return this.data;\n            }\n            dirpath = RES.path.normalize(dirpath);\n            var list = dirpath.split(\"/\");\n            var current = this.data;\n            for (var _i = 0, list_2 = list; _i < list_2.length; _i++) {\n                var f = list_2[_i];\n                if (current) {\n                    current = current[f];\n                }\n                else {\n                    return current;\n                }\n            }\n            return current;\n        };\n        NewFileSystem.prototype.mkdir = function (dirpath) {\n            dirpath = RES.path.normalize(dirpath);\n            var list = dirpath.split(\"/\");\n            var current = this.data;\n            for (var _i = 0, list_3 = list; _i < list_3.length; _i++) {\n                var f = list_3[_i];\n                if (!current[f]) {\n                    current[f] = {};\n                }\n                current = current[f];\n            }\n        };\n        NewFileSystem.prototype.exists = function (dirpath) {\n            if (dirpath == \"\")\n                return true;\n            dirpath = RES.path.normalize(dirpath);\n            var list = dirpath.split(\"/\");\n            var current = this.data;\n            for (var _i = 0, list_4 = list; _i < list_4.length; _i++) {\n                var f = list_4[_i];\n                if (!current[f]) {\n                    return false;\n                }\n                current = current[f];\n            }\n            return true;\n        };\n        return NewFileSystem;\n    }());\n    RES.NewFileSystem = NewFileSystem;\n    __reflect(NewFileSystem.prototype, \"RES.NewFileSystem\");\n})(RES || (RES = {}));\nvar RES;\n(function (RES) {\n    var __tempCache = {};\n    /**\n     * Print the memory occupied by the picture.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 打印图片所占内存\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function profile() {\n        RES.config.config.fileSystem.profile();\n        console.log(__tempCache);\n        //todo \n        var totalImageSize = 0;\n        for (var key in __tempCache) {\n            var img = __tempCache[key];\n            if (img instanceof egret.Texture) {\n                totalImageSize += img.$bitmapWidth * img.$bitmapHeight * 4;\n            }\n        }\n        console.log(\"gpu size : \" + (totalImageSize / 1024).toFixed(3) + \"kb\");\n    }\n    RES.profile = profile;\n    /**\n    * @internal\n    */\n    RES.host = {\n        state: {},\n        get resourceConfig() {\n            return RES.config;\n        },\n        load: function (r, processorName) {\n            var processor = typeof processorName == 'string' ? RES.processor._map[processorName] : processorName;\n            return RES.queue[\"loadResource\"](r, processor);\n        },\n        unload: function (r) { return RES.queue.unloadResource(r); },\n        save: function (resource, data) {\n            RES.host.state[resource.root + resource.name] = 2;\n            delete resource.promise;\n            __tempCache[resource.root + resource.name] = data;\n        },\n        get: function (resource) {\n            return __tempCache[resource.root + resource.name];\n        },\n        remove: function (resource) {\n            delete RES.host.state[resource.root + resource.name];\n            delete __tempCache[resource.root + resource.name];\n        }\n    };\n    /**\n     * @internal\n     */\n    RES.config = new RES.ResourceConfig();\n    /**\n     * @internal\n     */\n    RES.queue = new RES.ResourceLoader();\n    /**\n    * @private\n    */\n    var ResourceManagerError = (function (_super) {\n        __extends(ResourceManagerError, _super);\n        function ResourceManagerError(code, replacer, replacer2) {\n            var _this = _super.call(this) || this;\n            /**\n             * why instanceof e  != ResourceManagerError ???\n             * see link : https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work\n             */\n            _this.__resource_manager_error__ = true;\n            _this.name = code.toString();\n            _this.message = ResourceManagerError.errorMessage[code].replace(\"{0}\", replacer).replace(\"{1}\", replacer2);\n            return _this;\n        }\n        ResourceManagerError.errorMessage = {\n            1001: '文件加载失败:{0}',\n            1002: \"ResourceManager 初始化失败：配置文件加载失败\",\n            2001: \"{0}解析失败,不支持指定解析类型:\\'{1}\\'，请编写自定义 Processor ，更多内容请参见 https://github.com/egret-labs/resourcemanager/blob/master/docs/README.md#processor\",\n            2002: \"Analyzer 相关API 在 ResourceManager 中不再支持，请编写自定义 Processor ，更多内容请参见 https://github.com/egret-labs/resourcemanager/blob/master/docs/README.md#processor\",\n            2003: \"{0}解析失败,错误原因:{1}\",\n            2004: \"无法找到文件类型:{0}\",\n            2005: \"RES加载了不存在或空的资源组:\\\"{0}\\\"\",\n            2006: \"资源配置文件中无法找到特定的资源:{0}\"\n        };\n        return ResourceManagerError;\n    }(Error));\n    RES.ResourceManagerError = ResourceManagerError;\n    __reflect(ResourceManagerError.prototype, \"RES.ResourceManagerError\");\n})(RES || (RES = {}));\n"
  },
  {
    "path": "demo/libs/modules/egret/egret.d.ts",
    "content": "declare var global: any;\ndeclare var __global: any;\ndeclare let __define: any;\ndeclare namespace egret {\n    type Nullable<T> = T | null;\n    /**\n     * The HashObject class is the base class for all objects in the Egret framework.The HashObject\n     * class includes a hashCode property, which is a unique identification number of the instance.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * Egret顶级对象。框架内所有对象的基类，为对象实例提供唯一的hashCode值。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface IHashObject {\n        /**\n         * a unique identification number assigned to this instance.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language en_US\n         */\n        /**\n         * 返回此对象唯一的哈希值,用于唯一确定一个对象。hashCode为大于等于1的整数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language zh_CN\n         */\n        hashCode: number;\n    }\n    /**\n     * @private\n     * 哈希计数\n     */\n    let $hashCount: number;\n    /**\n     * The HashObject class is the base class for all objects in the Egret framework.The HashObject\n     * class includes a hashCode property, which is a unique identification number of the instance.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * Egret顶级对象。框架内所有对象的基类，为对象实例提供唯一的hashCode值。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class HashObject implements IHashObject {\n        /**\n         * Initializes a HashObject\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 HashObject 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        /**\n         * @private\n         */\n        $hashCode: number;\n        /**\n         * a unique identification number assigned to this instance.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回此对象唯一的哈希值,用于唯一确定一个对象。hashCode为大于等于1的整数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly hashCode: number;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The EventDispatcher class is the base class for all classes that dispatchEvent events. The EventDispatcher class implements\n     * the IEventDispatcher interface and is the base class for the DisplayObject class. The EventDispatcher class allows\n     * any object on the display list to be an event target and as such, to use the methods of the IEventDispatcher interface.\n     * Event targets are an important part of the Egret event model. The event target serves as the focal point for how events\n     * flow through the display list hierarchy. When an event such as a touch tap, Egret dispatches an event object into the\n     * event flow from the root of the display list. The event object then makes its way through the display list until it\n     * reaches the event target, at which point it begins its return trip through the display list. This round-trip journey\n     * to the event target is conceptually divided into three phases: <br/>\n     * the capture phase comprises the journey from the root to the last node before the event target's node, the target\n     * phase comprises only the event target node, and the bubbling phase comprises any subsequent nodes encountered on\n     * the return trip to the root of the display list. In general, the easiest way for a user-defined class to gain event\n     * dispatching capabilities is to extend EventDispatcher. If this is impossible (that is, if the class is already extending\n     * another class), you can instead implement the IEventDispatcher interface, create an EventDispatcher member, and write simple\n     * hooks to route calls into the aggregated EventDispatcher.\n     * @see egret.IEventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/EventDispatcher.ts\n     * @language en_US\n     */\n    /**\n     * EventDispatcher 是 Egret 的事件派发器类，负责进行事件的发送和侦听。\n     * 事件目标是事件如何通过显示列表层次结构这一问题的焦点。当发生鼠标单击、触摸或按键等事件时，\n     * 框架会将事件对象调度到从显示列表根开始的事件流中。然后该事件对象在显示列表中前进，直到到达事件目标，\n     * 然后从这一点开始其在显示列表中的回程。在概念上，到事件目标的此往返行程被划分为三个阶段：\n     * 捕获阶段包括从根到事件目标节点之前的最后一个节点的行程，目标阶段仅包括事件目标节点，冒泡阶段包括回程上遇到的任何后续节点到显示列表的根。\n     * 通常，使用户定义的类能够调度事件的最简单方法是扩展 EventDispatcher。如果无法扩展（即，如果该类已经扩展了另一个类），则可以实现\n     * IEventDispatcher 接口，创建 EventDispatcher 成员，并编写一些简单的映射，将调用连接到聚合的 EventDispatcher 中。\n     * @see egret.IEventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/EventDispatcher.ts\n     * @language zh_CN\n     */\n    class EventDispatcher extends HashObject implements IEventDispatcher {\n        /**\n         * create an instance of the EventDispatcher class.\n         * @param target The target object for events dispatched to the EventDispatcher object. This parameter is used when\n         * the EventDispatcher instance is aggregated by a class that implements IEventDispatcher; it is necessary so that the\n         * containing object can be the target for events. Do not use this parameter in simple cases in which a class extends EventDispatcher.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 EventDispatcher 类的实例\n         * @param target 此 EventDispatcher 所抛出事件对象的 target 指向。此参数主要用于一个实现了 IEventDispatcher 接口的自定义类，\n         * 以便抛出的事件对象的 target 属性可以指向自定义类自身。请勿在直接继承 EventDispatcher 的情况下使用此参数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(target?: IEventDispatcher);\n        /**\n         * @private\n         */\n        $EventDispatcher: Object;\n        /**\n         * @private\n         *\n         * @param useCapture\n         */\n        $getEventMap(useCapture?: boolean): any;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): void;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        once(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): void;\n        /**\n         * @private\n         */\n        $addListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number, dispatchOnce?: boolean): void;\n        $insertEventBin(list: any[], type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number, dispatchOnce?: boolean): boolean;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        removeEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean): void;\n        $removeEventBin(list: any[], listener: Function, thisObject: any): boolean;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        hasEventListener(type: string): boolean;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        willTrigger(type: string): boolean;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        dispatchEvent(event: Event): boolean;\n        /**\n         * @private\n         */\n        $notifyListener(event: Event, capturePhase: boolean): boolean;\n        /**\n         * Distribute a specified event parameters.\n         * @param type The type of the event. Event listeners can access this information through the inherited type property.\n         * @param bubbles Determines whether the Event object bubbles. Event listeners can access this information through\n         * the inherited bubbles property.\n         * @param data {any} data\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 派发一个指定参数的事件。\n         * @param type {string} 事件类型\n         * @param bubbles {boolean} 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param data {any} 事件data\n         * @param cancelable {boolean} 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        dispatchEventWith(type: string, bubbles?: boolean, data?: any, cancelable?: boolean): boolean;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 事件信息对象\n     */\n    interface EventBin {\n        type: string;\n        /**\n         * @private\n         */\n        listener: Function;\n        /**\n         * @private\n         */\n        thisObject: any;\n        /**\n         * @private\n         */\n        priority: number;\n        /**\n         * @private\n         */\n        target: IEventDispatcher;\n        /**\n         * @private\n         */\n        useCapture: boolean;\n        /**\n         * @private\n         */\n        dispatchOnce: boolean;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    class Filter extends HashObject {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        type: string;\n        /**\n         * @private\n         */\n        $id: number;\n        /**\n         * @private\n         */\n        $uniforms: any;\n        /**\n         * @private\n         */\n        protected paddingTop: number;\n        /**\n         * @private\n         */\n        protected paddingBottom: number;\n        /**\n         * @private\n         */\n        protected paddingLeft: number;\n        /**\n         * @private\n         */\n        protected paddingRight: number;\n        /**\n         * @private\n         * @native Render\n         */\n        $obj: any;\n        constructor();\n        /**\n         * @private\n         */\n        $toJson(): string;\n        protected updatePadding(): void;\n        onPropertyChange(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    const enum RenderMode {\n        NONE = 1,\n        FILTER = 2,\n        CLIP = 3,\n        SCROLLRECT = 4,\n    }\n    /**\n     * The DisplayObject class is the base class for all objects that can be placed on the display list. The display list\n     * manages all objects displayed in the runtime. Use the DisplayObjectContainer class to arrange the display\n     * objects in the display list. DisplayObjectContainer objects can have child display objects, while other display objects,\n     * such as Shape and TextField objects, are \"leaf\" nodes that have only parents and siblings, no children.\n     * The DisplayObject class supports basic functionality like the x and y position of an object, as well as more advanced\n     * properties of the object such as its transformation matrix.<br/>\n     * The DisplayObject class contains several broadcast events.Normally, the target of any particular event is a specific\n     * DisplayObject instance. For example, the target of an added event is the specific DisplayObject instance that was added\n     * to the display list. Having a single target restricts the placement of event listeners to that target and in some cases\n     * the target's ancestors on the display list. With broadcast events, however, the target is not a specific DisplayObject\n     * instance, but rather all DisplayObject instances, including those that are not on the display list. This means that you\n     * can add a listener to any DisplayObject instance to listen for broadcast events.\n     *\n     * @event egret.Event.ADDED Dispatched when a display object is added to the display list.\n     * @event egret.Event.ADDED_TO_STAGE Dispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained.\n     * @event egret.Event.REMOVED Dispatched when a display object is about to be removed from the display list.\n     * @event egret.Event.REMOVED_FROM_STAGE Dispatched when a display object is about to be removed from the display list, either directly or through the removal of a sub tree in which the display object is contained.\n     * @event egret.Event.ENTER_FRAME [broadcast event] Dispatched when the playhead is entering a new frame.\n     * @event egret.Event.RENDER [broadcast event] Dispatched when the display list is about to be updated and rendered.\n     * @event egret.TouchEvent.TOUCH_MOVE Dispatched when the user touches the device, and is continuously dispatched until the point of contact is removed.\n     * @event egret.TouchEvent.TOUCH_BEGIN Dispatched when the user first contacts a touch-enabled device (such as touches a finger to a mobile phone or tablet with a touch screen).\n     * @event egret.TouchEvent.TOUCH_END Dispatched when the user removes contact with a touch-enabled device (such as lifts a finger off a mobile phone or tablet with a touch screen).\n     * @event egret.TouchEvent.TOUCH_TAP Dispatched when the user lifts the point of contact over the same DisplayObject instance on which the contact was initiated on a touch-enabled device (such as presses and releases a finger from a single point over a display object on a mobile phone or tablet with a touch screen).\n     * @event egret.TouchEvent.TOUCH_RELEASE_OUTSIDE Dispatched when the user lifts the point of contact over the different DisplayObject instance on which the contact was initiated on a touch-enabled device (such as presses and releases a finger from a single point over a display object on a mobile phone or tablet with a touch screen).\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/DisplayObject.ts\n     * @language en_US\n     */\n    /**\n     * DisplayObject 类是可放在显示列表中的所有对象的基类。该显示列表管理运行时中显示的所有对象。使用 DisplayObjectContainer 类排列\n     * 显示列表中的显示对象。DisplayObjectContainer 对象可以有子显示对象，而其他显示对象（如 Shape 和 TextField 对象）是“叶”节点，没有子项，只有父级和\n     * 同级。DisplayObject 类有一些基本的属性（如确定坐标位置的 x 和 y 属性），也有一些高级的对象属性（如 Matrix 矩阵变换）。<br/>\n     * DisplayObject 类包含若干广播事件。通常，任何特定事件的目标均为一个特定的 DisplayObject 实例。例如，added 事件的目标是已添加到显示列表\n     * 的目标 DisplayObject 实例。若只有一个目标，则会将事件侦听器限制为只能监听在该目标上（在某些情况下，可监听在显示列表中该目标的祖代上）。\n     * 但是对于广播事件，目标不是特定的 DisplayObject 实例，而是所有 DisplayObject 实例（包括那些不在显示列表中的实例）。这意味着您可以向任何\n     * DisplayObject 实例添加侦听器来侦听广播事件。\n     *\n     * @event egret.Event.ADDED 将显示对象添加到显示列表中时调度。\n     * @event egret.Event.ADDED_TO_STAGE 在将显示对象直接添加到舞台显示列表或将包含显示对象的子树添加至舞台显示列表中时调度。\n     * @event egret.Event.REMOVED 将要从显示列表中删除显示对象时调度。\n     * @event egret.Event.REMOVED_FROM_STAGE 在从显示列表中直接删除显示对象或删除包含显示对象的子树时调度。\n     * @event egret.Event.ENTER_FRAME [广播事件] 播放头进入新帧时调度。\n     * @event egret.Event.RENDER [广播事件] 将要更新和呈现显示列表时调度。\n     * @event egret.TouchEvent.TOUCH_MOVE 当用户触碰设备时进行调度，而且会连续调度，直到接触点被删除。\n     * @event egret.TouchEvent.TOUCH_BEGIN 当用户第一次触摸启用触摸的设备时（例如，用手指触摸手机屏幕）调度。\n     * @event egret.TouchEvent.TOUCH_END 当用户移除与启用触摸的设备的接触时（例如，将手指从屏幕上抬起）调度。\n     * @event egret.TouchEvent.TOUCH_TAP 当用户在启用触摸设备上的已启动接触的同一 DisplayObject 实例上抬起接触点时（例如，手机点击屏幕后抬起）调度。\n     * @event egret.TouchEvent.TOUCH_RELEASE_OUTSIDE 当用户在启用触摸设备上的已启动接触的不同 DisplayObject 实例上抬起接触点时（例如，按住屏幕上的某个对象,然后从它上面挪开后再松开手指）调度。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/DisplayObject.ts\n     * @language zh_CN\n     */\n    class DisplayObject extends EventDispatcher {\n        /**\n         * Initializes a DisplayObject object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个显示对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        $nativeDisplayObject: egret_native.NativeDisplayObject;\n        protected createNativeDisplayObject(): void;\n        /**\n         * @private\n         * 是否添加到舞台上，防止重复发送 removed_from_stage 消息\n         */\n        $hasAddToStage: boolean;\n        /**\n         * @private\n         * 能够含有子项的类将子项列表存储在这个属性里。\n         */\n        $children: DisplayObject[];\n        private $name;\n        /**\n         * Indicates the instance name of the DisplayObject. The object can be identified in the child list of its parent\n         * display object container by calling the getChildByName() method of the display object container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 DisplayObject 的实例名称。\n         * 通过调用父显示对象容器的 getChildByName() 方法，可以在父显示对象容器的子列表中标识该对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * @private\n         */\n        $parent: DisplayObjectContainer;\n        /**\n         * Indicates the DisplayObjectContainer object that contains this display object. Use the parent property to specify\n         * a relative path to display objects that are above the current display object in the display list hierarchy.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示包含此显示对象的 DisplayObjectContainer 对象。\n         * 使用 parent 属性可以指定高于显示列表层次结构中当前显示对象的显示对象的相对路径。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly parent: DisplayObjectContainer;\n        /**\n         * @private\n         * 设置父级显示对象\n         */\n        $setParent(parent: DisplayObjectContainer): void;\n        /**\n         * @private\n         * 显示对象添加到舞台\n         */\n        $onAddToStage(stage: Stage, nestLevel: number): void;\n        /**\n         * @private\n         * 显示对象从舞台移除\n         */\n        $onRemoveFromStage(): void;\n        /**\n         * @private\n         */\n        $stage: Stage;\n        /**\n         * @private\n         * 这个对象在显示列表中的嵌套深度，舞台为1，它的子项为2，子项的子项为3，以此类推。当对象不在显示列表中时此属性值为0.\n         */\n        $nestLevel: number;\n        $useTranslate: boolean;\n        protected $updateUseTransform(): void;\n        /**\n         * The Stage of the display object. you can create and load multiple display objects into the display list, and\n         * the stage property of each display object refers to the same Stage object.<br/>\n         * If a display object is not added to the display list, its stage property is set to null.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 显示对象的舞台。\n         * 例如，您可以创建多个显示对象并加载到显示列表中，每个显示对象的 stage 属性是指向相同的 Stage 对象。<br/>\n         * 如果显示对象未添加到显示列表，则其 stage 属性会设置为 null。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly stage: Stage;\n        /**\n         * A Matrix object containing values that alter the scaling, rotation, and translation of the display object.<br/>\n         * Note: to change the value of a display object's matrix, you must make a copy of the entire matrix object, then copy\n         * the new object into the matrix property of the display object.\n         * @example the following code increases the tx value of a display object's matrix\n         * <pre>\n         *     let myMatrix:Matrix = myDisplayObject.matrix;\n         *     myMatrix.tx += 10;\n         *     myDisplayObject.matrix = myMatrix;\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个 Matrix 对象，其中包含更改显示对象的缩放、旋转和平移的值。<br/>\n         * 注意：要改变一个显示对象矩阵的值，您必引用整个矩阵对象，然后将它重新赋值给显示对象的 matrix 属性。\n         * @example 以下代码改变了显示对象矩阵的tx属性值：\n         * <pre>\n         *     let myMatrix:Matrix = myDisplayObject.matrix;\n         *     myMatrix.tx += 10;\n         *     myDisplayObject.matrix = myMatrix;\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        matrix: Matrix;\n        private $matrix;\n        private $matrixDirty;\n        /**\n         * @private\n         * 获取矩阵\n         */\n        $getMatrix(): Matrix;\n        /**\n         * @private\n         * 设置矩阵\n         */\n        $setMatrix(matrix: Matrix, needUpdateProperties?: boolean): void;\n        private $concatenatedMatrix;\n        /**\n         * @private\n         * 获得这个显示对象以及它所有父级对象的连接矩阵。\n         */\n        $getConcatenatedMatrix(): Matrix;\n        private $invertedConcatenatedMatrix;\n        /**\n         * @private\n         * 获取链接矩阵\n         */\n        $getInvertedConcatenatedMatrix(): Matrix;\n        $x: number;\n        /**\n         * Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent\n         * DisplayObjectContainer.<br/>\n         * If the object is inside a DisplayObjectContainer that has transformations, it is in\n         * the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer\n         * rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is\n         * rotated 90° counterclockwise. The object's coordinates refer to the registration point position.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 DisplayObject 实例相对于父级 DisplayObjectContainer 本地坐标的 x 坐标。<br/>\n         * 如果该对象位于具有变形的 DisplayObjectContainer 内，则它也位于包含 DisplayObjectContainer 的本地坐标系中。\n         * 因此，对于逆时针旋转 90 度的 DisplayObjectContainer，该 DisplayObjectContainer 的子级将继承逆时针旋转 90 度的坐标系。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        x: number;\n        /**\n         * @private\n         * 获取x坐标\n         */\n        $getX(): number;\n        /**\n         * @private\n         * 设置x坐标\n         */\n        $setX(value: number): boolean;\n        $y: number;\n        /**\n         * Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent\n         * DisplayObjectContainer. <br/>\n         * If the object is inside a DisplayObjectContainer that has transformations, it is in\n         * the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated\n         * 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90°\n         * counterclockwise. The object's coordinates refer to the registration point position.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 DisplayObject 实例相对于父级 DisplayObjectContainer 本地坐标的 y 坐标。<br/>\n         * 如果该对象位于具有变形的 DisplayObjectContainer 内，则它也位于包含 DisplayObjectContainer 的本地坐标系中。\n         * 因此，对于逆时针旋转 90 度的 DisplayObjectContainer，该 DisplayObjectContainer 的子级将继承逆时针旋转 90 度的坐标系。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        y: number;\n        /**\n         * @private\n         * 获取y坐标\n         */\n        $getY(): number;\n        /**\n         * @private\n         * 设置y坐标\n         */\n        $setY(value: number): boolean;\n        private $scaleX;\n        /**\n         * Indicates the horizontal scale (percentage) of the object as applied from the registration point. <br/>\n         * The default 1.0 equals 100% scale.\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示从注册点开始应用的对象的水平缩放比例（百分比）。<br/>\n         * 1.0 等于 100% 缩放。\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        scaleX: number;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getScaleX(): number;\n        /**\n         * @private\n         * 设置水平缩放值\n         */\n        $setScaleX(value: number): void;\n        private $scaleY;\n        /**\n         * Indicates the vertical scale (percentage) of an object as applied from the registration point of the object.\n         * 1.0 is 100% scale.\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示从对象注册点开始应用的对象的垂直缩放比例（百分比）。1.0 是 100% 缩放。\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        scaleY: number;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getScaleY(): number;\n        /**\n         * @private\n         * 设置垂直缩放值\n         */\n        $setScaleY(value: number): void;\n        private $rotation;\n        /**\n         * Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation. Values from\n         * 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. Values outside\n         * this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement\n         * myDisplayObject.rotation = 450 is the same as myDisplayObject.rotation = 90.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 DisplayObject 实例距其原始方向的旋转程度，以度为单位。\n         * 从 0 到 180 的值表示顺时针方向旋转；从 0 到 -180 的值表示逆时针方向旋转。对于此范围之外的值，可以通过加上或\n         * 减去 360 获得该范围内的值。例如，myDisplayObject.rotation = 450语句与 myDisplayObject.rotation = 90 是相同的。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        rotation: number;\n        /**\n         * @private\n         */\n        $getRotation(): number;\n        $setRotation(value: number): void;\n        private $skewX;\n        private $skewXdeg;\n        /**\n         * 表示DisplayObject的x方向斜切\n         * @member {number} egret.DisplayObject#skewX\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        skewX: number;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setSkewX(value: number): void;\n        private $skewY;\n        private $skewYdeg;\n        /**\n         * 表示DisplayObject的y方向斜切\n         * @member {number} egret.DisplayObject#skewY\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        skewY: number;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setSkewY(value: number): void;\n        /**\n         * Indicates the width of the display object, in pixels. The width is calculated based on the bounds of the content\n         * of the display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示显示对象的宽度，以像素为单位。宽度是根据显示对象内容的范围来计算的。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        width: number;\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        $getWidth(): number;\n        $explicitWidth: number;\n        /**\n         * @private\n         * 设置显示宽度\n         */\n        $setWidth(value: number): void;\n        /**\n         * Indicates the height of the display object, in pixels. The height is calculated based on the bounds of the\n         * content of the display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示显示对象的高度，以像素为单位。高度是根据显示对象内容的范围来计算的。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        height: number;\n        $explicitHeight: number;\n        /**\n         * @private\n         * 获取显示高度\n         */\n        $getHeight(): number;\n        /**\n         * @private\n         * 设置显示高度\n         */\n        $setHeight(value: number): void;\n        /**\n         * 测量宽度\n         * @returns {number}\n         * @member {egret.Rectangle} egret.DisplayObject#measuredWidth\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly measuredWidth: number;\n        /**\n         * 测量高度\n         * @returns {number}\n         * @member {egret.Rectangle} egret.DisplayObject#measuredWidth\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly measuredHeight: number;\n        $anchorOffsetX: number;\n        /**\n         * X represents the object of which is the anchor.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示从对象绝对锚点X。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        anchorOffsetX: number;\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        $setAnchorOffsetX(value: number): void;\n        $anchorOffsetY: number;\n        /**\n         * Y represents the object of which is the anchor.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示从对象绝对锚点Y。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        anchorOffsetY: number;\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        $setAnchorOffsetY(value: number): void;\n        /**\n         * @private\n         */\n        $visible: boolean;\n        /**\n         * Whether or not the display object is visible. Display objects that are not visible are disabled. For example,\n         * if visible=false for an DisplayObject instance, it cannot receive touch or other user input.\n         * @default true\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 显示对象是否可见。不可见的显示对象将被禁用。例如，如果实例的 visible 为 false，则无法接受触摸或用户交互操作。\n         * @default true\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        visible: boolean;\n        $setVisible(value: boolean): void;\n        /**\n         * @private\n         * cacheAsBitmap创建的缓存位图节点。\n         */\n        $displayList: egret.sys.DisplayList;\n        private $cacheAsBitmap;\n        /**\n         * If set to true, Egret runtime caches an internal bitmap representation of the display object. This caching can\n         * increase performance for display objects that contain complex vector content. After you set the cacheAsBitmap\n         * property to true, the rendering does not change, however the display object performs pixel snapping automatically.\n         * The execution speed can be significantly faster depending on the complexity of the content.The cacheAsBitmap\n         * property is best used with display objects that have mostly static content and that do not scale and rotate frequently.<br/>\n         * Note: The display object will not create the bitmap caching when the memory exceeds the upper limit,even if you set it to true.\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果设置为 true，则 Egret 运行时将缓存显示对象的内部位图表示形式。此缓存可以提高包含复杂矢量内容的显示对象的性能。\n         * 将 cacheAsBitmap 属性设置为 true 后，呈现并不更改，但是，显示对象将自动执行像素贴紧。执行速度可能会大大加快，\n         * 具体取决于显示对象内容的复杂性。最好将 cacheAsBitmap 属性与主要具有静态内容且不频繁缩放或旋转的显示对象一起使用。<br/>\n         * 注意：在内存超过上限的情况下，即使将 cacheAsBitmap 属性设置为 true，显示对象也不使用位图缓存。\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        cacheAsBitmap: boolean;\n        $setHasDisplayList(value: boolean): void;\n        $cacheDirty: boolean;\n        $cacheDirtyUp(): void;\n        /**\n         * @private\n         */\n        $alpha: number;\n        /**\n         * Indicates the alpha transparency value of the object specified. Valid values are 0 (fully transparent) to 1 (fully opaque).\n         * The default value is 1. Display objects with alpha set to 0 are active, even though they are invisible.\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示指定对象的 Alpha 透明度值。\n         * 有效值为 0（完全透明）到 1（完全不透明）。alpha 设置为 0 的显示对象是可触摸的，即使它们不可见。\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        alpha: number;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setAlpha(value: number): void;\n        /**\n         * @private\n         * The default touchEnabled property of DisplayObject\n         * @default false\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * @private\n         * 显示对象默认的 touchEnabled 属性\n         * @default false\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static defaultTouchEnabled: boolean;\n        $touchEnabled: boolean;\n        /**\n         * Specifies whether this object receives touch or other user input. The default value is false, which means that\n         * by default any DisplayObject instance that is on the display list cannot receive touch events. If touchEnabled is\n         * set to false, the instance does not receive any touch events (or other user input events). Any children of\n         * this instance on the display list are not affected. To change the touchEnabled behavior for all children of\n         * an object on the display list, use DisplayObjectContainer.touchChildren.\n         * @see egret.DisplayObjectContainer#touchChildren\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定此对象是否接收触摸或其他用户输入。默认值为 false，这表示默认情况下，显示列表上的任何 DisplayObject 实例都不会接收触摸事件或\n         * 其他用户输入事件。如果将 touchEnabled 设置为 false，则实例将不接收任何触摸事件（或其他用户输入事件）。显示列表上的该实例的任\n         * 何子级都不会受到影响。要更改显示列表上对象的所有子级的 touchEnabled 行为，请使用 DisplayObjectContainer.touchChildren。\n         * @see egret.DisplayObjectContainer#touchChildren\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        touchEnabled: boolean;\n        /**\n         * @private\n         */\n        $getTouchEnabled(): boolean;\n        /**\n         * @private\n         */\n        $setTouchEnabled(value: boolean): void;\n        /**\n         * @private\n         */\n        $scrollRect: Rectangle;\n        /**\n         * The scroll rectangle bounds of the display object. The display object is cropped to the size defined by the rectangle,\n         * and it scrolls within the rectangle when you change the x and y properties of the scrollRect object. A scrolled display\n         * object always scrolls in whole pixel increments.You can scroll an object left and right by setting the x property of\n         * the scrollRect Rectangle object. You can scroll an object up and down by setting the y property of the scrollRect\n         * Rectangle object. If the display object is rotated 90° and you scroll it left and right, the display object actually\n         * scrolls up and down.<br/>\n         *\n         * Note: to change the value of a display object's scrollRect, you must make a copy of the entire scrollRect object, then copy\n         * the new object into the scrollRect property of the display object.\n         * @example the following code increases the x value of a display object's scrollRect\n         * <pre>\n         *     let myRectangle:Rectangle = myDisplayObject.scrollRect;\n         *     myRectangle.x += 10;\n         *     myDisplayObject.scrollRect = myRectangle;\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 显示对象的滚动矩形范围。显示对象被裁切为矩形定义的大小，当您更改 scrollRect 对象的 x 和 y 属性时，它会在矩形内滚动。\n         * 滚动的显示对象始终以整像素为增量进行滚动。您可以通过设置 scrollRect Rectangle 对象的 x 属性来左右滚动对象， 还可以通过设置\n         * scrollRect 对象的 y 属性来上下滚动对象。如果显示对象旋转了 90 度，并且您左右滚动它，则实际上显示对象会上下滚动。<br/>\n         *\n         * 注意：要改变一个显示对象 scrollRect 属性的值，您必引用整个 scrollRect 对象，然后将它重新赋值给显示对象的 scrollRect 属性。\n         * @example 以下代码改变了显示对象 scrollRect 的 x 属性值：\n         * <pre>\n         *     let myRectangle:Rectangle = myDisplayObject.scrollRect;\n         *     myRectangle.x += 10;\n         *     myDisplayObject.scrollRect = myRectangle;//设置完scrollRect的x、y、width、height值之后，一定要对myDisplayObject重新赋值scrollRect，不然会出问题。\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        scrollRect: Rectangle;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        private $setScrollRect(value);\n        /**\n         * @private\n         */\n        $blendMode: number;\n        /**\n         * A value from the BlendMode class that specifies which blend mode to use. Determine how a source image (new one)\n         * is drawn on the target image (old one).<br/>\n         * If you attempt to set this property to an invalid value, Egret runtime set the value to BlendMode.NORMAL.\n         * @default egret.BlendMode.NORMAL\n         * @see egret.BlendMode\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * BlendMode 枚举中的一个值，用于指定要使用的混合模式，确定如何将一个源（新的）图像绘制到目标（已有）的图像上<br/>\n         * 如果尝试将此属性设置为无效值，则运行时会将此值设置为 BlendMode.NORMAL。\n         * @default egret.BlendMode.NORMAL\n         * @see egret.BlendMode\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        blendMode: string;\n        /**\n         * @private\n         * 被遮罩的对象\n         */\n        $maskedObject: DisplayObject;\n        /**\n         * @private\n         */\n        $mask: DisplayObject;\n        /**\n         * @private\n         */\n        $maskRect: Rectangle;\n        /**\n         * The calling display object is masked by the specified mask object. To ensure that masking works when the Stage\n         * is scaled, the mask display object must be in an active part of the display list. The mask object itself is not drawn.\n         * Set mask to null to remove the mask. To be able to scale a mask object, it must be on the display list. To be\n         * able to drag a mask object , it must be on the display list.<br/>\n         * Note: A single mask object cannot be used to mask more than one calling display object. When the mask is assigned\n         * to a second display object, it is removed as the mask of the first object, and that object's mask property becomes null.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 调用显示对象被指定的 mask 对象遮罩。要确保当舞台缩放时蒙版仍然有效，mask 显示对象必须处于显示列表的活动部分。\n         * 但不绘制 mask 对象本身。将 mask 设置为 null 可删除蒙版。要能够缩放遮罩对象，它必须在显示列表中。要能够拖动蒙版\n         * 对象，它必须在显示列表中。<br/>\n         * 注意：单个 mask 对象不能用于遮罩多个执行调用的显示对象。在将 mask 分配给第二个显示对象时，会撤消其作为第一个对象的遮罩，\n         * 该对象的 mask 属性将变为 null。\n         *\n         * 下面例子为 mask 为 Rectangle 类型对象，这种情况下，修改 mask 的值后，一定要对 myDisplayObject 重新赋值 mask，不然会出问题。\n         * @example 以下代码改变了显示对象 mask 的 x 属性值：\n         * <pre>\n         *     let myMask:Rectangle = myDisplayObject.mask;\n         *     myMask.x += 10;\n         *     myDisplayObject.mask = myMask;//设置完 mask 的x、y、width、height值之后，一定要对myDisplayObject重新赋值 mask，不然会出问题。\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        mask: DisplayObject | Rectangle;\n        private $setMaskRect(value);\n        $filters: Array<Filter | CustomFilter>;\n        /**\n         * An indexed array that contains each filter object currently associated with the display object.\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 包含当前与显示对象关联的每个滤镜对象的索引数组。\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        filters: Array<Filter | CustomFilter>;\n        /**\n         * Returns a rectangle that defines the area of the display object relative to the coordinate system of the targetCoordinateSpace object.\n         * @param targetCoordinateSpace The display object that defines the coordinate system to use.\n         * @param resultRect A reusable instance of Rectangle for saving the results. Passing this parameter can reduce the number of reallocate objects\n         *, which allows you to get better code execution performance..\n         * @returns The rectangle that defines the area of the display object relative to the targetCoordinateSpace object's coordinate system.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回一个矩形，该矩形定义相对于 targetCoordinateSpace 对象坐标系的显示对象区域。\n         * @param targetCoordinateSpace 定义要使用的坐标系的显示对象。\n         * @param resultRect 一个用于存储结果的可复用Rectangle实例，传入此参数能够减少内部创建对象的次数，从而获得更高的运行性能。\n         * @returns 定义与 targetCoordinateSpace 对象坐标系统相关的显示对象面积的矩形。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getTransformedBounds(targetCoordinateSpace: DisplayObject, resultRect?: Rectangle): Rectangle;\n        /**\n         * Obtain measurement boundary of display object\n         * @param resultRect {Rectangle} Optional. It is used to import Rectangle object for saving results, preventing duplicate object creation.\n         * @param calculateAnchor {boolean} Optional. It is used to determine whether to calculate anchor point.\n         * @returns {Rectangle}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取显示对象的测量边界\n         * @param resultRect {Rectangle} 可选参数，传入用于保存结果的Rectangle对象，避免重复创建对象。\n         * @param calculateAnchor {boolean} 可选参数，是否会计算锚点。\n         * @returns {Rectangle}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getBounds(resultRect?: Rectangle, calculateAnchor?: boolean): egret.Rectangle;\n        /**\n         * @private\n         */\n        $getTransformedBounds(targetCoordinateSpace: DisplayObject, resultRect?: Rectangle): Rectangle;\n        /**\n         * Converts the point object from the Stage (global) coordinates to the display object's (local) coordinates.\n         * @param stageX the x value in the global coordinates\n         * @param stageY the y value in the global coordinates\n         * @param resultPoint A reusable instance of Point for saving the results. Passing this parameter can reduce the\n         * number of reallocate objects, which allows you to get better code execution performance.\n         * @returns A Point object with coordinates relative to the display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将从舞台（全局）坐标转换为显示对象的（本地）坐标。\n         * @param stageX 舞台坐标x\n         * @param stageY 舞台坐标y\n         * @param resultPoint 一个用于存储结果的可复用 Point 实例，传入此参数能够减少内部创建对象的次数，从而获得更高的运行性能。\n         * @returns 具有相对于显示对象的坐标的 Point 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        globalToLocal(stageX?: number, stageY?: number, resultPoint?: Point): Point;\n        /**\n         * Converts the point object from the display object's (local) coordinates to the Stage (global) coordinates.\n         * @param localX the x value in the local coordinates\n         * @param localY the x value in the local coordinates\n         * @param resultPoint A reusable instance of Point for saving the results. Passing this parameter can reduce the\n         * number of reallocate objects, which allows you to get better code execution performance.\n         * @returns  A Point object with coordinates relative to the Stage.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将显示对象的（本地）坐标转换为舞台（全局）坐标。\n         * @param localX 本地坐标 x\n         * @param localY 本地坐标 y\n         * @param resultPoint 一个用于存储结果的可复用 Point 实例，传入此参数能够减少内部创建对象的次数，从而获得更高的运行性能。\n         * @returns 一个具有相对于舞台坐标的 Point 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        localToGlobal(localX?: number, localY?: number, resultPoint?: Point): Point;\n        /**\n         * @private\n         * 获取显示对象占用的矩形区域集合，通常包括自身绘制的测量区域，如果是容器，还包括所有子项占据的区域。\n         */\n        $getOriginalBounds(): Rectangle;\n        /**\n         * @private\n         * 测量子项占用的矩形区域\n         * @param bounds 测量结果存储在这个矩形对象内\n         */\n        $measureChildBounds(bounds: Rectangle): void;\n        /**\n         * @private\n         */\n        $getContentBounds(): Rectangle;\n        /**\n         * @private\n         * 测量自身占用的矩形区域，注意：此测量结果并不包括子项占据的区域。\n         * @param bounds 测量结果存储在这个矩形对象内\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        /**\n         * @private\n         */\n        $parentDisplayList: egret.sys.DisplayList;\n        /**\n         * @private\n         * 渲染节点,不为空表示自身有绘制到屏幕的内容\n         */\n        $renderNode: sys.RenderNode;\n        $renderDirty: boolean;\n        /**\n         * @private\n         * 获取渲染节点\n         */\n        $getRenderNode(): sys.RenderNode;\n        $updateRenderMode(): void;\n        $renderMode: RenderMode;\n        /**\n         * @private\n         */\n        private $measureFiltersOffset(fromParent);\n        /**\n         * @private\n         * 获取相对于指定根节点的连接矩阵。\n         * @param root 根节点显示对象\n         * @param matrix 目标显示对象相对于舞台的完整连接矩阵。\n         */\n        $getConcatenatedMatrixAt(root: DisplayObject, matrix: Matrix): void;\n        /**\n         * @private\n         * 更新renderNode\n         */\n        $updateRenderNode(): void;\n        /**\n         * @private\n         */\n        $hitTest(stageX: number, stageY: number): DisplayObject;\n        /**\n         * Calculate the display object to determine whether it overlaps or crosses with the points specified by the x and y parameters. The x and y parameters specify the points in the coordinates of the stage, rather than the points in the display object container that contains display objects (except the situation where the display object container is a stage).\n         * Note: Don't use accurate pixel collision detection on a large number of objects. Otherwise, this will cause serious performance deterioration.\n         * @param x {number}  x coordinate of the object to be tested.\n         * @param y {number}  y coordinate of the object to be tested.\n         * @param shapeFlag {boolean} Whether to check the actual pixel of object (true) or check that of border (false).Write realized.\n         * @returns {boolean} If display object overlaps or crosses with the specified point, it is true; otherwise, it is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 计算显示对象，以确定它是否与 x 和 y 参数指定的点重叠或相交。x 和 y 参数指定舞台的坐标空间中的点，而不是包含显示对象的显示对象容器中的点（除非显示对象容器是舞台）。\n         * 注意，不要在大量物体中使用精确碰撞像素检测，这回带来巨大的性能开销\n         * @param x {number}  要测试的此对象的 x 坐标。\n         * @param y {number}  要测试的此对象的 y 坐标。\n         * @param shapeFlag {boolean} 是检查对象 (true) 的实际像素，还是检查边框 (false) 的实际像素。\n         * @returns {boolean} 如果显示对象与指定的点重叠或相交，则为 true；否则为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        hitTestPoint(x: number, y: number, shapeFlag?: boolean): boolean;\n        /**\n         * @private\n         */\n        static $enterFrameCallBackList: DisplayObject[];\n        /**\n         * @private\n         */\n        static $renderCallBackList: DisplayObject[];\n        /**\n         * @private\n         */\n        $addListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number, dispatchOnce?: boolean): void;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        removeEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean): void;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        dispatchEvent(event: Event): boolean;\n        /**\n         * @private\n         * 获取事件流列表。注意：Egret框架的事件流与Flash实现并不一致。\n         *\n         * 事件流有三个阶段：捕获，目标，冒泡。\n         * Flash里默认的的事件监听若不开启useCapture将监听目标和冒泡阶段。若开始capture将只能监听捕获当不包括目标的事件。\n         * 可以在Flash中写一个简单的测试：实例化一个非容器显示对象，例如TextField。分别监听useCapture为true和false时的鼠标事件。\n         * 点击后将只有useCapture为false的回调函数输出信息。也就带来一个问题「Flash的捕获阶段不能监听到最内层对象本身，只在父级列表有效」。\n         *\n         * 而HTML里的事件流设置useCapture为true时是能监听到目标阶段的，也就是目标阶段会被触发两次，在捕获和冒泡过程各触发一次。这样可以避免\n         * 前面提到的监听捕获无法监听目标本身的问题。\n         *\n         * Egret最终采用了HTML里目标节点触发两次的事件流方式。\n         */\n        $getPropagationList(target: DisplayObject): DisplayObject[];\n        /**\n         * @private\n         */\n        $dispatchPropagationEvent(event: Event, list: DisplayObject[], targetIndex: number): void;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        willTrigger(type: string): boolean;\n        /**\n         * inspired by pixi.js\n         */\n        private _tint;\n        /**\n         * @private\n         */\n        $tintRGB: number;\n        /**\n         * Set a tint color for the current object\n         * @version Egret 5.2.24\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 给当前对象设置填充色\n         * @version Egret 5.2.24\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        tint: number;\n        /**\n         * @private\n         * inspired by pixi.js\n         */\n        $sortDirty: boolean;\n        sortChildren(): void;\n        /**\n         * @private\n         */\n        private _zIndex;\n        /**\n         * the z-order (front-to-back order) of the object\n         * @version Egret 5.2.24\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置对象的 Z 轴顺序（前后顺序）\n         * @version Egret 5.2.24\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        zIndex: number;\n        /**\n         * @private\n         */\n        $lastSortedIndex: number;\n        /**\n         * Allow objects to use zIndex sorting\n         * @version Egret 5.2.24\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 允许对象使用 zIndex 排序\n         * @version Egret 5.2.24\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        sortableChildren: boolean;\n    }\n}\ndeclare namespace egret {\n    let $TextureScaleFactor: number;\n    /**\n     * The Texture class encapsulates different image resources on different platforms.\n     * In HTML5, resource is an HTMLElement object\n     * In OpenGL / WebGL, resource is a texture ID obtained after the GPU is submitted\n     * The Texture class encapsulates the details implemented on the underlayer. Developers just need to focus on interfaces\n     * @see http://edn.egret.com/cn/docs/page/135 The use of texture packs\n     * @see http://edn.egret.com/cn/docs/page/123 Several ways of access to resources\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Texture.ts\n     * @language en_US\n     */\n    /**\n     * 纹理类是对不同平台不同的图片资源的封装\n     * 在HTML5中，资源是一个HTMLElement对象\n     * 在OpenGL / WebGL中，资源是一个提交GPU后获取的纹理id\n     * Texture类封装了这些底层实现的细节，开发者只需要关心接口即可\n     * @see http://edn.egret.com/cn/docs/page/135 纹理集的使用\n     * @see http://edn.egret.com/cn/docs/page/123 获取资源的几种方式\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Texture.ts\n     * @language zh_CN\n     */\n    class Texture extends HashObject {\n        /**\n         * Create an egret.Texture object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.Texture 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        /**\n         * Whether to destroy the corresponding BitmapData when the texture is destroyed\n         * @version Egret 5.0.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 销毁纹理时是否销毁对应BitmapData\n         * @version Egret 5.0.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        disposeBitmapData: boolean;\n        /**\n         * @private\n         * 表示这个纹理在 bitmapData 上的 x 起始位置\n         */\n        $bitmapX: number;\n        /**\n         * @private\n         * 表示这个纹理在 bitmapData 上的 y 起始位置\n         */\n        $bitmapY: number;\n        /**\n         * @private\n         * 表示这个纹理在 bitmapData 上的宽度\n         */\n        $bitmapWidth: number;\n        /**\n         * @private\n         * 表示这个纹理在 bitmapData 上的高度\n         */\n        $bitmapHeight: number;\n        /**\n         * @private\n         * 表示这个纹理显示了之后在 x 方向的渲染偏移量\n         */\n        $offsetX: number;\n        /**\n         * @private\n         * 表示这个纹理显示了之后在 y 方向的渲染偏移量\n         */\n        $offsetY: number;\n        /**\n         * @private\n         * 纹理宽度\n         */\n        private $textureWidth;\n        /**\n         * Texture width, read only\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 纹理宽度，只读属性，不可以设置\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly textureWidth: number;\n        $getTextureWidth(): number;\n        /**\n         * @private\n         * 纹理高度\n         */\n        private $textureHeight;\n        /**\n         * Texture height, read only\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 纹理高度，只读属性，不可以设置\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly textureHeight: number;\n        $getTextureHeight(): number;\n        $getScaleBitmapWidth(): number;\n        $getScaleBitmapHeight(): number;\n        /**\n         * @private\n         * 表示bitmapData.width\n         */\n        $sourceWidth: number;\n        /**\n         * @private\n         * 表示bitmapData.height\n         */\n        $sourceHeight: number;\n        /**\n         * @private\n         */\n        $bitmapData: BitmapData;\n        /**\n         * @private\n         */\n        $ktxData: ArrayBuffer;\n        /**\n         * @private\n         */\n        $rotated: boolean;\n        /**\n         * The BitmapData object being referenced.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 被引用的 BitmapData 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        bitmapData: BitmapData;\n        /**\n        * Set the BitmapData object.\n        * @version Egret 3.2.1\n        * @platform Web,Native\n        * @language en_US\n        */\n        /**\n         * 设置 BitmapData 对象。\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        _setBitmapData(value: BitmapData): void;\n        /**\n         * The KTX object being referenced.\n        * @version Egret 5.2.21\n        * @platform Web,Native\n        * @language en_US\n        */\n        /**\n         * 被引用的 KTXData 对象。\n         * @version Egret 5.2.21\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ktxData: ArrayBuffer;\n        /**\n        * Set the KTXData object.\n        * @version Egret 3.2.1\n        * @platform Web,Native\n        * @language en_US\n        */\n        /**\n         * 设置 KTXData 对象。\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        _setKtxData(value: ArrayBuffer): void;\n        /**\n         * @private\n         * 设置Texture数据\n         * @param bitmapX\n         * @param bitmapY\n         * @param bitmapWidth\n         * @param bitmapHeight\n         * @param offsetX\n         * @param offsetY\n         * @param textureWidth\n         * @param textureHeight\n         * @param sourceWidth\n         * @param sourceHeight\n         */\n        $initData(bitmapX: number, bitmapY: number, bitmapWidth: number, bitmapHeight: number, offsetX: number, offsetY: number, textureWidth: number, textureHeight: number, sourceWidth: number, sourceHeight: number, rotated?: boolean): void;\n        /**\n         * @deprecated\n         */\n        getPixel32(x: number, y: number): number[];\n        /**\n         * Obtain the color value for the specified pixel region\n         * @param x  The x coordinate of the pixel region\n         * @param y  The y coordinate of the pixel region\n         * @param width  The width of the pixel region\n         * @param height  The height of the pixel region\n         * @returns  Specifies the color value for the pixel region\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取指定像素区域的颜色值\n         * @param x  像素区域的X轴坐标\n         * @param y  像素区域的Y轴坐标\n         * @param width  像素区域的宽度\n         * @param height  像素区域的高度\n         * @returns  指定像素区域的颜色值\n         * @version Egret 3.2.1\n         * @platform Web\n         * @language zh_CN\n         */\n        getPixels(x: number, y: number, width?: number, height?: number): number[];\n        /**\n         * Convert base64 string, if the picture (or pictures included) cross-border or null\n         * @param type Type conversions, such as \"image / png\"\n         * @param rect The need to convert the area\n         * @param smoothing Whether to convert data to the smoothing process\n         * @returns {any} base64 string\n         * @version Egret 2.4\n         * @language en_US\n         */\n        /**\n         * 转换成base64字符串，如果图片（或者包含的图片）跨域，则返回null\n         * @param type 转换的类型，如  \"image/png\"\n         * @param rect 需要转换的区域\n         * @param {any} encoderOptions 编码用的参数\n         * @returns {any} base64字符串\n         * @version Egret 2.4\n         * @language zh_CN\n         */\n        toDataURL(type: string, rect?: egret.Rectangle, encoderOptions?: any): string;\n        /**\n         * Crop designated area and save it as image.\n         * native support only \"image / png\" and \"image / jpeg\"; Web browser because of the various implementations are not the same, it is recommended to use only these two kinds.\n         * @param type Type conversions, such as \"image / png\"\n         * @param filePath The path name of the image (the home directory for the game's private space, the path can not have \"../\",Web supports only pass names.)\n         * @param rect The need to convert the area\n         * @version Egret 2.4\n         * @platform Native\n         * @language en_US\n         */\n        /**\n         * 裁剪指定区域并保存成图片。\n         * native只支持 \"image/png\" 和 \"image/jpeg\"；Web中由于各个浏览器的实现不一样，因此建议也只用这2种。\n         * @param type 转换的类型，如  \"image/png\"\n         * @param filePath 图片的名称的路径（主目录为游戏的私有空间，路径中不能有 \"../\"，Web只支持传名称。）\n         * @param rect 需要转换的区域\n         * @version Egret 2.4\n         * @platform Native\n         * @language zh_CN\n         */\n        saveToFile(type: string, filePath: string, rect?: egret.Rectangle): void;\n        /**\n         * dispose texture\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放纹理\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        dispose(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The Event class is used as the base class for the creation of Event objects, which are passed as parameters to event\n     * listeners when an event occurs.The properties of the Event class carry basic information about an event, such as\n     * the event's type or whether the event's default behavior can be canceled. For many events, such as the events represented\n     * by the Event class constants, this basic information is sufficient. Other events, however, may require more detailed\n     * information. Events associated with a touch tap, for example, need to include additional information about the\n     * location of the touch event. You can pass such additional information to event listeners by extending the Event class,\n     * which is what the TouchEvent class does. Egret API defines several Event subclasses for common events that require\n     * additional information. Events associated with each of the Event subclasses are described in the documentation for\n     * each class.The methods of the Event class can be used in event listener functions to affect the behavior of the event\n     * object. Some events have an associated default behavior. Your event listener can cancel this behavior by calling the\n     * preventDefault() method. You can also make the current event listener the last one to process an event by calling\n     * the stopPropagation() or stopImmediatePropagation() method.\n     * @see egret.EventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/Event.ts\n     * @see http://edn.egret.com/cn/docs/page/798 取消触摸事件\n     * @language en_US\n     */\n    /**\n     * Event 类作为创建事件实例的基类，当发生事件时，Event 实例将作为参数传递给事件侦听器。Event 类的属性包含有关事件的基本信息，例如事件\n     * 的类型或者是否可以取消事件的默认行为。对于许多事件（如由 Event 类常量表示的事件），此基本信息就足够了。但其他事件可能需要更详细的信息。\n     * 例如，与触摸关联的事件需要包括有关触摸事件的位置信息。您可以通过扩展 Event 类（TouchEvent 类执行的操作）将此类其他信息传递给事件侦听器。\n     * Egret API 为需要其他信息的常见事件定义多个 Event 子类。与每个 Event 子类关联的事件将在每个类的文档中加以介绍。Event 类的方法可以在\n     * 事件侦听器函数中使用以影响事件对象的行为。某些事件有关联的默认行为，通过调用 preventDefault() 方法，您的事件侦听器可以取消此行为。\n     * 可以通过调用 stopPropagation() 或 stopImmediatePropagation() 方法，将当前事件侦听器作为处理事件的最后一个事件侦听器。\n     * @see egret.EventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/Event.ts\n     * @see http://edn.egret.com/cn/docs/page/798 取消触摸事件\n     * @language zh_CN\n     */\n    class Event extends HashObject {\n        /**\n         * Dispatched when a display object is added to the on stage display list, either directly or through the addition\n         * of a sub tree in which the display object is contained.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在将显示对象直接添加到舞台显示列表或将包含显示对象的子树添加至舞台显示列表中时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ADDED_TO_STAGE: string;\n        /**\n         * Dispatched when a display object is about to be removed from the display list, either directly or through the removal\n         * of a sub tree in which the display object is contained.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在从显示列表中直接删除显示对象或删除包含显示对象的子树时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static REMOVED_FROM_STAGE: string;\n        /**\n         * Dispatched when a display object is added to the display list.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将显示对象添加到显示列表中时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ADDED: string;\n        /**\n         * Dispatched when a display object is about to be removed from the display list.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将要从显示列表中删除显示对象时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static REMOVED: string;\n        /**\n         * [broadcast event] Dispatched when the playhead is entering a new frame.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * [广播事件] 进入新的一帧,监听此事件将会在下一帧开始时触发一次回调。这是一个广播事件，可以在任何一个显示对象上监听，无论它是否在显示列表中。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ENTER_FRAME: string;\n        /**\n         * Dispatched when the display list is about to be updated and rendered.\n         * Note: Every time you want to receive a render event,you must call the stage.invalidate() method.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 渲染事件，监听此事件将会在本帧末即将开始渲染的前一刻触发回调，这是一个广播事件，可以在任何一个显示对象上监听，无论它是否在显示列表中。\n         * 注意：每次您希望 Egret 发送 Event.RENDER 事件时，都必须调用 stage.invalidate() 方法，由于每帧只会触发一次屏幕刷新，\n         * 若在 Event.RENDER 回调函数执行期间再次调用stage.invalidate()，将会被忽略。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static RENDER: string;\n        /**\n         * Dispatched when the size of stage or UIComponent is changed.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 舞台尺寸或UI组件尺寸发生改变\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static RESIZE: string;\n        /**\n         * Dispatched when the value or selection of a property is chaned.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 属性值或状态发生改变。通常是按钮的选中状态，或者列表的选中项索引改变。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static CHANGE: string;\n        /**\n         * Dispatched when the value or selection of a property is going to change.you can cancel this by calling the\n         * preventDefault() method.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 属性值或状态即将发生改变,通常是按钮的选中状态，或者列表的选中项索引改变。可以通过调用 preventDefault() 方法阻止索引发生更改。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static CHANGING: string;\n        /**\n         * Dispatched when the net request is complete.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 网络请求加载完成\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static COMPLETE: string;\n        /**\n         * Dispatched when loop completed.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 循环完成。循环最后一次只派发 COMPLETE 事件，不派发 LOOP_COMPLETE 事件。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static LOOP_COMPLETE: string;\n        /**\n         * Dispatched when the TextInput instance gets focus.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * TextInput实例获得焦点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static FOCUS_IN: string;\n        /**\n         * Dispatched when the TextInput instance loses focus.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * TextInput实例失去焦点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static FOCUS_OUT: string;\n        /**\n         * Dispatched when the playback is ended.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 动画声音等播放完成\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ENDED: string;\n        /**\n         * 游戏激活\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static ACTIVATE: string;\n        /**\n         * 取消激活\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static DEACTIVATE: string;\n        /**\n         * Event.CLOSE 常量定义 close 事件对象的 type 属性的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static CLOSE: string;\n        /**\n         * Event.CONNECT 常量定义 connect 事件对象的 type 属性的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static CONNECT: string;\n        /**\n         * Event.LEAVE_STAGE 常量定义 leaveStage 事件对象的 type 属性的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static LEAVE_STAGE: string;\n        /**\n         * Event.SOUND_COMPLETE 常量定义 在声音完成播放后调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static SOUND_COMPLETE: string;\n        /**\n         * Creates an Event object to pass as a parameter to event listeners.\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @param data the optional data associated with this event\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个作为参数传递给事件侦听器的 Event 对象。\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param data 与此事件对象关联的可选数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean, data?: any);\n        /**\n         * the optional data associated with this event\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 与此事件对象关联的可选数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        data: any;\n        /**\n         * @private\n         */\n        $type: string;\n        /**\n         * The type of event. The type is case-sensitive.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 事件的类型。类型区分大小写。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly type: string;\n        /**\n         * @private\n         */\n        $bubbles: boolean;\n        /**\n         * Indicates whether an event is a bubbling event.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示事件是否为冒泡事件。如果事件可以冒泡，则此值为 true；否则为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly bubbles: boolean;\n        /**\n         * @private\n         */\n        $cancelable: boolean;\n        /**\n         * Indicates whether the behavior associated with the event can be prevented. If the behavior can be\n         * canceled, this value is true; otherwise it is false.\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示是否可以阻止与事件相关联的行为。如果可以取消该行为，则此值为 true；否则为 false。\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly cancelable: boolean;\n        /**\n         * @private\n         */\n        $eventPhase: number;\n        /**\n         * The current phase in the event flow. This property can contain the following numeric values:\n         * The capture phase (EventPhase.CAPTURING_PHASE).\n         * The target phase (EventPhase.AT_TARGET)\n         * The bubbling phase (EventPhase.BUBBLING_PHASE).\n         * @see egret.EventPhase\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 事件流中的当前阶段。此属性可以包含以下数值：\n         * 捕获阶段 (EventPhase.CAPTURING_PHASE)。\n         * 目标阶段 (EventPhase.AT_TARGET)。\n         * 冒泡阶段 (EventPhase.BUBBLING_PHASE)。\n         * @see egret.EventPhase\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly eventPhase: number;\n        /**\n         * @private\n         */\n        $currentTarget: any;\n        /**\n         * The object that is actively processing the Event object with an event listener. For example, if a\n         * user clicks an OK button, the current target could be the node containing that button or one of its ancestors\n         * that has registered an event listener for that event.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当前正在使用某个事件侦听器处理 Event 对象的对象。例如，如果用户单击“确定”按钮，\n         * 则当前目标可以是包含该按钮的节点，也可以是它的已为该事件注册了事件侦听器的始祖之一。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly currentTarget: any;\n        /**\n         * @private\n         */\n        $target: any;\n        /**\n         * The event target. This property contains the target node. For example, if a user clicks an OK button,\n         * the target node is the display list node containing that button.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 事件目标。此属性包含目标节点。例如，如果用户单击“确定”按钮，则目标节点就是包含该按钮的显示列表节点。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly target: any;\n        $setTarget(target: any): boolean;\n        /**\n         * @private\n         */\n        $isDefaultPrevented: boolean;\n        /**\n         * Checks whether the preventDefault() method has been called on the event. If the preventDefault() method has been\n         * called, returns true; otherwise, returns false.\n         * @returns If preventDefault() has been called, returns true; otherwise, returns false.\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 检查是否已对事件调用 preventDefault() 方法。\n         * @returns 如果已调用 preventDefault() 方法，则返回 true；否则返回 false。\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        isDefaultPrevented(): boolean;\n        /**\n         * Cancels an event's default behavior if that behavior can be canceled.Many events have associated behaviors that\n         * are carried out by default. For example, if a user types a character into a text input, the default behavior\n         * is that the character is displayed in the text input. Because the TextEvent.TEXT_INPUT event's default behavior\n         * can be canceled, you can use the preventDefault() method to prevent the character from appearing.\n         * You can use the Event.cancelable property to check whether you can prevent the default behavior associated with\n         * a particular event. If the value of Event.cancelable is true, then preventDefault() can be used to cancel the event;\n         * otherwise, preventDefault() has no effect.\n         * @see #cancelable\n         * @see #isDefaultPrevented\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果可以取消事件的默认行为，则取消该行为。\n         * 许多事件都有默认执行的关联行为。例如，如果用户在文本字段中键入一个字符，则默认行为就是在文本字段中显示该字符。\n         * 由于可以取消 TextEvent.TEXT_INPUT 事件的默认行为，因此您可以使用 preventDefault() 方法来防止显示该字符。\n         * 您可以使用 Event.cancelable 属性来检查是否可以防止与特定事件关联的默认行为。如果 Event.cancelable 的值为 true，\n         * 则可以使用 preventDefault() 来取消事件；否则，preventDefault() 无效。\n         * @see #cancelable\n         * @see #isDefaultPrevented\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        preventDefault(): void;\n        /**\n         * @private\n         */\n        $isPropagationStopped: boolean;\n        /**\n         * Prevents processing of any event listeners in nodes subsequent to the current node in the event flow. This method\n         * does not affect any event listeners in the current node (currentTarget). In contrast, the stopImmediatePropagation()\n         * method prevents processing of event listeners in both the current node and subsequent nodes. Additional calls to this\n         * method have no effect. This method can be called in any phase of the event flow.<br/>\n         * Note: This method does not cancel the behavior associated with this event; see preventDefault() for that functionality.\n         * @see #stopImmediatePropagation()\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 防止对事件流中当前节点的后续节点中的所有事件侦听器进行处理。此方法不会影响当前节点 currentTarget 中的任何事件侦听器。\n         * 相比之下，stopImmediatePropagation() 方法可以防止对当前节点中和后续节点中的事件侦听器进行处理。\n         * 对此方法的其它调用没有任何效果。可以在事件流的任何阶段中调用此方法。<br/>\n         * 注意：此方法不会取消与此事件相关联的行为；有关此功能的信息，请参阅 preventDefault()。\n         * @see #stopImmediatePropagation()\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        stopPropagation(): void;\n        /**\n         * @private\n         */\n        $isPropagationImmediateStopped: boolean;\n        /**\n         * Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow.\n         * This method takes effect immediately, and it affects event listeners in the current node. In contrast, the\n         * stopPropagation() method doesn't take effect until all the event listeners in the current node finish processing.<br/>\n         * Note: This method does not cancel the behavior associated with this event; see preventDefault() for that functionality.\n         * @see #stopPropagation()\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 防止对事件流中当前节点中和所有后续节点中的事件侦听器进行处理。此方法会立即生效，并且会影响当前节点中的事件侦听器。\n         * 相比之下，在当前节点中的所有事件侦听器都完成处理之前，stopPropagation() 方法不会生效。<br/>\n         * 注意：此方法不会取消与此事件相关联的行为；有关此功能的信息，请参阅 preventDefault()。\n         * @see #stopPropagation()\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        stopImmediatePropagation(): void;\n        /**\n         * This method will be called automatically when you pass the event object as the parameters to the Event.release() method.\n         * If your custom event is designed for reusable,you should override this method to make sure all the references to external\n         * objects are cleaned. if not,it may cause memory leaking.\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当事件实例传递给Event.release()静态方法时，实例上的clean()方法将会被自动调用。\n         * 若此自定义事件的实例设计为可以循环复用的，为了避免引起内存泄露，自定义事件需要覆盖此方法来确保实例被缓存前断开对外部对象的一切引用。\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        protected clean(): void;\n        /**\n         * EventDispatcher object using the specified event object thrown Event. Objects thrown objects will be cached in the pool for the next round robin.\n         * @param target the event target\n         * @param type The type of the event. Event listeners can access this information through the inherited type property.\n         * @param bubbles Determines whether the Event object bubbles. Event listeners can access this information through\n         * the inherited bubbles property.\n         * @param data {any} data\n         * @method egret.Event.dispatchEvent\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的 EventDispatcher 对象来抛出 Event 事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @param type {string} 事件类型\n         * @param bubbles {boolean} 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param data {any} 事件data\n         * @method egret.Event.dispatchEvent\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchEvent(target: IEventDispatcher, type: string, bubbles?: boolean, data?: any): boolean;\n        /**\n         * @private\n         *\n         * @param EventClass\n         * @returns\n         */\n        static _getPropertyData(EventClass: any): any;\n        /**\n         * Gets one event instance from the object pool or create a new one. We highly recommend using the Event.create()\n         * and Event.release() methods to create and release an event object,it can reduce the number of reallocate objects,\n         * which allows you to get better code execution performance.<br/>\n         * Note: If you want to use this method to initialize your custom event object,you must make sure the constructor\n         * of your custom event is the same as the constructor of egret.Event.\n         * @param EventClass Event Class。\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @example\n         * <pre>\n         *    let event = Event.create(Event,type, bubbles);\n         *    event.data = data;    //optional,initializes custom data here\n         *    this.dispatchEvent(event);\n         *    Event.release(event);\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从对象池中取出或创建一个新的事件实例。我们建议您尽可能使用Event.create()和Event.release() 这一对方法来创建和释放事件对象，\n         * 这一对方法会将事件实例在内部缓存下来供下次循环使用，减少对象的创建次数,从而获得更高的代码运行性能。<br/>\n         * 注意：若使用此方法来创建自定义事件的实例，自定义的构造函数参数列表必须跟Event类一致。\n         * @param EventClass Event类名。\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @example\n         * <pre>\n         *    let event = Event.create(Event,type, bubbles);\n         *    event.data = data;  //可选，若指定义事件上需要附加其他参数，可以在获取实例后在此处设置。\n         *    this.dispatchEvent(event);\n         *    Event.release(event);\n         * </pre>\n         * @see #clean()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static create<T extends Event>(EventClass: {\n            new (type: string, bubbles?: boolean, cancelable?: boolean): T;\n            eventPool?: Event[];\n        }, type: string, bubbles?: boolean, cancelable?: boolean): T;\n        /**\n         * Releases an event object and cache it into the object pool.We highly recommend using the Event.create()\n         * and Event.release() methods to create and release an event object,it can reduce the number of reallocate objects,\n         * which allows you to get better code execution performance.<br/>\n         * Note: The parameters of this method only accepts an instance created by the Event.create() method.\n         * if not,it may throw an error.\n         * @example\n         * <pre>\n         *    let event = Event.create(Event,type, bubbles);\n         *    event.data = data; //optional,initializes custom data here\n         *    this.dispatchEvent(event);\n         *    Event.release(event);\n         * </pre>\n         * @see #clean()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放一个事件对象，并缓存到对象池。我们建议您尽可能使用Event.create()和Event.release() 这一对方法来创建和释放事件对象，\n         * 这一对方法会将事件实例在内部缓存下来供下次循环使用，减少对象的创建次数,从而获得更高的代码运行性能。<br/>\n         * 注意：此方法只能传入由Event.create()创建的事件实例，传入非法对象实例可能会导致报错。\n         * @example\n         * <pre>\n         *    let event = Event.create(Event,type, bubbles);\n         *    event.data = data;   //可选，若指定义事件上需要附加其他参数，可以在获取实例后在此处设置。\n         *    this.dispatchEvent(event);\n         *    Event.release(event);\n         * </pre>\n         * @see #clean()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static release(event: Event): void;\n    }\n}\n/**\n * Is debug mode.\n * @version Egret 2.5\n * @platform Web,Native\n * @language en_US\n */\n/**\n * 是否为 debug 模式。\n * @version Egret 2.5\n * @platform Web,Native\n * @language zh_CN\n */\ndeclare let DEBUG: boolean;\n/**\n * Is release mode.\n * @version Egret 2.5\n * @platform Web,Native\n * @language en_US\n */\n/**\n * 是否为 release 模式。\n * @version Egret 2.5\n * @platform Web,Native\n * @language zh_CN\n */\ndeclare let RELEASE: boolean;\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    function $error(code: number, ...params: any[]): void;\n    /**\n     * @private\n     */\n    function $warn(code: number, ...params: any[]): void;\n    /**\n     * @private\n     */\n    function getString(code: number, ...params: any[]): string;\n    /**\n     * @private\n     */\n    function $markCannotUse(instance: any, property: string, defaultVale: any): void;\n}\ndeclare namespace egret {\n    /**\n     * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal\n     * axis and y represents the vertical axis.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Point.ts\n     * @language en_US\n     */\n    /**\n     * Point 对象表示二维坐标系统中的某个位置，其中 x 表示水平轴，y 表示垂直轴。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Point.ts\n     * @language zh_CN\n     */\n    class Point extends HashObject {\n        /**\n         * Releases a point instance to the object pool\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放一个Point实例到对象池\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static release(point: Point): void;\n        /**\n         * get a point instance from the object pool or create a new one.\n         * @param x The horizontal coordinate.\n         * @param y The vertical coordinate.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从对象池中取出或创建一个新的Point对象。\n         * @param x 该对象的x属性值，默认为0\n         * @param y 该对象的y属性值，默认为0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static create(x: number, y: number): Point;\n        /**\n         * Creates a new point. If you pass no parameters to this method, a point is created at (0,0).\n         * @param x The horizontal coordinate.\n         * @param y The vertical coordinate.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.Point 对象.若不传入任何参数，将会创建一个位于（0，0）位置的点。\n         * @param x 该对象的x属性值，默认为0\n         * @param y 该对象的y属性值，默认为0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(x?: number, y?: number);\n        /**\n         * The horizontal coordinate.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 该点的水平坐标。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        x: number;\n        /**\n         * The vertical coordinate.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 该点的垂直坐标。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        y: number;\n        /**\n         * The length of the line segment from (0,0) to this point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从 (0,0) 到此点的线段长度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly length: number;\n        /**\n         * Sets the members of Point to the specified values\n         * @param x The horizontal coordinate.\n         * @param y The vertical coordinate.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Point 的成员设置为指定值\n         * @param x 该对象的x属性值\n         * @param y 该对象的y属性值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setTo(x: number, y: number): Point;\n        /**\n         * Creates a copy of this Point object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 克隆点对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        clone(): Point;\n        /**\n         * Determines whether two points are equal. Two points are equal if they have the same x and y values.\n         * @param toCompare The point to be compared.\n         * @returns A value of true if the object is equal to this Point object; false if it is not equal.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定两个点是否相同。如果两个点具有相同的 x 和 y 值，则它们是相同的点。\n         * @param toCompare 要比较的点。\n         * @returns 如果该对象与此 Point 对象相同，则为 true 值，如果不相同，则为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        equals(toCompare: Point): boolean;\n        /**\n         * Returns the distance between pt1 and pt2.\n         * @param p1 The first point.\n         * @param p2 The second point.\n         * @returns The distance between the first and second points.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回 pt1 和 pt2 之间的距离。\n         * @param p1 第一个点\n         * @param p2 第二个点\n         * @returns 第一个点和第二个点之间的距离。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static distance(p1: Point, p2: Point): number;\n        /**\n         * Copies all of the point data from the source Point object into the calling Point object.\n         * @param sourcePoint The Point object from which to copy the data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将源 Point 对象中的所有点数据复制到调用方 Point 对象中。\n         * @param sourcePoint 要从中复制数据的 Point 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        copyFrom(sourcePoint: Point): void;\n        /**\n         * Adds the coordinates of another point to the coordinates of this point to create a new point.\n         * @param v The point to be added.\n         * @returns The new point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将另一个点的坐标添加到此点的坐标以创建一个新点。\n         * @param v 要添加的点。\n         * @returns 新点。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        add(v: Point): Point;\n        /**\n         * Determines a point between two specified points.\n         * The parameter f determines where the new interpolated point is located relative to the two end points specified by parameters pt1 and pt2. The closer the value of the parameter f is to 1.0, the closer the interpolated point is to the first point (parameter pt1). The closer the value of the parameter f is to 0, the closer the interpolated point is to the second point (parameter pt2).\n         * @param pt1 The first point.\n         * @param pt2 The second point.\n         * @param f The level of interpolation between the two points. Indicates where the new point will be, along the line between pt1 and pt2. If f=1, pt1 is returned; if f=0, pt2 is returned.\n         * @returns The new interpolated point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定两个指定点之间的点。\n         * 参数 f 确定新的内插点相对于参数 pt1 和 pt2 指定的两个端点所处的位置。参数 f 的值越接近 1.0，则内插点就越接近第一个点（参数 pt1）。参数 f 的值越接近 0，则内插点就越接近第二个点（参数 pt2）。\n         * @param pt1 第一个点。\n         * @param pt2 第二个点。\n         * @param f 两个点之间的内插级别。表示新点将位于 pt1 和 pt2 连成的直线上的什么位置。如果 f=1，则返回 pt1；如果 f=0，则返回 pt2。\n         * @returns 新的内插点。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static interpolate(pt1: Point, pt2: Point, f: number): Point;\n        /**\n         * Scales the line segment between (0,0) and the current point to a set length.\n         * @param thickness The scaling value. For example, if the current point is (0,5), and you normalize it to 1, the point returned is at (0,1).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 (0,0) 和当前点之间的线段缩放为设定的长度。\n         * @param thickness 缩放值。例如，如果当前点为 (0,5) 并且您将它规范化为 1，则返回的点位于 (0,1) 处。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        normalize(thickness: number): void;\n        /**\n         * Offsets the Point object by the specified amount. The value of dx is added to the original value of x to create the new x value. The value of dy is added to the original value of y to create the new y value.\n         * @param dx The amount by which to offset the horizontal coordinate, x.\n         * @param dy The amount by which to offset the vertical coordinate, y.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 按指定量偏移 Point 对象。dx 的值将添加到 x 的原始值中以创建新的 x 值。dy 的值将添加到 y 的原始值中以创建新的 y 值。\n         * @param dx 水平坐标 x 的偏移量。\n         * @param dy 水平坐标 y 的偏移量。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        offset(dx: number, dy: number): void;\n        /**\n         * Converts a pair of polar coordinates to a Cartesian point coordinate.\n         * @param len The length coordinate of the polar pair.\n         * @param angle The angle, in radians, of the polar pair.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将一对极坐标转换为笛卡尔点坐标。\n         * @param len 极坐标对的长度。\n         * @param angle 极坐标对的角度（以弧度表示）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static polar(len: number, angle: number): Point;\n        /**\n         * Subtracts the coordinates of another point from the coordinates of this point to create a new point.\n         * @param v The point to be subtracted.\n         * @returns The new point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从此点的坐标中减去另一个点的坐标以创建一个新点。\n         * @param v 要减去的点。\n         * @returns 新点。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        subtract(v: Point): Point;\n        /**\n         * Returns a string that contains the values of the x and y coordinates. The string has the form \"(x=x, y=y)\", so calling the toString() method for a point at 23,17 would return \"(x=23, y=17)\".\n         * @returns The string representation of the coordinates.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回包含 x 和 y 坐标的值的字符串。该字符串的格式为 \"(x=x, y=y)\"，因此为点 23,17 调用 toString() 方法将返回 \"(x=23, y=17)\"。\n         * @returns 坐标的字符串表示形式。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        toString(): string;\n    }\n    /**\n     * @private\n     * 仅供框架内复用，要防止暴露引用到外部。\n     */\n    let $TempPoint: Point;\n}\ndeclare namespace egret {\n    /**\n     * The DisplayObjectContainer class is a basic display list building block: a display list node that can contain children.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/DisplayObjectContainer.ts\n     * @language en_US\n     */\n    /**\n     * DisplayObjectContainer 类是基本显示列表构造块：一个可包含子项的显示列表节点。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/DisplayObjectContainer.ts\n     * @language zh_CN\n     */\n    class DisplayObjectContainer extends DisplayObject {\n        /**\n         * @private\n         */\n        static $EVENT_ADD_TO_STAGE_LIST: DisplayObject[];\n        /**\n         * @private\n         */\n        static $EVENT_REMOVE_FROM_STAGE_LIST: DisplayObject[];\n        /**\n         * Creates a new DisplayObjectContainer instance.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 实例化一个容器\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        /**\n         * Returns the number of children of this object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回此对象的子项数目。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly numChildren: number;\n        /**\n         * Set children sort mode.\n         * @param value {string} The sort mode\n         * @see egret.ChildrenSortMode\n         * @version Egret 5.2.19\n         * @platform Native\n         * @language en_US\n         */\n        /**\n         * 设置子项目的排序方式\n         * @param value {string} 排序方式\n         * @see egret.ChildrenSortMode\n         * @version Egret 5.2.19\n         * @platform Native\n         * @language en_US\n         */\n        setChildrenSortMode(value: string): void;\n        /**\n         * Adds a child DisplayObject instance to this DisplayObjectContainer instance. The child is added to the front\n         * (top) of all other children in this DisplayObjectContainer instance. (To add a child to a specific index position,\n         * use the addChildAt() method.)If you add a child object that already has a different display object container\n         * as a parent, the object is removed from the child list of the other display object container.\n         * @param child The DisplayObject instance to add as a child of this DisplayObjectContainer instance.\n         * @returns 在 child The DisplayObject instance that you pass in the child parameter.\n         * @see #addChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将一个 DisplayObject 子实例添加到该 DisplayObjectContainer 实例中。子项将被添加到该 DisplayObjectContainer 实例中其他\n         * 所有子项的前（上）面。（要将某子项添加到特定索引位置，请使用 addChildAt() 方法。）\n         * @param child 要作为该 DisplayObjectContainer 实例的子项添加的 DisplayObject 实例。\n         * @returns 在 child 参数中传递的 DisplayObject 实例。\n         * @see #addChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        addChild(child: DisplayObject): DisplayObject;\n        /**\n         * Adds a child DisplayObject instance to this DisplayObjectContainer instance. The child is added at the index position\n         * specified. An index of 0 represents the back (bottom) of the display list for this DisplayObjectContainer object.\n         * If you add a child object that already has a different display object container as a parent, the object is removed\n         * from the child list of the other display object container.\n         * @param child The DisplayObject instance to add as a child of this DisplayObjectContainer instance.\n         * @param index The index position to which the child is added. If you specify a currently occupied index position,\n         * the child object that exists at that position and all higher positions are moved up one position in the child list.\n         * @returns The DisplayObject instance that you pass in the child parameter.\n         * @see #addChild()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将一个 DisplayObject 子实例添加到该 DisplayObjectContainer 实例中。该子项将被添加到指定的索引位置。索引为 0 表示该\n         * DisplayObjectContainer 对象的显示列表的后（底）部。如果添加一个已将其它显示对象容器作为父项的子对象，则会从其它显示对象容器的子列表中删除该对象。\n         * @param child 要作为该 DisplayObjectContainer 实例的子项添加的 DisplayObject 实例。\n         * @param index 添加该子项的索引位置。 如果指定当前占用的索引位置，则该位置以及所有更高位置上的子对象会在子级列表中上移一个位置。\n         * @returns 在 child 参数中传递的 DisplayObject 实例。\n         * @see #addChild()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        addChildAt(child: DisplayObject, index: number): DisplayObject;\n        /**\n         * @private\n         */\n        $doAddChild(child: DisplayObject, index: number, notifyListeners?: boolean): DisplayObject;\n        /**\n         * Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance\n         * itself. The search includes the entire display list including this DisplayObjectContainer instance. Grandchildren,\n         * great-grandchildren, and so on each return true.\n         * @param child The child object to test.\n         * @returns true if the child object is a child of the DisplayObjectContainer or the container itself; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定指定显示对象是 DisplayObjectContainer 实例的子项或该实例本身。搜索包括整个显示列表（其中包括此 DisplayObjectContainer 实例）。\n         * 孙项、曾孙项等，每项都返回 true。\n         * @param child 要测试的子对象。\n         * @returns 如果 child 对象是 DisplayObjectContainer 的子项或容器本身，则为 true；否则为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        contains(child: DisplayObject): boolean;\n        /**\n         * Returns the child display object instance that exists at the specified index.\n         * @param index The index position of the child object.\n         * @returns The child display object at the specified index position.\n         * @see #getChildByName()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回位于指定索引处的子显示对象实例。\n         * @param index 子对象的索引位置。\n         * @returns 位于指定索引位置处的子显示对象。\n         * @see #getChildByName()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getChildAt(index: number): DisplayObject;\n        /**\n         * Returns the index position of a child DisplayObject instance.\n         * @param child The DisplayObject instance to identify.\n         * @returns The index position of the child display object to identify.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回 DisplayObject 的 child 实例的索引位置。\n         * @param child 要测试的子对象。\n         * @returns 要查找的子显示对象的索引位置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getChildIndex(child: egret.DisplayObject): number;\n        /**\n         * Returns the child display object that exists with the specified name. If more that one child display object has\n         * the specified name, the method returns the first object in the child list.The getChildAt() method is faster than\n         * the getChildByName() method. The getChildAt() method accesses a child from a cached array, whereas the getChildByName()\n         * method has to traverse a linked list to access a child.\n         * @param name The name of the child to return.\n         * @returns The child display object with the specified name.\n         * @see #getChildAt()\n         * @see egret.DisplayObject#name\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回具有指定名称的子显示对象。如果多个子显示对象具有指定名称，则该方法会返回子级列表中的第一个对象。\n         * getChildAt() 方法比 getChildByName() 方法快。getChildAt() 方法从缓存数组中访问子项，而 getChildByName() 方法则必须遍历链接的列表来访问子项。\n         * @param name 要返回的子项的名称。\n         * @returns 具有指定名称的子显示对象。\n         * @see #getChildAt()\n         * @see egret.DisplayObject#name\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getChildByName(name: string): DisplayObject;\n        /**\n         * Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance.\n         * The parent property of the removed child is set to null , and the object is garbage collected if no other references\n         * to the child exist. The index positions of any display objects above the child in the DisplayObjectContainer are\n         * decreased by 1.\n         * @param child The DisplayObject instance to remove.\n         * @returns The DisplayObject instance that you pass in the child parameter.\n         * @see #removeChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从 DisplayObjectContainer 实例的子列表中删除指定的 child DisplayObject 实例。将已删除子项的 parent 属性设置为 null；\n         * 如果不存在对该子项的任何其它引用，则将该对象作为垃圾回收。DisplayObjectContainer 中该子项之上的任何显示对象的索引位置都减去 1。\n         * @param child 要删除的 DisplayObject 实例。\n         * @returns 在 child 参数中传递的 DisplayObject 实例。\n         * @see #removeChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        removeChild(child: DisplayObject): DisplayObject;\n        /**\n         * Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer.\n         * The parent property of the removed child is set to null, and the object is garbage collected if no other references\n         * to the child exist. The index positions of any display objects above the child in the DisplayObjectContainer are decreased by 1.\n         * @param index The child index of the DisplayObject to remove.\n         * @returns The DisplayObject instance that was removed.\n         * @see #removeChild()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从 DisplayObjectContainer 的子列表中指定的 index 位置删除子 DisplayObject。将已删除子项的 parent 属性设置为 null；\n         * 如果没有对该子项的任何其他引用，则将该对象作为垃圾回收。DisplayObjectContainer 中该子项之上的任何显示对象的索引位置都减去 1。\n         * @param index 要删除的 DisplayObject 的子索引。\n         * @returns 已删除的 DisplayObject 实例。\n         * @see #removeChild()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        removeChildAt(index: number): DisplayObject;\n        /**\n         * @private\n         */\n        $doRemoveChild(index: number, notifyListeners?: boolean): DisplayObject;\n        /**\n         * Changes the position of an existing child in the display object container. This affects the layering of child objects.\n         * @param child The child DisplayObject instance for which you want to change the index number.\n         * @param index The resulting index number for the child display object.\n         * @see #addChildAt()\n         * @see #getChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 更改现有子项在显示对象容器中的位置。这会影响子对象的分层。\n         * @param child 要为其更改索引编号的 DisplayObject 子实例。\n         * @param index 生成的 child 显示对象的索引编号。当新的索引编号小于0或大于已有子元件数量时，新加入的DisplayObject对象将会放置于最上层。\n         * @see #addChildAt()\n         * @see #getChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setChildIndex(child: DisplayObject, index: number): void;\n        /**\n         * @private\n         */\n        private doSetChildIndex(child, index);\n        /**\n         * Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child\n         * list. All other child objects in the display object container remain in the same index positions.\n         * @param index1 The index position of the first child object.\n         * @param index2 The index position of the second child object.\n         * @see #swapChildren()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在子级列表中两个指定的索引位置，交换子对象的 Z 轴顺序（前后顺序）。显示对象容器中所有其他子对象的索引位置保持不变。\n         * @param index1 第一个子对象的索引位置。\n         * @param index2 第二个子对象的索引位置。\n         * @see #swapChildren()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        swapChildrenAt(index1: number, index2: number): void;\n        /**\n         * Swaps the z-order (front-to-back order) of the two specified child objects. All other child objects in the\n         * display object container remain in the same index positions.\n         * @param child1 The first child object.\n         * @param child2 The second child object.\n         * @see #swapChildrenAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 交换两个指定子对象的 Z 轴顺序（从前到后顺序）。显示对象容器中所有其他子对象的索引位置保持不变。\n         * @param child1 第一个子对象。\n         * @param child2 第二个子对象。\n         * @see #swapChildrenAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        swapChildren(child1: DisplayObject, child2: DisplayObject): void;\n        /**\n         * @private\n         */\n        private doSwapChildrenAt(index1, index2);\n        /**\n         * Removes all child DisplayObject instances from the child list of the DisplayObjectContainer instance. The parent\n         * property of the removed children is set to null , and the objects are garbage collected if no other references to the children exist.\n         * @see #removeChild()\n         * @see #removeChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从 DisplayObjectContainer 实例的子级列表中删除所有 child DisplayObject 实例。\n         * @see #removeChild()\n         * @see #removeChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        removeChildren(): void;\n        /**\n         * @private\n         * 一个子项被添加到容器内，此方法不仅在操作addChild()时会被回调，在操作setChildIndex()或swapChildren时也会回调。\n         * 当子项索引发生改变时，会先触发$childRemoved()方法，然后触发$childAdded()方法。\n         */\n        $childAdded(child: DisplayObject, index: number): void;\n        /**\n         * @private\n         * 一个子项从容器内移除，此方法不仅在操作removeChild()时会被回调，在操作setChildIndex()或swapChildren时也会回调。\n         * 当子项索引发生改变时，会先触发$childRemoved()方法，然后触发$childAdded()方法。\n         */\n        $childRemoved(child: DisplayObject, index: number): void;\n        /**\n         * @private\n         */\n        $onAddToStage(stage: Stage, nestLevel: number): void;\n        /**\n         * @private\n         *\n         */\n        $onRemoveFromStage(): void;\n        /**\n         * @private\n         */\n        $measureChildBounds(bounds: Rectangle): void;\n        $touchChildren: boolean;\n        /**\n         * Determines whether or not the children of the object are touch, or user input device, enabled. If an object is\n         * enabled, a user can interact with it by using a touch or user input device.\n         * @default true\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定对象的子级是否支持触摸或用户输入设备。如果对象支持触摸或用户输入设备，用户可以通过使用触摸或用户输入设备与之交互。\n         * @default true\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        touchChildren: boolean;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getTouchChildren(): boolean;\n        /**\n         * @private\n         */\n        $setTouchChildren(value: boolean): boolean;\n        /**\n         * @private\n         */\n        $hitTest(stageX: number, stageY: number): DisplayObject;\n        private _sortChildrenFunc(a, b);\n        sortChildren(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * SpriteSheet is a mosaic of multiple sub-bitmaps, comprising a plurality of Texture objects.\n     * Each Texture object shares the set bitmap of SpriteSheet, but it points to its different areas.\n     * On WebGL / OpenGL, this operation can significantly improve performance.\n     * At the same time, SpriteSheet can carry out material integration easily to reduce the number of HTTP requests\n     * For specification of the SpriteSheet format, see the document https://github.com/egret-labs/egret-core/wiki/Egret-SpriteSheet-Specification\n     * @see http://edn.egret.com/cn/docs/page/135 The use of texture packs\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/SpriteSheet.ts\n     * @language en_US\n     */\n    /**\n     * SpriteSheet 是一张由多个子位图拼接而成的集合位图，它包含多个 Texture 对象。\n     * 每一个 Texture 都共享 SpriteSheet 的集合位图，但是指向它的不同的区域。\n     * 在WebGL / OpenGL上，这种做法可以显著提升性能\n     * 同时，SpriteSheet可以很方便的进行素材整合，降低HTTP请求数量\n     * SpriteSheet 格式的具体规范可以参见此文档  https://github.com/egret-labs/egret-core/wiki/Egret-SpriteSheet-Specification\n     * @see http://edn.egret.com/cn/docs/page/135 纹理集的使用\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/SpriteSheet.ts\n     * @language zh_CN\n     */\n    class SpriteSheet extends HashObject {\n        /**\n         * Create an egret.SpriteSheet object\n         * @param texture {Texture} Texture\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.SpriteSheet 对象\n         * @param texture {Texture} 纹理\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(texture: Texture);\n        /**\n         * @private\n         * 表示这个SpriteSheet的位图区域在bitmapData上的起始位置x。\n         */\n        private _bitmapX;\n        /**\n         * @private\n         * 表示这个SpriteSheet的位图区域在bitmapData上的起始位置y。\n         */\n        private _bitmapY;\n        /**\n         * @private\n         * 共享的位图数据\n         */\n        $texture: Texture;\n        /**\n         * @private\n         * 纹理缓存字典\n         */\n        _textureMap: MapLike<Texture>;\n        /**\n         * Obtain a cached Texture object according to the specified texture name\n         * @param name {string} Cache the name of this Texture object\n         * @returns {egret.Texture} The Texture object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 根据指定纹理名称获取一个缓存的 Texture 对象\n         * @param name {string} 缓存这个 Texture 对象所使用的名称\n         * @returns {egret.Texture} Texture 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getTexture(name: string): Texture;\n        /**\n         * Create a new Texture object for the specified area on SpriteSheet and cache it\n         * @param name {string} Cache the name of this Texture object. If the name already exists, the previous Texture object will be overwrited.\n         * @param bitmapX {number} Starting coordinate x of texture area on bitmapData\n         * @param bitmapY {number} Starting coordinate y of texture area on bitmapData\n         * @param bitmapWidth {number} Width of texture area on bitmapData\n         * @param bitmapHeight {number} Height of texture area on bitmapData\n         * @param offsetX {number} Starting point x for a non-transparent area of the original bitmap\n         * @param offsetY {number} Starting point y for a non-transparent area of the original bitmap\n         * @param textureWidth {number} Width of the original bitmap. If it is not passed, use the bitmapWidth  value.\n         * @param textureHeight {number} Height of the original bitmap. If it is not passed, use the bitmapHeight value.\n         * @returns {egret.Texture} The created Texture object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 为 SpriteSheet 上的指定区域创建一个新的 Texture 对象并缓存它\n         * @param name {string} 缓存这个 Texture 对象所使用的名称，如果名称已存在，将会覆盖之前的 Texture 对象\n         * @param bitmapX {number} 纹理区域在 bitmapData 上的起始坐标x\n         * @param bitmapY {number} 纹理区域在 bitmapData 上的起始坐标y\n         * @param bitmapWidth {number} 纹理区域在 bitmapData 上的宽度\n         * @param bitmapHeight {number} 纹理区域在 bitmapData 上的高度\n         * @param offsetX {number} 原始位图的非透明区域 x 起始点\n         * @param offsetY {number} 原始位图的非透明区域 y 起始点\n         * @param textureWidth {number} 原始位图的高度，若不传入，则使用 bitmapWidth 的值。\n         * @param textureHeight {number} 原始位图的宽度，若不传入，则使用 bitmapHeight 的值。\n         * @returns {egret.Texture} 创建的 Texture 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        createTexture(name: string, bitmapX: number, bitmapY: number, bitmapWidth: number, bitmapHeight: number, offsetX?: number, offsetY?: number, textureWidth?: number, textureHeight?: number): Texture;\n        /**\n         * dispose texture\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放纹理\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        dispose(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    let $locale_strings: any;\n    /**\n     * @private\n     */\n    let $language: string;\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 全局多语言翻译函数\n     * @param code 要查询的字符串代码\n     * @param args 替换字符串中{0}标志的参数列表\n     * @returns 返回拼接后的字符串\n     */\n    function tr(code: number, ...args: any[]): string;\n}\ndeclare namespace egret {\n    /**\n     * The Bitmap class represents display objects that represent bitmap images.\n     * The Bitmap() constructor allows you to create a Bitmap object that contains a reference to a BitmapData object.\n     * After you create a Bitmap object, use the addChild() or addChildAt() method of the parent DisplayObjectContainer\n     * instance to place the bitmap on the display list.A Bitmap object can share its texture reference among several\n     * Bitmap objects, independent of translation or rotation properties. Because you can create multiple Bitmap objects\n     * that reference the same texture object, multiple display objects can use the same complex texture object\n     * without incurring the memory overhead of a texture object for each display object instance.\n     *\n     * @see egret.Texture\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Bitmap.ts\n     * @language en_US\n     */\n    /**\n     * Bitmap 类表示用于显示位图图片的显示对象。\n     * 利用 Bitmap() 构造函数，可以创建包含对 BitmapData 对象引用的 Bitmap 对象。创建了 Bitmap 对象后，\n     * 使用父级 DisplayObjectContainer 实例的 addChild() 或 addChildAt() 方法可以将位图放在显示列表中。\n     * 一个 Bitmap 对象可在若干 Bitmap 对象之中共享其 texture 引用，与缩放或旋转属性无关。\n     * 由于能够创建引用相同 texture 对象的多个 Bitmap 对象，因此，多个显示对象可以使用相同的 texture 对象，\n     * 而不会因为每个显示对象实例使用一个 texture 对象而产生额外内存开销。\n     *\n     * @see egret.Texture\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Bitmap.ts\n     * @language zh_CN\n     */\n    class Bitmap extends DisplayObject {\n        /**\n         * Initializes a Bitmap object to refer to the specified Texture object.\n         * @param value The Texture object being referenced.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个引用指定 Texture 实例的 Bitmap 对象\n         * @param value 被引用的 Texture 实例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(value?: Texture);\n        protected $texture: Texture;\n        $bitmapData: BitmapData;\n        protected $bitmapX: number;\n        protected $bitmapY: number;\n        protected $bitmapWidth: number;\n        protected $bitmapHeight: number;\n        protected $offsetX: number;\n        protected $offsetY: number;\n        protected $textureWidth: number;\n        protected $textureHeight: number;\n        protected $sourceWidth: number;\n        protected $sourceHeight: number;\n        protected $smoothing: boolean;\n        protected $explicitBitmapWidth: number;\n        protected $explicitBitmapHeight: number;\n        protected createNativeDisplayObject(): void;\n        /**\n         * @private\n         * 显示对象添加到舞台\n         */\n        $onAddToStage(stage: Stage, nestLevel: number): void;\n        /**\n         * @private\n         * 显示对象从舞台移除\n         */\n        $onRemoveFromStage(): void;\n        /**\n         * The Texture object being referenced.\n         * If you pass the constructor of type BitmapData or last set for bitmapData, this value returns null.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 被引用的 Texture 对象。\n         * 如果传入构造函数的类型为 BitmapData 或者最后设置的为 bitmapData，则此值返回 null。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        texture: Texture;\n        /**\n         * @private\n         */\n        $setTexture(value: Texture): boolean;\n        $setBitmapData(value: any): void;\n        /**\n         * @private\n         */\n        protected setBitmapDataToWasm(data?: Texture): void;\n        /**\n         * @private\n         */\n        $refreshImageData(): void;\n        /**\n         * @private\n         */\n        private setImageData(bitmapData, bitmapX, bitmapY, bitmapWidth, bitmapHeight, offsetX, offsetY, textureWidth, textureHeight, sourceWidth, sourceHeight);\n        /**\n         * @private\n         */\n        $scale9Grid: egret.Rectangle;\n        /**\n         * Represent a Rectangle Area that the 9 scale area of Image.\n         * Notice: This property is valid only when <code>fillMode</code>\n         * is <code>BitmapFillMode.SCALE</code>.\n         *\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 矩形区域，它定义素材对象的九个缩放区域。\n         * 注意:此属性仅在<code>fillMode</code>为<code>BitmapFillMode.SCALE</code>时有效。\n         *\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        scale9Grid: egret.Rectangle;\n        protected $setScale9Grid(value: egret.Rectangle): void;\n        /**\n         * @private\n         */\n        $fillMode: string;\n        /**\n         * Determines how the bitmap fills in the dimensions.\n         * <p>When set to <code>BitmapFillMode.REPEAT</code>, the bitmap\n         * repeats to fill the region.</p>\n         * <p>When set to <code>BitmapFillMode.SCALE</code>, the bitmap\n         * stretches to fill the region.</p>\n         *\n         * @default <code>BitmapFillMode.SCALE</code>\n         *\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 确定位图填充尺寸的方式。\n         * <p>设置为 <code>BitmapFillMode.REPEAT</code>时，位图将重复以填充区域。</p>\n         * <p>设置为 <code>BitmapFillMode.SCALE</code>时，位图将拉伸以填充区域。</p>\n         *\n         * @default <code>BitmapFillMode.SCALE</code>\n         *\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        fillMode: string;\n        $setFillMode(value: string): boolean;\n        /**\n         * The default value of whether or not is smoothed when scaled.\n         * When object such as Bitmap is created,smoothing property will be set to this value.\n         * @default true。\n         * @version Egret 3.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 控制在缩放时是否进行平滑处理的默认值。\n         * 在 Bitmap 等对象创建时,smoothing 属性会被设置为该值。\n         * @default true。\n         * @version Egret 3.0\n         * @platform Web\n         * @language zh_CN\n         */\n        static defaultSmoothing: boolean;\n        /**\n         * Whether or not the bitmap is smoothed when scaled.\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 控制在缩放时是否对位图进行平滑处理。\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        smoothing: boolean;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setWidth(value: number): boolean;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setHeight(value: number): boolean;\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        $getWidth(): number;\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        $getHeight(): number;\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        /**\n         * @private\n         */\n        $updateRenderNode(): void;\n        private _pixelHitTest;\n        /**\n         * Specifies whether this object use precise hit testing by checking the alpha value of each pixel.If pixelHitTest\n         * is set to true,the transparent area of the bitmap will be touched through.<br/>\n         * Note:If the image is loaded from cross origin,that we can't access to the pixel data,so it might cause\n         * the pixelHitTest property invalid.\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否开启精确像素碰撞。设置为true显示对象本身的透明区域将能够被穿透。<br/>\n         * 注意：若图片资源是以跨域方式从外部服务器加载的，将无法访问图片的像素数据，而导致此属性失效。\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        pixelHitTest: boolean;\n        $hitTest(stageX: number, stageY: number): DisplayObject;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 渲染节点类型\n     */\n    const enum RenderNodeType {\n        /**\n         * 位图渲染节点\n         */\n        BitmapNode = 1,\n        /**\n         * 文本渲染节点\n         */\n        TextNode = 2,\n        /**\n         * 矢量渲染节点\n         */\n        GraphicsNode = 3,\n        /**\n         * 组渲染节点\n         */\n        GroupNode = 4,\n        /**\n         * Mesh 节点\n         */\n        MeshNode = 5,\n        /**\n         * 普通位图渲染节点\n         */\n        NormalBitmapNode = 6,\n    }\n    /**\n     * @private\n     * 渲染节点基类\n     */\n    class RenderNode {\n        /**\n         * 节点类型..\n         */\n        type: number;\n        /**\n         * 绘制数据\n         */\n        drawData: any[];\n        /**\n         * 绘制次数\n         */\n        protected renderCount: number;\n        /**\n         * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n         */\n        cleanBeforeRender(): void;\n        $getRenderCount(): number;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 路径类型\n     */\n    const enum PathType {\n        /**\n         * 纯色填充路径\n         */\n        Fill = 1,\n        /**\n         * 渐变填充路径\n         */\n        GradientFill = 2,\n        /**\n         * 线条路径\n         */\n        Stroke = 3,\n    }\n    /**\n     * @private\n     * 2D路径命令\n     */\n    const enum PathCommand {\n        MoveTo = 1,\n        LineTo = 2,\n        CurveTo = 3,\n        CubicCurveTo = 4,\n    }\n    /**\n     * @private\n     * 2D路径\n     */\n    class Path2D {\n        /**\n         * 路径类型\n         */\n        type: number;\n        $commands: number[];\n        $data: number | number[][];\n        protected commandPosition: number;\n        protected dataPosition: number;\n        /**\n         * 当前移动到的坐标X\n         * 注意：目前只有drawArc之前会被赋值\n         */\n        $lastX: number;\n        /**\n         * 当前移动到的坐标Y\n         * 注意：目前只有drawArc之前会被赋值\n         */\n        $lastY: number;\n        /**\n         * 将当前绘图位置移动到 (x, y)。如果缺少任何一个参数，则此方法将失败，并且当前绘图位置不改变。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         */\n        moveTo(x: number, y: number): void;\n        /**\n         * 使用当前线条样式绘制一条从当前绘图位置开始到 (x, y) 结束的直线；当前绘图位置随后会设置为 (x, y)。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         */\n        lineTo(x: number, y: number): void;\n        /**\n         * 使用当前线条样式和由 (controlX, controlY) 指定的控制点绘制一条从当前绘图位置开始到 (anchorX, anchorY) 结束的二次贝塞尔曲线。当前绘图位置随后设置为 (anchorX, anchorY)。\n         * 如果在调用 moveTo() 方法之前调用了 curveTo() 方法，则当前绘图位置的默认值为 (0, 0)。如果缺少任何一个参数，则此方法将失败，并且当前绘图位置不改变。\n         * 绘制的曲线是二次贝塞尔曲线。二次贝塞尔曲线包含两个锚点和一个控制点。该曲线内插这两个锚点，并向控制点弯曲。\n         * @param controlX 一个数字，指定控制点相对于父显示对象注册点的水平位置。\n         * @param controlY 一个数字，指定控制点相对于父显示对象注册点的垂直位置。\n         * @param anchorX 一个数字，指定下一个锚点相对于父显示对象注册点的水平位置。\n         * @param anchorY 一个数字，指定下一个锚点相对于父显示对象注册点的垂直位置。\n         */\n        curveTo(controlX: number, controlY: number, anchorX: number, anchorY: number): void;\n        /**\n         * 从当前绘图位置到指定的锚点绘制一条三次贝塞尔曲线。三次贝塞尔曲线由两个锚点和两个控制点组成。该曲线内插这两个锚点，并向两个控制点弯曲。\n         * @param controlX1 指定首个控制点相对于父显示对象的注册点的水平位置。\n         * @param controlY1 指定首个控制点相对于父显示对象的注册点的垂直位置。\n         * @param controlX2 指定第二个控制点相对于父显示对象的注册点的水平位置。\n         * @param controlY2 指定第二个控制点相对于父显示对象的注册点的垂直位置。\n         * @param anchorX 指定锚点相对于父显示对象的注册点的水平位置。\n         * @param anchorY 指定锚点相对于父显示对象的注册点的垂直位置。\n         */\n        cubicCurveTo(controlX1: number, controlY1: number, controlX2: number, controlY2: number, anchorX: number, anchorY: number): void;\n        /**\n         * 绘制一个矩形\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         */\n        drawRect(x: number, y: number, width: number, height: number): void;\n        /**\n         * 绘制一个圆角矩形。\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @param ellipseWidth 用于绘制圆角的椭圆的宽度（以像素为单位）。\n         * @param ellipseHeight 用于绘制圆角的椭圆的高度（以像素为单位）。 （可选）如果未指定值，则默认值与为 ellipseWidth 参数提供的值相匹配。\n         */\n        drawRoundRect(x: number, y: number, width: number, height: number, ellipseWidth: number, ellipseHeight?: number): void;\n        /**\n         * 绘制一个圆。\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param radius 圆的半径（以像素为单位）。\n         */\n        drawCircle(x: number, y: number, radius: number): void;\n        /**\n         * 绘制一个椭圆。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         */\n        drawEllipse(x: number, y: number, width: number, height: number): void;\n        /**\n         * 绘制一段圆弧路径。圆弧路径的圆心在 (x, y) 位置，半径为 r ，根据anticlockwise （默认为顺时针）指定的方向从 startAngle 开始绘制，到 endAngle 结束。\n         * @param x 圆弧中心（圆心）的 x 轴坐标。\n         * @param y 圆弧中心（圆心）的 y 轴坐标。\n         * @param radius 圆弧的半径。\n         * @param startAngle 圆弧的起始点， x轴方向开始计算，单位以弧度表示。\n         * 注意，必须在0~2π之间。\n         * @param endAngle 圆弧的终点， 单位以弧度表示。\n         * 注意，必须在0~2π之间。\n         * @param anticlockwise 如果为 true，逆时针绘制圆弧，反之，顺时针绘制。\n         */\n        drawArc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise: boolean): void;\n        /**\n         * 绘制一段圆弧路径\n         * @param x 圆弧中心（圆心）的 x 轴坐标。\n         * @param y 圆弧中心（圆心）的 y 轴坐标。\n         * @param radiusX 圆弧的半径 x。\n         * @param radiusY 圆弧的半径 y。\n         * @param startAngle 圆弧的起始点， x轴方向开始计算，单位以弧度表示。\n         * 注意：必须为正数。\n         * @param endAngle 圆弧的终点， 单位以弧度表示。\n         * 注意：与startAngle差值必须在0~2π之间。\n         * @param anticlockwise 如果为 true，逆时针绘制圆弧，反之，顺时针绘制。\n         * 注意：如果为true，endAngle必须小于startAngle，反之必须大于。\n         */\n        private arcToBezier(x, y, radiusX, radiusY, startAngle, endAngle, anticlockwise?);\n    }\n}\ndeclare namespace egret {\n    /**\n     * Writes an error message to the console if the assertion is false. If the assertion is true, nothing will happen.\n     * @param assertion Any boolean expression. If the assertion is false, the message will get written to the console.\n     * @param message the message written to the console\n     * @param optionalParams the extra messages written to the console\n     * @language en_US\n     */\n    /**\n     * 判断参数assertion是否为true，若为false则抛出异常并且在console输出相应信息，反之什么也不做。\n     * @param assertion 一个 boolean 表达式，若结果为false，则抛出错误并输出信息。\n     * @param message 要输出到控制台的信息\n     * @param optionalParams 要输出到控制台的额外可选信息\n     * @language zh_CN\n     */\n    function assert(assertion?: boolean, message?: string, ...optionalParams: any[]): void;\n    /**\n     * Writes a warning message to the console.\n     * @param message the message written to the console\n     * @param optionalParams the extra messages written to the console\n     * @language en_US\n     */\n    /**\n     * 输出一个警告信息到控制台。\n     * @param message 要输出到控制台的信息\n     * @param optionalParams 要输出到控制台的额外信息\n     * @language zh_CN\n     */\n    function warn(message?: any, ...optionalParams: any[]): void;\n    /**\n     * Writes an error message to the console.\n     * @param message the message written to the console\n     * @param optionalParams the extra messages written to the console\n     * @language en_US\n     */\n    /**\n     * 输出一个错误信息到控制台。\n     * @param message 要输出到控制台的信息\n     * @param optionalParams 要输出到控制台的额外信息\n     * @language zh_CN\n     */\n    function error(message?: any, ...optionalParams: any[]): void;\n    /**\n     * Writes an message to the console.\n     * @param message the message written to the console\n     * @param optionalParams the extra messages written to the console\n     * @language en_US\n     */\n    /**\n     * 输出一个日志信息到控制台。\n     * @param message 要输出到控制台的信息\n     * @param optionalParams 要输出到控制台的额外信息\n     * @language zh_CN\n     */\n    function log(message?: any, ...optionalParams: any[]): void;\n}\n/**\n * @private\n */\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    let fontMapping: {};\n}\n/**\n * @private\n */\ndeclare namespace egret_native {\n    function readUpdateFileSync(filePath: any): any;\n    function readResourceFileSync(filePath: any): any;\n    function sendInfoToPlugin(info: string): void;\n    function receivedPluginInfo(info: string): void;\n    function nrInit(): void;\n    function nrDownloadBuffers(callback: (displayCmdBuffer: Float32Array) => void): void;\n    function nrSetRenderMode(mode: number): void;\n    function nrRenderDisplayObject(id: number, scale: number, useClip: boolean, clipX: number, clipY: number, clipW: number, clipH: number): void;\n    function nrRenderDisplayObject2(id: number, offsetX: number, offsetY: number, forHitTest: boolean): void;\n    function nrLocalToGlobal(id: number, localX: number, localY: number): string;\n    function nrGlobalToLocal(id: number, globalX: number, globalY: number): string;\n    function nrGetTextFieldWidth(id: number): number;\n    function nrGetTextFieldHeight(id: number): number;\n    function nrGetTextWidth(id: number): number;\n    function nrGetTextHeight(id: number): number;\n    function nrResize(width: number, height: number): void;\n    function nrSetCanvasScaleFactor(factor: number, scalex: number, scaley: number): void;\n    function nrUpdate(): void;\n    function nrRender(): void;\n    function nrSendTextFieldData(textFieldId: number, strData: string): void;\n    function nrUpdateCallbackList(dt: number): void;\n    function nrActiveBuffer(id: number, width: number, height: number): void;\n    function nrGetPixels(x: number, y: number, width: number, height: number, pixels: Uint8Array): void;\n    function nrGetCustomImageId(type: number): number;\n    function nrSetCustomImageData(customImageId: number, pvrtcData: any, width: any, height: any, mipmapsCount: any, format: any): void;\n    class NrNode {\n        constructor(id: number, type: number);\n    }\n}\n/**\n * @private\n */\ndeclare namespace egret_native {\n    let rootWebGLBuffer: egret.sys.RenderBuffer;\n    let forHitTest: boolean;\n    let addModuleCallback: (callback: Function, thisObj: any) => void;\n    let initNativeRender: () => void;\n    let updateNativeRender: () => void;\n    let activateBuffer: (buffer: egret.sys.RenderBuffer) => void;\n    let getJsCustomFilterVertexSrc: (key: any) => any;\n    let getJsCustomFilterFragSrc: (key: any) => any;\n    let getJsCustomFilterUniforms: (key: any) => any;\n    let nrABIVersion: number;\n    let nrMinEgretVersion: string;\n}\ndeclare namespace egret_native {\n    /**\n     * @private\n     */\n    class NativeRenderSurface {\n        width: number;\n        height: number;\n        constructor(currRenderBuffer: any, w?: number, h?: number, root?: boolean);\n        resize(w: number, h: number): void;\n    }\n    /**\n     * @private\n     */\n    class NativeBitmapData {\n        $init(): any;\n        $id: any;\n    }\n    /**\n     * @private\n     */\n    class NativeDisplayObject {\n        id: number;\n        constructor(type: number);\n        setChildrenSortMode(mode: string): void;\n        addChildAt(childId: number, index: number): void;\n        removeChild(childId: number): void;\n        swapChild(index1: number, index2: number): void;\n        setX(value: number): void;\n        setY(value: number): void;\n        setRotation(value: number): void;\n        setScaleX(value: number): void;\n        setScaleY(value: number): void;\n        setSkewX(value: number): void;\n        setSkewY(value: number): void;\n        setAlpha(value: number): void;\n        setAnchorOffsetX(value: number): void;\n        setAnchorOffsetY(value: number): void;\n        setVisible(value: boolean): void;\n        setBlendMode(value: number): void;\n        setMaskRect(x: number, y: number, w: number, h: number): void;\n        setScrollRect(x: number, y: number, w: number, h: number): void;\n        setFilters(filters: Array<egret.Filter>): void;\n        static createFilter(filter: egret.Filter): void;\n        static setFilterPadding(filterId: number, paddingTop: number, paddingBottom: number, paddingLeft: number, paddingRight: number): void;\n        setMask(value: number): void;\n        static setSourceToNativeBitmapData(nativeBitmapData: egret_native.NativeBitmapData, source: any): any;\n        setTexture(texture: egret.Texture): void;\n        setBitmapDataToMesh(texture: egret.Texture): void;\n        setBitmapDataToParticle(texture: egret.Texture): void;\n        setWidth(value: number): void;\n        setHeight(value: number): void;\n        setCacheAsBitmap(value: boolean): void;\n        setBitmapFillMode(fillMode: string): void;\n        setScale9Grid(x: number, y: number, w: number, h: number): void;\n        setMatrix(a: number, b: number, c: number, d: number, tx: number, ty: number): void;\n        setIsTyping(value: boolean): void;\n        setDataToBitmapNode(id: number, texture: egret.Texture, arr: number[]): void;\n        setDataToMesh(vertexArr: number[], indiceArr: number[], uvArr: number[]): void;\n        static setDataToFilter(currFilter: egret.Filter): void;\n        static disposeNativeBitmapData(nativeBitmapData: egret_native.NativeBitmapData): void;\n        static disposeTextData(node: egret.TextField): void;\n        static disposeGraphicData(graphic: egret.Graphics): void;\n        setFontSize(value: number): void;\n        setLineSpacing(value: number): void;\n        setTextColor(value: number): void;\n        setTextFieldWidth(value: number): void;\n        setTextFieldHeight(value: number): void;\n        setFontFamily(value: string): void;\n        setTextFlow(textArr: Array<egret.ITextElement>): void;\n        setTextAlign(value: string): void;\n        setVerticalAlign(value: string): void;\n        setText(value: string): void;\n        setBold(value: boolean): void;\n        setItalic(value: boolean): void;\n        setWordWrap(value: boolean): void;\n        setMaxChars(value: number): void;\n        setType(value: string): void;\n        setStrokeColor(value: number): void;\n        setStroke(value: number): void;\n        setScrollV(value: number): void;\n        setMultiline(value: boolean): void;\n        setBorder(value: boolean): void;\n        setBorderColor(value: number): void;\n        setBackground(value: boolean): void;\n        setBackgroundColor(value: number): void;\n        setInputType(value: string): void;\n        setBeginFill(color: number, alpha?: number): void;\n        setBeginGradientFill(type: string, colors: number[], alphas: number[], ratios: number[], matrix: egret.Matrix): void;\n        setEndFill(): void;\n        setLineStyle(thickness?: number, color?: number, alpha?: number, pixelHinting?: boolean, scaleMode?: string, caps?: string, joints?: string, miterLimit?: number, lineDash?: number[]): void;\n        setDrawRect(x: number, y: number, width: number, height: number): void;\n        setDrawRoundRect(x: number, y: number, width: number, height: number, ellipseWidth: number, ellipseHeight?: number): void;\n        setDrawCircle(x: number, y: number, radius: number): void;\n        setDrawEllipse(x: number, y: number, width: number, height: number): void;\n        setMoveTo(x: number, y: number): void;\n        setLineTo(x: number, y: number): void;\n        setCurveTo(controlX: number, controlY: number, anchorX: number, anchorY: number): void;\n        setCubicCurveTo(controlX1: number, controlY1: number, controlX2: number, controlY2: number, anchorX: number, anchorY: number): void;\n        setDrawArc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\n        setGraphicsClear(): void;\n    }\n}\n/**\n * @private\n */\ndeclare namespace egret_native {\n    /**\n     * @private\n     */\n    const enum NativeObjectType {\n        /**\n         * 容器\n         */\n        CONTAINER = 0,\n        /**\n         * 位图\n         */\n        BITMAP = 1,\n        /**\n         * 位图数据\n         */\n        BITMAP_DATA = 2,\n        /**\n         * 滤镜\n         */\n        FILTER = 6,\n        /**\n         * 文本\n         */\n        TEXT = 7,\n        /**\n         * 矢量绘图\n         */\n        GRAPHICS = 8,\n        /**\n         * 含一个适量绘图的容器\n         */\n        SPRITE = 9,\n        /**\n         * 粒子系统\n         */\n        PARTICLE_SYSTEM = 10,\n        /**\n         * 位图文本\n         */\n        BITMAP_TEXT = 11,\n        /**\n         * 网格\n         */\n        MESH = 12,\n        /**\n         * 舞台（根容器）\n         */\n        STAGE = 13,\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    interface MapLike<T> {\n        [key: string]: T;\n        [key: number]: T;\n    }\n    /**\n     * @private\n     */\n    function createMap<T>(): MapLike<T>;\n}\ndeclare namespace egret {\n    /**\n     * @class egret.GlowFilter\n     * @classdesc\n     * 使用 GlowFilter 类可以对显示对象应用发光效果。在投影滤镜的 distance 和 angle 属性设置为 0 时，发光滤镜与投影滤镜极为相似。\n     * @extends egret.Filter\n     * @version Egret 3.1.4\n     * @platform Web,Native\n     */\n    class GlowFilter extends Filter {\n        /**\n         * @private\n         */\n        $red: number;\n        /**\n         * @private\n         */\n        $green: number;\n        /**\n         * @private\n         */\n        $blue: number;\n        /**\n         * Initializes a new GlowFilter instance.\n         * @method egret.GlowFilter#constructor\n         * @param color {number} The color of the glow. Valid values are in the hexadecimal format 0xRRGGBB. The default value is 0xFF0000.\n         * @param alpha {number} The alpha transparency value for the color. Valid values are 0 to 1. For example, .25 sets a transparency value of 25%. The default value is 1.\n         * @param blurX {number} The amount of horizontal blur. Valid values are 0 to 255 (floating point).\n         * @param blurY {number} The amount of vertical blur. Valid values are 0 to 255 (floating point).\n         * @param strength {number} The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the glow and the background. Valid values are 0 to 255.\n         * @param quality {number} The number of times to apply the filter.\n         * @param inner {boolean} Specifies whether the glow is an inner glow. The value true indicates an inner glow. The default is false, an outer glow (a glow around the outer edges of the object).\n         * @param knockout {number} Specifies whether the object has a knockout effect. A value of true makes the object's fill transparent and reveals the background color of the document. The default value is false (no knockout effect).\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 初始化 GlowFilter 对象\n         * @method egret.GlowFilter#constructor\n         * @param color {number} 光晕颜色，采用十六进制格式 0xRRGGBB。默认值为 0xFF0000。\n         * @param alpha {number} 颜色的 Alpha 透明度值。有效值为 0 到 1。例如，0.25 设置透明度值为 25%。\n         * @param blurX {number} 水平模糊量。有效值为 0 到 255（浮点）。\n         * @param blurY {number} 垂直模糊量。有效值为 0 到 255（浮点）。\n         * @param strength {number} 印记或跨页的强度。该值越高，压印的颜色越深，而且发光与背景之间的对比度也越强。有效值为 0 到 255。\n         * @param quality {number} 应用滤镜的次数。暂未实现。\n         * @param inner {boolean} 指定发光是否为内侧发光。值 true 指定发光是内侧发光。值 false 指定发光是外侧发光（对象外缘周围的发光）。\n         * @param knockout {number} 指定对象是否具有挖空效果。值为 true 将使对象的填充变为透明，并显示文档的背景颜色。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        constructor(color?: number, alpha?: number, blurX?: number, blurY?: number, strength?: number, quality?: number, inner?: boolean, knockout?: boolean);\n        /**\n         * @private\n         */\n        $color: number;\n        /**\n         * The color of the glow.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 光晕颜色。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        color: number;\n        /**\n         * @private\n         */\n        $alpha: number;\n        /**\n         * The alpha transparency value for the color.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 颜色的 Alpha 透明度值。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        alpha: number;\n        /**\n         * @private\n         */\n        $blurX: number;\n        /**\n         * The amount of horizontal blur.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 水平模糊量。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        blurX: number;\n        /**\n         * @private\n         */\n        $blurY: number;\n        /**\n         * The amount of vertical blur.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 垂直模糊量。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        blurY: number;\n        /**\n         * @private\n         */\n        $strength: number;\n        /**\n         * The strength of the imprint or spread.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 印记或跨页的强度。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        strength: number;\n        /**\n         * @private\n         */\n        $quality: number;\n        /**\n         * The number of times to apply the filter.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 应用滤镜的次数。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        quality: number;\n        /**\n         * @private\n         */\n        $inner: boolean;\n        /**\n         * Specifies whether the glow is an inner glow.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 指定发光是否为内侧发光。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        inner: boolean;\n        /**\n         * @private\n         */\n        $knockout: boolean;\n        /**\n         * Specifies whether the object has a knockout effect.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 指定对象是否具有挖空效果。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        knockout: boolean;\n        /**\n         * @private\n         */\n        $toJson(): string;\n        protected updatePadding(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The Stage class represents the main drawing area.The Stage object is not globally accessible. You need to access\n     * it through the stage property of a DisplayObject instance.<br/>\n     * The Stage class has several ancestor classes — Sprite, DisplayObject, and EventDispatcher — from which it inherits\n     * properties and methods. Many of these properties and methods are inapplicable to Stage objects.\n     * @event egret.Event.RESIZE Dispatched when the stageWidth or stageHeight property of the Stage object is changed.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Stage.ts\n     * @language en_US\n     */\n    /**\n     * Stage 类代表主绘图区。\n     * 可以利用 DisplayObject 实例的 stage 属性进行访问。<br/>\n     * Stage 类具有多个祖代类: Sprite、DisplayObject 和 EventDispatcher，属性和方法便是从这些类继承而来的。\n     * 从这些继承的许多属性和方法不适用于 Stage 对象。\n     * @event egret.Event.RESIZE 当stageWidth或stageHeight属性发生改变时调度\n     * @event egret.Event.DEACTIVATE 当stage失去焦点后调度\n     * @event egret.Event.ACTIVATE 当stage获得焦点后调度\n     *\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Stage.ts\n     * @language zh_CN\n     */\n    class Stage extends DisplayObjectContainer {\n        /**\n         * @private\n         * Stage不许允许自行实例化\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor();\n        protected createNativeDisplayObject(): void;\n        /**\n         * Gets and sets the frame rate of the stage. The frame rate is defined as frames per second. Valid range for the\n         * frame rate is from 0.01 to 1000 frames per second.<br/>\n         * Note: setting the frameRate property of one Stage object changes the frame rate for all Stage objects\n         * @default 30\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取并设置舞台的帧速率。帧速率是指每秒显示的帧数。帧速率的有效范围为每秒 0.01 到 60 个帧。<br/>\n         * 注意: 修改任何一个Stage的frameRate属性都会同步修改其他Stage的帧率。\n         * @default 30\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        frameRate: number;\n        /**\n         * @private\n         */\n        $stageWidth: number;\n        /**\n         * Indicates the width of the stage, in pixels.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 舞台的当前宽度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly stageWidth: number;\n        /**\n         * @private\n         */\n        $stageHeight: number;\n        /**\n         * Indicates the height of the stage, in pixels.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 舞台的当前高度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly stageHeight: number;\n        /**\n         * After you call the invalidate() method, when the display list is next rendered, the Egret runtime sends a render\n         * event to each display object that has registered to listen for the render event. You must call the invalidate()\n         * method each time you want the Egret runtime to send render events.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 调用 invalidate() 方法后，在显示列表下次呈现时，Egret 会向每个已注册侦听 Event.RENDER 事件的显示对象发送一个 Event.RENDER 事件。\n         * 每次您希望 Egret 发送 Event.RENDER 事件时，都必须调用 invalidate() 方法。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        invalidate(): void;\n        /**\n         * @deprecated\n         */\n        registerImplementation(interfaceName: string, instance: any): void;\n        /**\n         * @deprecated\n         */\n        getImplementation(interfaceName: string): any;\n        /**\n         * @private\n         * 设备屏幕引用\n         */\n        $screen: egret.sys.Screen;\n        $scaleMode: string;\n        /**\n         * A StageScaleMode class that specifies which scale mode to use. The following are valid values:<br/>\n         * <ul>\n         * <li>StageScaleMode.EXACT_FIT -- The entire application be visible in the specified area without trying to preserve the original aspect ratio. Distortion can occur, the application may be stretched or compressed.</li>\n         * <li>StageScaleMode.SHOW_ALL -- The entire application is visible in the specified area without distortion while maintaining the application of the original aspect ratio. Applications may display border.</li>\n         * <li>StageScaleMode.NO_SCALE -- The size of the entire application is fixed, so that even if the size of the player window changes, it remains unchanged. If the player window is smaller than the content, it may do some trimming.</li>\n         * <li>StageScaleMode.NO_BORDER -- Keep the original aspect ratio scaling application content, after scaling a narrow direction of application content to fill the viewport players on both sides in the other direction may exceed the viewport and the player is cut.</li>\n         * <li>StageScaleMode.FIXED_WIDTH -- Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, but only to keep the contents of the original application constant width, height may change.</li>\n         * <li>StageScaleMode.FIXED_HEIGHT -- Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, but only to keep the contents of the original application constant height, width may change.</li>\n         * </ul>\n         * @default egret.StageScaleMode.SHOW_ALL\n         * @language en_US\n         */\n        /**\n         * 一个 StageScaleMode 类中指定要使用哪种缩放模式的值。以下是有效值：<br/>\n         * <ul>\n         * <li>StageScaleMode.EXACT_FIT -- 整个应用程序在指定区域中可见，但不尝试保持原始高宽比。可能会发生扭曲，应用程序可能会拉伸或压缩显示。</li>\n         * <li>StageScaleMode.SHOW_ALL -- 整个应用程序在指定区域中可见，且不发生扭曲，同时保持应用程序的原始高宽比。应用程序的可能会显示边框。</li>\n         * <li>StageScaleMode.NO_SCALE -- 整个应用程序的大小固定，因此，即使播放器窗口的大小更改，它也会保持不变。如果播放器窗口比内容小，则可能进行一些裁切。</li>\n         * <li>StageScaleMode.NO_BORDER -- 保持原始宽高比缩放应用程序内容，缩放后应用程序内容的较窄方向填满播放器视口，另一个方向的两侧可能会超出播放器视口而被裁切。</li>\n         * <li>StageScaleMode.FIXED_WIDTH -- 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，但只保持应用程序内容的原始宽度不变，高度可能会改变。</li>\n         * <li>StageScaleMode.FIXED_HEIGHT -- 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，但只保持应用程序内容的原始高度不变，宽度可能会改变。</li>\n         * </ul>\n         * @default egret.StageScaleMode.SHOW_ALL\n         * @language zh_CN\n         */\n        scaleMode: string;\n        $orientation: string;\n        /**\n         * Horizontal and vertical screen display screen, can only be set under the current Native in the configuration file. A egret.OrientationMode class that specifies which display mode to use. The following are valid values:<br/>\n         * <ul>\n         * <li>egret.OrientationMode.AUTO -- Always follow the direction of application display screen, always guaranteed by the look down.</li>\n         * <li>egret.OrientationMode.PORTRAIT -- Applications remain portrait mode, namely horizontal screen look, the screen from left to right.</li>\n         * <li>egret.OrientationMode.LANDSCAPE -- Applications remain horizontal screen mode, namely vertical screen, the screen from right to left.</li>\n         * <li>egret.OrientationMode.LANDSCAPE_FLIPPED -- Applications remain horizontal screen mode, namely vertical screen, the screen from left to right.</li>\n         * </ul>\n         * @platform Web\n         * @version 2.4\n         * @language en_US\n         */\n        /**\n         * 屏幕横竖屏显示方式，目前 Native 下只能在配置文件里设置。一个 egret.OrientationMode 类中指定要使用哪种显示方式。以下是有效值：<br/>\n         * <ul>\n         * <li>egret.OrientationMode.AUTO -- 应用始终跟随屏幕的方向显示，始终保证由上往下看。</li>\n         * <li>egret.OrientationMode.PORTRAIT -- 应用始终保持竖屏模式，即横屏看时，屏幕由左往右看。</li>\n         * <li>egret.OrientationMode.LANDSCAPE -- 应用始终保持横屏模式，即竖屏看时，屏幕显示由右往左。</li>\n         * <li>egret.OrientationMode.LANDSCAPE_FLIPPED -- 应用始终保持横屏模式，即竖屏看时，屏幕显示由左往右。</li>\n         * </ul>\n         * @platform Web\n         * @version 2.4\n         * @language zh_CN\n         */\n        orientation: string;\n        /**\n         * Draw texture zoom ratio\n         * @default 1\n         * @language en_US\n         */\n        /**\n         * 绘制纹理的缩放比率，默认值为1\n         * @default 1\n         * @language zh_CN\n         */\n        textureScaleFactor: number;\n        $maxTouches: number;\n        /**\n         * Set the number of screens can simultaneously touch. Above this amount will not be triggered in response.\n         * @default 99\n         * @language en_US\n         */\n        /**\n         * 设置屏幕同时可以触摸的数量。高于这个数量将不会被触发响应。\n         * @default 99\n         * @language zh_CN\n         */\n        maxTouches: number;\n        /**\n         * Set resolution size\n         * @param width width\n         * @param height height\n         * @version Egret 2.5.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置分辨率尺寸\n         * @param width 宽度\n         * @param height 高度\n         * @version Egret 2.5.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setContentSize(width: number, height: number): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * A class that provides constant values for visual blend mode effects. These constants are used in the blendMode\n     * property of the DisplayObject class.\n     * @see egret.DisplayObject#blendMode\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/BlendMode.ts\n     * @see http://edn.egret.com/cn/docs/page/108 显示容器的概念与实现\n     * @language en_US\n     */\n    /**\n     * 提供混合模式可视效果的常量值的类,通常用于 DisplayObject 的 blendMode 属性上。\n     * @see egret.DisplayObject#blendMode\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/BlendMode.ts\n     * @see http://edn.egret.com/cn/docs/page/108 显示容器的概念与实现\n     * @language zh_CN\n     */\n    class BlendMode {\n        /**\n         * The display object appears in front of the background. Pixel values of the display object override the pixel\n         * values of the background. Where the display object is transparent, the background is visible.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 该显示对象出现在背景前面。显示对象的像素值会覆盖背景的像素值。在显示对象为透明的区域，背景是可见的。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static NORMAL: string;\n        /**\n         * Adds the values of the constituent colors of the display object to the colors of its background, applying a\n         * ceiling of 0xFF. This setting is commonly used for animating a lightening dissolve between two objects.<br/>\n         * For example, if the display object has a pixel with an RGB value of 0xAAA633, and the background pixel has an\n         * RGB value of 0xDD2200, the resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD > 0xFF,\n         * 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将显示对象的原色值添加到它的背景颜色中，上限值为 0xFF。此设置通常用于使两个对象间的加亮溶解产生动画效果。<br/>\n         * 例如，如果显示对象的某个像素的 RGB 值为 0xAAA633，背景像素的 RGB 值为 0xDD2200，则显示像素的结果 RGB 值为 0xFFC833\n         * （因为 0xAA + 0xDD > 0xFF，0xA6 + 0x22 = 0xC8，且 0x33 + 0x00 = 0x33）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ADD: string;\n        /**\n         * Erases the background based on the alpha value of the display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 根据显示对象的 Alpha 值擦除背景。Alpha 值不为0的区域将被擦除。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ERASE: string;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 转换 blendMode 字符串为数字。\n     */\n    function blendModeToNumber(blendMode: string): number;\n    /**\n     * @private\n     * 转换数字为 blendMode 字符串。\n     */\n    function numberToBlendMode(blendMode: number): string;\n}\ndeclare namespace egret {\n    /**\n     * The ChildrenSortMode class defines a pattern enumeration for children sort mode of egret.DisplayObjectContainer.\n     * @version Egret 5.2.19\n     * @platform Native\n     * @language en_US\n     */\n    /**\n     * BitmapFillMode 类定义egret.DisplayObjectContainer的子项目排序方式。\n     * @version Egret 5.2.19\n     * @platform Native\n     * @language zh_CN\n     */\n    const ChildrenSortMode: {\n        DEFAULT: string;\n        INCREASE_Y: string;\n        DECREASE_Y: string;\n    };\n}\ndeclare namespace egret {\n    /**\n     * The CapsStyle class is an enumeration of constant values that specify the caps style to use in drawing lines.\n     * The constants are provided for use as values in the caps parameter of the egret.Graphics.lineStyle() method.\n     * @see egret.Graphics#lineStyle()\n     * @version Egret 2.5\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * CapsStyle 类是可指定在绘制线条中使用的端点样式的常量值枚举。常量可用作 egret.Graphics.lineStyle() 方法的 caps 参数中的值。\n     * @see egret.Graphics#lineStyle()\n     * @version Egret 2.5\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    const CapsStyle: {\n        NONE: string;\n        ROUND: string;\n        SQUARE: string;\n    };\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    class WebGLUtils {\n        static compileProgram(gl: WebGLRenderingContext, vertexSrc: string, fragmentSrc: string): WebGLProgram;\n        static compileFragmentShader(gl: WebGLRenderingContext, shaderSrc: string): WebGLShader;\n        static compileVertexShader(gl: WebGLRenderingContext, shaderSrc: string): WebGLShader;\n        private static _compileShader(gl, shaderSrc, shaderType);\n        private static canUseWebGL;\n        static checkCanUseWebGL(): boolean;\n        static deleteWebGLTexture(webglTexture: WebGLTexture): void;\n        /**\n         * inspired by pixi.js\n         */\n        static premultiplyTint(tint: number, alpha: number): number;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The EventPhase class provides values for the eventPhase property of the Event class.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/EventPhase.ts\n     * @language en_US\n     */\n    /**\n     * EventPhase 可为 Event 类的 eventPhase 属性提供值。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/EventPhase.ts\n     * @language zh_CN\n     */\n    const enum EventPhase {\n        /**\n         * The capturing phase, which is the first phase of the event flow.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 捕获阶段。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        CAPTURING_PHASE = 1,\n        /**\n         * The target phase, which is the second phase of the event flow.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 目标阶段，是事件流的第二个阶段。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        AT_TARGET = 2,\n        /**\n         * The bubbling phase, which is the third phase of the event flow.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 冒泡阶段。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        BUBBLING_PHASE = 3,\n    }\n}\ndeclare namespace egret {\n    /**\n     * When the user changes the focus from one object in the display list to another object, the object dispatches a FocusEvent object. Currently only supports input text.\n     * Focus events: FocusEvent.FOCUS_IN FocusEvent.FOCUS_OUT\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 用户将焦点从显示列表中的一个对象更改到另一个对象时，对象将调度 FocusEvent 对象。目前只支持输入文本。\n     * 焦点事件：FocusEvent.FOCUS_IN FocusEvent.FOCUS_OUT\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class FocusEvent extends egret.Event {\n        /**\n         * Gets focus\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获得焦点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static FOCUS_IN: \"focusIn\";\n        /**\n         * Loses focus\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 失去焦点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static FOCUS_OUT: \"focusOut\";\n        /**\n         * Create a egret.FocusEvent objects\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.FocusEvent 对象\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean);\n    }\n}\ndeclare namespace egret {\n    interface Geolocation {\n        addEventListener<Z>(type: \"ioError\", listener: (this: Z, e: GeolocationEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): any;\n    }\n    /**\n     * The GeolocationEvent represents the position and altitude of the device on Earth,\n     * and show errors occurred while getting the location of the device.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/Geolocation.ts\n     * @see http://edn.egret.com/cn/docs/page/662 获取位置信息\n     * @language en_US\n     */\n    /**\n     * GeolocationEvent 提供设备的地理位置信息和获取位置时发生的错误信息\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/Geolocation.ts\n     * @see http://edn.egret.com/cn/docs/page/662 获取位置信息\n     * @language zh_CN\n     */\n    class GeolocationEvent extends Event {\n        /**\n         * The acquisition of the location information failed because of app don't have permission.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 由于用户拒绝访问位置信息，获取位置信息失败\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static PERMISSION_DENIED: string;\n        /**\n         * The acquisition of the location failed because at least one internal source of position returned an internal error.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设备位置服务不可用或者超时等原因没有得到位置信息\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static UNAVAILABLE: string;\n        /**\n         * The position's longitude in decimal degrees.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当前位置的经度信息\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        longitude: number;\n        /**\n         * The position's latitude in decimal degrees.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当前位置的纬度信息\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        latitude: number;\n        /**\n         * The velocity of the device in meters per second. This value can be null.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当前设备的速度 单位是 米/秒，这个值可能为 null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        speed: number;\n        /**\n         * The direction in which the device is traveling. This value, specified in degrees,\n         * indicates how far off from heading due north the device is. 0 degrees represents\n         * true true north, and the direction is determined clockwise (which means that east\n         * is 90 degrees and west is 270 degrees). If speed is 0, heading is NaN. If the\n         * device is unable to provide heading information, this value is null.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示设备正在前进的方向，单位是度。heading 表示从正北开始顺时针旋转到当前方向的角度，\n         * 比如正东是 90 度，正西是 270 度，如果 speed 是 0，heading 为 NaN。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        heading: number;\n        /**\n         * The position's altitude in metres, relative to sea level.\n         * This value can be null if the implementation cannot provide the data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 该位置的海拔信息，如果设备没有实现这个属性时，这个值有可能为 null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        altitude: number;\n        /**\n         * The accuracy of the latitude and longitude properties, expressed in meters.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 经纬度的准确性，单位是米\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        accuracy: number;\n        /**\n         * The accuracy of the altitude expressed in meters. This value can be null.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 该位置海拔信息的准确性，单位是米，这个值有可能为 null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        altitudeAccuracy: number;\n        /**\n         * The type of error occurred while get the location of the device. The value could be:\n         * @see egret.GeolocationEvent.PERMISSION_DENIED\n         * @see egret.GeolocationEvent.UNAVAILABLE\n         *\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取位置信息错误时的错误类型。值可能为：\n         * @see egret.GeolocationEvent.PERMISSION_DENIED\n         * @see egret.GeolocationEvent.UNAVAILABLE\n         *\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        errorType: string;\n        /**\n         * The error message occurred while get the location of the device.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取位置信息错误的错误信息\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        errorMessage: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * When a network request returns an HTTP status code, the application dispatches HTTPStatusEvent objects.\n     * Before error or completion events will always send HTTPStatusEvent object. HTTPStatusEvent object does not necessarily indicate an error condition; it simply reflects the HTTP status code provided by the network stack (if any).\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 在网络请求返回 HTTP 状态代码时，应用程序将调度 HTTPStatusEvent 对象。\n     * 在错误或完成事件之前，将始终发送 HTTPStatusEvent 对象。HTTPStatusEvent 对象不一定表示错误条件；它仅反映网络堆栈提供的 HTTP 状态代码（如果有的话）。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class HTTPStatusEvent extends Event {\n        /**\n         * HTTPStatusEvent.HTTP_STATUS constant defines the value of the type property httpStatus event object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * HTTPStatusEvent.HTTP_STATUS 常量定义 httpStatus 事件对象的 type 属性值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static HTTP_STATUS: \"httpStatus\";\n        /**\n         * Create a egret.HTTPStatusEvent objects\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.HTTPStatusEvent 对象\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean);\n        /**\n         * @private\n         */\n        private _status;\n        /**\n         * he server returns the HTTP status code.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 由服务器返回的 HTTP 状态代码。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly status: number;\n        /**\n         * EventDispatcher object using the specified event object thrown Event. The objects will be thrown in the object cache pool for the next round robin.\n         * @param target {egret.IEventDispatcher} Distribute event target\n         * @param status {number} The server returns the HTTP status code\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出Event事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @param status {number} 由服务器返回的 HTTP 状态代码\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchHTTPStatusEvent(target: IEventDispatcher, status: number): boolean;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The IEventDispatcher interface defines methods for adding or removing event listeners, checks whether specific types\n     * of event listeners are registered, and dispatches events. Event targets are an important part of the Egret event model.\n     * The event target serves as the focal point for how events flow through the display list hierarchy. When an event\n     * such as a touch tap occurs, an event object is dispatched into the event flow from the root of the display list.\n     * The event object makes a round-trip journey to the event target, which is conceptually divided into three phases: <br/>\n     * the capture phase includes the journey from the root to the last node before the event target's node; the target\n     * phase includes only the event target node; and the bubbling phase includes any subsequent nodes encountered on the\n     * return trip to the root of the display list.In general, the easiest way for a user-defined class to gain event\n     * dispatching capabilities is to extend EventDispatcher. If this is impossible (that is, if the class is already\n     * extending another class), you can instead implement the IEventDispatcher interface, create an EventDispatcher member,\n     * and write simple hooks to route calls into the aggregated EventDispatcher.\n     * @see egret.EventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/IEventDispatcher.ts\n     * @language en_US\n     */\n    /**\n     * IEventDispatcher 接口定义用于添加或删除事件侦听器的方法，检查是否已注册特定类型的事件侦听器，并调度事件。\n     * 事件目标是 Egret 事件模型的重要组成部分。事件目标是事件如何通过显示列表层次结构这一问题的焦点。当发生触摸轻拍事件时，\n     * 会将事件对象调度到从显示列表根开始的事件流中。事件对象进行到事件目标的往返行程，在概念上，此往返行程被划分为三个阶段：<br/>\n     * 捕获阶段包括从根到事件目标节点之前的最后一个节点的行程，目标阶段仅包括事件目标节点，冒泡阶段包括到显示列表的根的回程上遇到的任何后续节点。\n     * 通常，使用户定义的类能够调度事件的最简单方法是扩展 EventDispatcher。如果无法扩展（即，如果该类已经扩展了另一个类），\n     * 则可以实现 IEventDispatcher 接口，创建 EventDispatcher 成员，并编写一些简单的挂钩，将调用连接到聚合的 EventDispatcher 中。\n     * @see egret.EventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/IEventDispatcher.ts\n     * @language zh_CN\n     */\n    interface IEventDispatcher extends HashObject {\n        /**\n         * Registers an event listener object with an EventDispatcher object so that the listener receives notification of an\n         * event. You can register event listeners on all nodes in the display list for a specific type of event, phase,\n         * and priority.After you successfully register an event listener, you cannot change its priority through additional\n         * calls to on(). To change a listener's priority, you must first call removeEventListener(). Then you can register the\n         * listener again with the new priority level.After the listener is registered, subsequent calls to on() with a\n         * different value for either type or useCapture result in the creation of a separate listener registration. <br/>\n         * When you no longer need an event listener, remove it by calling EventDispatcher.removeEventListener(); otherwise, memory\n         * problems might result. Objects with registered event listeners are not automatically removed from memory because\n         * the garbage collector does not remove objects that still have references.Copying an EventDispatcher instance does\n         * not copy the event listeners attached to it. (If your newly created node needs an event listener, you must attach\n         * the listener after creating the node.) However, if you move an EventDispatcher instance, the event listeners attached\n         * to it move along with it.If the event listener is being registered on a node while an event is also being processed\n         * on this node, the event listener is not triggered during the current phase but may be triggered during a later phase\n         * in the event flow, such as the bubbling phase.If an event listener is removed from a node while an event is being\n         * processed on the node, it is still triggered by the current actions. After it is removed, the event listener is\n         * never invoked again (unless it is registered again for future processing).\n         * @param type The type of event.\n         * @param listener The listener function that processes the event. This function must accept an event object as\n         * its only parameter and must return nothing, as this example shows: function(evt:Event):void  The function can\n         * have any name.\n         * @param thisObject the listener function's \"this\"\n         * @param useCapture Determines whether the listener works in the capture phase or the bubbling phases. If useCapture\n         * is set to true, the listener processes the event only during the capture phase and not in the bubbling phase.\n         * If useCapture is false, the listener processes the event only during the bubbling phase. To listen for the event\n         * in all three phases, call on() twice, once with useCapture set to true, then again with useCapture set to false.\n         * @param  priority The priority level of the event listener. Priorities are designated by a integer. The higher\n         * the number, the higher the priority. All listeners with priority n are processed before listeners of priority n-1.\n         * If two or more listeners share the same priority, they are processed in the order in which they were added.\n         * The default priority is\n         * @see #once()\n         * @see #removeEventListener()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用 EventDispatcher 对象注册事件侦听器对象，以使侦听器能够接收事件通知。可以为特定类型的事件、阶段和优先级在显示列表的所有节\n         * 点上注册事件侦听器。成功注册一个事件侦听器后，无法通过额外调用 on() 来更改其优先级。要更改侦听器的优先级，必须\n         * 先调用 removeEventListener()。然后，可以使用新的优先级再次注册该侦听器。注册该侦听器后，如果继续调用具有不同 type 或 useCapture\n         * 值的 on()，则会创建单独的侦听器注册。<br/>\n         * 如果不再需要某个事件侦听器，可调用 EventDispatcher.removeEventListener()\n         * 删除它；否则会产生内存问题。由于垃圾回收器不会删除仍包含引用的对象，因此不会从内存中自动删除使用已注册事件侦听器的对象。复制\n         * EventDispatcher 实例时并不复制其中附加的事件侦听器。（如果新近创建的节点需要一个事件侦听器，必须在创建该节点后附加该侦听器。）\n         * 但是，如果移动 EventDispatcher 实例，则其中附加的事件侦听器也会随之移动。如果在正在处理事件的节点上注册事件侦听器，则不会在当\n         * 前阶段触发事件侦听器，但会在事件流的稍后阶段触发，如冒泡阶段。如果从正在处理事件的节点中删除事件侦听器，则该事件侦听器仍由当前操\n         * 作触发。删除事件侦听器后，决不会再次调用该事件侦听器（除非再次注册以备将来处理）。\n         * @param type 事件的类型。\n         * @param listener 处理事件的侦听器函数。此函数必须接受 Event 对象作为其唯一的参数，并且不能返回任何结果，\n         * 如下面的示例所示： function(evt:Event):void 函数可以有任何名称。\n         * @param thisObject 侦听函数绑定的this对象\n         * @param useCapture 确定侦听器是运行于捕获阶段还是运行于冒泡阶段。如果将 useCapture 设置为 true，\n         * 则侦听器只在捕获阶段处理事件，而不在冒泡阶段处理事件。如果 useCapture 为 false，则侦听器只在冒泡阶段处理事件。\n         * 要在两个阶段都侦听事件，请调用 on() 两次：一次将 useCapture 设置为 true，一次将 useCapture 设置为 false。\n         * @param  priority 事件侦听器的优先级。优先级由一个带符号的整数指定。数字越大，优先级越高。优先级为 n 的所有侦听器会在\n         * 优先级为 n -1 的侦听器之前得到处理。如果两个或更多个侦听器共享相同的优先级，则按照它们的添加顺序进行处理。默认优先级为 0。\n         * @see #once()\n         * @see #removeEventListener()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): void;\n        /**\n         * Registers an event listener object with an EventDispatcher object so that the listener receives notification of an\n         * event. Different from the on() method,the listener receives notification only once,and then it will be removed\n         * automatically.\n         * @param type The type of event.\n         * @param listener The listener function that processes the event. This function must accept an event object as\n         * its only parameter and must return nothing, as this example shows: function(evt:Event):void  The function can\n         * have any name.\n         * @param thisObject the listener function's \"this\"\n         * @param useCapture Determines whether the listener works in the capture phase or the bubbling phases. If useCapture\n         * is set to true, the listener processes the event only during the capture phase and not in the bubbling phase.\n         * If useCapture is false, the listener processes the event only during the bubbling phase. To listen for the event\n         * in all three phases, call on() twice, once with useCapture set to true, then again with useCapture set to false.\n         * @param  priority The priority level of the event listener. Priorities are designated by a integer. The higher\n         * the number, the higher the priority. All listeners with priority n are processed before listeners of priority n-1.\n         * If two or more listeners share the same priority, they are processed in the order in which they were added.\n         * The default priority is\n         * @see #on()\n         * @see #removeEventListener()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 添加仅回调一次的事件侦听器，此方法与on()方法不同，on()方法会持续产生回调，而此方法在第一次回调时就会自动移除监听。\n         * @param type 事件的类型。\n         * @param listener 处理事件的侦听器函数。此函数必须接受 Event 对象作为其唯一的参数，并且不能返回任何结果，\n         * 如下面的示例所示： function(evt:Event):void 函数可以有任何名称。\n         * @param thisObject 侦听函数绑定的this对象\n         * @param useCapture 确定侦听器是运行于捕获阶段还是运行于冒泡阶段。如果将 useCapture 设置为 true，\n         * 则侦听器只在捕获阶段处理事件，而不在冒泡阶段处理事件。如果 useCapture 为 false，则侦听器只在冒泡阶段处理事件。\n         * 要在两个阶段都侦听事件，请调用 once() 两次：一次将 useCapture 设置为 true，一次将 useCapture 设置为 false。\n         * @param  priority 事件侦听器的优先级。优先级由一个带符号整数指定。数字越大，优先级越高。优先级为 n 的所有侦听器会在\n         * 优先级为 n -1 的侦听器之前得到处理。如果两个或更多个侦听器共享相同的优先级，则按照它们的添加顺序进行处理。默认优先级为 0。\n         * @see #on()\n         * @see #removeEventListener()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        once(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): void;\n        /**\n         * Removes a listener from the EventDispatcher object. If there is no matching listener registered with the\n         * EventDispatcher object, a call to this method has no effect.\n         * @param type The type of event.\n         * @param listener The listener object to remove.\n         * @param thisObject the listener function's \"this\"\n         * @param useCapture Specifies whether the listener was registered for the capture phase or the bubbling phases.\n         * If the listener was registered for both the capture phase and the bubbling phases, two calls to removeEventListener()\n         * are required to remove both: one call with useCapture set to true, and another call with useCapture set to false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从 EventDispatcher 对象中删除侦听器。如果没有向 EventDispatcher 对象注册任何匹配的侦听器，则对此方法的调用没有任何效果。\n         * @param type 事件的类型。\n         * @param listener 要删除的侦听器对象\n         * @param thisObject 侦听函数绑定的this对象\n         * @param useCapture 指出是为捕获阶段还是为冒泡阶段注册了侦听器。如果为捕获阶段以及冒泡阶段注册了侦听器，则需要对\n         * removeEventListener() 进行两次调用才能将这两个侦听器删除：一次调用将 useCapture 设置为 true，另一次调用将 useCapture 设置为 false。。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        removeEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean): void;\n        /**\n         * Checks whether the EventDispatcher object has any listeners registered for a specific type of event. This allows\n         * you to determine where an EventDispatcher object has altered handling of an event type in the event flow hierarchy.\n         * To determine whether a specific event type will actually trigger an event listener, use IEventDispatcher.willTrigger().\n         * The difference between hasEventListener() and willTrigger() is that hasEventListener() examines only the object to\n         * which it belongs, whereas willTrigger() examines the entire event flow for the event specified by the type parameter.\n         * @param type The type of event.\n         * @returns A value of true if a listener of the specified type is registered; false otherwise.\n         * @see #willTrigger()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。这样，您就可以确定 EventDispatcher 对象在事件流层次结构中的哪个\n         * 位置改变了对事件类型的处理。要确定特定事件类型是否确实会触发事件侦听器，请使用 IEventDispatcher.willTrigger()。hasEventListener()\n         * 与 willTrigger() 的区别是：hasEventListener() 只检查它所属的对象，而 willTrigger() 检查整个事件流以查找由 type 参数指定的事件。\n         * @param type 事件的类型。\n         * @returns 如果指定类型的侦听器已注册，则值为 true；否则，值为 false。\n         * @see #willTrigger()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        hasEventListener(type: string): boolean;\n        /**\n         * Dispatches an event into the event flow. The event target is the EventDispatcher object upon which dispatchEvent() is called.\n         * @param event The event object dispatched into the event flow.\n         * @returns A value of true unless preventDefault() is called on the event, in which case it returns false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将事件分派到事件流中。事件目标是对其调用 dispatchEvent() 方法的 EventDispatcher 对象。\n         * @param event 调度到事件流中的 Event 对象。\n         * @returns 如果成功调度了事件，则值为 true。值 false 表示失败或对事件调用了 preventDefault()。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        dispatchEvent(event: Event): boolean;\n        /**\n         * Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the\n         * specified event type. This method returns true if an event listener is triggered during any phase of the event\n         * flow when an event of the specified type is dispatched to this EventDispatcher object or any of its descendants.\n         * @param type The type of event.\n         * @returns A value of true if a listener of the specified type will be triggered; false otherwise.\n         * @see #hasEventListener()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 检查是否用此 EventDispatcher 对象或其任何始祖为指定事件类型注册了事件侦听器。将指定类型的事件调度给此\n         * EventDispatcher 对象或其任一后代时，如果在事件流的任何阶段触发了事件侦听器，则此方法返回 true。\n         * hasEventListener() 与 willTrigger() 方法的区别是：hasEventListener() 只检查它所属的对象，\n         * 而 willTrigger() 方法检查整个事件流以查找由 type 参数指定的事件。\n         * @param type 事件类型\n         * @returns 是否注册过监听器，如果注册过返回true，反之返回false\n         * @see #hasEventListener()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        willTrigger(type: string): boolean;\n    }\n}\ndeclare namespace egret {\n    interface HttpRequest {\n        addEventListener<Z>(type: \"ioError\", listener: (this: Z, e: IOErrorEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): any;\n    }\n    /**\n     * @classdesc IO流事件，当错误导致输入或输出操作失败时调度 IOErrorEvent 对象。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/IOErrorEvent.ts\n     * @language en_US\n     */\n    /**\n     * @classdesc IO流事件，当错误导致输入或输出操作失败时调度 IOErrorEvent 对象。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/IOErrorEvent.ts\n     * @language zh_CN\n     */\n    class IOErrorEvent extends Event {\n        /**\n         * io error\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * io发生错误\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static IO_ERROR: \"ioError\";\n        /**\n         * Create a egret.IOErrorEvent objects\n         * @param type {string} Type of event, accessible as Event.type.\n         * @param bubbles {boolean} Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable {boolean} Determine whether the Event object can be canceled. The default value is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.IOErrorEvent 对象\n         * @param type {string} 事件的类型，可以作为 Event.type 访问。\n         * @param bubbles {boolean} 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable {boolean} 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean);\n        /**\n         * EventDispatcher object using the specified event object thrown Event. The objects will be thrown in the object cache pool for the next round robin.\n         * @param target {egret.IEventDispatcher} Distribute event target\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出Event事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchIOErrorEvent(target: IEventDispatcher): boolean;\n    }\n}\ndeclare namespace egret {\n    /**\n     * MotionEvent represents the device's movement\n     * Acceleration and accelerationIncludingGravity to represents the device's acceleration\n     * RotationRate to represents the device's rotation\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/Motion.ts\n     * @language en_US\n     */\n    /**\n     * MotionEvent 类呈现设备运动的具体信息\n     * Acceleration 和 accelerationIncludingGravity 呈现设备三个维度的加速度信息\n     * RotationRate 呈现设备的旋转状态信息\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/Motion.ts\n     * @language zh_CN\n     */\n    class MotionEvent extends Event {\n        /**\n         * An object giving the acceleration of the device on the three axis X, Y and Z. Acceleration is expressed in m/s2.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * acceleration 表示设备在 X Y Z 轴方将的加速度信息，单位是  m/s2，不包含重力\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        acceleration: DeviceAcceleration;\n        /**\n         * An object giving the acceleration of the device on the three axis X, Y and Z with the effect of gravity. Acceleration is expressed in m/s2.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * acceleration 表示设备在 X Y Z 轴方将的加速度信息，单位是  m/s2，包含重力\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        accelerationIncludingGravity: DeviceAcceleration;\n        /**\n         * An object giving the rate of change of the device's orientation on the three orientation axis alpha, beta and gamma. Rotation rate is express in degrees per seconds.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * rotationRate 表示设备在 alpha、 beta 和 gamma 三个轴向的角速度信息，单位是 角度每秒\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        rotationRate: DeviceRotationRate;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The OrientationEvent provides information from the physical orientation of the device.\n     * Note: Currently, Browsers on the iOS and Android does not handle the coordinates the same way.\n     * Take care about this while using them.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/DeviceOrientation.ts\n     * @language en_US\n     */\n    /**\n     * OrientationEvent 提供设备的方向信息\n     * 注意: 目前各个浏览器和操作系统处理方向的方式不完全相同，请根据使用场景做相应的校正，\n     * 比如使用两次方向数据的变化而不是直接使用方向的值\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/DeviceOrientation.ts\n     * @language zh_CN\n     */\n    class OrientationEvent extends Event {\n        /**\n         * A number representing the motion of the device around the z axis,\n         * express in degrees with values ranging from 0 to 360\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示设备绕 Z 轴的角度，单位是 角度 范围是 0 到 360\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        alpha: number;\n        /**\n         * A number representing the motion of the device around the x axis,\n         * express in degrees with values ranging from -180 to 180.\n         * This represents a front to back motion of the device.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示设备绕 X 轴的角度，单位是 角度 范围是 -180 到 180.\n         * 这个值表示设备从前向后的旋转状态\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        beta: number;\n        /**\n         * A number representing the motion of the device around the y axis,\n         * express in degrees with values ranging from -90 to 90.\n         * This represents a left to right motion of the device.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示设备绕 Y 轴的角度，单位是 角度 范围是 -90 到 90.\n         * 这个值表示设备从前向后的旋转状态\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        gamma: number;\n    }\n}\ndeclare namespace egret {\n    interface HttpRequest {\n        addEventListener<Z>(type: \"progress\", listener: (this: Z, e: ProgressEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): any;\n    }\n    /**\n     * When a load operation has begun or a socket has received data, ProgressEvent object is dispatched.\n     * There are two types of progress events: ProgressEvent.PROGRESS and ProgressEvent.SOCKET_DATA.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 当加载操作已开始或套接字已接收到数据时，将调度 ProgressEvent 对象。\n     * 有两种类型的进程事件：ProgressEvent.PROGRESS 和 ProgressEvent.SOCKET_DATA。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class ProgressEvent extends egret.Event {\n        /**\n         * Changes in the loading progress\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 加载进度发生变化\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static PROGRESS: \"progress\";\n        /**\n         * Get the data\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取到数据\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static SOCKET_DATA: \"socketData\";\n        /**\n         * Number of items or bytes when the listener processes the event。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在侦听器处理事件时加载的项数或字节数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        bytesLoaded: number;\n        /**\n         * If the loading process succeeds, the total number or the total number of bytes that will be loaded term.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果加载过程成功，将加载的总项数或总字节数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        bytesTotal: number;\n        /**\n         * 创建一个 egret.ProgressEvent 对象\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @param bytesLoaded {number} Number of items or bytes loaded\n         * @param bytesTotal {number} The total number of items or bytes loaded\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.ProgressEvent 对象\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param bytesLoaded {number} 加载的项数或字节数\n         * @param bytesTotal {number} 加载的总项数或总字节数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean, bytesLoaded?: number, bytesTotal?: number);\n        /**\n         * EventDispatcher object using the specified event object thrown Event. The objects will be thrown in the object cache pool for the next round robin.\n         * @param target {egret.IEventDispatcher} Distribute event target\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bytesLoaded {number} Number of items or bytes loaded\n         * @param bytesTotal {number} The total number of items or bytes loaded\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出Event事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @param type {string} 事件类型\n         * @param bytesLoaded {number} 加载的项数或字节数\n         * @param bytesTotal {number} 加载的总项数或总字节数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchProgressEvent(target: IEventDispatcher, type: string, bytesLoaded?: number, bytesTotal?: number): boolean;\n    }\n}\ndeclare namespace egret {\n    interface Stage {\n        addEventListener<Z>(type: \"orientationChange\", listener: (this: Z, e: StageOrientationEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): any;\n    }\n    /**\n     * When the direction of the stage of change, Stage object dispatches StageOrientationEvent object.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/StageOrientationEvent.ts\n     * @language en_US\n     */\n    /**\n     * 当舞台的方向更改时，Stage 对象将调度 StageOrientationEvent 对象。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/StageOrientationEvent.ts\n     * @language zh_CN\n     */\n    class StageOrientationEvent extends Event {\n        /**\n         * After screen rotation distribute events.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 屏幕旋转后派发的事件。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ORIENTATION_CHANGE: \"orientationChange\";\n        /**\n         * Creating contains specific information related to the event and the stage direction of StageOrientationEvent object.\n         * @param type Event types:StageOrientationEvent.ORIENTATION_CHANGE\n         * @param bubbles It indicates whether the Event object participates in the bubbling stage of the event flow.\n         * @param cancelable It indicates whether the Event object can be canceled.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建包含与舞台方向事件相关的特定信息的 StageOrientationEvent 对象。\n         * @param type 事件的类型：StageOrientationEvent.ORIENTATION_CHANGE\n         * @param bubbles 表示 Event 对象是否参与事件流的冒泡阶段。\n         * @param cancelable 表示是否可以取消 Event 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean);\n        /**\n         * 派发一个屏幕旋转的事件。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @param type {egret.IEventDispatcher} 派发事件类型\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 派发一个屏幕旋转的事件。\n         * @param target {egret.IEventDispatcher} Distribute event target\n         * @param type {egret.IEventDispatcher} Distribute event type\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchStageOrientationEvent(target: IEventDispatcher, type: string): boolean;\n    }\n}\ndeclare namespace egret {\n    /**\n     * When a user clicks a hyperlink rich text object dispatches TextEvent object. Text Event Type: TextEvent.LINK.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TextEvent.ts\n     * @language en_US\n     */\n    /**\n     * 用户在富文本中单击超链接时，对象将调度 TextEvent 对象。文本事件类型：TextEvent.LINK。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TextEvent.ts\n     * @language zh_CN\n     */\n    class TextEvent extends Event {\n        /**\n         * TextEvent create an object that contains information about text events.\n         * @param type Type of event, you can access the TextEvent.type.\n         * @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determine whether the Event object can be canceled. The default value is false.\n         * @param text One or more characters of text entered by the user. Event listeners can access this information through the text property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 TextEvent 对象，其中包含有关文本事件的信息。\n         * @param type 事件的类型，可以作为 TextEvent.type 访问。\n         * @param bubbles 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param text 用户输入的一个或多个文本字符。事件侦听器可以通过 text 属性访问此信息。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean, text?: string);\n        /**\n         * It defines the value of the type property of a link event object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 定义 link 事件对象的 type 属性值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static LINK: \"link\";\n        /**\n         * In TextEvent.LINK event, event corresponding string.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在 TextEvent.LINK 事件中，event对应的字符串。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        text: string;\n        /**\n         * EventDispatcher object using the specified event object thrown TextEvent. The objects will be thrown in the object cache pool for the next round robin.\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param text  Text TextEvent object assignment\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出TextEvent事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target 派发事件目标\n         * @param type  事件类型\n         * @param text  TextEvent对象的text赋值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchTextEvent(target: IEventDispatcher, type: string, text: string): boolean;\n    }\n}\ndeclare namespace egret {\n    interface Timer {\n        addEventListener<Z>(type: \"timer\" | \"timerComplete\", listener: (this: Z, e: TimerEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): any;\n    }\n    /**\n     * A Timer object dispatches a TimerEvent objects whenever the Timer object reaches the interval specified by the Timer.delay property.\n     * @see egret.Timer\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TimerEvent.ts\n     * @language en_US\n     */\n    /**\n     * 每当 Timer 对象达到由 Timer.delay 属性指定的间隔时，Timer 对象即会调度 TimerEvent 对象。\n     * @see egret.Timer\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TimerEvent.ts\n     * @language zh_CN\n     */\n    class TimerEvent extends Event {\n        /**\n         * Dispatched whenever a Timer object reaches an interval specified according to the Timer.delay property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 每当 Timer 对象达到根据 Timer.delay 属性指定的间隔时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TIMER: \"timer\";\n        /**\n         * Dispatched whenever it has completed the number of requests set by Timer.repeatCount.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 每当它完成 Timer.repeatCount 设置的请求数后调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TIMER_COMPLETE: \"timerComplete\";\n        /**\n         * Creates an Event object with specific information relevant to timer events.\n         * @param type The type of the event. Event listeners can access this information through the inherited type property.\n         * @param bubbles Determines whether the Event object bubbles. Event listeners can access this information through\n         * the inherited bubbles property.\n         * @param cancelable Determines whether the Event object can be canceled. Event listeners can access this information\n         * through the inherited cancelable property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 Event 对象，其中包含有关 timer 事件的特定信息。\n         * @param type 事件的类型。事件侦听器可以通过继承的 type 属性访问此信息。\n         * @param bubbles 确定 Event 对象是否冒泡。事件侦听器可以通过继承的 bubbles 属性访问此信息。\n         * @param cancelable 确定是否可以取消 Event 对象。事件侦听器可以通过继承的 cancelable 属性访问此信息。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean);\n        /**\n         * Instructs Egret runtime to render after processing of this event completes, if the display list has been modified.\n         * @example\n         * <pre>\n         *    function onTimer(event:TimerEvent):void {\n         *        if (40 < mySp.x && mySp.x < 375) {\n         *            mySp.x-= 50;\n         *        } else {\n         *            mySp.x=374;\n         *        }\n         *        event.updateAfterEvent();\n         *    }\n         *\n         *    let moveTimer:Timer=new Timer(50,250);\n         *    moveTimer.addEventListener(TimerEvent.TIMER,onTimer);\n         *    moveTimer.start();\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果已修改显示列表，调用此方法将会忽略帧频限制，在此事件处理完成后立即重绘屏幕。\n         * @example\n         * <pre>\n         *    function onTimer(event:TimerEvent):void {\n         *        if (40 < mySp.x && mySp.x < 375) {\n         *            mySp.x-= 50;\n         *        } else {\n         *            mySp.x=374;\n         *        }\n         *        event.updateAfterEvent();\n         *    }\n         *\n         *    let moveTimer:Timer=new Timer(50,250);\n         *    moveTimer.addEventListener(TimerEvent.TIMER,onTimer);\n         *    moveTimer.start();\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        updateAfterEvent(): void;\n        /**\n         * uses a specified target to dispatchEvent an event. Using this method can reduce the number of\n         * reallocate event objects, which allows you to get better code execution performance.\n         * @param target the event target\n         * @param type The type of the event. Event listeners can access this information through the inherited type property.\n         * @param bubbles Determines whether the Event object bubbles. Event listeners can access this information through\n         * the inherited bubbles property.\n         * @param cancelable Determines whether the Event object can be canceled. Event listeners can access this information\n         * through the inherited cancelable property.\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target 事件派发目标\n         * @param type 事件的类型。事件侦听器可以通过继承的 type 属性访问此信息。\n         * @param bubbles 确定 Event 对象是否冒泡。事件侦听器可以通过继承的 bubbles 属性访问此信息。\n         * @param cancelable 确定是否可以取消 Event 对象。事件侦听器可以通过继承的 cancelable 属性访问此信息。\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchTimerEvent(target: IEventDispatcher, type: string, bubbles?: boolean, cancelable?: boolean): boolean;\n    }\n}\ndeclare namespace egret {\n    class CompressedTextureData {\n        glInternalFormat: number;\n        width: number;\n        height: number;\n        byteArray: Uint8Array;\n        face: number;\n        level: number;\n    }\n    const etc_alpha_mask = \"etc_alpha_mask\";\n    const engine_default_empty_texture = \"engine_default_empty_texture\";\n    const is_compressed_texture = \"is_compressed_texture\";\n    const glContext = \"glContext\";\n    const UNPACK_PREMULTIPLY_ALPHA_WEBGL = \"UNPACK_PREMULTIPLY_ALPHA_WEBGL\";\n    /**\n     * A BitmapData object contains an array of pixel data. This data can represent either a fully opaque bitmap or a\n     * transparent bitmap that contains alpha channel data. Either type of BitmapData object is stored as a buffer of 32-bit\n     * integers. Each 32-bit integer determines the properties of a single pixel in the bitmap.<br/>\n     * Each 32-bit integer is a combination of four 8-bit channel values (from 0 to 255) that describe the alpha transparency\n     * and the red, green, and blue (ARGB) values of the pixel. (For ARGB values, the most significant byte represents the\n     * alpha channel value, followed by red, green, and blue.)\n     * @see egret.Bitmap\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * BitmapData 对象是一个包含像素数据的数组。此数据可以表示完全不透明的位图，或表示包含 Alpha 通道数据的透明位图。\n     * 以上任一类型的 BitmapData 对象都作为 32 位整数的缓冲区进行存储。每个 32 位整数确定位图中单个像素的属性。<br/>\n     * 每个 32 位整数都是四个 8 位通道值（从 0 到 255）的组合，这些值描述像素的 Alpha 透明度以及红色、绿色、蓝色 (ARGB) 值。\n     * （对于 ARGB 值，最高有效字节代表 Alpha 通道值，其后的有效字节分别代表红色、绿色和蓝色通道值。）\n     * @see egret.Bitmap\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class BitmapData extends HashObject {\n        /**\n         * The width of the bitmap image in pixels.\n         * @readOnly\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 位图图像的宽度，以像素为单位。\n         * @readOnly\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        width: number;\n        /**\n         * The height of the bitmap image in pixels.\n         * @readOnly\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 位图图像的高度，以像素为单位。\n         * @readOnly\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        height: number;\n        /**\n         * Original bitmap image.\n         * HTMLImageElement|HTMLCanvasElement|HTMLVideoElement\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @private\n         * @language en_US\n         */\n        /**\n         * 原始位图图像。\n         * HTMLImageElement|HTMLCanvasElement|HTMLVideoElement\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @private\n         * @language zh_CN\n         */\n        $source: any;\n        /**\n         * WebGL texture.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @private\n         * @language en_US\n         */\n        /**\n         * WebGL纹理。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @private\n         * @language zh_CN\n         */\n        webGLTexture: any;\n        /**\n         * Texture format.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 纹理格式。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        format: string;\n        /**\n         * @private\n         * webgl纹理生成后，是否删掉原始图像数据\n         */\n        $deleteSource: boolean;\n        /**\n         * @private\n         * id\n         */\n        $nativeBitmapData: egret_native.NativeBitmapData;\n        /**\n         * @private\n         *\n         */\n        readonly compressedTextureData: Array<Array<CompressedTextureData>>;\n        debugCompressedTextureURL: string;\n        etcAlphaMask: Nullable<BitmapData>;\n        /**\n         * Initializes a BitmapData object to refer to the specified source object.\n         * @param source The source object being referenced.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个引用指定 source 实例的 BitmapData 对象\n         * @param source 被引用的 source 实例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(source: any);\n        source: any;\n        static create(type: \"arraybuffer\", data: ArrayBuffer, callback?: (bitmapData: BitmapData) => void): BitmapData;\n        static create(type: \"base64\", data: string, callback?: (bitmapData: BitmapData) => void): BitmapData;\n        $dispose(): void;\n        private static _displayList;\n        static $addDisplayObject(displayObject: DisplayObject, bitmapData: BitmapData): void;\n        static $removeDisplayObject(displayObject: DisplayObject, bitmapData: BitmapData): void;\n        static $invalidate(bitmapData: BitmapData): void;\n        static $dispose(bitmapData: BitmapData): void;\n        private _getCompressedTextureData(level, face);\n        getCompressed2dTextureData(): CompressedTextureData;\n        hasCompressed2d(): boolean;\n        clearCompressedTextureData(): void;\n    }\n}\ndeclare namespace egret {\n    interface DisplayObject {\n        addEventListener<Z>(type: \"touchMove\" | \"touchBegin\" | \"touchEnd\" | \"touchCancel\" | \"touchTap\" | \"touchReleaseOutside\" | \"touchRollOut\" | \"touchRollOver\", listener: (this: Z, e: TouchEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): any;\n    }\n    /**\n     * The TouchEvent class lets you handle events on devices that detect user contact with the device (such as a finger\n     * on a touch screen).When a user interacts with a device such as a mobile phone or tablet with a touch screen, the\n     * user typically touches the screen with his or her fingers or a pointing device. You can develop applications that\n     * respond to basic touch events (such as a single finger tap) with the TouchEvent class. Create event listeners using\n     * the event types defined in this class.\n     * Note: When objects are nested on the display list, touch events target the deepest possible nested object that is\n     * visible in the display list. This object is called the target node. To have a target node's ancestor (an object\n     * containing the target node in the display list) receive notification of a touch event, use EventDispatcher.addEventListener()\n     * on the ancestor node with the type parameter set to the specific touch event you want to detect.\n     *\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TouchEvent.ts\n     * @language en_US\n     */\n    /**\n     * 使用 TouchEvent 类，您可以处理设备上那些检测用户与设备之间的接触的事件。\n     * 当用户与带有触摸屏的移动电话或平板电脑等设备交互时，用户通常使用手指或指针设备接触屏幕。可使用 TouchEvent\n     * 类开发响应基本触摸事件（如单个手指点击）的应用程序。使用此类中定义的事件类型创建事件侦听器。\n     * 注意：当对象嵌套在显示列表中时，触摸事件的目标将是显示列表中可见的最深的可能嵌套对象。\n     * 此对象称为目标节点。要使目标节点的祖代（祖代是一个包含显示列表中所有目标节点的对象，从舞台到目标节点的父节点均包括在内）\n     * 接收触摸事件的通知，请对祖代节点使用 EventDispatcher.on() 并将 type 参数设置为要检测的特定触摸事件。\n     *\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TouchEvent.ts\n     * @language zh_CN\n     */\n    class TouchEvent extends Event {\n        /**\n         * Dispatched when the user touches the device, and is continuously dispatched until the point of contact is removed.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户触碰设备时进行调度，而且会连续调度，直到接触点被删除。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TOUCH_MOVE: \"touchMove\";\n        /**\n         * Dispatched when the user first contacts a touch-enabled device (such as touches a finger to a mobile phone or tablet with a touch screen).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户第一次触摸启用触摸的设备时（例如，用手指触摸配有触摸屏的移动电话或平板电脑）调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TOUCH_BEGIN: \"touchBegin\";\n        /**\n         * Dispatched when the user removes contact with a touch-enabled device (such as lifts a finger off a mobile phone\n         * or tablet with a touch screen).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户移除与启用触摸的设备的接触时（例如，将手指从配有触摸屏的移动电话或平板电脑上抬起）调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TOUCH_END: \"touchEnd\";\n        /**\n         * Dispatched when an event of some kind occurred that canceled the touch.\n         * Such as the eui.Scroller will dispatch 'TOUCH_CANCEL' when it start move, the 'TOUCH_END' and 'TOUCH_TAP' will not be triggered.\n         * @version Egret 3.0.1\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 由于某个事件取消了触摸时触发。比如 eui.Scroller 在开始滚动后会触发 'TOUCH_CANCEL' 事件，不再触发后续的 'TOUCH_END' 和 'TOUCH_TAP' 事件\n         * @version Egret 3.0.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TOUCH_CANCEL: \"touchCancel\";\n        /**\n         * Dispatched when the user lifts the point of contact over the same DisplayObject instance on which the contact\n         * was initiated on a touch-enabled device.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户在触摸设备上与开始触摸的同一 DisplayObject 实例上抬起接触点时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TOUCH_TAP: \"touchTap\";\n        /**\n         * Dispatched when the user lifts the point of contact over the different DisplayObject instance on which the contact\n         * was initiated on a touch-enabled device (such as presses and releases a finger from a single point over a display\n         * object on a mobile phone or tablet with a touch screen).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户在触摸设备上与开始触摸的不同 DisplayObject 实例上抬起接触点时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TOUCH_RELEASE_OUTSIDE: \"touchReleaseOutside\";\n        /**\n         * Creates an Event object that contains information about touch events.\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @param stageX The horizontal coordinate at which the event occurred in global Stage coordinates.\n         * @param stageY The vertical coordinate at which the event occurred in global Stage coordinates.\n         * @param touchPointID A unique identification number assigned to the touch point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 TouchEvent 对象，其中包含有关Touch事件的信息\n         * @param type 事件的类型，可以作为 Event.type 访问。\n         * @param bubbles 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param stageX 事件发生点在全局舞台坐标系中的水平坐标\n         * @param stageY 事件发生点在全局舞台坐标系中的垂直坐标\n         * @param touchPointID 分配给触摸点的唯一标识号\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean, stageX?: number, stageY?: number, touchPointID?: number);\n        /**\n         * @private\n         */\n        $initTo(stageX: number, stageY: number, touchPointID: number): void;\n        /**\n         * @private\n         */\n        $stageX: number;\n        /**\n         * The horizontal coordinate at which the event occurred in global Stage coordinates.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 事件发生点在全局舞台坐标中的水平坐标。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly stageX: number;\n        /**\n         * @private\n         */\n        $stageY: number;\n        /**\n         * The vertical coordinate at which the event occurred in global Stage coordinates.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 事件发生点在全局舞台坐标中的垂直坐标。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly stageY: number;\n        private _localX;\n        /**\n         * The horizontal coordinate at which the event occurred relative to the display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 事件发生点相对于所属显示对象的水平坐标。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly localX: number;\n        private _localY;\n        /**\n         * The vertical coordinate at which the event occurred relative to the display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 事件发生点相对于所属显示对象的垂直坐标。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly localY: number;\n        private targetChanged;\n        /**\n         * @private\n         */\n        private getLocalXY();\n        $setTarget(target: any): boolean;\n        /**\n         * A unique identification number assigned to the touch point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 分配给触摸点的唯一标识号\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        touchPointID: number;\n        /**\n         * Instructs Egret runtime to render after processing of this event completes, if the display list has been modified.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果已修改显示列表，调用此方法将会忽略帧频限制，在此事件处理完成后立即重绘屏幕。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        updateAfterEvent(): void;\n        /**\n         * Whether the touch is pressed (true) or not pressed (false).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示触摸已按下 (true) 还是未按下 (false)。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        touchDown: boolean;\n        /**\n         * uses a specified target to dispatchEvent an event. Using this method can reduce the number of\n         * reallocate event objects, which allows you to get better code execution performance.\n         * @param target the event target\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @param stageX The horizontal coordinate at which the event occurred in global Stage coordinates.\n         * @param stageY The vertical coordinate at which the event occurred in global Stage coordinates.\n         * @param touchPointID A unique identification number (as an int) assigned to the touch point.\n         *\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         *\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出Event事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target 派发事件目标\n         * @param type 事件的类型，可以作为 Event.type 访问。\n         * @param bubbles 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param stageX 事件发生点在全局舞台坐标系中的水平坐标\n         * @param stageY 事件发生点在全局舞台坐标系中的垂直坐标\n         * @param touchPointID 分配给触摸点的唯一标识号\n         *\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         *\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchTouchEvent(target: IEventDispatcher, type: string, bubbles?: boolean, cancelable?: boolean, stageX?: number, stageY?: number, touchPointID?: number, touchDown?: boolean): boolean;\n    }\n}\ndeclare namespace egret {\n    /**\n     * h5 and native interaction.\n     * @see http://edn.egret.com/cn/article/index/id/714 Egret basic skills to communicate with Native\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/external/ExternalInterface.ts\n     * @language en_US\n     */\n    /**\n     * h5与native交互。\n     * @see http://edn.egret.com/cn/article/index/id/714 Egret 与 Native 通信基本技巧\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/external/ExternalInterface.ts\n     * @language zh_CN\n     */\n    interface ExternalInterface {\n    }\n    let ExternalInterface: {\n        /**\n         * Call functionName, and the value passed to the native.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 调用 functionName，并将value传入到native中。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        call(functionName: string, value: string): void;\n        /**\n         * FunctionName callback listener, you need to have to call functionName this field in native rather than such a call.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 监听 functionName 回调，需要在native中有调用 functionName 这个字段，而不是 此类的call。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        addCallback(functionName: string, listener: (value: string) => void): void;\n    };\n}\ndeclare namespace egret {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    const enum BitmapFilterQuality {\n        /**\n         * 定义低品质滤镜设置\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        LOW = 1,\n        /**\n         * 定义中等品质滤镜设置\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MEDIUM = 2,\n        /**\n         * 定义高品质滤镜设置\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        HIGH = 3,\n    }\n}\ndeclare namespace egret {\n    /**\n     * The BlurFilter class lets you apply a blur visual effect to display objects. A blur effect softens the details of an image.\n     * You can produce blurs that range from a softly unfocused look to a Gaussian blur, a hazy appearance like viewing an image through semi-opaque glass.\n     * @version Egret 3.0.1\n     * @platform Web\n     * @see http://edn.egret.com/cn/docs/page/947#模糊滤镜 模糊滤镜\n     * @language en_US\n     */\n    /**\n     * 可使用 BlurFilter 类将模糊视觉效果应用于显示对象。模糊效果可以柔化图像的细节。\n     * 您可以生成一些模糊效果，范围从创建一个柔化的、未聚焦的外观到高斯模糊（就像通过半透明玻璃查看图像一样的朦胧的外观）。\n     * @version Egret 3.1.0\n     * @platform Web\n     * @see http://edn.egret.com/cn/docs/page/947#模糊滤镜 模糊滤镜\n     * @language zh_CN\n     */\n    class BlurFilter extends Filter {\n        /**\n         * Initializes a BlurFilter object.\n         * @param blurX {number} The amount of horizontal blur. Valid values are 0 to 255 (floating point).\n         * @param blurY {number} The amount of vertical blur. Valid values are 0 to 255 (floating point).\n         * @param quality {number} The number of times to apply the filter.\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 创建一个 BlurFilter 对象。\n         * @param blurX {number} 水平模糊量。有效值为 0 到 255（浮点）。\n         * @param blurY {number} 垂直模糊量。有效值为 0 到 255（浮点）。\n         * @param quality {number} 应用滤镜的次数。暂未实现。\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        constructor(blurX?: number, blurY?: number, quality?: number);\n        /**\n         * @private\n         */\n        blurXFilter: IBlurXFilter;\n        /**\n         * @private\n         */\n        blurYFilter: IBlurYFilter;\n        /**\n         * @private\n         */\n        $quality: number;\n        /**\n         * The amount of horizontal blur.\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 水平模糊量。\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        blurX: number;\n        /**\n         * @private\n         */\n        $blurX: number;\n        /**\n         * The amount of vertical blur.\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 垂直模糊量。\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        blurY: number;\n        /**\n         * @private\n         */\n        $blurY: number;\n        /**\n         * @private\n         */\n        $toJson(): string;\n        protected updatePadding(): void;\n        onPropertyChange(): void;\n    }\n    /**\n     * @private\n     */\n    interface IBlurXFilter extends Filter {\n        type: string;\n        $uniforms: any;\n        blurX: number;\n    }\n    /**\n     * @private\n     */\n    interface IBlurYFilter extends Filter {\n        type: string;\n        $uniforms: any;\n        blurY: number;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The ColorMatrixFilter class lets you apply a 4 x 5 matrix transformation on the RGBA color and alpha values of every pixel in the input image to produce a result with a new set of RGBA color and alpha values.\n     * It allows saturation changes, hue rotation, luminance to alpha, and various other effects.\n     * @version Egret 3.1.0\n     * @platform Web\n     * @see http://edn.egret.com/cn/docs/page/947 颜色矩阵滤镜\n     * @language en_US\n     */\n    /**\n     * 使用 ColorMatrixFilter 类可以将 4 x 5 矩阵转换应用于输入图像上的每个像素的 RGBA 颜色和 Alpha 值，以生成具有一组新的 RGBA 颜色和 Alpha 值的结果。\n     * 该类允许饱和度更改、色相旋转、亮度为 Alpha 以及各种其他效果。\n     * @version Egret 3.1.0\n     * @platform Web\n     * @see http://edn.egret.com/cn/docs/page/947 颜色矩阵滤镜\n     * @language zh_CN\n     */\n    class ColorMatrixFilter extends Filter {\n        /**\n         * @private\n         */\n        $matrix: number[];\n        /**\n         * @private\n         */\n        private matrix2;\n        /**\n         * Initializes a ColorMatrixFilter object.\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 创建一个 ColorMatrixFilter 对象。\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        constructor(matrix?: number[]);\n        /**\n         * A comma delimited list of 20 doubles that comprise a 4x5 matrix applied to the rendered element.\n         * The matrix is in row major order -- that is, the first five elements are multipled by the vector [srcR,srcG,srcB,srcA,1] to determine the output red value, the second five determine the output green value, etc.\n         * The value must either be an array or comma delimited string of 20 numbers.\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 构成应用于所呈示的元素的一个 4x5 矩阵的、以逗号分隔的 20 个双精度数的列表。\n         * 矩阵以行作为主要顺序，即用第一行五个元素乘以矢量 [srcR,srcG,srcB,srcA,1] 以确定输出的红色值，用第二行的五个元素确定输出的绿色值，等等。\n         * 该值必须为 20 个数字组成的数组或以逗号分隔的字符串。\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        matrix: number[];\n        /**\n         * @private\n         */\n        private setMatrix(value);\n        /**\n         * @private\n         */\n        $toJson(): string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * custom filter, now support WebGL mode only.\n     * @version Egret 4.1.0\n     * @platform Web\n     * @language en_US\n     */\n    /**\n     * 自定义滤镜，目前仅支持WebGL模式\n     * @version Egret 4.1.0\n     * @platform Web\n     * @language zh_CN\n     */\n    class CustomFilter extends Filter {\n        /**\n         * @private\n         */\n        $vertexSrc: string;\n        /**\n         * @private\n         */\n        $fragmentSrc: string;\n        /**\n         * @private\n         */\n        $shaderKey: string;\n        /**\n         * @private\n         */\n        type: string;\n        private $padding;\n        /**\n         * The inner margin of the filter.\n         * If the desired area of the custom filter is larger than the original area (stroke, etc.), you need to set it manually.\n         * @version Egret 4.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 滤镜的内边距\n         * 如果自定义滤镜所需区域比原区域大（描边等），需要手动设置\n         * @version Egret 4.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        padding: number;\n        /**\n         * The initial value of the uniform in the shader (key, value one-to-one correspondence), currently only supports numbers and arrays.\n         * @version Egret 4.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 着色器中uniform的初始值（key，value一一对应），目前仅支持数字和数组。\n         * @version Egret 4.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        readonly uniforms: any;\n        /**\n         * Initialize the CustomFilter object.\n         * @param vertexSrc Custom vertex shader program.\n         * @param fragmentSrc Custom fragment shader program.\n         * @param uniforms The initial value of the uniform in the shader (key, value one-to-one correspondence), currently only supports numbers and arrays.\n         * @version Egret 4.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 初始化 CustomFilter 对象\n         * @param vertexSrc 自定义的顶点着色器程序。\n         * @param fragmentSrc 自定义的片段着色器程序。\n         * @param uniforms 着色器中uniform的初始值（key，value一一对应），目前仅支持数字和数组。\n         * @version Egret 4.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        constructor(vertexSrc: string, fragmentSrc: string, uniforms?: any);\n        onPropertyChange(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @class egret.DropShadowFilter\n     * @classdesc\n     * 可使用 DropShadowFilter 类向显示对象添加投影。\n     * @extends egret.GlowFilter\n     * @version Egret 3.1.4\n     * @platform Web,Native\n     */\n    class DropShadowFilter extends GlowFilter {\n        /**\n         * Initializes a new DropShadowFilter instance.\n         * @method egret.DropShadowFilter#constructor\n         * @param distance {number} The offset distance of the bevel. Valid values are in pixels (floating point).\n         * @param angle {number} The angle of the bevel. Valid values are from 0 to 360°.\n         * @param color {number} The color of the glow. Valid values are in the hexadecimal format 0xRRGGBB. The default value is 0xFF0000.\n         * @param alpha {number} The alpha transparency value for the color. Valid values are 0 to 1. For example, .25 sets a transparency value of 25%. The default value is 1.\n         * @param blurX {number} The amount of horizontal blur. Valid values are 0 to 255 (floating point).\n         * @param blurY {number} The amount of vertical blur. Valid values are 0 to 255 (floating point).\n         * @param strength {number} The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the glow and the background. Valid values are 0 to 255.\n         * @param quality {number} The number of times to apply the filter.\n         * @param inner {boolean} Specifies whether the glow is an inner glow. The value true indicates an inner glow. The default is false, an outer glow (a glow around the outer edges of the object).\n         * @param knockout {number} Specifies whether the object has a knockout effect. A value of true makes the object's fill transparent and reveals the background color of the document. The default value is false (no knockout effect).\n         * @param hideObject {number} Indicates whether or not the object is hidden. The value true indicates that the object itself is not drawn; only the shadow is visible. The default is false, meaning that the object is shown.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 初始化 DropShadowFilter 对象\n         * @method egret.DropShadowFilter#constructor\n         * @param distance {number} 阴影的偏移距离，以像素为单位。\n         * @param angle {number} 阴影的角度，0 到 360 度（浮点）。\n         * @param color {number} 光晕颜色，采用十六进制格式 0xRRGGBB。默认值为 0xFF0000。\n         * @param alpha {number} 颜色的 Alpha 透明度值。有效值为 0 到 1。例如，0.25 设置透明度值为 25%。\n         * @param blurX {number} 水平模糊量。有效值为 0 到 255（浮点）。\n         * @param blurY {number} 垂直模糊量。有效值为 0 到 255（浮点）。\n         * @param strength {number} 印记或跨页的强度。该值越高，压印的颜色越深，而且发光与背景之间的对比度也越强。有效值为 0 到 255。\n         * @param quality {number} 应用滤镜的次数。暂未实现。\n         * @param inner {boolean} 指定发光是否为内侧发光。值 true 指定发光是内侧发光。值 false 指定发光是外侧发光（对象外缘周围的发光）。\n         * @param knockout {number} 指定对象是否具有挖空效果。值为 true 将使对象的填充变为透明，并显示文档的背景颜色。\n         * @param hideObject {number} 表示是否隐藏对象。如果值为 true，则表示没有绘制对象本身，只有阴影是可见的。默认值为 false（显示对象）。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        constructor(distance?: number, angle?: number, color?: number, alpha?: number, blurX?: number, blurY?: number, strength?: number, quality?: number, inner?: boolean, knockout?: boolean, hideObject?: boolean);\n        /**\n         * @private\n         */\n        $distance: number;\n        /**\n         * The offset distance of the bevel.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 阴影的偏移距离，以像素为单位。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        distance: number;\n        /**\n         * @private\n         */\n        $angle: number;\n        /**\n         * The angle of the bevel.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 阴影的角度。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        angle: number;\n        /**\n         * @private\n         */\n        $hideObject: boolean;\n        /**\n         * Indicates whether or not the object is hidden.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 表示是否隐藏对象。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        hideObject: boolean;\n        /**\n         * @private\n         */\n        $toJson(): string;\n        protected updatePadding(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The GradientType class provides values for the type parameter in the beginGradientFill() methods of the egret.Graphics class.\n     *\n     * @see egret.Graphics#beginGradientFill()\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * GradientType 类为 egret.Graphics 类的 beginGradientFill() 方法中的 type 参数提供值。\n     *\n     * @see egret.Graphics#beginGradientFill()\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class GradientType {\n        /**\n         * Value used to specify a linear gradient fill.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于指定线性渐变填充的值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static LINEAR: string;\n        /**\n         * Value used to specify a radial gradient fill.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于指定放射状渐变填充的值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static RADIAL: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The Graphics class contains a set of methods for creating vector shape. Display objects that support drawing include Sprite and Shape objects. Each class in these classes includes the graphics attribute that is a Graphics object.\n     * The following auxiliary functions are provided for ease of use: drawRect(), drawRoundRect(), drawCircle(), and drawEllipse().\n     * @see http://edn.egret.com/cn/docs/page/136 Draw Rectangle\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Graphics.ts\n     * @language en_US\n     */\n    /**\n     * Graphics 类包含一组可用来创建矢量形状的方法。支持绘制的显示对象包括 Sprite 和 Shape 对象。这些类中的每一个类都包括 graphics 属性，该属性是一个 Graphics 对象。\n     * 以下是为便于使用而提供的一些辅助函数：drawRect()、drawRoundRect()、drawCircle() 和 drawEllipse()。\n     * @see http://edn.egret.com/cn/docs/page/136 绘制矩形\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Graphics.ts\n     * @language zh_CN\n     */\n    class Graphics extends HashObject {\n        /**\n         * Initializes a Graphics object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 Graphics 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        /**\n         * @private\n         */\n        $renderNode: sys.GraphicsNode;\n        /**\n         * 绑定到的目标显示对象\n         */\n        $targetDisplay: DisplayObject;\n        $targetIsSprite: boolean;\n        /**\n         * @private\n         * 设置绑定到的目标显示对象\n         */\n        $setTarget(target: DisplayObject): void;\n        /**\n         * 当前移动到的坐标X\n         */\n        private lastX;\n        /**\n         * 当前移动到的坐标Y\n         */\n        private lastY;\n        /**\n         * 当前正在绘制的填充\n         */\n        private fillPath;\n        /**\n         * 当前正在绘制的线条\n         */\n        private strokePath;\n        /**\n         * 线条的左上方宽度\n         */\n        private topLeftStrokeWidth;\n        /**\n         * 线条的右下方宽度\n         */\n        private bottomRightStrokeWidth;\n        /**\n         * 对1像素和3像素特殊处理，向右下角偏移0.5像素，以显示清晰锐利的线条。\n         */\n        private setStrokeWidth(width);\n        /**\n         * Specify a simple single color fill that will be used for subsequent calls to other Graphics methods (for example, lineTo() and drawCircle()) when drawing.\n         * Calling the clear() method will clear the fill.\n         * @param color Filled color\n         * @param alpha Filled Alpha value\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定一种简单的单一颜色填充，在绘制时该填充将在随后对其他 Graphics 方法（如 lineTo() 或 drawCircle()）的调用中使用。\n         * 调用 clear() 方法会清除填充。\n         * @param color 填充的颜色\n         * @param alpha 填充的 Alpha 值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        beginFill(color: number, alpha?: number): void;\n        /**\n         * Specifies a gradient fill used by subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object.\n         * Calling the clear() method clears the fill.\n         * @param type A value from the GradientType class that specifies which gradient type to use: GradientType.LINEAR or GradientType.RADIAL.\n         * @param colors An array of RGB hexadecimal color values used in the gradient; for example, red is 0xFF0000, blue is 0x0000FF, and so on. You can specify up to 15 colors. For each color, specify a corresponding value in the alphas and ratios parameters.\n         * @param alphas An array of alpha values for the corresponding colors in the colors array;\n         * @param ratios An array of color distribution ratios; valid values are 0-255.\n         * @param matrix A transformation matrix as defined by the egret.Matrix class. The egret.Matrix class includes a createGradientBox() method, which lets you conveniently set up the matrix for use with the beginGradientFill() method.\n         * @platform Web,Native\n         * @version Egret 2.4\n         * @language en_US\n         */\n        /**\n         * 指定一种渐变填充，用于随后调用对象的其他 Graphics 方法（如 lineTo() 或 drawCircle()）。\n         * 调用 clear() 方法会清除填充。\n         * @param type 用于指定要使用哪种渐变类型的 GradientType 类的值：GradientType.LINEAR 或 GradientType.RADIAL。\n         * @param colors 渐变中使用的 RGB 十六进制颜色值的数组（例如，红色为 0xFF0000，蓝色为 0x0000FF，等等）。对于每种颜色，请在 alphas 和 ratios 参数中指定对应值。\n         * @param alphas colors 数组中对应颜色的 alpha 值数组。\n         * @param ratios 颜色分布比率的数组。有效值为 0 到 255。\n         * @param matrix 一个由 egret.Matrix 类定义的转换矩阵。egret.Matrix 类包括 createGradientBox() 方法，通过该方法可以方便地设置矩阵，以便与 beginGradientFill() 方法一起使用\n         * @platform Web,Native\n         * @version Egret 2.4\n         * @language zh_CN\n         */\n        beginGradientFill(type: string, colors: number[], alphas: number[], ratios: number[], matrix?: egret.Matrix): void;\n        /**\n         * Apply fill to the lines and curves added after the previous calling to the beginFill() method.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 对从上一次调用 beginFill()方法之后添加的直线和曲线应用填充。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        endFill(): void;\n        /**\n         * Specify a line style that will be used for subsequent calls to Graphics methods such as lineTo() and drawCircle().\n         * @param thickness An integer, indicating the thickness of the line in points. Valid values are 0 to 255. If a number is not specified, or if the parameter is undefined, a line is not drawn. If a value less than 0 is passed, the default value is 0. Value 0 indicates hairline thickness; the maximum thickness is 255. If a value greater than 255 is passed, the default value is 255.\n         * @param color A hexadecimal color value of the line (for example, red is 0xFF0000, and blue is 0x0000FF, etc.). If no value is specified, the default value is 0x000000 (black). Optional.\n         * @param alpha Indicates Alpha value of the line's color. Valid values are 0 to 1. If no value is specified, the default value is 1 (solid). If the value is less than 0, the default value is 0. If the value is greater than 1, the default value is 1.\n         * @param pixelHinting A boolean value that specifies whether to hint strokes to full pixels. This affects both the position of anchors of a curve and the line stroke size itself. With pixelHinting set to true, the line width is adjusted to full pixel width. With pixelHinting set to false, disjoints can appear for curves and straight lines.\n         * @param scaleMode Specifies the scale mode to be used\n         * @param caps Specifies the value of the CapsStyle class of the endpoint type at the end of the line. (default = CapsStyle.ROUND)\n         * @param joints Specifies the type of joint appearance of corner.  (default = JointStyle.ROUND)\n         * @param miterLimit Indicates the limit number of cut miter.\n         * @param lineDash set the line dash.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定一种线条样式以用于随后对 lineTo() 或 drawCircle() 等 Graphics 方法的调用。\n         * @param thickness 一个整数，以点为单位表示线条的粗细，有效值为 0 到 255。如果未指定数字，或者未定义该参数，则不绘制线条。如果传递的值小于 0，则默认值为 0。值 0 表示极细的粗细；最大粗细为 255。如果传递的值大于 255，则默认值为 255。\n         * @param color 线条的十六进制颜色值（例如，红色为 0xFF0000，蓝色为 0x0000FF 等）。如果未指明值，则默认值为 0x000000（黑色）。可选。\n         * @param alpha 表示线条颜色的 Alpha 值的数字；有效值为 0 到 1。如果未指明值，则默认值为 1（纯色）。如果值小于 0，则默认值为 0。如果值大于 1，则默认值为 1。\n         * @param pixelHinting 布尔型值，指定是否提示笔触采用完整像素。它同时影响曲线锚点的位置以及线条笔触大小本身。在 pixelHinting 设置为 true 的情况下，线条宽度会调整到完整像素宽度。在 pixelHinting 设置为 false 的情况下，对于曲线和直线可能会出现脱节。\n         * @param scaleMode 用于指定要使用的比例模式\n         * @param caps 用于指定线条末端处端点类型的 CapsStyle 类的值。默认值：CapsStyle.ROUND\n         * @param joints 指定用于拐角的连接外观的类型。默认值：JointStyle.ROUND\n         * @param miterLimit 用于表示剪切斜接的极限值的数字。\n         * @param lineDash 设置虚线样式。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        lineStyle(thickness?: number, color?: number, alpha?: number, pixelHinting?: boolean, scaleMode?: string, caps?: string, joints?: string, miterLimit?: number, lineDash?: number[]): void;\n        /**\n         * Draw a rectangle\n         * @param x x position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param y y position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param width Width of the rectangle (in pixels).\n         * @param height Height of the rectangle (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一个矩形\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        drawRect(x: number, y: number, width: number, height: number): void;\n        /**\n         * Draw a rectangle with rounded corners.\n         * @param x x position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param y y position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param width Width of the rectangle (in pixels).\n         * @param height Height of the rectangle (in pixels).\n         * @param ellipseWidth Width used to draw an ellipse with rounded corners (in pixels).\n         * @param ellipseHeight Height used to draw an ellipse with rounded corners (in pixels). (Optional) If no value is specified, the default value matches the value of the ellipseWidth parameter.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一个圆角矩形。\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @param ellipseWidth 用于绘制圆角的椭圆的宽度（以像素为单位）。\n         * @param ellipseHeight 用于绘制圆角的椭圆的高度（以像素为单位）。 （可选）如果未指定值，则默认值与为 ellipseWidth 参数提供的值相匹配。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        drawRoundRect(x: number, y: number, width: number, height: number, ellipseWidth: number, ellipseHeight?: number): void;\n        /**\n         * Draw a circle.\n         * @param x x position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param y y position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param r Radius of the circle (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一个圆。\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param radius 圆的半径（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        drawCircle(x: number, y: number, radius: number): void;\n        /**\n         * Draw an ellipse.\n         * @param x A number indicating the horizontal position, relative to the registration point of the parent display object (in pixels).\n         * @param y A number indicating the vertical position, relative to the registration point of the parent display object (in pixels).\n         * @param width Width of the rectangle (in pixels).\n         * @param height Height of the rectangle (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一个椭圆。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        drawEllipse(x: number, y: number, width: number, height: number): void;\n        /**\n         * Move the current drawing position to (x, y). If any of these parameters is missed, calling this method will fail and the current drawing position keeps unchanged.\n         * @param x A number indicating the horizontal position, relative to the registration point of the parent display object (in pixels).\n         * @param y A number indicating the vertical position, relative to the registration point of the parent display object (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将当前绘图位置移动到 (x, y)。如果缺少任何一个参数，则此方法将失败，并且当前绘图位置不改变。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        moveTo(x: number, y: number): void;\n        /**\n         * Draw a straight line from the current drawing position to (x, y) using the current line style; the current drawing position is then set to (x, y).\n         * @param x A number indicating the horizontal position, relative to the registration point of the parent display object (in pixels).\n         * @param y A number indicating the vertical position, relative to the registration point of the parent display object (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用当前线条样式绘制一条从当前绘图位置开始到 (x, y) 结束的直线；当前绘图位置随后会设置为 (x, y)。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        lineTo(x: number, y: number): void;\n        /**\n         * Draw a quadratic Bezier curve from the current drawing position to (anchorX, anchorY) using the current line style according to the control points specified by (controlX, controlY). The current drawing position is then set to (anchorX, anchorY).\n         * If the curveTo() method is called before the moveTo() method, the default value of the current drawing position is (0, 0). If any of these parameters is missed, calling this method will fail and the current drawing position keeps unchanged.\n         * The drawn curve is a quadratic Bezier curve. A quadratic Bezier curve contains two anchor points and one control point. The curve interpolates the two anchor points and bends to the control point.\n         * @param controlX A number indicating the horizontal position of the control point, relative to the registration point of the parent display object.\n         * @param controlY A number indicating the vertical position of the control point, relative to the registration point of the parent display object.\n         * @param anchorX A number indicating the horizontal position of the next anchor point, relative to the registration point of the parent display object.\n         * @param anchorY A number indicating the vertical position of the next anchor point, relative to the registration point of the parent display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用当前线条样式和由 (controlX, controlY) 指定的控制点绘制一条从当前绘图位置开始到 (anchorX, anchorY) 结束的二次贝塞尔曲线。当前绘图位置随后设置为 (anchorX, anchorY)。\n         * 如果在调用 moveTo() 方法之前调用了 curveTo() 方法，则当前绘图位置的默认值为 (0, 0)。如果缺少任何一个参数，则此方法将失败，并且当前绘图位置不改变。\n         * 绘制的曲线是二次贝塞尔曲线。二次贝塞尔曲线包含两个锚点和一个控制点。该曲线内插这两个锚点，并向控制点弯曲。\n         * @param controlX 一个数字，指定控制点相对于父显示对象注册点的水平位置。\n         * @param controlY 一个数字，指定控制点相对于父显示对象注册点的垂直位置。\n         * @param anchorX 一个数字，指定下一个锚点相对于父显示对象注册点的水平位置。\n         * @param anchorY 一个数字，指定下一个锚点相对于父显示对象注册点的垂直位置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        curveTo(controlX: number, controlY: number, anchorX: number, anchorY: number): void;\n        /**\n         * Draws a cubic Bezier curve from the current drawing position to the specified anchor. Cubic Bezier curves consist of two anchor points and two control points. The curve interpolates the two anchor points and two control points to the curve.\n         * @param controlX1 Specifies the first control point relative to the registration point of the parent display the horizontal position of the object.\n         * @param controlY1 Specifies the first control point relative to the registration point of the parent display the vertical position of the object.\n         * @param controlX2 Specify the second control point relative to the registration point of the parent display the horizontal position of the object.\n         * @param controlY2 Specify the second control point relative to the registration point of the parent display the vertical position of the object.\n         * @param anchorX Specifies the anchor point relative to the registration point of the parent display the horizontal position of the object.\n         * @param anchorY Specifies the anchor point relative to the registration point of the parent display the vertical position of the object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从当前绘图位置到指定的锚点绘制一条三次贝塞尔曲线。三次贝塞尔曲线由两个锚点和两个控制点组成。该曲线内插这两个锚点，并向两个控制点弯曲。\n         * @param controlX1 指定首个控制点相对于父显示对象的注册点的水平位置。\n         * @param controlY1 指定首个控制点相对于父显示对象的注册点的垂直位置。\n         * @param controlX2 指定第二个控制点相对于父显示对象的注册点的水平位置。\n         * @param controlY2 指定第二个控制点相对于父显示对象的注册点的垂直位置。\n         * @param anchorX 指定锚点相对于父显示对象的注册点的水平位置。\n         * @param anchorY 指定锚点相对于父显示对象的注册点的垂直位置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        cubicCurveTo(controlX1: number, controlY1: number, controlX2: number, controlY2: number, anchorX: number, anchorY: number): void;\n        /**\n         * adds an arc to the path which is centered at (x, y) position with radius r starting at startAngle and ending\n         * at endAngle going in the given direction by anticlockwise (defaulting to clockwise).\n         * @param x The x coordinate of the arc's center.\n         * @param y The y coordinate of the arc's center.\n         * @param radius The arc's radius.\n         * @param startAngle The angle at which the arc starts, measured clockwise from the positive x axis and expressed in radians.\n         * @param endAngle The angle at which the arc ends, measured clockwise from the positive x axis and expressed in radians.\n         * @param anticlockwise if true, causes the arc to be drawn counter-clockwise between the two angles. By default it is drawn clockwise.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一段圆弧路径。圆弧路径的圆心在 (x, y) 位置，半径为 r ，根据anticlockwise （默认为顺时针）指定的方向从 startAngle 开始绘制，到 endAngle 结束。\n         * @param x 圆弧中心（圆心）的 x 轴坐标。\n         * @param y 圆弧中心（圆心）的 y 轴坐标。\n         * @param radius 圆弧的半径。\n         * @param startAngle 圆弧的起始点， x轴方向开始计算，单位以弧度表示。\n         * @param endAngle 圆弧的终点， 单位以弧度表示。\n         * @param anticlockwise 如果为 true，逆时针绘制圆弧，反之，顺时针绘制。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        drawArc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\n        private dirty();\n        /**\n         * @private\n         * 测量圆弧的矩形大小\n         */\n        private arcBounds(x, y, radius, startAngle, endAngle);\n        /**\n         * Clear graphics that are drawn to this Graphics object, and reset fill and line style settings.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 清除绘制到此 Graphics 对象的图形，并重置填充和线条样式设置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        clear(): void;\n        /**\n         * @private\n         */\n        private minX;\n        /**\n         * @private\n         */\n        private minY;\n        /**\n         * @private\n         */\n        private maxX;\n        /**\n         * @private\n         */\n        private maxY;\n        /**\n         * @private\n         */\n        private extendBoundsByPoint(x, y);\n        /**\n         * @private\n         */\n        private extendBoundsByX(x);\n        /**\n         * @private\n         */\n        private extendBoundsByY(y);\n        /**\n         * @private\n         */\n        private updateNodeBounds();\n        /**\n         * 是否已经包含上一次moveTo的坐标点\n         */\n        private includeLastPosition;\n        /**\n         * 更新当前的lineX和lineY值，并标记尺寸失效。\n         * @private\n         */\n        private updatePosition(x, y);\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        /**\n         * @private\n         *\n         */\n        $hitTest(stageX: number, stageY: number): DisplayObject;\n        /**\n         * @private\n         */\n        $onRemoveFromStage(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The Matrix class represents a transformation matrix that determines how to map points from one coordinate space to\n     * another. You can perform various graphical transformations on a display object by setting the properties of a Matrix\n     * object, applying that Matrix object to the matrix property of a display object, These transformation functions include\n     * translation (x and y repositioning), rotation, scaling, and skewing.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Matrix.ts\n     * @language en_US\n     */\n    /**\n     * Matrix 类表示一个转换矩阵，它确定如何将点从一个坐标空间映射到另一个坐标空间。\n     * 您可以对一个显示对象执行不同的图形转换，方法是设置 Matrix 对象的属性，将该 Matrix\n     * 对象应用于显示对象的 matrix 属性。这些转换函数包括平移（x 和 y 重新定位）、旋转、缩放和倾斜。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Matrix.ts\n     * @language zh_CN\n     */\n    class Matrix extends HashObject {\n        /**\n         * Releases a matrix instance to the object pool\n         * @param matrix matrix that Needs to be recycled\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放一个Matrix实例到对象池\n         * @param matrix 需要回收的 matrix\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static release(matrix: Matrix): void;\n        /**\n         * get a matrix instance from the object pool or create a new one.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从对象池中取出或创建一个新的Matrix对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static create(): Matrix;\n        /**\n         * Creates a new Matrix object with the specified parameters.\n         * @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image..\n         * @param tx The distance by which to translate each point along the x axis.\n         * @param ty The distance by which to translate each point along the y axis.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定参数创建一个 Matrix 对象\n         * @param a 缩放或旋转图像时影响像素沿 x 轴定位的值。\n         * @param b 旋转或倾斜图像时影响像素沿 y 轴定位的值。\n         * @param c 旋转或倾斜图像时影响像素沿 x 轴定位的值。\n         * @param d 缩放或旋转图像时影响像素沿 y 轴定位的值。\n         * @param tx 沿 x 轴平移每个点的距离。\n         * @param ty 沿 y 轴平移每个点的距离。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);\n        /**\n         * The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 缩放或旋转图像时影响像素沿 x 轴定位的值\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        a: number;\n        /**\n         * The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 旋转或倾斜图像时影响像素沿 y 轴定位的值\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        b: number;\n        /**\n         * The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 旋转或倾斜图像时影响像素沿 x 轴定位的值\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        c: number;\n        /**\n         * The value that affects the positioning of pixels along the y axis when scaling or rotating an image.\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 缩放或旋转图像时影响像素沿 y 轴定位的值\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        d: number;\n        /**\n         * The distance by which to translate each point along the x axis.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 沿 x 轴平移每个点的距离\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        tx: number;\n        /**\n         * The distance by which to translate each point along the y axis.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 沿 y 轴平移每个点的距离\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ty: number;\n        /**\n         * Returns a new Matrix object that is a clone of this matrix, with an exact copy of the contained object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回一个新的 Matrix 对象，它是此矩阵的克隆，带有与所含对象完全相同的副本。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        clone(): Matrix;\n        /**\n         * Concatenates a matrix with the current matrix, effectively combining the geometric effects of the two. In mathematical\n         * terms, concatenating two matrixes is the same as combining them using matrix multiplication.\n         * @param other The matrix to be concatenated to the source matrix.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将某个矩阵与当前矩阵连接，从而将这两个矩阵的几何效果有效地结合在一起。在数学术语中，将两个矩阵连接起来与使用矩阵乘法将它们结合起来是相同的。\n         * @param other 要连接到源矩阵的矩阵。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        concat(other: Matrix): void;\n        /**\n         * Copies all of the matrix data from the source Point object into the calling Matrix object.\n         * @param other  The Matrix object from which to copy the data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将源 Matrix 对象中的所有矩阵数据复制到调用方 Matrix 对象中。\n         * @param other 要拷贝的目标矩阵\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        copyFrom(other: Matrix): Matrix;\n        /**\n         * Sets each matrix property to a value that causes a null transformation. An object transformed by applying an\n         * identity matrix will be identical to the original. After calling the identity() method, the resulting matrix\n         * has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 为每个矩阵属性设置一个值，该值将导致矩阵无转换。通过应用恒等矩阵转换的对象将与原始对象完全相同。\n         * 调用 identity() 方法后，生成的矩阵具有以下属性：a=1、b=0、c=0、d=1、tx=0 和 ty=0。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        identity(): void;\n        /**\n         * Performs the opposite transformation of the original matrix. You can apply an inverted matrix to an object to\n         * undo the transformation performed when applying the original matrix.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 执行原始矩阵的逆转换。\n         * 您可以将一个逆矩阵应用于对象来撤消在应用原始矩阵时执行的转换。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        invert(): void;\n        /**\n         * @private\n         */\n        $invertInto(target: Matrix): void;\n        /**\n         * Applies a rotation transformation to the Matrix object.\n         * The rotate() method alters the a, b, c, and d properties of the Matrix object.\n         * @param angle The rotation angle in radians.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 对 Matrix 对象应用旋转转换。\n         * rotate() 方法将更改 Matrix 对象的 a、b、c 和 d 属性。\n         * @param angle 以弧度为单位的旋转角度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        rotate(angle: number): void;\n        /**\n         * Applies a scaling transformation to the matrix. The x axis is multiplied by sx, and the y axis it is multiplied by sy.\n         * The scale() method alters the a and d properties of the Matrix object.\n         * @param sx A multiplier used to scale the object along the x axis.\n         * @param sy A multiplier used to scale the object along the y axis.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 对矩阵应用缩放转换。x 轴乘以 sx，y 轴乘以 sy。\n         * scale() 方法将更改 Matrix 对象的 a 和 d 属性。\n         * @param sx 用于沿 x 轴缩放对象的乘数。\n         * @param sy 用于沿 y 轴缩放对象的乘数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        scale(sx: number, sy: number): void;\n        /**\n         * Sets the members of Matrix to the specified values\n         * @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image..\n         * @param tx The distance by which to translate each point along the x axis.\n         * @param ty The distance by which to translate each point along the y axis.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Matrix 的成员设置为指定值\n         * @param a 缩放或旋转图像时影响像素沿 x 轴定位的值。\n         * @param b 旋转或倾斜图像时影响像素沿 y 轴定位的值。\n         * @param c 旋转或倾斜图像时影响像素沿 x 轴定位的值。\n         * @param d 缩放或旋转图像时影响像素沿 y 轴定位的值。\n         * @param tx 沿 x 轴平移每个点的距离。\n         * @param ty 沿 y 轴平移每个点的距离。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setTo(a: number, b: number, c: number, d: number, tx: number, ty: number): Matrix;\n        /**\n         * Returns the result of applying the geometric transformation represented by the Matrix object to the specified point.\n         * @param pointX The x coordinate for which you want to get the result of the Matrix transformation.\n         * @param pointY The y coordinate for which you want to get the result of the Matrix transformation.\n         * @param resultPoint A reusable instance of Point for saving the results. Passing this parameter can reduce the\n         * number of reallocate objects, which allows you to get better code execution performance.\n         * @returns The point resulting from applying the Matrix transformation.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回将 Matrix 对象表示的几何转换应用于指定点所产生的结果。\n         * @param pointX 想要获得其矩阵转换结果的点的x坐标。\n         * @param pointY 想要获得其矩阵转换结果的点的y坐标。\n         * @param resultPoint 框架建议尽可能减少创建对象次数来优化性能，可以从外部传入一个复用的Point对象来存储结果，若不传入将创建一个新的Point对象返回。\n         * @returns 由应用矩阵转换所产生的点。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        transformPoint(pointX: number, pointY: number, resultPoint?: Point): Point;\n        /**\n         * Translates the matrix along the x and y axes, as specified by the dx and dy parameters.\n         * @param dx The amount of movement along the x axis to the right, in pixels.\n         * @param dy The amount of movement down along the y axis, in pixels.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 沿 x 和 y 轴平移矩阵，由 dx 和 dy 参数指定。\n         * @param dx 沿 x 轴向右移动的量（以像素为单位）。\n         * @param dy 沿 y 轴向下移动的量（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        translate(dx: number, dy: number): void;\n        /**\n         * Determines whether two matrixes are equal.\n         * @param other The matrix to be compared.\n         * @returns A value of true if the object is equal to this Matrix object; false if it is not equal.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否与另一个矩阵数据相等\n         * @param other 要比较的另一个矩阵对象。\n         * @returns 是否相等，ture表示相等。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        equals(other: Matrix): boolean;\n        /**\n         * prepend matrix\n         * @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image..\n         * @param tx The distance by which to translate each point along the x axis.\n         * @param ty The distance by which to translate each point along the y axis.\n         * @returns matrix\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 前置矩阵\n         * @param a 缩放或旋转图像时影响像素沿 x 轴定位的值\n         * @param b 缩放或旋转图像时影响像素沿 y 轴定位的值\n         * @param c 缩放或旋转图像时影响像素沿 x 轴定位的值\n         * @param d 缩放或旋转图像时影响像素沿 y 轴定位的值\n         * @param tx 沿 x 轴平移每个点的距离\n         * @param ty 沿 y 轴平移每个点的距离\n         * @returns 矩阵自身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        prepend(a: number, b: number, c: number, d: number, tx: number, ty: number): Matrix;\n        /**\n         * append matrix\n         * @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image..\n         * @param tx The distance by which to translate each point along the x axis.\n         * @param ty The distance by which to translate each point along the y axis.\n         * @returns matrix\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 后置矩阵\n         * @param a 缩放或旋转图像时影响像素沿 x 轴定位的值\n         * @param b 缩放或旋转图像时影响像素沿 y 轴定位的值\n         * @param c 缩放或旋转图像时影响像素沿 x 轴定位的值\n         * @param d 缩放或旋转图像时影响像素沿 y 轴定位的值\n         * @param tx 沿 x 轴平移每个点的距离\n         * @param ty 沿 y 轴平移每个点的距离\n         * @returns 矩阵自身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        append(a: number, b: number, c: number, d: number, tx: number, ty: number): Matrix;\n        /**\n         * Given a point in the pretransform coordinate space, returns the coordinates of that point after the transformation occurs.\n         * Unlike the standard transformation applied using the transformPoint() method, the deltaTransformPoint() method's transformation does not consider the translation parameters tx and ty.\n         * @param point The point for which you want to get the result of the matrix transformation.\n         * @returns The point resulting from applying the matrix transformation.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果给定预转换坐标空间中的点，则此方法返回发生转换后该点的坐标。\n         * 与使用 transformPoint() 方法应用的标准转换不同，deltaTransformPoint() 方法的转换不考虑转换参数 tx 和 ty。\n         * @param point 想要获得其矩阵转换结果的点\n         * @returns 由应用矩阵转换所产生的点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        deltaTransformPoint(point: Point): Point;\n        /**\n         * Returns a text value listing the properties of the Matrix object.\n         * @returns A string containing the values of the properties of the Matrix object: a, b, c, d, tx, and ty.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回将 Matrix 对象表示的几何转换应用于指定点所产生的结果。\n         * @returns 一个字符串，它包含 Matrix 对象的属性值：a、b、c、d、tx 和 ty。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        toString(): string;\n        /**\n         * Includes parameters for scaling, rotation, and translation. When applied to a matrix it sets the matrix's values based on those parameters.\n         * @param scaleX The factor by which to scale horizontally.\n         * @param scaleY The factor by which scale vertically.\n         * @param rotation The amount to rotate, in radians.\n         * @param tx The number of pixels to translate (move) to the right along the x axis.\n         * @param ty The number of pixels to translate (move) down along the y axis.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 包括用于缩放、旋转和转换的参数。当应用于矩阵时，该方法会基于这些参数设置矩阵的值。\n         * @param scaleX 水平缩放所用的系数\n         * @param scaleY 垂直缩放所用的系数\n         * @param rotation 旋转量（以弧度为单位）\n         * @param tx 沿 x 轴向右平移（移动）的像素数\n         * @param ty 沿 y 轴向下平移（移动）的像素数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        createBox(scaleX: number, scaleY: number, rotation?: number, tx?: number, ty?: number): void;\n        /**\n         * Creates the specific style of matrix expected by the beginGradientFill() and lineGradientStyle() methods of the Graphics class.\n         * Width and height are scaled to a scaleX/scaleY pair and the tx/ty values are offset by half the width and height.\n         * @param width The width of the gradient box.\n         * @param height The height of the gradient box.\n         * @param rotation The amount to rotate, in radians.\n         * @param tx The distance, in pixels, to translate to the right along the x axis. This value is offset by half of the width parameter.\n         * @param ty The distance, in pixels, to translate down along the y axis. This value is offset by half of the height parameter.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建 Graphics 类的 beginGradientFill() 和 lineGradientStyle() 方法所需的矩阵的特定样式。\n         * 宽度和高度被缩放为 scaleX/scaleY 对，而 tx/ty 值偏移了宽度和高度的一半。\n         * @param width 渐变框的宽度\n         * @param height 渐变框的高度\n         * @param rotation 旋转量（以弧度为单位）\n         * @param tx 沿 x 轴向右平移的距离（以像素为单位）。此值将偏移 width 参数的一半\n         * @param ty 沿 y 轴向下平移的距离（以像素为单位）。此值将偏移 height 参数的一半\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        createGradientBox(width: number, height: number, rotation?: number, tx?: number, ty?: number): void;\n        /**\n         * @private\n         */\n        $transformBounds(bounds: Rectangle): void;\n        /**\n         * @private\n         */\n        private getDeterminant();\n        /**\n         * @private\n         */\n        $getScaleX(): number;\n        /**\n         * @private\n         */\n        $getScaleY(): number;\n        /**\n         * @private\n         */\n        $getSkewX(): number;\n        /**\n         * @private\n         */\n        $getSkewY(): number;\n        /**\n         * @private\n         */\n        $updateScaleAndRotation(scaleX: number, scaleY: number, skewX: number, skewY: number): void;\n        /**\n         * @private\n         * target = other * this\n         */\n        $preMultiplyInto(other: Matrix, target: Matrix): void;\n    }\n    /**\n     * @private\n     * 仅供框架内复用，要防止暴露引用到外部。\n     */\n    let $TempMatrix: Matrix;\n}\ndeclare namespace egret {\n    /**\n     * A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its\n     * width and its height.<br/>\n     * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of\n     * one property has no effect on the others. However, the right and bottom properties are integrally related to those\n     * four properties. For example, if you change the value of the right property, the value of the width property changes;\n     * if you change the bottom property, the value of the height property changes.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Rectangle.ts\n     * @language en_US\n     */\n    /**\n     * Rectangle 对象是按其位置（由它左上角的点 (x, y) 确定）以及宽度和高度定义的区域。<br/>\n     * Rectangle 类的 x、y、width 和 height 属性相互独立；更改一个属性的值不会影响其他属性。\n     * 但是，right 和 bottom 属性与这四个属性是整体相关的。例如，如果更改 right 属性的值，则 width\n     * 属性的值将发生变化；如果更改 bottom 属性，则 height 属性的值将发生变化。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Rectangle.ts\n     * @language zh_CN\n     */\n    class Rectangle extends HashObject {\n        /**\n         * Releases a rectangle instance to the object pool.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放一个Rectangle实例到对象池\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static release(rect: Rectangle): void;\n        /**\n         * get a rectangle instance from the object pool or create a new one.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从对象池中取出或创建一个新的Rectangle对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static create(): Rectangle;\n        /**\n         * Creates a new Rectangle object with the top-left corner specified by the x and y parameters and with the specified\n         * width and height parameters.\n         * @param x The x coordinate of the top-left corner of the rectangle.\n         * @param y The y coordinate of the top-left corner of the rectangle.\n         * @param width The width of the rectangle, in pixels.\n         * @param height The height of the rectangle, in pixels.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个新 Rectangle 对象，其左上角由 x 和 y 参数指定，并具有指定的 width 和 height 参数。\n         * @param x 矩形左上角的 x 坐标。\n         * @param y 矩形左上角的 y 坐标。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(x?: number, y?: number, width?: number, height?: number);\n        /**\n         * The x coordinate of the top-left corner of the rectangle.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 矩形左上角的 x 坐标。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        x: number;\n        /**\n         * The y coordinate of the top-left corner of the rectangle.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 矩形左上角的 y 坐标。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        y: number;\n        /**\n         * The width of the rectangle, in pixels.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 矩形的宽度（以像素为单位）。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        width: number;\n        /**\n         * 矩形的高度（以像素为单位）。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * The height of the rectangle, in pixels.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        height: number;\n        /**\n         * The sum of the x and width properties.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * x 和 width 属性的和。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        right: number;\n        /**\n         * The sum of the y and height properties.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * y 和 height 属性的和。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        bottom: number;\n        /**\n         * The x coordinate of the top-left corner of the rectangle. Changing the left property of a Rectangle object has\n         * no effect on the y and height properties. However it does affect the width property, whereas changing the x value\n         * does not affect the width property.\n         * The value of the left property is equal to the value of the x property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 矩形左上角的 x 坐标。更改 Rectangle 对象的 left 属性对 y 和 height 属性没有影响。但是，它会影响 width 属性，而更改 x 值不会影响 width 属性。\n         * left 属性的值等于 x 属性的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        left: number;\n        /**\n         * The y coordinate of the top-left corner of the rectangle. Changing the top property of a Rectangle object has\n         * no effect on the x and width properties. However it does affect the height property, whereas changing the y\n         * value does not affect the height property.<br/>\n         * The value of the top property is equal to the value of the y property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 矩形左上角的 y 坐标。更改 Rectangle 对象的 top 属性对 x 和 width 属性没有影响。但是，它会影响 height 属性，而更改 y 值不会影响 height 属性。<br/>\n         * top 属性的值等于 y 属性的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        top: number;\n        /**\n         * The location of the Rectangle object's top-left corner, determined by the x and y coordinates of the point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 由该点的 x 和 y 坐标确定的 Rectangle 对象左上角的位置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        topLeft: Point;\n        /**\n         * The location of the Rectangle object's bottom-right corner, determined by the values of the right and bottom properties.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 由 right 和 bottom 属性的值确定的 Rectangle 对象的右下角的位置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        bottomRight: Point;\n        /**\n         * Copies all of rectangle data from the source Rectangle object into the calling Rectangle object.\n         * @param sourceRect The Rectangle object from which to copy the data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将源 Rectangle 对象中的所有矩形数据复制到调用方 Rectangle 对象中。\n         * @param sourceRect 要从中复制数据的 Rectangle 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        copyFrom(sourceRect: Rectangle): Rectangle;\n        /**\n         * Sets the members of Rectangle to the specified values\n         * @param x The x coordinate of the top-left corner of the rectangle.\n         * @param y The y coordinate of the top-left corner of the rectangle.\n         * @param width The width of the rectangle, in pixels.\n         * @param height The height of the rectangle, in pixels.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Rectangle 的成员设置为指定值\n         * @param x 矩形左上角的 x 坐标。\n         * @param y 矩形左上角的 y 坐标。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setTo(x: number, y: number, width: number, height: number): Rectangle;\n        /**\n         * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object.\n         * @param x The x coordinate (horizontal position) of the point.\n         * @param y The y coordinate (vertical position) of the point.\n         * @returns A value of true if the Rectangle object contains the specified point; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定由此 Rectangle 对象定义的矩形区域内是否包含指定的点。\n         * @param x 检测点的x轴\n         * @param y 检测点的y轴\n         * @returns 如果检测点位于矩形内，返回true，否则，返回false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        contains(x: number, y: number): boolean;\n        /**\n         * If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle object, returns\n         * the area of intersection as a Rectangle object. If the rectangles do not intersect, this method returns an empty\n         * Rectangle object with its properties set to 0.\n         * @param toIntersect The Rectangle object to compare against to see if it intersects with this Rectangle object.\n         * @returns A Rectangle object that equals the area of intersection. If the rectangles do not intersect, this method\n         * returns an empty Rectangle object; that is, a rectangle with its x, y, width, and height properties set to 0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果在 toIntersect 参数中指定的 Rectangle 对象与此 Rectangle 对象相交，则返回交集区域作为 Rectangle 对象。如果矩形不相交，\n         * 则此方法返回一个空的 Rectangle 对象，其属性设置为 0。\n         * @param toIntersect 要对照比较以查看其是否与此 Rectangle 对象相交的 Rectangle 对象。\n         * @returns 等于交集区域的 Rectangle 对象。如果该矩形不相交，则此方法返回一个空的 Rectangle 对象；即，其 x、y、width 和\n         * height 属性均设置为 0 的矩形。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        intersection(toIntersect: Rectangle): Rectangle;\n        /**\n         * Increases the size of the Rectangle object by the specified amounts, in pixels.\n         * The center point of the Rectangle object stays the same, and its size increases to the left and right by the dx value, and to the top and the bottom by the dy value.\n         * @param dx The value to be added to the left and the right of the Rectangle object.\n         * @param dy The value to be added to the top and the bottom of the Rectangle.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 按指定量增加 Rectangle 对象的大小（以像素为单位）\n         * 保持 Rectangle 对象的中心点不变，使用 dx 值横向增加它的大小，使用 dy 值纵向增加它的大小。\n         * @param dx Rectangle 对象横向增加的值。\n         * @param dy Rectangle 对象纵向增加的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        inflate(dx: number, dy: number): void;\n        /**\n         * @private\n         */\n        $intersectInPlace(clipRect: Rectangle): Rectangle;\n        /**\n         * Determines whether the object specified in the toIntersect parameter intersects with this Rectangle object.\n         * This method checks the x, y, width, and height properties of the specified Rectangle object to see if it\n         * intersects with this Rectangle object.\n         * @param toIntersect The Rectangle object to compare against this Rectangle object.\n         * @returns A value of true if the specified object intersects with this Rectangle object; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定在 toIntersect 参数中指定的对象是否与此 Rectangle 对象相交。此方法检查指定的 Rectangle\n         * 对象的 x、y、width 和 height 属性，以查看它是否与此 Rectangle 对象相交。\n         * @param toIntersect 要与此 Rectangle 对象比较的 Rectangle 对象。\n         * @returns 如果两个矩形相交，返回true，否则返回false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        intersects(toIntersect: Rectangle): boolean;\n        /**\n         * Determines whether or not this Rectangle object is empty.\n         * @returns A value of true if the Rectangle object's width or height is less than or equal to 0; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定此 Rectangle 对象是否为空。\n         * @returns 如果 Rectangle 对象的宽度或高度小于等于 0，则返回 true 值，否则返回 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        isEmpty(): boolean;\n        /**\n         * Sets all of the Rectangle object's properties to 0. A Rectangle object is empty if its width or height is less than or equal to 0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Rectangle 对象的所有属性设置为 0。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setEmpty(): void;\n        /**\n         * Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object.\n         * @returns A new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回一个新的 Rectangle 对象，其 x、y、width 和 height 属性的值与原始 Rectangle 对象的对应值相同。\n         * @returns 新的 Rectangle 对象，其 x、y、width 和 height 属性的值与原始 Rectangle 对象的对应值相同。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        clone(): Rectangle;\n        /**\n         * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object.\n         * This method is similar to the Rectangle.contains() method, except that it takes a Point object as a parameter.\n         * @param point The point, as represented by its x and y coordinates.\n         * @returns A value of true if the Rectangle object contains the specified point; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定由此 Rectangle 对象定义的矩形区域内是否包含指定的点。\n         * 此方法与 Rectangle.contains() 方法类似，只不过它采用 Point 对象作为参数。\n         * @param point 包含点对象\n         * @returns 如果包含，返回true，否则返回false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        containsPoint(point: Point): boolean;\n        /**\n         * Determines whether the Rectangle object specified by the rect parameter is contained within this Rectangle object.\n         * A Rectangle object is said to contain another if the second Rectangle object falls entirely within the boundaries of the first.\n         * @param rect The Rectangle object being checked.\n         * @returns A value of true if the Rectangle object that you specify is contained by this Rectangle object; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定此 Rectangle 对象内是否包含由 rect 参数指定的 Rectangle 对象。\n         * 如果一个 Rectangle 对象完全在另一个 Rectangle 的边界内，我们说第二个 Rectangle 包含第一个 Rectangle。\n         * @param rect 所检查的 Rectangle 对象\n         * @returns 如果此 Rectangle 对象包含您指定的 Rectangle 对象，则返回 true 值，否则返回 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        containsRect(rect: egret.Rectangle): boolean;\n        /**\n         * Determines whether the object specified in the toCompare parameter is equal to this Rectangle object.\n         * This method compares the x, y, width, and height properties of an object against the same properties of this Rectangle object.\n         * @param The rectangle to compare to this Rectangle object.\n         * @returns A value of true if the object has exactly the same values for the x, y, width, and height properties as this Rectangle object; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定在 toCompare 参数中指定的对象是否等于此 Rectangle 对象。\n         * 此方法将某个对象的 x、y、width 和 height 属性与此 Rectangle 对象所对应的相同属性进行比较。\n         * @param toCompare 要与此 Rectangle 对象进行比较的矩形。\n         * @returns 如果对象具有与此 Rectangle 对象完全相同的 x、y、width 和 height 属性值，则返回 true 值，否则返回 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        equals(toCompare: Rectangle): boolean;\n        /**\n         * Increases the size of the Rectangle object. This method is similar to the Rectangle.inflate() method except it takes a Point object as a parameter.\n         * @param point 此 Point 对象的 x 属性用于增加 Rectangle 对象的水平尺寸。y 属性用于增加 Rectangle 对象的垂直尺寸。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 增加 Rectangle 对象的大小。此方法与 Rectangle.inflate() 方法类似，只不过它采用 Point 对象作为参数。\n         * @param point The x property of this Point object is used to increase the horizontal dimension of the Rectangle object. The y property is used to increase the vertical dimension of the Rectangle object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        inflatePoint(point: Point): void;\n        /**\n         * Adjusts the location of the Rectangle object, as determined by its top-left corner, by the specified amounts.\n         * @param dx Moves the x value of the Rectangle object by this amount.\n         * @param dy Moves the y value of the Rectangle object by this amount.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 按指定量调整 Rectangle 对象的位置（由其左上角确定）。\n         * @param dx 将 Rectangle 对象的 x 值移动此数量。\n         * @param dy 将 Rectangle 对象的 t 值移动此数量。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        offset(dx: number, dy: number): void;\n        /**\n         * Adjusts the location of the Rectangle object using a Point object as a parameter. This method is similar to the Rectangle.offset() method, except that it takes a Point object as a parameter.\n         * @param point A Point object to use to offset this Rectangle object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Point 对象用作参数来调整 Rectangle 对象的位置。此方法与 Rectangle.offset() 方法类似，只不过它采用 Point 对象作为参数。\n         * @param point 要用于偏移此 Rectangle 对象的 Point 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        offsetPoint(point: Point): void;\n        /**\n         * Builds and returns a string that lists the horizontal and vertical positions and the width and height of the Rectangle object.\n         * @returns A string listing the value of each of the following properties of the Rectangle object: x, y, width, and height.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 生成并返回一个字符串，该字符串列出 Rectangle 对象的水平位置和垂直位置以及高度和宽度。\n         * @returns 一个字符串，它列出了 Rectangle 对象的下列各个属性的值：x、y、width 和 height。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        toString(): string;\n        /**\n         * Adds two rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two rectangles.\n         * @param toUnion A Rectangle object to add to this Rectangle object.\n         * @returns A new Rectangle object that is the union of the two rectangles.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 通过填充两个矩形之间的水平和垂直空间，将这两个矩形组合在一起以创建一个新的 Rectangle 对象。\n         * @param toUnion 要添加到此 Rectangle 对象的 Rectangle 对象。\n         * @returns 充当两个矩形的联合的新 Rectangle 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        union(toUnion: Rectangle): Rectangle;\n        /**\n         * @private\n         */\n        $getBaseWidth(angle: number): number;\n        /**\n         * @private\n         */\n        $getBaseHeight(angle: number): number;\n    }\n    /**\n     * @private\n     * 仅供框架内复用，要防止暴露引用到外部。\n     */\n    let $TempRectangle: Rectangle;\n}\ndeclare namespace egret {\n}\ndeclare namespace egret {\n    /**\n     * The JointStyle class is an enumeration of constant values that specify the joint style to use in drawing lines.\n     * These constants are provided for use as values in the joints parameter of the egret.Graphics.lineStyle() method.\n     * @see egret.Graphics#lineStyle()\n     * @version Egret 2.5\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * JointStyle 类是指定要在绘制线条中使用的联接点样式的常量值枚举。提供的这些常量用作 egret.Graphics.lineStyle() 方法的 joints 参数中的值。\n     * @see egret.Graphics#lineStyle()\n     * @version Egret 2.5\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    const JointStyle: {\n        BEVEL: string;\n        MITER: string;\n        ROUND: string;\n    };\n}\ndeclare namespace egret {\n}\n/**\n * @version Egret 2.4\n * @platform Web,Native\n * @includeExample egret/localStorage/localStorage.ts\n */\ndeclare namespace egret.localStorage {\n    /**\n     * Read data\n     * @param key {string} Name of the key to be read\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 读取数据\n     * @param key {string} 要读取的键名称\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let getItem: (key: string) => string;\n    /**\n     * Save data\n     * @param key {string} Name of the key to be saved\n     * @param value {string} Value to be saved\n     * @returns {boolean} Whether data is saved successfully\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 保存数据\n     * @param key {string} 要保存的键名称\n     * @param value {string} 要保存的值\n     * @returns {boolean} 数据保存是否成功\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let setItem: (key: string, value: string) => boolean;\n    /**\n     * Delete data\n     * @param key {string} Name of the key to be deleted\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 删除数据\n     * @param key {string} 要删除的键名称\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let removeItem: (key: string) => void;\n    /**\n     * Clear all data\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 将所有数据清空\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let clear: () => void;\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * @param channel\n     */\n    function $pushSoundChannel(channel: SoundChannel): void;\n    /**\n     * @private\n     * @param channel\n     */\n    function $popSoundChannel(channel: SoundChannel): boolean;\n}\ndeclare namespace egret {\n    /**\n     * The Sound class lets you work with sound in an application.\n     * The Sound class lets you create a Sound object, load and play an external audio file into that object.\n     * More detailed control of the sound is performed through the SoundChannel\n     *\n     * @event egret.Event.COMPLETE Dispatch when the audio resource is loaded and ready to play\n     * @event egret.IOErrorEvent.IO_ERROR Dispatch when the audio resource is failed to load\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/media/Sound.ts\n     * @language en_US\n     */\n    /**\n     * Sound 允许您在应用程序中使用声音。使用 Sound 类可以创建 Sound 对象、将外部音频文件加载到该对象并播放该文件。\n     * 可通过 SoundChannel 对声音执行更精细的控制，如控制音量和监控播放进度。\n     * @see http://edn.egret.com/cn/docs/page/156 音频系统\n     *\n     * @event egret.Event.COMPLETE 音频加载完成时抛出\n     * @event egret.IOErrorEvent.IO_ERROR 音频加载失败时抛出\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/media/Sound.ts\n     * @language zh_CN\n     */\n    interface Sound extends EventDispatcher {\n        /**\n         * Initiates loading of an external audio file from the specified URL.\n         * @param url Audio file URL\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 启动从指定 URL 加载外部音频文件的过程。\n         * @param url 需要加载的音频文件URL\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        load(url: string): void;\n        /**\n         * Generates a new SoundChannel object to play back the sound.\n         * @param startTime The initial position in seconds at which playback should start, (default = 0)\n         * @param loops Plays, the default value is 0. Greater than 0 to the number of plays, such as 1 to play 1, less than or equal to 0, to loop.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 生成一个新的 SoundChannel 对象来播放该声音。此方法返回 SoundChannel 对象，访问该对象可停止声音调整音量。\n         * @param startTime 应开始播放的初始位置（以秒为单位），默认值是 0\n         * @param loops 播放次数，默认值是 0，循环播放。 大于 0 为播放次数，如 1 为播放 1 次；小于等于 0，为循环播放。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        play(startTime?: number, loops?: number): SoundChannel;\n        /**\n         * Closes the stream, causing any download of data to cease\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 关闭该流，从而停止所有数据的下载。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        close(): void;\n        /**\n         * Type, default is egret.Sound.EFFECT.\n         * In the native and runtime environment, while only play a background music, sound length so as not to be too long.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 类型，默认为 egret.Sound.EFFECT。\n         * 在 native 和 runtime 环境下，背景音乐同时只能播放一个，音效长度尽量不要太长。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        type: string;\n        /**\n         * Length of the current sound (in seconds).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language en_US\n         */\n        /**\n         * 当前声音的长度（以秒为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language zh_CN\n         */\n        length: number;\n    }\n    /**\n     * @copy egret.Sound\n     */\n    let Sound: {\n        /**\n         * Create Sound object, load an external audio file and play\n         * @param url Audio file URL, Sound will start to load the media if url is not empty\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建 Sound 对象、将外部音频文件加载到该对象并播放该文件\n         * @param url 需要加载的音频文件URL,如果指定了 url, Sound会立即开始加载指定的媒体文件\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        new (): Sound;\n        /**\n         * Background music\n         * @default \"music\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 背景音乐\n         * @default \"music\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        MUSIC: string;\n        /**\n         * EFFECT\n         * @default \"effect\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 音效\n         * @default \"effect\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        EFFECT: string;\n    };\n}\ndeclare namespace egret {\n    /**\n     * The SoundChannel class controls a sound in an application.\n     * Every sound is assigned to a sound channel, and the application\n     * can have multiple sound channels that are mixed together.\n     * The SoundChannel class contains a stop() method, properties for\n     * set the volume of the channel\n     *\n     * @event egret.Event.SOUND_COMPLETE Dispatch when a sound has finished playing at last time\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/media/Sound.ts\n     * @language en_US\n     */\n    /**\n     * SoundChannel 类控制应用程序中的声音。每个声音均分配给一个声道，而且应用程序可以具有混合在一起的多个声道。\n     * SoundChannel 类包含 stop() 方法、用于设置音量和监视播放进度的属性。\n     *\n     * @event egret.Event.SOUND_COMPLETE 音频最后一次播放完成时抛出\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/media/Sound.ts\n    * @language zh_CN\n    */\n    interface SoundChannel extends IEventDispatcher {\n        /**\n         * The volume, ranging from 0 (silent) to 1 (full volume).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 音量范围从 0（静音）至 1（最大音量）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        volume: number;\n        /**\n         *  When the sound is playing, the position property indicates\n         * in seconds the current point that is being played in the sound file.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language en_US\n         */\n        /**\n         * 当播放声音时，position 属性表示声音文件中当前播放的位置（以秒为单位）\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language zh_CN\n         */\n        position: number;\n        /**\n         * Stops the sound playing in the channel.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 停止在该声道中播放声音。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        stop(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The Video class lets you work with video in an application.\n     * The Video class lets you create a Video object, load and play an external video file into that object.\n     * Note: On most mobile device, the video is playback in the full screen mode.<br/>\n     *\n     * @param url URL of the media to play, Video will start to load if the url is not empty\n     *\n     * @event egret.Event.COMPLETE Dispatch when the video resource is loaded and ready to play\n     * @event egret.Event.ENDED Dispatch when the video playback ended\n     * @event egret.IOErrorEvent.IO_ERROR when the video is failed to load\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/media/Video.ts\n     * @language en_US\n     */\n    /**\n     * Video 允许您在应用程序中使用视频。使用 Video 类可以创建 Video 对象、将外部视频文件加载到该对象并播放该文件。<br/>\n     * 注意: 在大多数移动设备中，视频是强制全屏播放的，所以你可以直接调用 play() 方法全屏播放视频，不用将它绘制在Stage中。\n     * @see http://edn.egret.com/cn/docs/page/657 视频系统\n     *\n     * @param url 要播放的视频的URL，如果url不为空，Video会立即加载这个视频\n     *\n     * @event egret.Event.COMPLETE 视频加载完成时抛出\n     * @event egret.Event.ENDED 视频播放完成时抛出\n     * @event egret.IOErrorEvent.IO_ERROR 视频加载失败时触发\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/media/Video.ts\n     * @language zh_CN\n     */\n    interface Video extends DisplayObject {\n        /**\n         * Initiates loading of an external video file from the specified URL.\n         * @param url Audio file URL\n         * * @param cache Should cache the video，only  used in Native\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 启动从指定 URL 加载外部视频文件的过程。\n         * @param url 需要加载的视频文件URL\n         * @param cache 是否需要缓存到本地，只在 Native 上使用\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        load(url: string, cache?: boolean): void;\n        /**\n         * Play back the video.\n         * @param startTime The initial position in seconds at which playback should start, (default = 0)\n         * @param loop Defines should play the video again when the video is ended. (default = false)\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 播放该视频\n         * @param startTime 应开始播放的初始位置（以秒为单位），默认值是视频上次结束的位置\n         * @param loop 是否需要循环播放，默认值是 false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        play(startTime?: number, loop?: boolean): any;\n        /**\n         * Closes the stream, causing any download of data to cease\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 关闭该流，从而停止所有数据的下载。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        close(): void;\n        /**\n         * The URL of the video you want to play.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 想要播放的视频的URL\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        src: string;\n        /**\n         * The URL of an image you want to display before the video is loaded or video cannot been draw on the canvas on some mobile device.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 视频加载前，或者在不支持将 video 画在 canvas 的设备上，想要显示的视频截图地址。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        poster: string;\n        /**\n         * Should play the video in fullscreen mode (default = true).\n         * Currently only supports full-screen mobile terminal web.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否全屏播放这个视频（默认值是 true）。\n         * 目前移动端 web 只支持全屏。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        fullscreen: boolean;\n        /**\n         * The volume, ranging from 0 (silent) to 1 (full volume).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 音量范围从 0（静音）至 1（最大音量）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        volume: number;\n        /**\n         * When the video is playing, the position property indicates\n         * in seconds the current point that is being played in the video file.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当播放视频时，position 属性表示视频文件中当前播放的位置（以秒为单位）\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        position: number;\n        /**\n         * Pause the video playing.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 暂停播放。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        pause(): void;\n        /**\n         * Get bitmapData of the video file, you can use the video as bitmapData on the stage.\n         * Note: On most mobile device, the video is playback in the full screen mode.\n         * So you can just use the play() method instead of draw it on the Stage\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         *  获取视频的 bitmapData, 你可以将视频绘制到舞台上。\n         * 注意： 在大多数移动设备中，视频是全屏播放的，所以你可以直接调用 play() 方法全屏播放视频，不用将它绘制在Stage中。\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        bitmapData?: BitmapData;\n        /**\n         * Whether current video is paused.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language en_US\n         */\n        /**\n         * 当前视频是否在暂停状态。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language zh_CN\n         */\n        paused: boolean;\n        /**\n         * Length of the current video (in seconds).\n         * @version Egret 3.0.8\n         * @platform Web,Native\n         * @readOnly\n         * @language en_US\n         */\n        /**\n         * 当前视频的长度（以秒为单位）。\n         * @version Egret 3.0.8\n         * @platform Web,Native\n         * @readOnly\n         * @language zh_CN\n         */\n        length: number;\n    }\n    /**\n     * @copy egret.Video\n     */\n    let Video: {\n        new (url?: string, cache?: boolean): Video;\n    };\n}\ndeclare namespace egret {\n    /**\n     * The HttpMethod class provides values that specify whether the HttpRequest object should use the POST method\n     * or the GET method when sending data to a server.\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * HttpRequestMethod 类提供了一些值，这些值可指定在将数据发送到服务器时，\n     * HttpRequest 对象应使用 POST 方法还是 GET 方法。\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    namespace HttpMethod {\n        /**\n         * Specifies that the HttpRequest object is a GET.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 HttpRequest 对象是一个 GET。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const GET = \"GET\";\n        /**\n         * Specifies that the HttpRequest object is a POST.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 HttpRequest 对象是一个 POST。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const POST = \"POST\";\n    }\n}\ndeclare namespace egret {\n    /**\n     * The HttpRequest class downloads data from a URL as text or binary data. It is useful for downloading text files,\n     * XML, or other information to be used in a dynamic, data-driven application. A HttpRequest object downloads all\n     * of the data from a URL before making it available to code in the applications. It sends out notifications about\n     * the progress of the download, which you can monitor through the bytesLoaded and bytesTotal properties,\n     * as well as through dispatched events.\n     * @event egret.Event.COMPLETE Dispatched when the net request is complete.\n     * @event egret.Event.IO_ERROR Dispatched when the net request is failed.\n     * @event egret.ProgressEvent.PROGRESS Dispatched when data is received as the download operation progresses.\n     * @see egret.HttpMethod\n     * @see egret.HttpResponseType\n     * @includeExample egret/net/HttpRequestExample.ts\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * HttpRequest 类以文本或二进制数据的形式从 URL 下载数据。\n     * HttpRequest 对象会先从 URL 中下载所有数据，然后才将数据用于应用程序中的代码。它会发出有关下载进度的通知，\n     * 通过 bytesLoaded 和 bytesTotal 属性以及已调度的事件，可以监视下载进度。\n     * @event egret.Event.COMPLETE 加载完成\n     * @event egret.Event.IO_ERROR 加载失败\n     * @event egret.ProgressEvent.PROGRESS 加载进度，可通过event.bytesLoaded和event.bytesTotal统计进度信息。\n     * @see egret.HttpMethod\n     * @see egret.HttpResponseType\n     * @includeExample egret/net/HttpRequestExample.ts\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface HttpRequest extends EventDispatcher {\n        /**\n         * The data received from the load operation.  The format of the data depends on the setting of the responseType property.\n         * @readOnly\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 本次请求返回的数据，数据类型根据 responseType 设置的值确定。\n         * @readOnly\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        response: any;\n        /**\n         * Controls whether the downloaded data is received as text (HttpResponseType.TEXT) or raw binary data (HttpResponseType.ArrayBuffer)<br/>\n         * Note:If you attempt to set this property to an invalid value, Egret runtime set the value to HttpResponseType.TEXT.\n         * @default egret.HttpResponseType.TEXT\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置返回的数据格式为文本（HttpResponseType.TEXT）还是二进制数据（HttpResponseType.ArrayBuffer）<br/>\n         * 注意：若尝试设置此属性为一个非法的值，运行时将使用HttpResponseType.TEXT。\n         * @default egret.HttpResponseType.TEXT\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        responseType: string;\n        /**\n         * Can be set to a time in milliseconds.When set to a non-zero value will cause fetching to terminate after the given time has passed.\n         * @default egret.HttpResponseType.TEXT\n         * @version Egret 5.2.15\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 代表着一个请求在被自动终止前所消耗的毫秒数。默认值为 0，意味着没有超时。\n         * @default egret.HttpResponseType.TEXT\n         * @version Egret 5.2.15\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        timeout: number;\n        /**\n         * indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies\n         * or authorization headers. (This never affects same-site requests.)\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表明在进行跨站(cross-site)的访问控制(Access-Control)请求时，是否使用认证信息(例如cookie或授权的header)。(这个标志不会影响同站的请求)\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        withCredentials: boolean;\n        /**\n         * Initializes a request.<br/>\n         * Note: Calling this method for an already active request (one for which open() or openRequest() has already been\n         * called) is the equivalent of calling abort().\n         * @param url The URL to send the request to.\n         * @param method The HTTP method to use, please use the const value in the HttpMethod class.\n         * @see egret.HttpMethod\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 初始化一个请求.<br/>\n         * 注意: 若在已经发出请求的对象上调用此方法，相当于立即调用abort().\n         * @param url 该请求所要访问的URL该请求所要访问的URL\n         * @param method 请求所使用的HTTP方法， 请使用 HttpMethod 定义的枚举值.\n         * @see egret.HttpMethod\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        open(url: string, method?: string): void;\n        /**\n         * Sends the request.\n         * @param data the data to send.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 发送请求.\n         * @param data 需要发送的数据\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        send(data?: any): void;\n        /**\n         * Aborts the request if it has already been sent.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果请求已经被发送,则立刻中止请求.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        abort(): void;\n        /**\n         * Returns all the response headers as a string, or null if no response has been received.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回所有响应头信息(响应头名和值), 如果响应头还没接受,则返回\"\".\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getAllResponseHeaders(): string;\n        /**\n         * Sets the value of an HTTP request header. You must call setRequestHeader() after open().\n         * @param header The name of the header whose value is to be set.\n         * @param value The value to set as the body of the header.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 给指定的HTTP请求头赋值.在这之前,您必须确认已经调用 open() 方法打开了一个url.\n         * @param header 将要被赋值的请求头名称.\n         * @param value 给指定的请求头赋的值.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setRequestHeader(header: string, value: string): void;\n        /**\n         * Returns the string containing the text of the specified header, or null if either the response has not yet been\n         * received or the header doesn't exist in the response.\n         * @param header The name of the header whose value is to be get.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回指定的响应头的值, 如果响应头还没被接受,或该响应头不存在,则返回\"\".\n         * @param header 要返回的响应头名称\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getResponseHeader(header: string): string;\n    }\n    /**\n     * Creates a HttpRequest object.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 创建一个 HttpRequest 实例。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let HttpRequest: {\n        new (): HttpRequest;\n    };\n}\ndeclare namespace egret {\n    /**\n     * The HttpResponseType class provides values that specify how downloaded data is received.\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * URLLoaderDataFormat 类提供了一些用于指定如何接收已下载数据的值。\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class HttpResponseType {\n        /**\n         * Specifies that downloaded data is received as text. This is the default value of HttpRequest.responseType\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回字符串。HttpRequest.responseType属性的默认值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TEXT: string;\n        /**\n         * Specifies that downloaded data is received as raw binary data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回二进制的ArrayBuffer对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ARRAY_BUFFER: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The Loader class is used to load image (JPG, PNG, or GIF) files. Use the load() method to initiate loading.\n     * The loaded image data is in the data property of ImageLoader.\n     * @event egret.Event.COMPLETE Dispatched when the net request is complete.\n     * @event egret.IOErrorEvent.IO_ERROR Dispatched when the net request is failed.\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/net/ImageLoaderExample.ts\n     * @see http://edn.egret.com/cn/docs/page/590 加载位图文件\n     * @language en_US\n     */\n    /**\n     * ImageLoader 类可用于加载图像（JPG、PNG 或 GIF）文件。使用 load() 方法来启动加载。被加载的图像对象数据将存储在 ImageLoader.data 属性上 。\n     * @event egret.Event.COMPLETE 加载完成\n     * @event egret.IOErrorEvent.IO_ERROR 加载失败\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/net/ImageLoaderExample.ts\n     * @see http://edn.egret.com/cn/docs/page/590 加载位图文件\n     * @language zh_CN\n     */\n    interface ImageLoader extends EventDispatcher {\n        /**\n         * The data received from the load operation.\n         * @default null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用 load() 方法加载成功的 BitmapData 图像数据。\n         * @default null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        data: BitmapData;\n        /**\n         * Specifies whether or not cross-site Access-Control requests should be made when loading a image from foreign origins.<br/>\n         * possible values are:\"anonymous\",\"use-credentials\" or null.\n         * @default null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当从其他站点加载一个图片时，指定是否启用跨域资源共享(CORS)，默认值为null。<br/>\n         * 可以设置为\"anonymous\",\"use-credentials\"或null,设置为其他值将等同于\"anonymous\"。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        crossOrigin: string;\n        /**\n         * start a load operation。<br/>\n         * Note: Calling this method for an already active request (one for which load() has already been\n         * called) will abort the last load operation immediately.\n         * @param url 要加载的图像文件的地址。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 启动一次图像加载。<br/>\n         * 注意：若之前已经调用过加载请求，重新调用 load() 将终止先前的请求，并开始新的加载。\n         * @param url 要加载的图像文件的地址。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        load(url: string): void;\n    }\n    /**\n     * Creates a ImageLoader object\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 创建一个 ImageLoader 实例\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let ImageLoader: {\n        /**\n         * constructor\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 构造函数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        new (): ImageLoader;\n        /**\n         * Specifies whether to enable cross-origin resource sharing, If ImageLoader instance has been set crossOrigin property will be used to set the property.\n         * @version Egret 2.5.7\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定是否启用跨域资源共享,如果ImageLoader实例有设置过crossOrigin属性将使用设置的属性\n         * @version Egret 2.5.7\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        crossOrigin: string;\n    };\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 显示列表\n     */\n    class DisplayList extends HashObject {\n        /**\n         * 创建一个DisplayList对象，若内存不足或无法创建RenderBuffer，将会返回null。\n         */\n        static create(target: DisplayObject): DisplayList;\n        /**\n         * @private\n         * 创建一个DisplayList对象\n         */\n        constructor(root: DisplayObject);\n        private isStage;\n        /**\n         * 位图渲染节点\n         */\n        $renderNode: RenderNode;\n        /**\n         * @private\n         * 获取渲染节点\n         */\n        $getRenderNode(): sys.RenderNode;\n        /**\n         * @private\n         */\n        renderBuffer: RenderBuffer;\n        /**\n         * @private\n         */\n        offsetX: number;\n        /**\n         * @private\n         */\n        offsetY: number;\n        /**\n         * @private\n         */\n        private offsetMatrix;\n        /**\n         * @private\n         * 显示列表根节点\n         */\n        root: DisplayObject;\n        /**\n         * @private\n         * 设置剪裁边界，不再绘制完整目标对象，画布尺寸由外部决定，超过边界的节点将跳过绘制。\n         */\n        setClipRect(width: number, height: number): void;\n        $canvasScaleX: number;\n        $canvasScaleY: number;\n        /**\n         * @private\n         * 绘制根节点显示对象到目标画布，返回draw的次数。\n         */\n        drawToSurface(): number;\n        private bitmapData;\n        /**\n         * @private\n         * 改变画布的尺寸，由于画布尺寸修改会清空原始画布。所以这里将原始画布绘制到一个新画布上，再与原始画布交换。\n         */\n        changeSurfaceSize(): void;\n        static $canvasScaleFactor: number;\n        /**\n         * @private\n         */\n        static $canvasScaleX: number;\n        static $canvasScaleY: number;\n        /**\n         * @private\n         */\n        static $setCanvasScale(x: number, y: number): void;\n    }\n}\ndeclare namespace egret {\n    type runEgretOptions = {\n        renderMode?: string;\n        audioType?: number;\n        screenAdapter?: sys.IScreenAdapter;\n        antialias?: boolean;\n        canvasScaleFactor?: number;\n        calculateCanvasScaleFactor?: (context: CanvasRenderingContext2D) => number;\n        /**\n         * 以下目前仅供小游戏使用\n         * The following are for mini-games only\n         */\n        entryClassName?: string;\n        scaleMode?: string;\n        frameRate?: number;\n        contentWidth?: number;\n        contentHeight?: number;\n        orientation?: string;\n        maxTouches?: number;\n        showFPS?: boolean;\n        showLog?: boolean;\n        fpsStyles?: string;\n    };\n    /**\n     * egret project entry function\n     * @param options An object containing the initialization properties for egret engine.\n     * @language en_US\n     */\n    /**\n     * egret工程入口函数\n     * @param options 一个可选对象，包含初始化Egret引擎需要的参数。\n     * @language zh_CN\n     */\n    function runEgret(options?: runEgretOptions): void;\n    /**\n     * Refresh the screen display\n     * @language en_US\n     */\n    /**\n     * 刷新屏幕显示\n     * @language zh_CN\n     */\n    function updateAllScreens(): void;\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    interface FPSDisplay {\n        /**\n         * 更新FPS信息\n         */\n        update(datas: FPSData): void;\n        /**\n         * 插入一条log信息\n         */\n        updateInfo(info: string): void;\n        /**\n         * 插入一条warn信息\n         */\n        updateWarn(info: string): void;\n        /**\n         * 插入一条error信息\n         */\n        updateError(info: string): void;\n    }\n    /**\n     * @private\n     */\n    let FPSDisplay: {\n        new (stage: Stage, showFPS: boolean, showLog: boolean, logFilter: string, styles: Object): FPSDisplay;\n    };\n}\n/**\n * @private\n */\ninterface FPSData extends Object {\n    fps: number;\n    draw: number;\n    costTicker: number;\n    costRender: number;\n}\ndeclare namespace egret.sys {\n    let $TempStage: egret.Stage;\n    /**\n     * @private\n     * Egret播放器\n     */\n    class Player extends HashObject {\n        /**\n         * @private\n         * 实例化一个播放器对象。\n         */\n        constructor(buffer: RenderBuffer, stage: Stage, entryClassName: string);\n        /**\n         * @private\n         */\n        private createDisplayList(stage, buffer);\n        /**\n         * @private\n         */\n        private screenDisplayList;\n        /**\n         * @private\n         * 入口类的完整类名\n         */\n        private entryClassName;\n        /**\n         * @private\n         * 舞台引用\n         */\n        stage: Stage;\n        /**\n         * @private\n         * 入口类实例\n         */\n        private root;\n        /**\n         * @private\n         */\n        private isPlaying;\n        /**\n         * @private\n         * 启动播放器\n         */\n        start(): void;\n        /**\n         * @private\n         */\n        private initialize();\n        /**\n         * @private\n         * 停止播放器，停止后将不能重新启动。\n         */\n        stop(): void;\n        /**\n         * @private\n         * 暂停播放器，后续可以通过调用start()重新启动播放器。\n         */\n        pause(): void;\n        /**\n         * @private\n         * 渲染屏幕\n         */\n        $render(triggerByFrame: boolean, costTicker: number): void;\n        /**\n         * @private\n         * 更新舞台尺寸\n         * @param stageWidth 舞台宽度（以像素为单位）\n         * @param stageHeight 舞台高度（以像素为单位）\n         */\n        updateStageSize(stageWidth: number, stageHeight: number): void;\n        /**\n         * @private\n         * 显示FPS。\n         */\n        displayFPS(showFPS: boolean, showLog: boolean, logFilter: string, styles: Object): void;\n        /**\n         * @private\n         */\n        private showFPS;\n        /**\n         * @private\n         */\n        private showLog;\n        /**\n         * @private\n         */\n        private stageDisplayList;\n    }\n    /**\n     * @private\n     */\n    let $logToFPS: (info: string) => void;\n    /**\n     * @private\n     */\n    let $warnToFPS: (info: string) => void;\n    /**\n     * @private\n     */\n    let $errorToFPS: (info: string) => void;\n}\n/**\n * @private\n */\ndeclare module egret {\n    /**\n     * @private\n     */\n    var nativeRender: boolean;\n}\ndeclare namespace egret {\n    /** !!!!!!!!inspired by Babylon.js!!!!!!!!!!!!!\n     * for description see https://www.khronos.org/opengles/sdk/tools/KTX/\n     * for file layout see https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/\n     * Current families are astc, dxt, pvrtc, etc2, & etc1.\n     * @returns The extension selected.\n     */\n    class KTXContainer {\n        /** contents of the KTX container file */ arrayBuffer: any;\n        private static readonly HEADER_LEN;\n        private static readonly COMPRESSED_2D;\n        private static readonly COMPRESSED_3D;\n        private static readonly TEX_2D;\n        private static readonly TEX_3D;\n        /**\n         * Gets the openGL type\n         */\n        glType: number;\n        /**\n         * Gets the openGL type size\n         */\n        glTypeSize: number;\n        /**\n         * Gets the openGL format\n         */\n        glFormat: number;\n        /**\n         * Gets the openGL internal format\n         */\n        glInternalFormat: number;\n        /**\n         * Gets the base internal format\n         */\n        glBaseInternalFormat: number;\n        /**\n         * Gets image width in pixel\n         */\n        pixelWidth: number;\n        /**\n         * Gets image height in pixel\n         */\n        pixelHeight: number;\n        /**\n         * Gets image depth in pixels\n         */\n        pixelDepth: number;\n        /**\n         * Gets the number of array elements\n         */\n        numberOfArrayElements: number;\n        /**\n         * Gets the number of faces\n         */\n        numberOfFaces: number;\n        /**\n         * Gets the number of mipmap levels\n         */\n        numberOfMipmapLevels: number;\n        /**\n         * Gets the bytes of key value data\n         */\n        bytesOfKeyValueData: number;\n        /**\n         * Gets the load type\n         */\n        loadType: number;\n        /**\n         * If the container has been made invalid (eg. constructor failed to correctly load array buffer)\n         */\n        isInvalid: boolean;\n        /**\n         * Creates a new KhronosTextureContainer\n         * @param arrayBuffer contents of the KTX container file\n         * @param facesExpected should be either 1 or 6, based whether a cube texture or or\n         * @param threeDExpected provision for indicating that data should be a 3D texture, not implemented\n         * @param textureArrayExpected provision for indicating that data should be a texture array, not implemented\n         */\n        constructor(/** contents of the KTX container file */ arrayBuffer: any, facesExpected: number, threeDExpected?: boolean, textureArrayExpected?: boolean);\n        /**\n         * Uploads KTX content to a Babylon Texture.\n         * It is assumed that the texture has already been created & is currently bound\n         * @hidden\n         */\n        uploadLevels(bitmapData: egret.BitmapData, loadMipmaps: boolean): void;\n        private _upload2DCompressedLevels(bitmapData, loadMipmaps);\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 共享的用于碰撞检测的渲染缓冲\n     */\n    let customHitTestBuffer: sys.RenderBuffer;\n    /**\n     * @private\n     * 共享的用于canvas碰撞检测的渲染缓冲\n     */\n    let canvasHitTestBuffer: sys.RenderBuffer;\n    /**\n     * @private\n     * 渲染缓冲\n     */\n    interface RenderBuffer {\n        /**\n         * 呈现最终绘图结果的画布。\n         * @readOnly\n         */\n        surface: any;\n        /**\n         * 渲染上下文。\n         * @readOnly\n         */\n        context: any;\n        /**\n         * 渲染缓冲的宽度，以像素为单位。\n         * @readOnly\n         */\n        width: number;\n        /**\n         * 渲染缓冲的高度，以像素为单位。\n         * @readOnly\n         */\n        height: number;\n        /**\n         * 改变渲染缓冲的大小并清空缓冲区\n         * @param width 改变后的宽\n         * @param height 改变后的高\n         * @param useMaxSize 若传入true，则将改变后的尺寸与已有尺寸对比，保留较大的尺寸。\n         */\n        resize(width: number, height: number, useMaxSize?: boolean): void;\n        /**\n         * 获取指定区域的像素\n         */\n        getPixels(x: number, y: number, width?: number, height?: number): number[];\n        /**\n         * 转换成base64字符串，如果图片（或者包含的图片）跨域，则返回null\n         * @param type 转换的类型，如: \"image/png\",\"image/jpeg\"\n         */\n        toDataURL(type?: string, ...args: any[]): string;\n        /**\n         * 清空缓冲区数据\n         */\n        clear(): void;\n        /**\n         * 销毁渲染缓冲\n         */\n        destroy(): void;\n    }\n    /**\n     * @private\n     */\n    let RenderBuffer: {\n        /**\n         * 创建一个RenderTarget。\n         * 注意：若内存不足或创建缓冲区失败，将会抛出错误异常。\n         * @param width 渲染缓冲的初始宽\n         * @param height 渲染缓冲的初始高\n         * @param root 是否为舞台buffer\n         */\n        new (width?: number, height?: number, root?: boolean): RenderBuffer;\n    };\n    /**\n     * @private\n     */\n    let CanvasRenderBuffer: {\n        /**\n         * 创建一个CanvasRenderBuffer。\n         * 注意：若内存不足或创建缓冲区失败，将会抛出错误异常。\n         * @param width 渲染缓冲的初始宽\n         * @param height 渲染缓冲的初始高\n         */\n        new (width?: number, height?: number): RenderBuffer;\n    };\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 设备屏幕\n     */\n    interface Screen {\n        /**\n         * @private\n         * 更新屏幕视口尺寸\n         */\n        updateScreenSize(): any;\n        /**\n         * @private\n         * 更新触摸数量\n         */\n        updateMaxTouches(): any;\n        /**\n         * @private\n         * 设置分辨率尺寸\n         */\n        setContentSize(width: number, height: number): any;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 屏幕适配器接口，当播放器视口尺寸改变时，屏幕适配器将被用于计算当前对应的舞台显示尺寸。\n     */\n    interface IScreenAdapter {\n        /**\n         * @private\n         * 计算舞台显示尺寸\n         * @param scaleMode 当前的缩放模式\n         * @param screenWidth 播放器视口宽度\n         * @param screenHeight 播放器视口高度\n         * @param contentWidth 初始化内容宽度\n         * @param contentHeight 初始化内容高度\n         */\n        calculateStageSize(scaleMode: string, screenWidth: number, screenHeight: number, contentWidth: number, contentHeight: number): StageDisplaySize;\n    }\n    /**\n     * @private\n     * 舞台显示尺寸数据\n     */\n    interface StageDisplaySize {\n        /**\n         * @private\n         * 舞台宽度\n         */\n        stageWidth: number;\n        /**\n         * @private\n         * 舞台高度\n         */\n        stageHeight: number;\n        /**\n         * @private\n         * 显示宽度，若跟舞台宽度不同，将会产生缩放。\n         */\n        displayWidth: number;\n        /**\n         * @private\n         * 显示高度，若跟舞台高度不同，将会产生缩放。\n         */\n        displayHeight: number;\n    }\n    /**\n     * @private\n     * 屏幕适配器实例，开发者可以通过给这个变量赋值实现了IScreenAdapter接口的实例，从而注入自定义的屏幕适配器。\n     */\n    let screenAdapter: IScreenAdapter;\n    /**\n     * @private\n     * 屏幕适配器默认实现，开发者可以实现自定义规则的屏幕适配器。并在初始化加载时将适配器的实例赋值给egret.sys.screenAdapter上，从而替换掉默认适配器。\n     */\n    class DefaultScreenAdapter extends HashObject implements IScreenAdapter {\n        /**\n         * @private\n         */\n        constructor();\n        /**\n         * @private\n         * 计算舞台显示尺寸\n         * @param scaleMode 当前的缩放模式\n         * @param screenWidth 播放器视口宽度\n         * @param screenHeight 播放器视口高度\n         * @param contentWidth 初始化内容宽度\n         * @param contentHeight 初始化内容高度\n         */\n        calculateStageSize(scaleMode: string, screenWidth: number, screenHeight: number, contentWidth: number, contentHeight: number): StageDisplaySize;\n    }\n}\ndeclare namespace egret {\n    /**\n     * StageScaleMode class provides values for the stage zoom mode.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/player/StageScaleMode.ts\n     * @language en_US\n     */\n    /**\n     * StageScaleMode 类为舞台缩放模式提供值。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/player/StageScaleMode.ts\n     * @language zh_CN\n     */\n    class StageScaleMode {\n        /**\n         * Do not scale application content. Even when you change the player viewport size, it remains unchanged. If the player is smaller than the viewport content, possibly with some cropping.<br/>\n         * In this mode, the stage size (Stage.stageWidth, Stage.stageHeight) always with the player viewport size consistent.\n         * @language en_US\n         */\n        /**\n         * 不缩放应用程序内容。即使在更改播放器视口大小时，它仍然保持不变。如果播放器视口比内容小，则可能进行一些裁切。<br/>\n         * 在此模式下，舞台尺寸（Stage.stageWidth,Stage.stageHeight）始终跟播放器视口大小保持一致。\n         * @language zh_CN\n         */\n        static NO_SCALE: string;\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling a wide directions application content to fill the viewport players on both sides in the other direction may not be wide enough and left black bars.<br/>\n         * In this mode, the stage size (Stage.stageWidth, Stage.stageHeight) is always equal to the initialization incoming external application content size.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容的较宽方向填满播放器视口，另一个方向的两侧可能会不够宽而留有黑边。<br/>\n         * 在此模式下，舞台尺寸(Stage.stageWidth,Stage.stageHeight)始终等于初始化时外部传入的应用程序内容尺寸。\n         * @language zh_CN\n         */\n        static SHOW_ALL: string;\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling a narrow direction of application content to fill the viewport players on both sides in the other direction may exceed the viewport and the player is cut.<br/>\n         * In this mode, the stage size (Stage.stageWidth, Stage.stageHeight) is always equal to the initialization incoming external application content size.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容的较窄方向填满播放器视口，另一个方向的两侧可能会超出播放器视口而被裁切。<br/>\n         * 在此模式下，舞台尺寸(Stage.stageWidth,Stage.stageHeight)始终等于初始化时外部传入的应用程序内容尺寸。\n         * @language zh_CN\n         */\n        static NO_BORDER: string;\n        /**\n         * Do not keep the original aspect ratio scaling application content, after scaling application content just fill the player viewport.<br/>\n         * In this mode, the stage size (Stage.stageWidth, Stage.stageHeight) is always equal to the initialization incoming external application content size.\n         * @language en_US\n         */\n        /**\n         * 不保持原始宽高比缩放应用程序内容，缩放后应用程序内容正好填满播放器视口。<br/>\n         * 在此模式下，舞台尺寸(Stage.stageWidth,Stage.stageHeight)始终等于初始化时外部传入的应用程序内容尺寸。\n         * @language zh_CN\n         */\n        static EXACT_FIT: string;\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, but only to keep the contents of the original application constant width, height may change.<br/>\n         * In this mode, the stage width (Stage.stageWidth) is always equal to initialize external incoming application content width. Stage height (Stage.stageHeight) by the current scale with the player viewport height decision.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，但只保持应用程序内容的原始宽度不变，高度可能会改变。<br/>\n         * 在此模式下，舞台宽度(Stage.stageWidth)始终等于初始化时外部传入的应用程序内容宽度。舞台高度(Stage.stageHeight)由当前的缩放比例与播放器视口高度决定。\n         * @language zh_CN\n         */\n        static FIXED_WIDTH: string;\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, but only to keep the contents of the original application constant height, width may change.<br/>\n         * In this mode, the stage height (Stage.stageHeight) is always equal to initialize external incoming application content height. Stage width (Stage.stageWidth) by the current scale with the player viewport width decision.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，但只保持应用程序内容的原始高度不变，宽度可能会改变。<br/>\n         * 在此模式下，舞台高度(Stage.stageHeight)始终等于初始化时外部传入的应用程序内容高度。舞台宽度(Stage.stageWidth)由当前的缩放比例与播放器视口宽度决定。\n         * @language zh_CN\n         */\n        static FIXED_HEIGHT: string;\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player,a narrow direction may not be wide enough and fill.<br/>\n         * In this mode, the stage height (Stage.stageHeight) and the stage width (Stage.stageWidth) by the current scale with the player viewport size.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，应用程序内容的较窄方向可能会不够宽而填充。<br/>\n         * 在此模式下，舞台高度(Stage.stageHeight)和舞台宽度(Stage.stageWidth)由当前的缩放比例与播放器视口宽高决定。\n         * @language zh_CN\n         */\n        static FIXED_NARROW: string;\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, a wide direction may exceed the viewport and the player is cut.<br/>\n         * In this mode, the stage height (Stage.stageHeight) and the stage width (Stage.stageWidth) by the current scale with the player viewport size.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，应用程序内容的较宽方向的两侧可能会超出播放器视口而被裁切。<br/>\n         * 在此模式下，舞台高度(Stage.stageHeight)和舞台宽度(Stage.stageWidth)由当前的缩放比例与播放器视口宽高决定。\n         * @language zh_CN\n         */\n        static FIXED_WIDE: string;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     */\n    let systemRenderer: SystemRenderer;\n    /**\n     * @private\n     * 用于碰撞检测绘制\n     */\n    let canvasRenderer: SystemRenderer;\n    /**\n     * @private\n     * 显示渲染器接口\n     */\n    interface SystemRenderer {\n        /**\n         * 渲染一个显示对象\n         * @param displayObject 要渲染的显示对象\n         * @param buffer 渲染缓冲\n         * @param matrix 要叠加的矩阵\n         * @param forRenderTexture 绘制目标是RenderTexture的标志\n         * @returns drawCall触发绘制的次数\n         */\n        render(displayObject: DisplayObject, buffer: RenderBuffer, matrix: Matrix, forRenderTexture?: boolean): number;\n        /**\n         * 将一个RenderNode对象绘制到渲染缓冲\n         * @param node 要绘制的节点\n         * @param buffer 渲染缓冲\n         * @param matrix 要叠加的矩阵\n         * @param forHitTest 绘制结果是用于碰撞检测。若为true，当渲染GraphicsNode时，会忽略透明度样式设置，全都绘制为不透明的。\n         */\n        drawNodeToBuffer(node: sys.RenderNode, buffer: RenderBuffer, matrix: Matrix, forHitTest?: boolean): void;\n    }\n    /**\n     *\n     */\n    interface RenderContext {\n    }\n    /**\n     * 创建一个canvas。\n     */\n    function mainCanvas(width?: number, height?: number): HTMLCanvasElement;\n    function createCanvas(width?: number, height?: number): HTMLCanvasElement;\n    /**\n    * 重新设置主canvas的大小\n    */\n    function resizeContext(renderContext: RenderContext, width: number, height: number, useMaxSize?: boolean): void;\n    /**\n    * 获得系统的渲染运行时\n    */\n    function getContextWebGL(surface: HTMLCanvasElement): WebGLRenderingContext;\n    function getContext2d(surface: HTMLCanvasElement): CanvasRenderingContext2D;\n    /**\n    * 仅通过bitmapData创建纹理\n    */\n    function createTexture(renderContext: RenderContext, bitmapData: BitmapData | HTMLCanvasElement): WebGLTexture;\n    /**\n    * 通过 width, height, data创建纹理\n    */\n    function _createTexture(renderContext: RenderContext, width: number, height: number, data: any): WebGLTexture;\n    /**\n     * 画texture\n     **/\n    function drawTextureElements(renderContext: RenderContext, data: any, offset: number): number;\n    /**\n     * 测量文本的宽度\n     * @param context\n     * @param text\n     */\n    function measureTextWith(context: CanvasRenderingContext2D, text: string): number;\n    /**\n     * 为CanvasRenderBuffer创建一个canvas\n     * @param defaultFunc\n     * @param width\n     * @param height\n     * @param root\n     */\n    function createCanvasRenderBufferSurface(defaultFunc: (width?: number, height?: number) => HTMLCanvasElement, width?: number, height?: number, root?: boolean): HTMLCanvasElement;\n    /**\n     * 改变渲染缓冲的大小并清空缓冲区\n     * @param renderContext\n     * @param width\n     * @param height\n     * @param useMaxSize\n     */\n    function resizeCanvasRenderBuffer(renderContext: RenderContext, width: number, height: number, useMaxSize?: boolean): void;\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     */\n    let $START_TIME: number;\n    /**\n     * @private\n     * 是否要广播Event.RENDER事件的标志。\n     */\n    let $invalidateRenderFlag: boolean;\n    /**\n     * @private\n     * 需要立即刷新屏幕的标志\n     */\n    let $requestRenderingFlag: boolean;\n    /**\n     * Egret心跳计时器\n     */\n    class SystemTicker {\n        /**\n         * @private\n         */\n        constructor();\n        /**\n         * @private\n         */\n        private playerList;\n        /**\n         * @private\n         * 注册一个播放器实例并运行\n         */\n        $addPlayer(player: Player): void;\n        /**\n         * @private\n         * 停止一个播放器实例的运行。\n         */\n        $removePlayer(player: Player): void;\n        /**\n         * @private\n         */\n        private callBackList;\n        /**\n         * @private\n         */\n        private thisObjectList;\n        /**\n         * @private\n         */\n        $startTick(callBack: (timeStamp: number) => boolean, thisObject: any): void;\n        /**\n         * @private\n         */\n        $stopTick(callBack: (timeStamp: number) => boolean, thisObject: any): void;\n        /**\n         * @private\n         */\n        private getTickIndex(callBack, thisObject);\n        /**\n         * @private\n         *\n         */\n        private concatTick();\n        /**\n         * @private\n         * 全局帧率\n         */\n        $frameRate: number;\n        /**\n         * @private\n         */\n        private frameInterval;\n        /**\n         * @private\n         */\n        private frameDeltaTime;\n        /**\n         * @private\n         */\n        private lastTimeStamp;\n        /**\n         * @private\n         * 设置全局帧率\n         */\n        $setFrameRate(value: number): boolean;\n        /**\n         * @private\n         */\n        private lastCount;\n        /**\n         * @private\n         * ticker 花销的时间\n         */\n        private costEnterFrame;\n        /**\n         * @private\n         * 是否被暂停\n         */\n        private isPaused;\n        /**\n         * Pause the ticker.\n         * @version Egret 5.0.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 暂停心跳\n         * @version Egret 5.0.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        pause(): void;\n        /**\n         * Resume the ticker.\n         * @version Egret 5.0.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 恢复心跳\n         * @version Egret 5.0.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        resume(): void;\n        /**\n         * @private\n         * 执行一次刷新\n         */\n        update(forceUpdate?: boolean): void;\n        /**\n         * @private\n         * 执行一次屏幕渲染\n         */\n        private render(triggerByFrame, costTicker);\n        /**\n         * @private\n         * 广播EnterFrame事件。\n         */\n        private broadcastEnterFrame();\n        /**\n         * @private\n         * 广播Render事件。\n         */\n        private broadcastRender();\n        /**\n         * @private\n         */\n        private callLaters();\n        /**\n         * @private\n         */\n        private callLaterAsyncs();\n    }\n}\ndeclare module egret {\n    namespace lifecycle {\n        type LifecyclePlugin = (context: LifecycleContext) => void;\n        /**\n         * @private\n         */\n        let stage: egret.Stage;\n        /**\n         * @private\n         */\n        let contexts: LifecycleContext[];\n        class LifecycleContext {\n            pause(): void;\n            resume(): void;\n            onUpdate?: () => void;\n        }\n        let onResume: () => void;\n        let onPause: () => void;\n        function addLifecycleListener(plugin: LifecyclePlugin): void;\n    }\n    /**\n     * 心跳计时器单例\n     */\n    let ticker: sys.SystemTicker;\n}\n/**\n * @private\n */\ndeclare let egret_stages: egret.Stage[];\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 用户交互操作管理器\n     */\n    class TouchHandler extends HashObject {\n        private maxTouches;\n        private useTouchesCount;\n        /**\n         * @private\n         */\n        constructor(stage: Stage);\n        /**\n         * @private\n         * 设置同时触摸数量\n         */\n        $initMaxTouches(): void;\n        /**\n         * @private\n         */\n        private stage;\n        /**\n         * @private\n         */\n        private touchDownTarget;\n        /**\n         * @private\n         * 触摸开始（按下）\n         * @param x 事件发生处相对于舞台的坐标x\n         * @param y 事件发生处相对于舞台的坐标y\n         * @param touchPointID 分配给触摸点的唯一标识号\n         */\n        onTouchBegin(x: number, y: number, touchPointID: number): void;\n        /**\n         * @private\n         */\n        private lastTouchX;\n        /**\n         * @private\n         */\n        private lastTouchY;\n        /**\n         * @private\n         * 触摸移动\n         * @param x 事件发生处相对于舞台的坐标x\n         * @param y 事件发生处相对于舞台的坐标y\n         * @param touchPointID 分配给触摸点的唯一标识号\n         */\n        onTouchMove(x: number, y: number, touchPointID: number): void;\n        /**\n         * @private\n         * 触摸结束（弹起）\n         * @param x 事件发生处相对于舞台的坐标x\n         * @param y 事件发生处相对于舞台的坐标y\n         * @param touchPointID 分配给触摸点的唯一标识号\n         */\n        onTouchEnd(x: number, y: number, touchPointID: number): void;\n        /**\n         * @private\n         * 获取舞台坐标下的触摸对象\n         */\n        private findTarget(stageX, stageY);\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 位图渲染节点\n     */\n    class BitmapNode extends RenderNode {\n        constructor();\n        /**\n         * 要绘制的位图\n         */\n        image: BitmapData;\n        /**\n         * 控制在缩放时是否对位图进行平滑处理。\n         */\n        smoothing: boolean;\n        /**\n         * 相对偏移矩阵。\n         */\n        matrix: egret.Matrix;\n        /**\n         * 图片宽度。WebGL渲染使用\n         */\n        imageWidth: number;\n        /**\n         * 图片高度。WebGL渲染使用\n         */\n        imageHeight: number;\n        /**\n         * 使用的混合模式\n         */\n        blendMode: number;\n        /**\n         * 相对透明度\n         */\n        alpha: number;\n        /**\n         * 颜色变换滤镜\n         */\n        filter: ColorMatrixFilter;\n        /**\n         * 翻转\n         */\n        rotated: boolean;\n        /**\n         * 绘制一次位图\n         */\n        drawImage(sourceX: number, sourceY: number, sourceW: number, sourceH: number, drawX: number, drawY: number, drawW: number, drawH: number): void;\n        /**\n         * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n         */\n        cleanBeforeRender(): void;\n        static $updateTextureData(node: sys.NormalBitmapNode, image: BitmapData, bitmapX: number, bitmapY: number, bitmapWidth: number, bitmapHeight: number, offsetX: number, offsetY: number, textureWidth: number, textureHeight: number, destW: number, destH: number, sourceWidth: number, sourceHeight: number, fillMode: string, smoothing: boolean): void;\n        /**\n         * @private\n         * 绘制九宫格位图\n         */\n        static $updateTextureDataWithScale9Grid(node: sys.NormalBitmapNode, image: BitmapData, scale9Grid: egret.Rectangle, bitmapX: number, bitmapY: number, bitmapWidth: number, bitmapHeight: number, offsetX: number, offsetY: number, textureWidth: number, textureHeight: number, destW: number, destH: number, sourceWidth: number, sourceHeight: number, smoothing: boolean): void;\n        /**\n         * @private\n         */\n        private static drawClipImage(node, scale, bitmapX, bitmapY, scaledBitmapW, scaledBitmapH, offsetX, offsetY, destW, destH, startX?, startY?);\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 矢量渲染节点\n     */\n    class GraphicsNode extends RenderNode {\n        constructor();\n        /**\n         * 指定一种简单的单一颜色填充，在绘制时该填充将在随后对其他 Graphics 方法（如 lineTo() 或 drawCircle()）的调用中使用。\n         * @param color 填充的颜色\n         * @param alpha 填充的 Alpha 值\n         * @param beforePath 插入在指定的路径命令之前绘制，通常是插入到当前正在绘制的线条路径之前，以确保线条总在填充的上方。\n         */\n        beginFill(color: number, alpha?: number, beforePath?: Path2D): Path2D;\n        /**\n         * 指定一种简单的单一颜色填充，在绘制时该填充将在随后对其他 Graphics 方法（如 lineTo() 或 drawCircle()）的调用中使用。\n         * 调用 clear() 方法会清除填充。\n         * @param type 用于指定要使用哪种渐变类型的 GradientType 类的值：GradientType.LINEAR 或 GradientType.RADIAL。\n         * @param colors 渐变中使用的 RGB 十六进制颜色值的数组（例如，红色为 0xFF0000，蓝色为 0x0000FF，等等）。对于每种颜色，请在 alphas 和 ratios 参数中指定对应值。\n         * @param alphas colors 数组中对应颜色的 alpha 值数组。\n         * @param ratios 颜色分布比率的数组。有效值为 0 到 255。\n         * @param matrix 一个由 egret.Matrix 类定义的转换矩阵。egret.Matrix 类包括 createGradientBox() 方法，通过该方法可以方便地设置矩阵，以便与 beginGradientFill() 方法一起使用\n         * @param beforePath 插入在指定的路径命令之前绘制，通常是插入到当前正在绘制的线条路径之前，以确保线条总在填充的上方。\n         */\n        beginGradientFill(type: string, colors: number[], alphas: number[], ratios: number[], matrix?: egret.Matrix, beforePath?: Path2D): Path2D;\n        /**\n         * 指定一种线条样式以用于随后对 lineTo() 或 drawCircle() 等 Graphics 方法的调用。\n         * @param thickness 一个整数，以点为单位表示线条的粗细，有效值为 0 到 255。如果未指定数字，或者未定义该参数，则不绘制线条。如果传递的值小于 0，则默认值为 0。值 0 表示极细的粗细；最大粗细为 255。如果传递的值大于 255，则默认值为 255。\n         * @param color 线条的十六进制颜色值（例如，红色为 0xFF0000，蓝色为 0x0000FF 等）。如果未指明值，则默认值为 0x000000（黑色）。可选。\n         * @param alpha 表示线条颜色的 Alpha 值的数字；有效值为 0 到 1。如果未指明值，则默认值为 1（纯色）。如果值小于 0，则默认值为 0。如果值大于 1，则默认值为 1。\n         * @param caps 用于指定线条末端处端点类型的 CapsStyle 类的值。默认值：CapsStyle.ROUND\n         * @param joints 指定用于拐角的连接外观的类型。默认值：JointStyle.ROUND\n         * @param miterLimit 用于表示剪切斜接的极限值的数字。\n         */\n        lineStyle(thickness?: number, color?: number, alpha?: number, caps?: string, joints?: string, miterLimit?: number, lineDash?: number[]): StrokePath;\n        /**\n         * 清空所有缓存的绘制数据\n         */\n        clear(): void;\n        /**\n         * 覆盖父类方法，不自动清空缓存的绘图数据，改为手动调用clear()方法清空。\n         */\n        cleanBeforeRender(): void;\n        /**\n         * 绘制x偏移\n         */\n        x: number;\n        /**\n         * 绘制y偏移\n         */\n        y: number;\n        /**\n         * 绘制宽度\n         */\n        width: number;\n        /**\n         * 绘制高度\n         */\n        height: number;\n        /**\n         * 脏渲染标记\n         * 暂时调用lineStyle,beginFill,beginGradientFill标记,实际应该draw时候标记在Path2D\n         */\n        dirtyRender: boolean;\n        $texture: WebGLTexture;\n        $textureWidth: number;\n        $textureHeight: number;\n        $canvasScaleX: number;\n        $canvasScaleY: number;\n        /**\n         * 清除非绘制的缓存数据\n         */\n        clean(): void;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 组渲染节点,用于组合多个渲染节点\n     */\n    class GroupNode extends RenderNode {\n        /**\n         * 相对偏移矩阵。\n         */\n        matrix: egret.Matrix;\n        constructor();\n        addNode(node: RenderNode): void;\n        /**\n         * 覆盖父类方法，不自动清空缓存的绘图数据，改为手动调用clear()方法清空。\n         * 这里只是想清空绘制命令，因此不调用super\n         */\n        cleanBeforeRender(): void;\n        $getRenderCount(): number;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * Mesh 渲染节点\n     */\n    class MeshNode extends RenderNode {\n        constructor();\n        /**\n         * 要绘制的位图\n         */\n        image: BitmapData;\n        /**\n         * 控制在缩放时是否对位图进行平滑处理。\n         */\n        smoothing: boolean;\n        /**\n         * 图片宽度。WebGL渲染使用\n         */\n        imageWidth: number;\n        /**\n         * 图片高度。WebGL渲染使用\n         */\n        imageHeight: number;\n        /**\n         * 相对偏移矩阵。\n         */\n        matrix: egret.Matrix;\n        /**\n         * UV 坐标。\n         */\n        uvs: number[];\n        /**\n         * 顶点坐标。\n         */\n        vertices: number[];\n        /**\n         * 顶点索引。\n         */\n        indices: number[];\n        /**\n         * 顶点索引。\n         */\n        bounds: Rectangle;\n        /**\n         * 使用的混合模式\n         */\n        blendMode: number;\n        /**\n         * 相对透明度\n         */\n        alpha: number;\n        /**\n         * 颜色变换滤镜\n         */\n        filter: ColorMatrixFilter;\n        /**\n         * 翻转\n         */\n        rotated: boolean;\n        /**\n         * 绘制一次位图\n         */\n        drawMesh(sourceX: number, sourceY: number, sourceW: number, sourceH: number, drawX: number, drawY: number, drawW: number, drawH: number): void;\n        /**\n         * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n         */\n        cleanBeforeRender(): void;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 位图渲染节点\n     */\n    class NormalBitmapNode extends RenderNode {\n        constructor();\n        /**\n         * 要绘制的位图\n         */\n        image: BitmapData;\n        /**\n         * 控制在缩放时是否对位图进行平滑处理。\n         */\n        smoothing: boolean;\n        /**\n         * 图片宽度。WebGL渲染使用\n         */\n        imageWidth: number;\n        /**\n         * 图片高度。WebGL渲染使用\n         */\n        imageHeight: number;\n        /**\n         * 翻转\n         */\n        rotated: boolean;\n        sourceX: number;\n        sourceY: number;\n        sourceW: number;\n        sourceH: number;\n        drawX: number;\n        drawY: number;\n        drawW: number;\n        drawH: number;\n        /**\n         * 绘制一次位图\n         */\n        drawImage(sourceX: number, sourceY: number, sourceW: number, sourceH: number, drawX: number, drawY: number, drawW: number, drawH: number): void;\n        /**\n         * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n         */\n        cleanBeforeRender(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    class Mesh extends Bitmap {\n        constructor(value?: Texture);\n        protected createNativeDisplayObject(): void;\n        /**\n         * @private\n         */\n        protected setBitmapDataToWasm(data?: Texture): void;\n        /**\n         * @private\n         */\n        $updateRenderNode(): void;\n        /**\n         * @private\n         */\n        private _verticesDirty;\n        private _bounds;\n        /**\n         * @private\n         */\n        $updateVertices(): void;\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 文本格式\n     */\n    interface TextFormat {\n        /**\n         * 颜色值\n         */\n        textColor?: number;\n        /**\n         * 描边颜色值\n         */\n        strokeColor?: number;\n        /**\n         * 字号\n         */\n        size?: number;\n        /**\n         * 描边大小\n         */\n        stroke?: number;\n        /**\n         * 是否加粗\n         */\n        bold?: boolean;\n        /**\n         * 是否倾斜\n         */\n        italic?: boolean;\n        /**\n         * 字体名称\n         */\n        fontFamily?: string;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 文本渲染节点\n     */\n    class TextNode extends RenderNode {\n        constructor();\n        /**\n         * 颜色值\n         */\n        textColor: number;\n        /**\n         * 描边颜色值\n         */\n        strokeColor: number;\n        /**\n         * 字号\n         */\n        size: number;\n        /**\n         * 描边大小\n         */\n        stroke: number;\n        /**\n         * 是否加粗\n         */\n        bold: boolean;\n        /**\n         * 是否倾斜\n         */\n        italic: boolean;\n        /**\n         * 字体名称\n         */\n        fontFamily: string;\n        /**\n         * 绘制一行文本\n         */\n        drawText(x: number, y: number, text: string, format: TextFormat): void;\n        /**\n         * 绘制x偏移\n         */\n        x: number;\n        /**\n         * 绘制y偏移\n         */\n        y: number;\n        /**\n         * 绘制宽度\n         */\n        width: number;\n        /**\n         * 绘制高度\n         */\n        height: number;\n        /**\n         * 脏渲染标记\n         */\n        dirtyRender: boolean;\n        $texture: WebGLTexture;\n        $textureWidth: number;\n        $textureHeight: number;\n        $canvasScaleX: number;\n        $canvasScaleY: number;\n        /**\n         * 清除非绘制的缓存数据\n         */\n        clean(): void;\n        /**\n         * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n         */\n        cleanBeforeRender(): void;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 填充路径\n     */\n    class FillPath extends Path2D {\n        constructor();\n        /**\n         * 填充颜色\n         */\n        fillColor: number;\n        /**\n         * 填充透明度\n         */\n        fillAlpha: number;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 渐变填充路径\n     */\n    class GradientFillPath extends Path2D {\n        constructor();\n        gradientType: string;\n        colors: number[];\n        alphas: number[];\n        ratios: number[];\n        matrix: Matrix;\n    }\n}\ndeclare namespace egret {\n    /**\n     * OrientationMode 类为舞台初始旋转模式提供值。\n     */\n    const OrientationMode: {\n        AUTO: string;\n        PORTRAIT: string;\n        LANDSCAPE: string;\n        LANDSCAPE_FLIPPED: string;\n    };\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 线条路径。\n     * 注意：当线条宽度（lineWidth）为1或3像素时，需要特殊处理，往右下角偏移0.5像素，以显示清晰锐利的线条。\n     */\n    class StrokePath extends Path2D {\n        constructor();\n        /**\n         * 线条宽度。\n         * 注意：绘制时对1像素和3像素要特殊处理，整体向右下角偏移0.5像素，以显示清晰锐利的线条。\n         */\n        lineWidth: number;\n        /**\n         * 线条颜色\n         */\n        lineColor: number;\n        /**\n         * 线条透明度\n         */\n        lineAlpha: number;\n        /**\n         * 端点样式,\"none\":无端点,\"round\":圆头端点,\"square\":方头端点\n         */\n        caps: string;\n        /**\n         * 联接点样式,\"bevel\":斜角连接,\"miter\":尖角连接,\"round\":圆角连接\n         */\n        joints: string;\n        /**\n         * 用于表示剪切斜接的极限值的数字。\n         */\n        miterLimit: number;\n        /**\n         * 描述交替绘制线段和间距（坐标空间单位）长度的数字。\n         */\n        lineDash: number[];\n    }\n}\n/**\n * @private\n */\ninterface CanvasRenderingContext2D {\n    imageSmoothingEnabled: boolean;\n    $imageSmoothingEnabled: boolean;\n    $offsetX: number;\n    $offsetY: number;\n}\ndeclare namespace egret {\n    class CanvasRenderer {\n        private nestLevel;\n        render(displayObject: DisplayObject, buffer: sys.RenderBuffer, matrix: Matrix, forRenderTexture?: boolean): number;\n        /**\n         * @private\n         * 绘制一个显示对象\n         */\n        private drawDisplayObject(displayObject, context, offsetX, offsetY, isStage?);\n        private drawWithFilter(displayObject, context, offsetX, offsetY);\n        private drawWithClip(displayObject, context, offsetX, offsetY);\n        private drawWithScrollRect(displayObject, context, offsetX, offsetY);\n        drawNodeToBuffer(node: sys.RenderNode, buffer: sys.RenderBuffer, matrix: Matrix, forHitTest?: boolean): void;\n        /**\n         * 将一个DisplayObject绘制到渲染缓冲，用于RenderTexture绘制\n         * @param displayObject 要绘制的显示对象\n         * @param buffer 渲染缓冲\n         * @param matrix 要叠加的矩阵\n         */\n        drawDisplayToBuffer(displayObject: DisplayObject, buffer: sys.RenderBuffer, matrix: Matrix): number;\n        private renderNode(node, context, forHitTest?);\n        private renderNormalBitmap(node, context);\n        private renderBitmap(node, context);\n        private renderMesh(node, context);\n        renderText(node: sys.TextNode, context: CanvasRenderingContext2D): void;\n        private renderingMask;\n        /**\n         * @private\n         */\n        renderGraphics(node: sys.GraphicsNode, context: CanvasRenderingContext2D, forHitTest?: boolean): number;\n        private renderPath(path, context);\n        private renderGroup(groupNode, context);\n        private createRenderBuffer(width, height, useForFilters?);\n    }\n    /**\n     * @private\n     * 获取字体字符串\n     */\n    function getFontString(node: sys.TextNode, format: sys.TextFormat): string;\n    /**\n     * @private\n     * 获取RGBA字符串\n     */\n    function getRGBAString(color: number, alpha: number): string;\n}\ndeclare namespace egret {\n    /**\n     * Orientation monitor the orientation of the device, send CHANGE event when the orientation is changed\n     *\n     * @event egret.Event.CHANGE device's orientation is changed\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/sensor/DeviceOrientation.ts\n     * @see http://edn.egret.com/cn/docs/page/661 获取设备旋转角度\n     * @language en_US\n     */\n    /**\n     * Orientation 监听设备方向的变化，当方向变化时派发 CHANGE 事件\n     * @event egret.Event.CHANGE 设备方向改变时派发\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/sensor/DeviceOrientation.ts\n     * @see http://edn.egret.com/cn/docs/page/661 获取设备旋转角度\n     * @language zh_CN\n     */\n    interface DeviceOrientation extends EventDispatcher {\n        /**\n         * Start to monitor the device's orientation\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 开始监听设备方向变化\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        start(): void;\n        /**\n         * Stop monitor the device's orientation\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 停止监听设备方向变化\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        stop(): void;\n    }\n    /**\n     * @copy egret.Orientation\n     */\n    let DeviceOrientation: {\n        new (): DeviceOrientation;\n    };\n}\ndeclare namespace egret {\n    /**\n     * The Geolocation able to obtain the position of the device.\n     * Geolocation will emit CHANGE event when the device's location is changed.\n     * It will emit IO_ERROR event if the location request is denied\n     * or there is no location service on the device.\n     *\n     * @event egret.Event.CHANGE The device's location is changed\n     * @event egret.Event.IO_ERROR Error occurred while getting the location\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/sensor/Geolocation.ts\n     * @language en_US\n     */\n    /**\n     * Geolocation 能够从设备的定位服务获取设备的当前位置。\n     * 当设备的位置发生改变时 Geolocation 会派发 CHANGE 事件。\n     * 当定位请求被拒绝或该设备没有定位服务时 Geolocation 会派发 IO_ERROR 事件。\n     *\n     * @event egret.Event.CHANGE 设备位置发生改变\n     * @event egret.Event.IO_ERROR 获取设备位置时发生错误\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/sensor/Geolocation.ts\n     * @language zh_CN\n     */\n    interface Geolocation extends EventDispatcher {\n        /**\n         * Start to monitor the device's location\n         * @returns\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 开始监听设备位置信息\n         * @returns\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        start(): void;\n        /**\n         * Stop monitor the device's location\n         * @returns\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 停止监听设备位置信息\n         * @returns\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        stop(): void;\n    }\n    /**\n     * @copy egret.Geolocation\n     */\n    let Geolocation: {\n        /**\n         * constructor\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 构造函数\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        new (): Geolocation;\n    };\n}\ndeclare namespace egret {\n    /**\n     * @copy egret.Motion\n     */\n    let Motion: {\n        new (): Motion;\n    };\n    /**\n     * The Motion class emits events based on activity detected by the device's motion sensor.\n     * This data represents the device's movement along a 3-dimensional axis. When the device moves,\n     * the sensor detects this movement and emit the CHANGE event. @see egret.MotionEvent\n     *\n     * @event egret.Event.CHANGE device is moved\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/sensor/Motion.ts\n     * @language en_US\n     */\n    /**\n     * Motion 类从用户设备读取运动状态信息并派发 CHANGE 事件。\n     * 当设备移动时，传感器会检测到此移动并返回设备加速度，重力和旋转数据。@see egret.MotionEvent\n     * Motion 类提供了 start 和 stop 方法，来启动和停止运动信息检查\n     *\n     * @event egret.Event.CHANGE 运动状态发生改变\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/sensor/Motion.ts\n     * @language zh_CN\n     */\n    interface Motion extends EventDispatcher {\n        /**\n         * Start to monitor device movement\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 开始监听设备运动状态\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        start(): void;\n        /**\n         * Stop monitor device movement\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 停止监听设备运动状态\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        stop(): void;\n    }\n    /**\n     * A DeviceRotationRate object provides information about the rate at which\n     * the device is rotating around all three axes.\n     * @version Egret 2.4\n     * @platform Web\n     * @language en_US\n     */\n    /**\n     * DeviceRotationRate 提供设备围绕三个轴旋转的角速度信息，单位是 角度/秒\n     * @version Egret 2.4\n     * @platform Web\n     * @language zh_CN\n     */\n    interface DeviceRotationRate {\n        /**\n         * The amount of rotation around the Z axis, in degrees per second.\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 设备绕 Z 轴旋转的角速度信息，单位是 度/秒\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        alpha: number;\n        /**\n         * The amount of rotation around the X axis, in degrees per second.\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 设备绕 X 轴旋转的角速度信息，单位是 度/秒\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        beta: number;\n        /**\n         * The amount of rotation around the Y axis, in degrees per second.\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 设备绕 Y 轴旋转的角速度信息，单位是 度/秒\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        gamma: number;\n    }\n    /**\n     * A DeviceAcceleration object provides information about the amount\n     * of acceleration the device is experiencing along all three axes.\n     * Acceleration is expressed in m/s2.\n     * @version Egret 2.4\n     * @platform Web\n     * @language en_US\n     */\n    /**\n     * DeviceAcceleration 提供设备在三个维度的加速度信息，加速度值的单位是 m/s2\n     * @version Egret 2.4\n     * @platform Web\n     * @language zh_CN\n     */\n    interface DeviceAcceleration {\n        /**\n         * The amount of acceleration along the X axis\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * X 轴方向的加速度值\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        x: number;\n        /**\n         * The amount of acceleration along the Y axis\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * Y 轴方向的加速度值\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        y: number;\n        /**\n         * The amount of acceleration along the Z axis\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * Z 轴方向的加速度值\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        z: number;\n    }\n}\ndeclare namespace egret {\n    /**\n     * Type of operation.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 运行类型的类型。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    namespace RuntimeType {\n        /**\n         * Running on Web\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 运行在Web上\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const WEB = \"web\";\n        /**\n         * Running on NATIVE\n         * @version Egret 2.4\n         * @deprecated\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 运行在NATIVE上\n         * @version Egret 2.4\n         * @deprecated\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const NATIVE = \"native\";\n        /**\n         * Running on Runtime2.0\n         * @version Egret 5.1.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 运行在Runtime2.0上\n         * @version Egret 5.1.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const RUNTIME2 = \"runtime2\";\n        /**\n         * Running on Alipay\n         * @version Egret 5.2.23\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在支付宝小游戏上\n         * @version Egret 5.2.26\n         * @platform All\n         * @language zh_CN\n         */\n        const MYGAME = \"mygame\";\n        /**\n         * Running on WeChat mini game\n         * @version Egret 5.1.5\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在微信小游戏上\n         * @version Egret 5.1.5\n         * @platform All\n         * @language zh_CN\n         */\n        const WXGAME = \"wxgame\";\n        /**\n         * Running on Baidu mini game\n         * @version Egret 5.2.13\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在百度小游戏上\n         * @version Egret 5.2.13\n         * @platform All\n         * @language zh_CN\n         */\n        const BAIDUGAME = \"baidugame\";\n        /**\n         * Running on Xiaomi quick game\n         * @version Egret 5.2.14\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在小米快游戏上\n         * @version Egret 5.2.14\n         * @platform All\n         * @language zh_CN\n         */\n        const QGAME = \"qgame\";\n        /**\n         * Running on OPPO mini game\n         * @version Egret 5.2.14\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在 Oppo 小游戏上\n         * @version Egret 5.2.14\n         * @platform All\n         * @language zh_CN\n         */\n        const OPPOGAME = \"oppogame\";\n        /**\n        * Running on QQ mini game\n        * @version Egret 5.2.25\n        * @platform All\n        * @language en_US\n        */\n        /**\n        * 运行在 QQ 小游戏上\n        * @version Egret 5.2.25\n        * @platform All\n        * @language zh_CN\n        */\n        const QQGAME = \"qqgame\";\n        /**\n         * Running on vivo mini game\n         * @version Egret 5.2.23\n         * @platform All\n         * @language en_US\n         */\n        /**\n        * 运行在 vivo 小游戏上\n        * @version Egret 5.2.23\n        * @platform All\n        * @language zh_CN\n        */\n        const VIVOGAME = \"vivogame\";\n    }\n    interface SupportedCompressedTexture {\n        pvrtc: boolean;\n        etc1: boolean;\n    }\n    /**\n     * The Capabilities class provides properties that describe the system and runtime that are hosting the application.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/system/Capabilities.ts\n     * @language en_US\n     */\n    /**\n     * Capabilities 类提供一些属性，这些属性描述了承载应用程序的系统和运行时。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/system/Capabilities.ts\n     * @language zh_CN\n     */\n    class Capabilities {\n        /**\n         * Specifies the language code of the system on which the content is running. The language is specified as a lowercase\n         * two-letter language code from ISO 639-1. For Chinese, an additional uppercase two-letter country code from ISO 3166\n         * distinguishes between Simplified and Traditional Chinese.<br/>\n         * The following table lists the possible values,but not limited to them:\n         * <ul>\n         * <li>Simplified    Chinese  zh-CN</li>\n         * <li>Traditional   Chinese  zh-TW</li>\n         * <li>English       en</li>\n         * <li>Japanese      ja</li>\n         * <li>Korean        ko</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示运行内容的系统的语言代码。语言指定为 ISO 639-1 中的小写双字母语言代码。\n         * 对于中文，另外使用 ISO 3166 中的大写双字母国家/地区代码，以区分简体中文和繁体中文。<br/>\n         * 以下是可能但不限于的语言和值：\n         * <ul>\n         * <li>简体中文  zh-CN</li>\n         * <li>繁体中文  zh-TW</li>\n         * <li>英语      en</li>\n         * <li>日语      ja</li>\n         * <li>韩语      ko</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly language: string;\n        /**\n         * Specifies whether the system is running in a mobile device.(such as a mobile phone or tablet)\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示程序内容是否运行在移动设备中（例如移动电话或平板电脑）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly isMobile: boolean;\n        /**\n         * Specifies the current operating system. The os property can return the following strings:\n         * <ul>\n         * <li>iPhone            \"iOS\"</li>\n         * <li>Android Phone     \"Android\"</li>\n         * <li>Windows Phone     \"Windows Phone\"</li>\n         * <li>Windows Desktop   \"Windows PC\"</li>\n         * <li>Mac Desktop       \"Mac OS\"</li>\n         * <li>Unknown OS        \"Unknown\"</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指示当前的操作系统。os 属性返回下列字符串：\n         * <ul>\n         * <li>苹果手机操作系统     \"iOS\"</li>\n         * <li>安卓手机操作系统     \"Android\"</li>\n         * <li>微软手机操作系统     \"Windows Phone\"</li>\n         * <li>微软桌面操作系统     \"Windows PC\"</li>\n         * <li>苹果桌面操作系统     \"Mac OS\"</li>\n         * <li>未知操作系统        \"Unknown\"</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly os: string;\n        /**\n         * It indicates the current type of operation. runtimeType property returns the following string:\n         * <ul>\n         * <li>Run on Web     egret.RuntimeType.WEB</li>\n         * <li>Run on Runtime2.0     egret.RuntimeType.RUNTIME2</li>\n         * <li>Run on WeChat mini game     egret.RuntimeType.WXGAME</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指示当前的运行类型。runtimeType 属性返回下列字符串：\n         * <ul>\n         * <li>运行在Web上     egret.RuntimeType.WEB</li>\n         * <li>运行在Runtime2.0上     egret.RuntimeType.RUNTIME2</li>\n         * <li>运行在微信小游戏上    egret.RuntimeType.WXGAME</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly runtimeType: string;\n        /***\n         * version of Egret.\n         * @type {string}\n         * @version Egret 3.2.0\n         * @platform Web,Native\n         * @language en_US\n         */\n        /***\n         * Egret 的版本号。\n         * @type {string}\n         * @version Egret 3.2.0\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly engineVersion: string;\n        /***\n         * current render mode.\n         * @type {string}\n         * @version Egret 3.0.7\n         * @platform Web,Native\n         * @language en_US\n         */\n        /***\n         * 当前渲染模式。\n         * @type {string}\n         * @version Egret 3.0.7\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly renderMode: string;\n        /***\n         * Clients border width.\n         * The value before the document class initialization is always 0.\n         * This value will change after the distribution Event.RESIZE and StageOrientationEvent.ORIENTATION_CHANGE.\n         * @version Egret 3.1.3\n         * @platform Web,Native\n         * @language en_US\n         */\n        /***\n         * 客户端边界宽度。\n         * 该值在文档类初始化之前始终是0。\n         * 该值在派发 Event.RESIZE 以及 StageOrientationEvent.ORIENTATION_CHANGE 之后会发生改变。\n         * @version Egret 3.1.3\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly boundingClientWidth: number;\n        /***\n         * Clients border height.\n         * The value before the document class initialization is always 0.\n         * This value will change after the distribution Event.RESIZE and StageOrientationEvent.ORIENTATION_CHANGE.\n         * @version Egret 3.1.3\n         * @platform Web,Native\n         * @language en_US\n         */\n        /***\n         * 客户端边界高度。\n         * 该值在文档类初始化之前始终是0。\n         * 该值在派发 Event.RESIZE 以及 StageOrientationEvent.ORIENTATION_CHANGE 之后会发生改变。\n         * @version Egret 3.1.3\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly boundingClientHeight: number;\n        /***\n         * supported compressed texture\n         * @version Egret 5.2.19\n         * @platform Web,Native\n         * @language en_US\n         */\n        /***\n         * supported compressed texture\n         * @version Egret 5.2.19\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static supportedCompressedTexture: SupportedCompressedTexture;\n    }\n}\ndeclare namespace egret {\n    /**\n     * RenderTexture is a dynamic texture\n     * @extends egret.Texture\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/RenderTexture.ts\n     * @language en_US\n     */\n    /**\n     * RenderTexture 是动态纹理类，他实现了将显示对象及其子对象绘制成为一个纹理的功能\n     * @extends egret.Texture\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/RenderTexture.ts\n     * @language zh_CN\n     */\n    class RenderTexture extends egret.Texture {\n        constructor();\n        $renderBuffer: sys.RenderBuffer;\n        /**\n         * The specified display object is drawn as a texture\n         * @param displayObject {egret.DisplayObject} the display to draw\n         * @param clipBounds {egret.Rectangle} clip rect\n         * @param scale {number} scale factor\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将指定显示对象绘制为一个纹理\n         * @param displayObject {egret.DisplayObject} 需要绘制的显示对象\n         * @param clipBounds {egret.Rectangle} 绘制矩形区域\n         * @param scale {number} 缩放比例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        drawToTexture(displayObject: egret.DisplayObject, clipBounds?: Rectangle, scale?: number): boolean;\n        /**\n         * @inheritDoc\n         */\n        getPixel32(x: number, y: number): number[];\n        /**\n         * @inheritDoc\n         */\n        dispose(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * Adds an interface-name-to-implementation-class mapping to the registry.\n     * @param interfaceName the interface name to register. For example：\"eui.IAssetAdapter\",\"eui.Theme\"\n     * @param instance the instance to register.\n     * @version Egret 3.2.1\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 注册一个接口实现。\n     * @param interfaceName 注入的接口名称。例如：\"eui.IAssetAdapter\",\"eui.Theme\"\n     * @param instance 实现此接口的实例。\n     * @version Egret 3.2.1\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function registerImplementation(interfaceName: string, instance: any): void;\n    /**\n     * Returns the singleton instance of the implementation class that was registered for the specified interface.\n     * This method is usually called by egret framework.\n     * @param interfaceName The interface name to identify. For example：\"eui.IAssetAdapter\",\"eui.Theme\"\n     * @returns the singleton instance of the implementation class\n     * @version Egret 3.2.1\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 获取一个接口实现。此方法通常由框架内部调用。获取项目注入的自定义实现实例。\n     * @param interfaceName 要获取的接口名称。例如：\"eui.IAssetAdapter\",\"eui.Theme\"\n     * @returns 返回实现此接口的实例。\n     * @version Egret 3.2.1\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getImplementation(interfaceName: string): any;\n}\ndeclare namespace egret {\n    /**\n     * This class is used to create lightweight shapes using the drawing application program interface (API). The Shape\n     * class includes a graphics property, which lets you access methods from the Graphics class.\n     * @see egret.Graphics\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Shape.ts\n     * @language en_US\n     */\n    /**\n     * 此类用于使用绘图应用程序编程接口 (API) 创建简单形状。Shape 类含有 graphics 属性，通过该属性您可以访问各种矢量绘图方法。\n     * @see egret.Graphics\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Shape.ts\n     * @language zh_CN\n     */\n    class Shape extends DisplayObject {\n        /**\n         * Creates a new Shape object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 Shape 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        protected createNativeDisplayObject(): void;\n        /**\n         * @private\n         */\n        $graphics: Graphics;\n        /**\n         * Specifies the Graphics object belonging to this Shape object, where vector drawing commands can occur.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取 Shape 中的 Graphics 对象。可通过此对象执行矢量绘图命令。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly graphics: Graphics;\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        $hitTest(stageX: number, stageY: number): DisplayObject;\n        /**\n         * @private\n         */\n        $onRemoveFromStage(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * Bitmap font, texture set of a font. It is generally used as the value of the BitmapText.font attribute.\n     * @see http://bbs.egret-labs.org/thread-918-1-1.html TextureMerger\n     * @see http://bbs.egret-labs.org/forum.php?mod=viewthread&tid=251 Text(Containing the specific usage of the bitmap font )\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/BitmapFont.ts\n     * @language en_US\n     */\n    /**\n     * 位图字体,是一个字体的纹理集，通常作为BitmapText.font属性的值。\n     * @see http://bbs.egret-labs.org/thread-918-1-1.html TextureMerger\n     * @see http://bbs.egret-labs.org/forum.php?mod=viewthread&tid=251 文本(含位图字体具体用法)\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/BitmapFont.ts\n     * @language zh_CN\n     */\n    class BitmapFont extends SpriteSheet {\n        /**\n         * Create an egret.BitmapFont object\n         * @param texture {egret.Texture} Texture set that use TextureMerger create\n         * @param config {any} Configure data that use TextureMerger create\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.BitmapFont 对象\n         * @param texture {egret.Texture} 使用TextureMerger生成的纹理集\n         * @param config {any} 使用TextureMerger生成的配置数据\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(texture: Texture, config: any);\n        /**\n         * @private\n         */\n        private charList;\n        /**\n         * Obtain corresponding texture through the name attribute\n         * @param name {string} name Attribute\n         * @returns {egret.Texture}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 通过 name 属性获取对应纹理\n         * @param name {string} name属性\n         * @returns {egret.Texture}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getTexture(name: string): Texture;\n        /**\n         * @private\n         */\n        getConfig(name: string, key: string): number;\n        /**\n         * @private\n         */\n        private firstCharHeight;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        _getFirstCharHeight(): number;\n        /**\n         * @private\n         *\n         * @param fntText\n         * @returns\n         */\n        private parseConfig(fntText);\n        /**\n         * @private\n         *\n         * @param configText\n         * @param key\n         * @returns\n         */\n        private getConfigByKey(configText, key);\n    }\n}\ndeclare namespace egret {\n    /**\n     * Bitmap font adopts the Bitmap+SpriteSheet mode to render text.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/BitmapText.ts\n     * @language en_US\n     */\n    /**\n     * 位图字体采用了Bitmap+SpriteSheet的方式来渲染文字。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/BitmapText.ts\n     * @language zh_CN\n     */\n    class BitmapText extends DisplayObject {\n        /**\n         * Create an egret.BitmapText object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.BitmapText 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        protected createNativeDisplayObject(): void;\n        private $smoothing;\n        /**\n         * Whether or not is smoothed when scaled.\n         * @default true。\n         * @version Egret 3.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 控制在缩放时是否进行平滑处理。\n         * @default true。\n         * @version Egret 3.0\n         * @platform Web\n         * @language zh_CN\n         */\n        smoothing: boolean;\n        private $text;\n        /**\n         * A string to display in the text field.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 要显示的文本内容\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        text: string;\n        /**\n         * @private\n         */\n        $setText(value: string): boolean;\n        protected $textFieldWidth: number;\n        /**\n         * @private\n         */\n        $getWidth(): number;\n        /**\n         * @private\n         */\n        $setWidth(value: number): boolean;\n        private $textLinesChanged;\n        /**\n         * @private\n         */\n        $invalidateContentBounds(): void;\n        protected $textFieldHeight: number;\n        /**\n         * @private\n         */\n        $getHeight(): number;\n        /**\n         * @private\n         */\n        $setHeight(value: number): boolean;\n        protected $font: BitmapFont;\n        protected $fontStringChanged: boolean;\n        /**\n         * The name of the font to use, or a comma-separated list of font names, the type of value must be BitmapFont.\n         * @default null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 要使用的字体的名称或用逗号分隔的字体名称列表，类型必须是 BitmapFont。\n         * @default null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        font: Object;\n        $setFont(value: any): boolean;\n        private $lineSpacing;\n        /**\n         /**\n         * An integer representing the amount of vertical space between lines.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个整数，表示行与行之间的垂直间距量\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        lineSpacing: number;\n        $setLineSpacing(value: number): boolean;\n        private $letterSpacing;\n        /**\n         * An integer representing the amount of distance between characters.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个整数，表示字符之间的距离。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        letterSpacing: number;\n        $setLetterSpacing(value: number): boolean;\n        private $textAlign;\n        /**\n         * Horizontal alignment of text.\n         * @default：egret.HorizontalAlign.LEFT\n         * @version Egret 2.5.6\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本的水平对齐方式。\n         * @default：egret.HorizontalAlign.LEFT\n         * @version Egret 2.5.6\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        textAlign: string;\n        $setTextAlign(value: string): boolean;\n        private $verticalAlign;\n        /**\n         * Vertical alignment of text.\n         * @default：egret.VerticalAlign.TOP\n         * @version Egret 2.5.6\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文字的垂直对齐方式。\n         * @default：egret.VerticalAlign.TOP\n         * @version Egret 2.5.6\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        verticalAlign: string;\n        $setVerticalAlign(value: string): boolean;\n        /**\n         * A ratio of the width of the space character. This value is multiplied by the height of the first character is the space character width.\n         * @default 0.33\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个空格字符的宽度比例。这个数值乘以第一个字符的高度即为空格字符的宽。\n         * @default 0.33\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static EMPTY_FACTOR: number;\n        /**\n         * @private\n         */\n        $updateRenderNode(): void;\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        private $textWidth;\n        /**\n         * Get the BitmapText measured width\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取位图文本测量宽度\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly textWidth: number;\n        private $textHeight;\n        /**\n         * Get Text BitmapText height\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取位图文本测量高度\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly textHeight: number;\n        /**\n         * @private\n         */\n        private $textOffsetX;\n        /**\n         * @private\n         */\n        private $textOffsetY;\n        /**\n         * @private\n         */\n        private $textStartX;\n        /**\n         * @private\n         */\n        private $textStartY;\n        /**\n         * @private\n         */\n        private textLines;\n        /**\n         * @private 每一行文字的宽度\n         */\n        private $textLinesWidth;\n        /**\n         * @private\n         */\n        $lineHeights: number[];\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getTextLines(): string[];\n    }\n}\ndeclare namespace egret {\n    /**\n     * The HorizontalAlign class defines the possible values for the horizontal alignment.\n     * @see egret.TextField#textAlign\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * HorizontalAlign 类为水平对齐方式定义可能的值。\n     * @see egret.TextField#textAlign\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class HorizontalAlign {\n        /**\n         * Horizontally align content to the left of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将内容与容器的左侧对齐。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static LEFT: string;\n        /**\n         * Horizontally align content to the right of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将内容与容器的右侧对齐。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static RIGHT: string;\n        /**\n         * Horizontally align content in the center of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在容器的水平中心对齐内容。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static CENTER: string;\n        /**\n         * Horizontal alignment with both edges.\n         * Note: TextFiled does not support this alignment method.\n         * @constant egret.HorizontalAlign.JUSTIFY\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 水平两端对齐。\n         * 注意：TextFiled不支持此对齐方式。\n         * @constant egret.HorizontalAlign.JUSTIFY\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static JUSTIFY: string;\n        /**\n         * Align the content of the child items, relative to the container. This operation will adjust uniformly the size of all the child items to be the Content Width \\\" of the container \\\".\n         * The Content Width \\\" of the container \\\" is the size of the max. child item. If the size of all child items are less than the width of the container, they will be adjusted to the width of the container.\n         * Note: TextFiled does not support this alignment method.\n         * @constant egret.HorizontalAlign.CONTENT_JUSTIFY\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 相对于容器对子项进行内容对齐。这会将所有子项的大小统一调整为容器的\"内容宽度\"。\n         * 容器的\"内容宽度\"是最大子项的大小,如果所有子项都小于容器的宽度，则会将所有子项的大小调整为容器的宽度。\n         * 注意：TextFiled不支持此对齐方式。\n         * @constant egret.HorizontalAlign.CONTENT_JUSTIFY\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static CONTENT_JUSTIFY: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * Convert the text in html format to the object that can be assigned to the egret.TextField#textFlow property\n     * @see http://edn.egret.com/cn/docs/page/146 Text mixed in a variety of style\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/HtmlTextParser.ts\n     * @language en_US\n     */\n    /**\n     * 将html格式文本转换为可赋值给 egret.TextField#textFlow 属性的对象\n     * @see http://edn.egret.com/cn/docs/page/146 多种样式文本混合\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/HtmlTextParser.ts\n     * @language zh_CN\n     */\n    class HtmlTextParser {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor();\n        private replaceArr;\n        private initReplaceArr();\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        private replaceSpecial(value);\n        /**\n         * @private\n         */\n        private resutlArr;\n        /**\n         * Convert the text in html format to the object that can be assigned to the egret.TextField#textFlow property\n         * @param htmltext {string} Text in html\n         * @returns {Array<egret.ITextElement>} 可赋值给 egret.TextField#textFlow Object that can be assigned to the egret.TextField#textFlow property\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将html格式文本转换为可赋值给 egret.TextField#textFlow 属性的对象\n         * @param htmltext {string} html文本\n         * @returns {Array<egret.ITextElement>} 可赋值给 egret.TextField#textFlow 属性的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        parse(htmltext: string): egret.ITextElement[];\n        parser(htmltext: string): Array<egret.ITextElement>;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        private addToResultArr(value);\n        private changeStringToObject(str);\n        /**\n         * @private\n         *\n         * @returns\n         */\n        private getHeadReg();\n        /**\n         * @private\n         *\n         * @param info\n         * @param head\n         * @param value\n         */\n        private addProperty(info, head, value);\n        /**\n         * @private\n         */\n        private stackArray;\n        /**\n         * @private\n         *\n         * @param infoStr\n         */\n        private addToArray(infoStr);\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    interface IHitTextElement {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        lineIndex: number;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        textElementIndex: number;\n    }\n    /**\n     * Text Style\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 文本样式\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface ITextStyle {\n        /**\n         * text color\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @see http://edn.egret.com/cn/docs/page/146 多种样式混合文本的基本结构\n         * @language en_US\n         */\n        /**\n         * 颜色值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @see http://edn.egret.com/cn/docs/page/146 多种样式混合文本的基本结构\n         * @language zh_CN\n         */\n        textColor?: number;\n        /**\n         * stroke color\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 描边颜色值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        strokeColor?: number;\n        /**\n         * size\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 字号\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        size?: number;\n        /**\n         * stroke width\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 描边大小\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        stroke?: number;\n        /**\n         * whether bold\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否加粗\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        bold?: boolean;\n        /**\n         * whether italic\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否倾斜\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        italic?: boolean;\n        /**\n         * fontFamily\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 字体名称\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        fontFamily?: string;\n        /**\n         * Link events or address\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 链接事件或者地址\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        href?: string;\n        /**\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        target?: string;\n        /**\n         * Is underlined\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否加下划线\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        underline?: boolean;\n    }\n    /**\n     * Used to build the basic structure of text with a variety of mixed styles, mainly for setting textFlow property\n     * @see http://edn.egret.com/cn/docs/page/146 Text mixed in a variety of style\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 用于建立多种样式混合文本的基本结构，主要用于设置 textFlow 属性\n     * @see http://edn.egret.com/cn/docs/page/146 多种样式文本混合\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface ITextElement {\n        /**\n         * String Content\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 字符串内容\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        text: string;\n        /**\n         * Text Style\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本样式\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        style?: ITextStyle;\n    }\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    interface IWTextElement extends ITextElement {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        width: number;\n    }\n    /**\n     * 文本最终解析的一行数据格式\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    interface ILineElement {\n        /**\n         * 文本占用宽度\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        width: number;\n        /**\n         * 文本占用高度\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        height: number;\n        /**\n         * 当前文本字符总数量（包括换行符）\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        charNum: number;\n        /**\n         * 是否含有换行符\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        hasNextLine: boolean;\n        /**\n         * 本行文本内容\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        elements: Array<IWTextElement>;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    class InputController extends HashObject {\n        /**\n         * @private\n         */\n        stageText: egret.StageText;\n        /**\n         * @private\n         */\n        private stageTextAdded;\n        /**\n         * @private\n         */\n        private _text;\n        /**\n         * @private\n         */\n        private _isFocus;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor();\n        /**\n         *\n         * @param text\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        init(text: TextField): void;\n        /**\n         * @private\n         *\n         */\n        _addStageText(): void;\n        /**\n         * @private\n         *\n         */\n        _removeStageText(): void;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        _getText(): string;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        _setText(value: string): void;\n        /**\n         * @private\n         */\n        _setColor(value: number): void;\n        /**\n         * @private\n         *\n         * @param event\n         */\n        private focusHandler(event);\n        /**\n         * @private\n         *\n         * @param event\n         */\n        private blurHandler(event);\n        private tempStage;\n        private onMouseDownHandler(event);\n        $onFocus(): void;\n        private onStageDownHandler(event);\n        /**\n         * @private\n         *\n         * @param event\n         */\n        private updateTextHandler(event);\n        /**\n         * @private\n         *\n         */\n        private resetText();\n        /**\n         * @private\n         *\n         */\n        _hideInput(): void;\n        /**\n         * @private\n         *\n         */\n        private updateInput();\n        /**\n         * @private\n         *\n         */\n        _updateProperties(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    interface StageText extends EventDispatcher {\n        /**\n         * @private\n         */\n        $textfield: egret.TextField;\n        /**\n         * @private\n         *\n         * @param textfield\n         */\n        $setTextField(textfield: egret.TextField): boolean;\n        /**\n         * @private\n         *\n         */\n        $resetStageText(): void;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getText(): string;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setText(value: string): boolean;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setColor(value: number): boolean;\n        /**\n         * @private\n         *\n         */\n        $show(): void;\n        /**\n         * @private\n         *\n         */\n        $hide(): void;\n        /**\n         * @private\n         *\n         */\n        $addToStage(): void;\n        /**\n         * @private\n         *\n         */\n        $removeFromStage(): void;\n        /**\n         * @private\n         *\n         */\n        $onBlur(): void;\n    }\n    /**\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    let StageText: {\n        new (): StageText;\n    };\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     */\n    const enum TextKeys {\n        /**\n         * @private\n         */\n        fontSize = 0,\n        /**\n         * @private\n         */\n        lineSpacing = 1,\n        /**\n         * @private\n         */\n        textColor = 2,\n        /**\n         * @private\n         */\n        textFieldWidth = 3,\n        /**\n         * @private\n         */\n        textFieldHeight = 4,\n        /**\n         * @private\n         */\n        textWidth = 5,\n        /**\n         * @private\n         */\n        textHeight = 6,\n        /**\n         * @private\n         */\n        textDrawWidth = 7,\n        /**\n         * @private\n         */\n        fontFamily = 8,\n        /**\n         * @private\n         */\n        textAlign = 9,\n        /**\n         * @private\n         */\n        verticalAlign = 10,\n        /**\n         * @private\n         */\n        textColorString = 11,\n        /**\n         * @private\n         */\n        fontString = 12,\n        /**\n         * @private\n         */\n        text = 13,\n        /**\n         * @private\n         */\n        measuredWidths = 14,\n        /**\n         * @private\n         */\n        bold = 15,\n        /**\n         * @private\n         */\n        italic = 16,\n        /**\n         * @private\n         */\n        fontStringChanged = 17,\n        /**\n         * @private\n         */\n        textLinesChanged = 18,\n        /**\n         * @private\n         */\n        wordWrap = 19,\n        /**\n         * @private\n         */\n        displayAsPassword = 20,\n        /**\n         * @private\n         */\n        maxChars = 21,\n        /**\n         * @private\n         */\n        selectionActivePosition = 22,\n        /**\n         * @private\n         */\n        selectionAnchorPosition = 23,\n        /**\n         * @private\n         */\n        type = 24,\n        /**\n         * @private\n         */\n        strokeColor = 25,\n        /**\n         * @private\n         */\n        strokeColorString = 26,\n        /**\n         * @private\n         */\n        stroke = 27,\n        /**\n         * @private\n         */\n        scrollV = 28,\n        /**\n         * @private\n         */\n        numLines = 29,\n        /**\n         * @private\n         */\n        multiline = 30,\n        /**\n         * @private\n         */\n        border = 31,\n        /**\n         * @private\n         */\n        borderColor = 32,\n        /**\n         * @private\n         */\n        background = 33,\n        /**\n         * @private\n         */\n        backgroundColor = 34,\n        /**\n         * @private\n         */\n        restrictAnd = 35,\n        /**\n         * @private\n         */\n        restrictNot = 36,\n        /**\n         * @private\n         */\n        inputType = 37,\n        /**\n         * @private\n         */\n        textLinesChangedForNativeRender = 38,\n    }\n}\ndeclare namespace egret {\n    /**\n     * TextField is the text rendering class of egret. It conducts rendering by using the browser / device API. Due to different ways of font rendering in different browsers / devices, there may be differences in the rendering\n     * If developers expect  no differences among all platforms, please use BitmapText\n     * @see http://edn.egret.com/cn/docs/page/141 Create Text\n     *\n     * @event egret.Event.CHANGE Dispatched when entering text user input。\n     * @event egret.FocusEvent.FOCUS_IN Dispatched after the focus to enter text.\n     * @event egret.FocusEvent.FOCUS_OUT Enter the text loses focus after dispatch.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/TextField.ts\n     * @language en_US\n     */\n    /**\n     * TextField是egret的文本渲染类，采用浏览器/设备的API进行渲染，在不同的浏览器/设备中由于字体渲染方式不一，可能会有渲染差异\n     * 如果开发者希望所有平台完全无差异，请使用BitmapText\n     * @see http://edn.egret.com/cn/docs/page/141 创建文本\n     *\n     * @event egret.Event.CHANGE 输入文本有用户输入时调度。\n     * @event egret.FocusEvent.FOCUS_IN 聚焦输入文本后调度。\n     * @event egret.FocusEvent.FOCUS_OUT 输入文本失去焦点后调度。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/TextField.ts\n     * @language zh_CN\n     */\n    class TextField extends DisplayObject {\n        /**\n         * default fontFamily\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 默认文本字体\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static default_fontFamily: string;\n        /**\n         * default size in pixels of text\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 默认文本字号大小\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static default_size: number;\n        /**\n         * default color of the text.\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 默认文本颜色\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static default_textColor: number;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor();\n        protected createNativeDisplayObject(): void;\n        /**\n         * @private\n         */\n        $TextField: Object;\n        /**\n         * @private\n         */\n        private isInput();\n        $inputEnabled: boolean;\n        $setTouchEnabled(value: boolean): void;\n        /**\n         * The name of the font to use, or a comma-separated list of font names.\n         * @default \"Arial\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 要使用的字体的名称或用逗号分隔的字体名称列表。\n         * @default \"Arial\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        fontFamily: string;\n        $setFontFamily(value: string): boolean;\n        /**\n         * The size in pixels of text\n         * @default 30\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本的字号大小。\n         * @default 30\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        size: number;\n        $setSize(value: number): boolean;\n        /**\n         * Specifies whether the text is boldface.\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否显示为粗体。\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        bold: boolean;\n        $setBold(value: boolean): boolean;\n        /**\n         * Determines whether the text is italic font.\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否显示为斜体。\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        italic: boolean;\n        $setItalic(value: boolean): boolean;\n        /**\n         * @private\n         *\n         */\n        private invalidateFontString();\n        /**\n         * Horizontal alignment of text.\n         * @default：egret.HorizontalAlign.LEFT\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本的水平对齐方式。\n         * @default：egret.HorizontalAlign.LEFT\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        textAlign: string;\n        $setTextAlign(value: string): boolean;\n        /**\n         * Vertical alignment of text.\n         * @default：egret.VerticalAlign.TOP\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文字的垂直对齐方式。\n         * @default：egret.VerticalAlign.TOP\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        verticalAlign: string;\n        $setVerticalAlign(value: string): boolean;\n        /**\n         * An integer representing the amount of vertical space between lines.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个整数，表示行与行之间的垂直间距量\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        lineSpacing: number;\n        $setLineSpacing(value: number): boolean;\n        /**\n         * Color of the text.\n         * @default 0x000000\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本颜色\n         * @default 0x000000\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        textColor: number;\n        $setTextColor(value: number): boolean;\n        /**\n         * A Boolean value that indicates whether the text field word wrap. If the value is true, then the text field by word wrap;\n         * if the value is false, the text field by newline characters.\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个布尔值，表示文本字段是否按单词换行。如果值为 true，则该文本字段按单词换行；\n         * 如果值为 false，则该文本字段按字符换行。\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        wordWrap: boolean;\n        $setWordWrap(value: boolean): void;\n        protected inputUtils: InputController;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Type of the text field.\n         * Any one of the following TextFieldType constants: TextFieldType.DYNAMIC (specifies the dynamic text field that users can not edit), or TextFieldType.INPUT (specifies the dynamic text field that users can edit).\n         * @default egret.TextFieldType.DYNAMIC\n         * @language en_US\n         */\n        /**\n         * 文本字段的类型。\n         * 以下 TextFieldType 常量中的任一个：TextFieldType.DYNAMIC（指定用户无法编辑的动态文本字段），或 TextFieldType.INPUT（指定用户可以编辑的输入文本字段）。\n         * @default egret.TextFieldType.DYNAMIC\n         * @language zh_CN\n         */\n        type: string;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setType(value: string): boolean;\n        /**\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         */\n        /**\n         * Pop-up keyboard type.\n         * Any of a TextFieldInputType constants.\n         * @language en_US\n         */\n        /**\n         * 弹出键盘的类型。\n         * TextFieldInputType 常量中的任一个。\n         * @language zh_CN\n         */\n        inputType: string;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Serve as a string of the current text field in the text\n         * @language en_US\n         */\n        /**\n         * 作为文本字段中当前文本的字符串\n         * @language zh_CN\n         */\n        text: string;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getText(): string;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setBaseText(value: string): boolean;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setText(value: string): boolean;\n        /**\n         * Specify whether the text field is a password text field.\n         * If the value of this property is true, the text field is treated as a password text field and hides the input characters using asterisks instead of the actual characters. If false, the text field is not treated as a password text field.\n         * @default false\n         * @language en_US\n         */\n        /**\n         * 指定文本字段是否是密码文本字段。\n         * 如果此属性的值为 true，则文本字段被视为密码文本字段，并使用星号而不是实际字符来隐藏输入的字符。如果为 false，则不会将文本字段视为密码文本字段。\n         * @default false\n         * @language zh_CN\n         */\n        displayAsPassword: boolean;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setDisplayAsPassword(value: boolean): boolean;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Represent the stroke color of the text.\n         * Contain three 8-bit numbers with RGB color components; for example, 0xFF0000 is red, 0x00FF00 is green.\n         * @default 0x000000\n         * @language en_US\n         */\n        /**\n         * 表示文本的描边颜色。\n         * 包含三个 8 位 RGB 颜色成分的数字；例如，0xFF0000 为红色，0x00FF00 为绿色。\n         * @default 0x000000\n         * @language zh_CN\n         */\n        strokeColor: number;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setStrokeColor(value: number): boolean;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Indicate the stroke width.\n         * 0 means no stroke.\n         * @default 0\n         * @language en_US\n         */\n        /**\n         * 表示描边宽度。\n         * 0为没有描边。\n         * @default 0\n         * @language zh_CN\n         */\n        stroke: number;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setStroke(value: number): boolean;\n        /**\n         * The maximum number of characters that the text field can contain, as entered by a user. \\n A script can insert more text than maxChars allows; the maxChars property indicates only how much text a user can enter. If the value of this property is 0, a user can enter an unlimited amount of text.\n         * The default value is 0.\n         * @default 0\n         * @language en_US\n         */\n        /**\n         * 文本字段中最多可包含的字符数（即用户输入的字符数）。\n         * 脚本可以插入比 maxChars 允许的字符数更多的文本；maxChars 属性仅表示用户可以输入多少文本。如果此属性的值为 0，则用户可以输入无限数量的文本。\n         * @default 0\n         * @language zh_CN\n         */\n        maxChars: number;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setMaxChars(value: number): boolean;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Vertical position of text in a text field. scrollV property helps users locate specific passages in a long article, and create scrolling text fields.\n         * Vertically scrolling units are lines, and horizontal scrolling unit is pixels.\n         * If the first displayed line is the first line in the text field, scrollV is set to 1 (instead of 0).\n         * @language en_US\n         */\n        /**\n         * 文本在文本字段中的垂直位置。scrollV 属性可帮助用户定位到长篇文章的特定段落，还可用于创建滚动文本字段。\n         * 垂直滚动的单位是行，而水平滚动的单位是像素。\n         * 如果显示的第一行是文本字段中的第一行，则 scrollV 设置为 1（而非 0）。\n         * @language zh_CN\n         */\n        scrollV: number;\n        /**\n         * The maximum value of scrollV\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * scrollV 的最大值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly maxScrollV: number;\n        /**\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly selectionBeginIndex: number;\n        /**\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly selectionEndIndex: number;\n        /**\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly caretIndex: number;\n        /**\n         * @private\n         *\n         * @param beginIndex\n         * @param endIndex\n         */\n        $setSelection(beginIndex: number, endIndex: number): boolean;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getLineHeight(): number;\n        /**\n         * Number of lines of text.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本行数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly numLines: number;\n        /**\n         * Indicate whether field is a multiline text field. Note that this property is valid only when the type is TextFieldType.INPUT.\n         * If the value is true, the text field is multiline; if the value is false, the text field is a single-line text field. In a field of type TextFieldType.INPUT, the multiline value determines whether the Enter key creates a new line (a value of false, and the Enter key is ignored).\n         * @default false\n         * @language en_US\n         */\n        /**\n         * 表示字段是否为多行文本字段。注意，此属性仅在type为TextFieldType.INPUT时才有效。\n         * 如果值为 true，则文本字段为多行文本字段；如果值为 false，则文本字段为单行文本字段。在类型为 TextFieldType.INPUT 的字段中，multiline 值将确定 Enter 键是否创建新行（如果值为 false，则将忽略 Enter 键）。\n         * @default false\n         * @language zh_CN\n         */\n        multiline: boolean;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setMultiline(value: boolean): boolean;\n        /**\n         * Indicates a user can enter into the text field character set. If you restrict property is null, you can enter any character. If you restrict property is an empty string, you can not enter any character. If you restrict property is a string of characters, you can enter only characters in the string in the text field. The string is scanned from left to right. You can use a hyphen (-) to specify a range. Only restricts user interaction; a script may put any text into the text field. <br/>\n                  * If the string of characters caret (^) at the beginning, all characters are initially accepted, then the string are excluded from receiving ^ character. If the string does not begin with a caret (^) to, any characters are initially accepted and then a string of characters included in the set of accepted characters. <br/>\n                  * The following example allows only uppercase characters, spaces, and numbers in the text field: <br/>\n                  * My_txt.restrict = \"A-Z 0-9\"; <br/>\n                  * The following example includes all characters except lowercase letters: <br/>\n                  * My_txt.restrict = \"^ a-z\"; <br/>\n                  * If you need to enter characters \\ ^, use two backslash \"\\\\ -\" \"\\\\ ^\": <br/>\n                  * Can be used anywhere in the string ^ to rule out including characters and switch between characters, but can only be used to exclude a ^. The following code includes only uppercase letters except uppercase Q: <br/>\n                  * My_txt.restrict = \"A-Z ^ Q\"; <br/>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @default null\n         * @language en_US\n         */\n        /**\n         * 表示用户可输入到文本字段中的字符集。如果 restrict 属性的值为 null，则可以输入任何字符。如果 restrict 属性的值为空字符串，则不能输入任何字符。如果 restrict 属性的值为一串字符，则只能在文本字段中输入该字符串中的字符。从左向右扫描该字符串。可以使用连字符 (-) 指定一个范围。只限制用户交互；脚本可将任何文本放入文本字段中。<br/>\n         * 如果字符串以尖号 (^) 开头，则先接受所有字符，然后从接受字符集中排除字符串中 ^ 之后的字符。如果字符串不以尖号 (^) 开头，则最初不接受任何字符，然后将字符串中的字符包括在接受字符集中。<br/>\n         * 下例仅允许在文本字段中输入大写字符、空格和数字：<br/>\n         * my_txt.restrict = \"A-Z 0-9\";<br/>\n         * 下例包含除小写字母之外的所有字符：<br/>\n         * my_txt.restrict = \"^a-z\";<br/>\n         * 如果需要输入字符 \\ ^，请使用2个反斜杠 \"\\\\-\" \"\\\\^\" ：<br/>\n         * 可在字符串中的任何位置使用 ^，以在包含字符与排除字符之间进行切换，但是最多只能有一个 ^ 用来排除。下面的代码只包含除大写字母 Q 之外的大写字母：<br/>\n         * my_txt.restrict = \"A-Z^Q\";<br/>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @default null\n         * @language zh_CN\n         */\n        restrict: string;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setWidth(value: number): boolean;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setHeight(value: number): boolean;\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        $getWidth(): number;\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        $getHeight(): number;\n        /**\n         * @private\n         */\n        private textNode;\n        /**\n         * @private\n         */\n        $graphicsNode: sys.GraphicsNode;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Specifies whether the text field has a border.\n         * If true, the text field has a border. If false, the text field has no border.\n         * Use borderColor property to set the border color.\n         * @default false\n         * @language en_US\n         */\n        /**\n         * 指定文本字段是否具有边框。\n         * 如果为 true，则文本字段具有边框。如果为 false，则文本字段没有边框。\n         * 使用 borderColor 属性来设置边框颜色。\n         * @default false\n         * @language zh_CN\n         */\n        border: boolean;\n        /**\n         * @private\n         */\n        $setBorder(value: boolean): void;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * The color of the text field border.\n         * Even currently is no border can be retrieved or set this property, but only if the text field has the border property is set to true, the color is visible.\n         * @default 0x000000\n         * @language en_US\n         */\n        /**\n         * 文本字段边框的颜色。\n         * 即使当前没有边框，也可检索或设置此属性，但只有当文本字段已将 border 属性设置为 true 时，才可以看到颜色。\n         * @default 0x000000\n         * @language zh_CN\n         */\n        borderColor: number;\n        /**\n         * @private\n         */\n        $setBorderColor(value: number): void;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Specifies whether the text field has a background fill.\n         * If true, the text field has a background fill. If false, the text field has no background fill.\n         * Use the backgroundColor property to set the background color of the text field.\n         * @default false\n         * @language en_US\n         */\n        /**\n         * 指定文本字段是否具有背景填充。\n         * 如果为 true，则文本字段具有背景填充。如果为 false，则文本字段没有背景填充。\n         * 使用 backgroundColor 属性来设置文本字段的背景颜色。\n         * @default false\n         * @language zh_CN\n         */\n        background: boolean;\n        /**\n         * @private\n         */\n        $setBackground(value: boolean): void;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Color of the text field background.\n         * Even currently is no background, can be retrieved or set this property, but only if the text field has the background property set to true, the color is visible.\n         * @default 0xFFFFFF\n         * @language en_US\n         */\n        /**\n         * 文本字段背景的颜色。\n         * 即使当前没有背景，也可检索或设置此属性，但只有当文本字段已将 background 属性设置为 true 时，才可以看到颜色。\n         * @default 0xFFFFFF\n         * @language zh_CN\n         */\n        backgroundColor: number;\n        /**\n         * @private\n         */\n        $setBackgroundColor(value: number): void;\n        /**\n         * @private\n         *\n         */\n        private fillBackground(lines?);\n        /**\n         * Enter the text automatically entered into the input state, the input type is text only and may only be invoked in the user interaction.\n         * @version Egret 3.0.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 输入文本自动进入到输入状态，仅在类型是输入文本并且是在用户交互下才可以调用。\n         * @version Egret 3.0.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setFocus(): void;\n        /**\n         * @private\n         *\n         */\n        $onRemoveFromStage(): void;\n        /**\n         * @private\n         *\n         * @param stage\n         * @param nestLevel\n         */\n        $onAddToStage(stage: Stage, nestLevel: number): void;\n        $invalidateTextField(): void;\n        $getRenderBounds(): Rectangle;\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        $updateRenderNode(): void;\n        /**\n         * @private\n         */\n        private isFlow;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Set rich text\n         * @language en_US\n         */\n        /**\n         * 设置富文本\n         * @see http://edn.egret.com/cn/index.php/article/index/id/146\n         * @language zh_CN\n         */\n        textFlow: Array<egret.ITextElement>;\n        /**\n         * @private\n         *\n         * @param text\n         * @returns\n         */\n        private changeToPassText(text);\n        /**\n         * @private\n         */\n        private textArr;\n        /**\n         * @private\n         *\n         * @param textArr\n         */\n        private setMiddleStyle(textArr);\n        /**\n         * Get the text measured width\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取文本测量宽度\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly textWidth: number;\n        /**\n         * Get Text measuring height\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取文本测量高度\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly textHeight: number;\n        /**\n         * @private\n         * @param text\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        appendText(text: string): void;\n        /**\n         * @private\n         * @param element\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        appendElement(element: egret.ITextElement): void;\n        /**\n         * @private\n         */\n        private linesArr;\n        $getLinesArr(): Array<egret.ILineElement>;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getLinesArr2(): Array<egret.ILineElement>;\n        /**\n         * @private\n         */\n        $isTyping: boolean;\n        /**\n         * @private\n         */\n        $setIsTyping(value: boolean): void;\n        /**\n         * @private\n         * 返回要绘制的下划线列表\n         */\n        private drawText();\n        private addEvent();\n        private removeEvent();\n        private onTapHandler(e);\n    }\n    interface TextField {\n        addEventListener<Z>(type: \"link\", listener: (this: Z, e: TextEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener<Z>(type: \"focusIn\" | \"focusOut\", listener: (this: Z, e: FocusEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): any;\n    }\n}\ndeclare namespace egret {\n    /**\n     * TextFieldInputType class is an enumeration of constant value used in setting the inputType property of the TextField class.\n     * @version Egret 3.1.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * TextFieldInputType 类是在设置 TextField 类的 inputType 属性时使用的常数值的枚举。\n     * @version Egret 3.1.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class TextFieldInputType {\n        /**\n         * The default\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 默认 input 类型\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TEXT: string;\n        /**\n         * Telephone Number Inputs\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 电话号码 input 类型\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TEL: string;\n        /**\n         * Password Inputs\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * password 类型\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static PASSWORD: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * TextFieldType class is an enumeration of constant value used in setting the type property of the TextField class.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * TextFieldType 类是在设置 TextField 类的 type 属性时使用的常数值的枚举。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class TextFieldType {\n        /**\n         * Used to specify dynamic text\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于指定动态文本\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static DYNAMIC: string;\n        /**\n         * Used to specify the input text\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于指定输入文本\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static INPUT: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    class TextFieldUtils {\n        /**\n         * 获取第一个绘制的行数\n         * @param textfield 文本\n         * @returns {number} 行数，从0开始\n         * @private\n         */\n        static $getStartLine(textfield: egret.TextField): number;\n        /**\n         * 获取水平比例\n         * @param textfield 文本\n         * @returns {number} 水平比例\n         * @private\n         */\n        static $getHalign(textfield: egret.TextField): number;\n        /**\n         * @private\n         *\n         * @param textfield\n         * @returns\n         */\n        static $getTextHeight(textfield: egret.TextField): number;\n        /**\n         * 获取垂直比例\n         * @param textfield 文本\n         * @returns {number} 垂直比例\n         * @private\n         */\n        static $getValign(textfield: egret.TextField): number;\n        /**\n         * 根据x、y获取文本项\n         * @param textfield 文本\n         * @param x x坐标值\n         * @param y y坐标值\n         * @returns 文本单项\n         * @private\n         */\n        static $getTextElement(textfield: egret.TextField, x: number, y: number): ITextElement;\n        /**\n         * 获取文本点击块\n         * @param textfield 文本\n         * @param x x坐标值\n         * @param y y坐标值\n         * @returns 文本点击块\n         * @private\n         */\n        static $getHit(textfield: egret.TextField, x: number, y: number): IHitTextElement;\n        /**\n         * 获取当前显示多少行\n         * @param textfield 文本\n         * @returns {number} 显示的行数\n         * @private\n         */\n        static $getScrollNum(textfield: egret.TextField): number;\n    }\n}\n/**\n * @private\n */\ndeclare namespace egret.sys {\n    /**\n     * 测量文本在指定样式下的宽度。\n     * @param text 要测量的文本内容。\n     * @param fontFamily 字体名称\n     * @param fontSize 字体大小\n     * @param bold 是否粗体\n     * @param italic 是否斜体\n     */\n    let measureText: (text: string, fontFamily: string, fontSize: number, bold: boolean, italic: boolean) => number;\n}\ndeclare namespace egret {\n    /**\n     * The VerticalAlign class defines the possible values for the vertical alignment.\n     * @see egret.TextField#verticalAlign\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * VerticalAlign 类为垂直对齐方式定义可能的值。\n     * @see egret.TextField#verticalAlign\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class VerticalAlign {\n        /**\n         * Vertically align content to the top of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将内容与容器的顶部对齐。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TOP: string;\n        /**\n         * Vertically align content to the bottom of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将内容与容器的底部对齐。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static BOTTOM: string;\n        /**\n         * Vertically align content in the middle of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在容器的垂直中心对齐内容。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static MIDDLE: string;\n        /**\n         * Vertical alignment with both edges\n         * Note: TextFiled does not support this alignment method.\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 垂直两端对齐\n         * 注意：TextFiled不支持此对齐方式。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static JUSTIFY: string;\n        /**\n         * Align the content of the child items, relative to the container. This operation will adjust uniformly the size of all the child items to be the Content Height \\\" of the container \\\".\n         * The Content Height \\\" of the container \\\" is the size of the max. child item. If the size of all child items are less than the height of the container, they will be adjusted to the height of the container.\n         * Note: TextFiled does not support this alignment method.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 相对于容器对子项进行内容对齐。这会将所有子项的大小统一调整为容器的\"内容高度\"。\n         * 容器的\"内容高度\"是最大子项的大小,如果所有子项都小于容器的高度，则会将所有子项的大小调整为容器的高度。\n         * 注意：TextFiled不支持此对齐方式。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static CONTENT_JUSTIFY: string;\n    }\n}\ndeclare namespace egret {\n    /**\n    * @language en_US\n    * The Base64Util class provides methods for encoding and decoding base64.\n    * @version Egret 2.4\n    * @platform Web,Native\n    * @includeExample egret/utils/Base64Util.ts\n    */\n    /**\n     * @language zh_CN\n     * Base64Util 类提供用于编解码base64的方法。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/Base64Util.ts\n     */\n    class Base64Util {\n        /**\n         * @language en_US\n         * encode base64.\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * @language zh_CN\n         * 编码base64。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static encode(arraybuffer: ArrayBuffer): string;\n        /**\n         * @language en_US\n         * decode base64.\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * @language zh_CN\n         * 解码base64。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static decode(base64: string): ArrayBuffer;\n    }\n}\n/**\n * @private\n */\ndeclare let chars: string;\n/**\n * @private\n */\ndeclare let lookup: Uint8Array;\ndeclare namespace egret {\n    /**\n     * The Endian class contains values that denote the byte order used to represent multibyte numbers.\n     * The byte order is either bigEndian (most significant byte first) or littleEndian (least significant byte first).\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * Endian 类中包含一些值，它们表示用于表示多字节数字的字节顺序。\n     * 字节顺序为 bigEndian（最高有效字节位于最前）或 littleEndian（最低有效字节位于最前）。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class Endian {\n        /**\n         * Indicates the least significant byte of the multibyte number appears first in the sequence of bytes.\n         * The hexadecimal number 0x12345678 has 4 bytes (2 hexadecimal digits per byte). The most significant byte is 0x12. The least significant byte is 0x78. (For the equivalent decimal number, 305419896, the most significant digit is 3, and the least significant digit is 6).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示多字节数字的最低有效字节位于字节序列的最前面。\n         * 十六进制数字 0x12345678 包含 4 个字节（每个字节包含 2 个十六进制数字）。最高有效字节为 0x12。最低有效字节为 0x78。（对于等效的十进制数字 305419896，最高有效数字是 3，最低有效数字是 6）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static LITTLE_ENDIAN: string;\n        /**\n         * Indicates the most significant byte of the multibyte number appears first in the sequence of bytes.\n         * The hexadecimal number 0x12345678 has 4 bytes (2 hexadecimal digits per byte).  The most significant byte is 0x12. The least significant byte is 0x78. (For the equivalent decimal number, 305419896, the most significant digit is 3, and the least significant digit is 6).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示多字节数字的最高有效字节位于字节序列的最前面。\n         * 十六进制数字 0x12345678 包含 4 个字节（每个字节包含 2 个十六进制数字）。最高有效字节为 0x12。最低有效字节为 0x78。（对于等效的十进制数字 305419896，最高有效数字是 3，最低有效数字是 6）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static BIG_ENDIAN: string;\n    }\n    const enum EndianConst {\n        LITTLE_ENDIAN = 0,\n        BIG_ENDIAN = 1,\n    }\n    /**\n     * The ByteArray class provides methods and attributes for optimized reading and writing as well as dealing with binary data.\n     * Note: The ByteArray class is applied to the advanced developers who need to access data at the byte layer.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/ByteArray.ts\n     * @language en_US\n     */\n    /**\n     * ByteArray 类提供用于优化读取、写入以及处理二进制数据的方法和属性。\n     * 注意：ByteArray 类适用于需要在字节层访问数据的高级开发人员。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/ByteArray.ts\n     * @language zh_CN\n     */\n    class ByteArray {\n        /**\n         * @private\n         */\n        protected bufferExtSize: number;\n        protected data: DataView;\n        protected _bytes: Uint8Array;\n        /**\n         * @private\n         */\n        protected _position: number;\n        /**\n         *\n         * 已经使用的字节偏移量\n         * @protected\n         * @type {number}\n         * @memberOf ByteArray\n         */\n        protected write_position: number;\n        /**\n         * Changes or reads the byte order; egret.EndianConst.BIG_ENDIAN or egret.EndianConst.LITTLE_EndianConst.\n         * @default egret.EndianConst.BIG_ENDIAN\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 更改或读取数据的字节顺序；egret.EndianConst.BIG_ENDIAN 或 egret.EndianConst.LITTLE_ENDIAN。\n         * @default egret.EndianConst.BIG_ENDIAN\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        endian: string;\n        protected $endian: EndianConst;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor(buffer?: ArrayBuffer | Uint8Array, bufferExtSize?: number);\n        /**\n         * @deprecated\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        setArrayBuffer(buffer: ArrayBuffer): void;\n        /**\n         * 可读的剩余字节数\n         *\n         * @returns\n         *\n         * @memberOf ByteArray\n         */\n        readonly readAvailable: number;\n        /**\n         * @private\n         */\n        buffer: ArrayBuffer;\n        readonly rawBuffer: ArrayBuffer;\n        readonly bytes: Uint8Array;\n        /**\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * @private\n         */\n        dataView: DataView;\n        /**\n         * @private\n         */\n        readonly bufferOffset: number;\n        /**\n         * The current position of the file pointer (in bytes) to move or return to the ByteArray object. The next time you start reading reading method call in this position, or will start writing in this position next time call a write method.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将文件指针的当前位置（以字节为单位）移动或返回到 ByteArray 对象中。下一次调用读取方法时将在此位置开始读取，或者下一次调用写入方法时将在此位置开始写入。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        position: number;\n        /**\n         * The length of the ByteArray object (in bytes).\n                  * If the length is set to be larger than the current length, the right-side zero padding byte array.\n                  * If the length is set smaller than the current length, the byte array is truncated.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * ByteArray 对象的长度（以字节为单位）。\n         * 如果将长度设置为大于当前长度的值，则用零填充字节数组的右侧。\n         * 如果将长度设置为小于当前长度的值，将会截断该字节数组。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        length: number;\n        protected _validateBuffer(value: number): void;\n        /**\n         * The number of bytes that can be read from the current position of the byte array to the end of the array data.\n         * When you access a ByteArray object, the bytesAvailable property in conjunction with the read methods each use to make sure you are reading valid data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 可从字节数组的当前位置到数组末尾读取的数据的字节数。\n         * 每次访问 ByteArray 对象时，将 bytesAvailable 属性与读取方法结合使用，以确保读取有效的数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly bytesAvailable: number;\n        /**\n         * Clears the contents of the byte array and resets the length and position properties to 0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 清除字节数组的内容，并将 length 和 position 属性重置为 0。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        clear(): void;\n        /**\n         * Read a Boolean value from the byte stream. Read a simple byte. If the byte is non-zero, it returns true; otherwise, it returns false.\n         * @return If the byte is non-zero, it returns true; otherwise, it returns false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取布尔值。读取单个字节，如果字节非零，则返回 true，否则返回 false\n         * @return 如果字节不为零，则返回 true，否则返回 false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readBoolean(): boolean;\n        /**\n         * Read signed bytes from the byte stream.\n         * @return An integer ranging from -128 to 127\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取带符号的字节\n         * @return 介于 -128 和 127 之间的整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readByte(): number;\n        /**\n         * Read data byte number specified by the length parameter from the byte stream. Starting from the position specified by offset, read bytes into the ByteArray object specified by the bytes parameter, and write bytes into the target ByteArray\n         * @param bytes ByteArray object that data is read into\n         * @param offset Offset (position) in bytes. Read data should be written from this position\n         * @param length Byte number to be read Default value 0 indicates reading all available data\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取 length 参数指定的数据字节数。从 offset 指定的位置开始，将字节读入 bytes 参数指定的 ByteArray 对象中，并将字节写入目标 ByteArray 中\n         * @param bytes 要将数据读入的 ByteArray 对象\n         * @param offset bytes 中的偏移（位置），应从该位置写入读取的数据\n         * @param length 要读取的字节数。默认值 0 导致读取所有可用的数据\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readBytes(bytes: ByteArray, offset?: number, length?: number): void;\n        /**\n         * Read an IEEE 754 double-precision (64 bit) floating point number from the byte stream\n         * @return Double-precision (64 bit) floating point number\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个 IEEE 754 双精度（64 位）浮点数\n         * @return 双精度（64 位）浮点数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readDouble(): number;\n        /**\n         * Read an IEEE 754 single-precision (32 bit) floating point number from the byte stream\n         * @return Single-precision (32 bit) floating point number\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个 IEEE 754 单精度（32 位）浮点数\n         * @return 单精度（32 位）浮点数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readFloat(): number;\n        /**\n         * Read a 32-bit signed integer from the byte stream.\n         * @return A 32-bit signed integer ranging from -2147483648 to 2147483647\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个带符号的 32 位整数\n         * @return 介于 -2147483648 和 2147483647 之间的 32 位带符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readInt(): number;\n        /**\n         * Read a 16-bit signed integer from the byte stream.\n         * @return A 16-bit signed integer ranging from -32768 to 32767\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个带符号的 16 位整数\n         * @return 介于 -32768 和 32767 之间的 16 位带符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readShort(): number;\n        /**\n         * Read unsigned bytes from the byte stream.\n         * @return A unsigned integer ranging from 0 to 255\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取无符号的字节\n         * @return 介于 0 和 255 之间的无符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readUnsignedByte(): number;\n        /**\n         * Read a 32-bit unsigned integer from the byte stream.\n         * @return A 32-bit unsigned integer ranging from 0 to 4294967295\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个无符号的 32 位整数\n         * @return 介于 0 和 4294967295 之间的 32 位无符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readUnsignedInt(): number;\n        /**\n         * Read a 16-bit unsigned integer from the byte stream.\n         * @return A 16-bit unsigned integer ranging from 0 to 65535\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个无符号的 16 位整数\n         * @return 介于 0 和 65535 之间的 16 位无符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readUnsignedShort(): number;\n        /**\n         * Read a UTF-8 character string from the byte stream Assume that the prefix of the character string is a short unsigned integer (use byte to express length)\n         * @return UTF-8 character string\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个 UTF-8 字符串。假定字符串的前缀是无符号的短整型（以字节表示长度）\n         * @return UTF-8 编码的字符串\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readUTF(): string;\n        /**\n         * Read a UTF-8 byte sequence specified by the length parameter from the byte stream, and then return a character string\n         * @param Specify a short unsigned integer of the UTF-8 byte length\n         * @return A character string consists of UTF-8 bytes of the specified length\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个由 length 参数指定的 UTF-8 字节序列，并返回一个字符串\n         * @param length 指明 UTF-8 字节长度的无符号短整型数\n         * @return 由指定长度的 UTF-8 字节组成的字符串\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readUTFBytes(length: number): string;\n        /**\n         * Write a Boolean value. A single byte is written according to the value parameter. If the value is true, write 1; if the value is false, write 0.\n         * @param value A Boolean value determining which byte is written. If the value is true, write 1; if the value is false, write 0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 写入布尔值。根据 value 参数写入单个字节。如果为 true，则写入 1，如果为 false，则写入 0\n         * @param value 确定写入哪个字节的布尔值。如果该参数为 true，则该方法写入 1；如果该参数为 false，则该方法写入 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeBoolean(value: boolean): void;\n        /**\n         * Write a byte into the byte stream\n         * The low 8 bits of the parameter are used. The high 24 bits are ignored.\n         * @param value A 32-bit integer. The low 8 bits will be written into the byte stream\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个字节\n         * 使用参数的低 8 位。忽略高 24 位\n         * @param value 一个 32 位整数。低 8 位将被写入字节流\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeByte(value: number): void;\n        /**\n         * Write the byte sequence that includes length bytes in the specified byte array, bytes, (starting at the byte specified by offset, using a zero-based index), into the byte stream\n         * If the length parameter is omitted, the default length value 0 is used and the entire buffer starting at offset is written. If the offset parameter is also omitted, the entire buffer is written\n         * If the offset or length parameter is out of range, they are clamped to the beginning and end of the bytes array.\n         * @param bytes ByteArray Object\n         * @param offset A zero-based index specifying the position into the array to begin writing\n         * @param length An unsigned integer specifying how far into the buffer to write\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将指定字节数组 bytes（起始偏移量为 offset，从零开始的索引）中包含 length 个字节的字节序列写入字节流\n         * 如果省略 length 参数，则使用默认长度 0；该方法将从 offset 开始写入整个缓冲区。如果还省略了 offset 参数，则写入整个缓冲区\n         * 如果 offset 或 length 超出范围，它们将被锁定到 bytes 数组的开头和结尾\n         * @param bytes ByteArray 对象\n         * @param offset 从 0 开始的索引，表示在数组中开始写入的位置\n         * @param length 一个无符号整数，表示在缓冲区中的写入范围\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeBytes(bytes: ByteArray, offset?: number, length?: number): void;\n        /**\n         * Write an IEEE 754 double-precision (64 bit) floating point number into the byte stream\n         * @param value Double-precision (64 bit) floating point number\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个 IEEE 754 双精度（64 位）浮点数\n         * @param value 双精度（64 位）浮点数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeDouble(value: number): void;\n        /**\n         * Write an IEEE 754 single-precision (32 bit) floating point number into the byte stream\n         * @param value Single-precision (32 bit) floating point number\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个 IEEE 754 单精度（32 位）浮点数\n         * @param value 单精度（32 位）浮点数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeFloat(value: number): void;\n        /**\n         * Write a 32-bit signed integer into the byte stream\n         * @param value An integer to be written into the byte stream\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个带符号的 32 位整数\n         * @param value 要写入字节流的整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeInt(value: number): void;\n        /**\n         * Write a 16-bit integer into the byte stream. The low 16 bits of the parameter are used. The high 16 bits are ignored.\n         * @param value A 32-bit integer. Its low 16 bits will be written into the byte stream\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个 16 位整数。使用参数的低 16 位。忽略高 16 位\n         * @param value 32 位整数，该整数的低 16 位将被写入字节流\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeShort(value: number): void;\n        /**\n         * Write a 32-bit unsigned integer into the byte stream\n         * @param value An unsigned integer to be written into the byte stream\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个无符号的 32 位整数\n         * @param value 要写入字节流的无符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeUnsignedInt(value: number): void;\n        /**\n         * Write a 16-bit unsigned integer into the byte stream\n         * @param value An unsigned integer to be written into the byte stream\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个无符号的 16 位整数\n         * @param value 要写入字节流的无符号整数\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeUnsignedShort(value: number): void;\n        /**\n         * Write a UTF-8 string into the byte stream. The length of the UTF-8 string in bytes is written first, as a 16-bit integer, followed by the bytes representing the characters of the string\n         * @param value Character string value to be written\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 UTF-8 字符串写入字节流。先写入以字节表示的 UTF-8 字符串长度（作为 16 位整数），然后写入表示字符串字符的字节\n         * @param value 要写入的字符串值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeUTF(value: string): void;\n        /**\n         * Write a UTF-8 string into the byte stream. Similar to the writeUTF() method, but the writeUTFBytes() method does not prefix the string with a 16-bit length word\n         * @param value Character string value to be written\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 UTF-8 字符串写入字节流。类似于 writeUTF() 方法，但 writeUTFBytes() 不使用 16 位长度的词为字符串添加前缀\n         * @param value 要写入的字符串值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeUTFBytes(value: string): void;\n        /**\n         *\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        toString(): string;\n        /**\n         * @private\n         * 将 Uint8Array 写入字节流\n         * @param bytes 要写入的Uint8Array\n         * @param validateBuffer\n         */\n        _writeUint8Array(bytes: Uint8Array | ArrayLike<number>, validateBuffer?: boolean): void;\n        /**\n         * @param len\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @private\n         */\n        validate(len: number): boolean;\n        /**********************/\n        /**********************/\n        /**\n         * @private\n         * @param len\n         * @param needReplace\n         */\n        protected validateBuffer(len: number): void;\n        /**\n         * @private\n         * UTF-8 Encoding/Decoding\n         */\n        private encodeUTF8(str);\n        /**\n         * @private\n         *\n         * @param data\n         * @returns\n         */\n        private decodeUTF8(data);\n        /**\n         * @private\n         *\n         * @param code_point\n         */\n        private encoderError(code_point);\n        /**\n         * @private\n         *\n         * @param fatal\n         * @param opt_code_point\n         * @returns\n         */\n        private decoderError(fatal, opt_code_point?);\n        /**\n         * @private\n         */\n        private EOF_byte;\n        /**\n         * @private\n         */\n        private EOF_code_point;\n        /**\n         * @private\n         *\n         * @param a\n         * @param min\n         * @param max\n         */\n        private inRange(a, min, max);\n        /**\n         * @private\n         *\n         * @param n\n         * @param d\n         */\n        private div(n, d);\n        /**\n         * @private\n         *\n         * @param string\n         */\n        private stringToCodePoints(string);\n    }\n}\ndeclare namespace egret {\n    /**\n     * The Sprite class is a basic display list building block: a display list node that can contain children.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Sprite.ts\n     * @language en_US\n     */\n    /**\n     * Sprite 类是基本显示列表构造块：一个可包含子项的显示列表节点。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Sprite.ts\n     * @language zh_CN\n     */\n    class Sprite extends DisplayObjectContainer {\n        /**\n         * Creates a new Sprite instance.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 实例化一个容器\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        protected createNativeDisplayObject(): void;\n        /**\n         * @private\n         */\n        $graphics: Graphics;\n        /**\n         * Specifies the Graphics object belonging to this Shape object, where vector drawing commands can occur.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取 Shape 中的 Graphics 对象。可通过此对象执行矢量绘图命令。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly graphics: Graphics;\n        $hitTest(stageX: number, stageY: number): DisplayObject;\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        /**\n         * @private\n         */\n        $onRemoveFromStage(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * Registers the runtime class information for a class.This method adds some strings which represent the class name or\n     * some interface names to the class definition. After the registration,you can use egret.is() method to do the type checking\n     * for the instance of this class.<br/>\n     * Note:If you use the TypeScript programming language, the egret command line tool will automatically generate the registration code line.\n     * You don't need to manually call this method.\n     *\n     * @example the following code shows how to register the runtime class information for the EventDispatcher class and do the type checking:\n     * <pre>\n     *      egret.registerClass(egret.EventDispatcher,\"egret.EventDispatcher\",[\"egret.IEventDispatcher\"]);\n     *      let dispatcher = new egret.EventDispatcher();\n     *      egret.log(egret.is(dispatcher, \"egret.IEventDispatcher\"));  //true。\n     *      egret.log(egret.is(dispatcher, \"egret.EventDispatcher\"));   //true。\n     *      egret.log(egret.is(dispatcher, \"egret.Bitmap\"));   //false。\n     * </pre>\n     * @param classDefinition the class definition to be registered.\n     * @param className  a unique identification string of the specific class\n     * @param interfaceNames a list of unique identification string of the specific interfaces.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 为一个类定义注册运行时类信息,用此方法往类定义上注册它自身以及所有接口对应的字符串。\n     * 在运行时，这个类的实例将可以使用 egret.is() 方法传入一个字符串来判断实例类型。\n     * @example 以下代码演示了如何为EventDispatcher类注册运行时类信息并判断类型：\n     * <pre>\n     *      //为egret.EventDispatcher类注册运行时类信息，由于它实现了IEventDispatcher接口，这里应同时传入接口名对应的字符串。\n     *      egret.registerClass(egret.EventDispatcher,\"egret.EventDispatcher\",[\"egret.IEventDispatcher\"]);\n     *      let dispatcher = new egret.EventDispatcher();\n     *      egret.log(egret.is(dispatcher, \"egret.IEventDispatcher\"));  //true。\n     *      egret.log(egret.is(dispatcher, \"egret.EventDispatcher\"));   //true。\n     *      egret.log(egret.is(dispatcher, \"egret.Bitmap\"));   //false。\n     * </pre>\n     * 注意：若您使用 TypeScript 来编写程序，egret 命令行会自动帮您生成类信息注册代码行到最终的 Javascript 文件中。因此您不需要手动调用此方法。\n     *\n     * @param classDefinition 要注册的类定义。\n     * @param className 要注册的类名。\n     * @param interfaceNames 要注册的类所实现的接口名列表。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function registerClass(classDefinition: any, className: string, interfaceNames?: string[]): void;\n}\ndeclare namespace egret {\n    /**\n     * The BitmapFillMode class defines the image fill mode of Bitmap.\n     * The BitmapFillMode class defines a pattern enumeration for adjusting size. These patterns determine how Bitmap fill the size designated by the layout system.\n     * @see http://edn.egret.com/cn/docs/page/134 Texture filling way\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/BitmapFillMode.ts\n     * @language en_US\n     */\n    /**\n     * BitmapFillMode 类定义Bitmap的图像填充方式。\n     * BitmapFillMode 类定义了调整大小模式的一个枚举，这些模式确定 Bitmap 如何填充由布局系统指定的尺寸。\n     * @see http://edn.egret.com/cn/docs/page/134 纹理的填充方式\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/BitmapFillMode.ts\n     * @language zh_CN\n     */\n    const BitmapFillMode: {\n        REPEAT: string;\n        SCALE: string;\n        CLIP: string;\n    };\n}\ndeclare namespace egret {\n    /**\n     * Logger is an entrance for the log processing namespace of the engine\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * Logger是引擎的日志处理模块入口\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class Logger {\n        /**\n         * open all\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 全开\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ALL: string;\n        /**\n         * level: DEBUG\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等级为 DEBUG\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static DEBUG: string;\n        /**\n         * level: INFO\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等级为 INFO\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static INFO: string;\n        /**\n         * level: WARN\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等级为 WARN\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static WARN: string;\n        /**\n         * level: ERROR\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等级为 ERROR\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ERROR: string;\n        /**\n         * close all\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 全关\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static OFF: string;\n        /**\n         * Set the current need to open the log level. Grade level are: ALL <DEBUG <INFO <WARN <ERROR <OFF<br/>\n         * This feature is only in DEBUG mode to take effect. <br/>\n         * <Ul>\n         * <Li> Logger.ALL - all levels of log can be printed out. </ li>\n         * <Li> Logger.DEBUG - print debug, info, log, warn, error. </ li>\n         * <Li> Logger.INFO - print info, log, warn, error. </ li>\n         * <Li> Logger.WARN - can print warn, error. </ li>\n         * <Li> Logger.ERROR - You can print error. </ li>\n         * <Li> Logger.OFF - all closed. </ li>\n         * </ Ul>\n         *param LogType from this level to start printing.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置当前需要开启的log级别。级别等级分别为：ALL < DEBUG < INFO < WARN < ERROR < OFF<br/>\n         * 此功能只在 DEBUG 模式下才生效。<br/>\n         * <ul>\n         * <li>Logger.ALL -- 所有等级的log都可以打印出来。</li>\n         * <li>Logger.DEBUG -- 可以打印debug、info、log、warn、error。</li>\n         * <li>Logger.INFO -- 可以打印info、log、warn、error。</li>\n         * <li>Logger.WARN -- 可以打印warn、error。</li>\n         * <li>Logger.ERROR -- 可以打印error。</li>\n         * <li>Logger.OFF -- 全部关闭。</li>\n         * </ul>\n         * @param logType 从这个等级开始打印。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static logLevel: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    class NumberUtils {\n        /**\n         * Judge whether it is a numerical value\n         * @param value Parameter that needs to be judged\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 判断是否是数值\n         * @param value 需要判断的参数\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static isNumber(value: any): boolean;\n        /**\n         * Obtain the approximate sin value of the corresponding angle value\n         * @param value {number} Angle value\n         * @returns {number} sin value\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 得到对应角度值的sin近似值\n         * @param value {number} 角度值\n         * @returns {number} sin值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static sin(value: number): number;\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        private static sinInt(value);\n        /**\n         * Obtain the approximate cos value of the corresponding angle value\n         * @param value {number} Angle value\n         * @returns {number} cos value\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 得到对应角度值的cos近似值\n         * @param value {number} 角度值\n         * @returns {number} cos值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static cos(value: number): number;\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        private static cosInt(value);\n        static convertStringToHashCode(str: string): number;\n    }\n}\n/**\n * @private\n */\ndeclare let egret_sin_map: {};\n/**\n * @private\n */\ndeclare let egret_cos_map: {};\n/**\n * @private\n */\ndeclare let DEG_TO_RAD: number;\ndeclare namespace egret {\n    /**\n     * The Timer class is the interface to timers, which let you run code on a specified time sequence. Use the start()\n     * method to start a timer. Add an event listener for the timer event to set up code to be run on the timer interval.<br/>\n     * You can create Timer objects to run once or repeat at specified intervals to execute code on a schedule. Depending\n     * on the framerate or the runtime environment (available memory and other factors), the runtime may dispatchEvent events at\n     * slightly offset intervals.\n     * @see egret.TimerEvent\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/Timer.ts\n     * @language en_US\n     */\n    /**\n     * Timer 类是计时器的接口，它使您能按指定的时间序列运行代码。\n     * 使用 start() 方法来启动计时器。为 timer 事件添加事件侦听器，以便将代码设置为按计时器间隔运行。\n     * 可以创建 Timer 对象以运行一次或按指定间隔重复运行，从而按计划执行代码。\n     * 根据 Egret 的帧速率或运行时环境（可用内存和其他因素），运行时调度事件的间隔可能稍有不同。\n     * @see egret.TimerEvent\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/Timer.ts\n     * @language zh_CN\n     */\n    class Timer extends EventDispatcher {\n        /**\n         * Constructs a new Timer object with the specified delay and repeatCount states.\n         * @param delay The delay between timer events, in milliseconds. A delay lower than 20 milliseconds is not recommended.\n         * Timer frequency is limited to 60 frames per second, meaning a delay lower than 16.6 milliseconds causes runtime problems.\n         * @param repeatCount Specifies the number of repetitions. If zero, the timer repeats indefinitely.If nonzero,\n         * the timer runs the specified number of times and then stops.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的 delay 和 repeatCount 状态构造新的 Timer 对象。\n         * @param delay 计时器事件间的延迟（以毫秒为单位）。建议 delay 不要低于 20 毫秒。计时器频率不得超过 60 帧/秒，这意味着低于 16.6 毫秒的延迟可导致出现运行时问题。\n         * @param repeatCount 指定重复次数。如果为零，则计时器将持续不断重复运行。如果不为 0，则将运行计时器，运行次数为指定的次数，然后停止。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(delay: number, repeatCount?: number);\n        /**\n         * @private\n         */\n        private _delay;\n        /**\n         * The delay between timer events, in milliseconds. A delay lower than 20 milliseconds is not recommended.<br/>\n         * Note: Timer frequency is limited to 60 frames per second, meaning a delay lower than 16.6 milliseconds causes runtime problems.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 计时器事件间的延迟（以毫秒为单位）。如果在计时器正在运行时设置延迟间隔，则计时器将按相同的 repeatCount 迭代重新启动。<br/>\n         * 注意：建议 delay 不要低于 20 毫秒。计时器频率不得超过 60 帧/秒，这意味着低于 16.6 毫秒的延迟可导致出现运行时问题。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        delay: number;\n        /**\n         * The total number of times the timer is set to run. If the repeat count is set to 0, the timer continues indefinitely,\n         * until the stop() method is invoked or the program stops. If the repeat count is nonzero, the timer runs the specified\n         * number of times. If repeatCount is set to a total that is the same or less then currentCount the timer stops and will not fire again.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置的计时器运行总次数。如果重复计数设置为 0，则计时器将持续不断运行，或直至调用了 stop() 方法或节目停止。\n         * 如果重复计数不为 0，则将运行计时器，运行次数为指定的次数。如果设置的 repeatCount 总数等于或小于 currentCount，则计时器将停止并且不会再次触发。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        repeatCount: number;\n        /**\n         * @private\n         */\n        private _currentCount;\n        /**\n         * The total number of times the timer has fired since it started at zero. If the timer has been reset, only the fires since the reset are counted.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 计时器从 0 开始后触发的总次数。如果已重置了计时器，则只会计入重置后的触发次数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly currentCount: number;\n        /**\n         * @private\n         */\n        private _running;\n        /**\n         * The timer's current state; true if the timer is running, otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 计时器的当前状态；如果计时器正在运行，则为 true，否则为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly running: boolean;\n        /**\n         * Stops the timer, if it is running, and sets the currentCount property back to 0, like the reset button of a stopwatch.\n         * Then, when start() is called, the timer instance runs for the specified number of repetitions, as set by the repeatCount value.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果计时器正在运行，则停止计时器，并将 currentCount 属性设回为 0，这类似于秒表的重置按钮。然后，在调用 start() 后，将运行计时器实例，运行次数为指定的重复次数（由 repeatCount 值设置）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        reset(): void;\n        /**\n         * Starts the timer, if it is not already running.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果计时器尚未运行，则启动计时器。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        start(): void;\n        /**\n         * Stops the timer. When start() is called after stop(), the timer instance runs for the remaining number of\n         * repetitions, as set by the repeatCount property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 停止计时器。如果在调用 stop() 后调用 start()，则将继续运行计时器实例，运行次数为剩余的 重复次数（由 repeatCount 属性设置）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        stop(): void;\n        /**\n         * @private\n         */\n        private updateInterval;\n        /**\n         * @private\n         */\n        private lastCount;\n        /**\n         * @private\n         */\n        private lastTimeStamp;\n        /**\n         * @private\n         * Ticker以60FPS频率刷新此方法\n         */\n        $update(timeStamp: number): boolean;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The XMLNode class is the base class for all xml node.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * XML节点基类\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface XMLNode {\n        /**\n         * a integer representing the type of the node, 1：XML，2：XMLAttribute，3：XMLText\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 节点类型，1：XML，2：XMLAttribute，3：XMLText\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        nodeType: number;\n        /**\n         * the parent node of this xml node.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 节点所属的父级节点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        parent: XML;\n    }\n    /**\n     * The XML class contains properties for working with XML objects.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/XML.ts\n     * @language en_US\n     */\n    /**\n     * XML 类包含用于处理 XML 对象的属性。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/XML.ts\n     * @language zh_CN\n     */\n    interface XML extends XMLNode {\n        /**\n         * the attributes of this xml node.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当前节点上的属性列表\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        attributes: any;\n        /**\n         * the children of the xml node.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当前节点的子节点列表\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        children: XMLNode[];\n        /**\n         * the full name of this xml node. For example,the name of <s:Button/> is \"s:Button\".\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 节点完整名称。例如节点 <s:Button/> 的 name 为：\"s:Button\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * thie namesapce prefix of this xml node.For example,the prefix of <s:Button/> is \"s\".\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 节点的命名空间前缀。例如节点 <s:Button/> 的 prefix 为：s\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        prefix: string;\n        /**\n         * the local name of this xml node. For example,the local name of <s:Button/> is \"Button\".\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 节点的本地名称。例如节点 <s:Button/> 的 localName 为：Button\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        localName: string;\n        /**\n         * the namesapce uri of this xml node.For example,the namespace uri of <s:Skin xmlns:s=\"http://ns.egret.com/eui\"/> is \"http://ns.egret.com/eui\".\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 节点的命名空间地址。例如节点 <s:Skin xmlns:s=\"http://ns.egret.com/eui\"/> 的 namespace 为： http://ns.egret.com/eui\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        namespace: string;\n    }\n    /**\n     * The XMLText class represents a string node in the XML.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * XMLText 类表示在XML中的文本节点\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface XMLText extends XMLNode {\n        /**\n         * the text content\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本内容\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        text: string;\n    }\n    /**\n     * The XML class contains properties for working with XML objects.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * XML 类包含用于处理 XML 对象的属性。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let XML: {\n        /**\n         * parses a text to XML instance.\n         * @param text the text to be parsed.\n         * @language en_US\n         */\n        /**\n         * 解析字符串为XML对象\n         * @param text 要解析的XML对象。\n         * @language zh_CN\n         */\n        parse(text: string): XML;\n    };\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    let $callLaterFunctionList: any[];\n    /**\n     * @private\n     */\n    let $callLaterThisList: any[];\n    /**\n     * @private\n     */\n    let $callLaterArgsList: any[];\n    /**\n     * Delay the function to run unless screen is redrawn.\n     * @param method {Function} The function to be delayed to run\n     * @param thisObject {any} this reference of callback function\n     * @param ...args {any} Function parameter list\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/callLater.ts\n     * @language en_US\n     */\n    /**\n     * 延迟函数到屏幕重绘前执行。\n     * @param method {Function} 要延迟执行的函数\n     * @param thisObject {any} 回调函数的this引用\n     * @param ...args {any} 函数参数列表\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/callLater.ts\n     * @language zh_CN\n     */\n    function callLater(method: Function, thisObject: any, ...args: any[]): void;\n    /**\n     * @private\n     */\n    let $callAsyncFunctionList: any[];\n    /**\n     * @private\n     */\n    let $callAsyncThisList: any[];\n    /**\n     * @private\n     */\n    let $callAsyncArgsList: any[];\n    /**\n     * 异步调用函数\n     * @param method {Function} 要异步调用的函数\n     * @param thisObject {any} 函数的this引用\n     * @param ...args {any} 函数参数列表\n     * @private\n     */\n    function $callAsync(method: Function, thisObject: any, ...args: any[]): void;\n}\ndeclare namespace egret {\n    /**\n     * Call setter properties of the parent class, instead of the other writing languages, such as super.alpha = 1;\n     * @param currentClass The current class class name, non-string\n     * @param thisObj The current object. Always this\n     * @param type Setter property names need to call\n     * @param values Value passed to the parent class\n     *\n     * @exmaple egret.superSetter(egret.Sprite, this, \"alpha\", 1);\n     * @language en_US\n     */\n    /**\n     * 调用父类的setter属性，代替其他语言的写法，如 super.alpha = 1;\n     * @param currentClass 当前 class 类名，非字符串\n     * @param thisObj 当前对象。永远都this\n     * @param type 需要调用的setter属性名称\n     * @param values 传给父类的值\n     *\n     * @exmaple egret.superSetter(egret.Sprite, this, \"alpha\", 1);\n     * @language zh_CN\n     */\n    function superSetter(currentClass: any, thisObj: any, type: string, ...values: any[]): any;\n    /**\n     * Get getter property value of the parent class. Instead of writing in other languages, such as super.alpha;\n     * @param currentClass The current class class name, non-string\n     * @param thisObj The current object. Always this\n     * @param type Setter property names need to call\n     * @returns {any} The value returned by the parent\n     *\n     * @exmaple egret.superGetter(egret.Sprite, this, \"alpha\");\n     * @language en_US\n     */\n    /**\n     * 获取父类的getter属性值。代替其他语言的写法，如 super.alpha;\n     * @param currentClass 当前 class 类名，非字符串\n     * @param thisObj 当前对象。永远都this\n     * @param type 需要调用的getter属性名称\n     * @returns {any} 父类返回的值\n     *\n     * @exmaple egret.superGetter(egret.Sprite, this, \"alpha\");\n     * @language zh_CN\n     */\n    function superGetter(currentClass: any, thisObj: any, type: string): any;\n}\ndeclare namespace egret {\n    /**\n     * Returns a reference to the class object of the class specified by the name parameter.\n     * @param name The name of a class.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getDefinitionByName.ts\n     * @language en_US\n     */\n    /**\n     * 返回 name 参数指定的类的类对象引用。\n     * @param name 类的名称。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getDefinitionByName.ts\n     * @language zh_CN\n     */\n    function getDefinitionByName(name: string): any;\n}\ndeclare namespace egret {\n    /**\n     * Get browser or Runtime parameters, returns an empty string if not set\n     * Get the url parameter corresponds to the browser, access to the corresponding parameter in the Runtime setOption\n     * @method egret.getOption\n     * @param key {string} Parameters key\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 获取浏览器或者Runtime参数，如果没有设置返回空字符串\n     * 在浏览器中相当于获取url中参数，在Runtime获取对应setOption参数\n     * @method egret.getOption\n     * @param key {string} 参数key\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let getOption: (key: string) => string;\n}\ndeclare namespace egret {\n    /**\n     * Return the fully qualified class name of an object\n     * @param value The object for which a fully qualified class name is desired. Any JavaScript value may be passed to\n     * this method including all available JavaScript types, object instances, primitive types such as number, and class objects.\n     * @returns A string containing the fully qualified class name.\n     * @example\n     * <pre>\n     *  egret.getQualifiedClassName(egret.DisplayObject) //return \"egret.DisplayObject\"\n     * </pre>\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getQualifiedClassName.ts\n     * @language en_US\n     */\n    /**\n     * 返回对象的完全限定类名。\n     * @param value 需要完全限定类名称的对象，可以将任何 JavaScript 值传递给此方法，包括所有可用的 JavaScript 类型、对象实例、原始类型\n     * （如number)和类对象\n     * @returns 包含完全限定类名称的字符串。\n     * @example\n     * <pre>\n     *  egret.getQualifiedClassName(egret.DisplayObject) //返回 \"egret.DisplayObject\"\n     * </pre>\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getQualifiedClassName.ts\n     * @language zh_CN\n     */\n    function getQualifiedClassName(value: any): string;\n}\ndeclare namespace egret {\n    /**\n     * Returns the fully qualified class name of the base class of the object specified by the value parameter.\n     * @param value The object for which a parent class is desired. Any JavaScript value may be passed to this method including\n     * all available JavaScript types, object instances, primitive types such as number, and class objects.\n     * @returns  A fully qualified base class name, or null if none exists.\n     * @example\n     * <pre>\n     *  egret.getQualifiedSuperclassName(egret.Bitmap) //return \"egret.DisplayObject\"\n     * </pre>\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getQualifiedSuperclassName.ts\n     * @language en_US\n     */\n    /**\n     * 返回 value 参数指定的对象的基类的完全限定类名。\n     * @param value 需要取得父类的对象，可以将任何 JavaScript 值传递给此方法，包括所有可用的 JavaScript 类型、对象实例、原始类型（如number）和类对象\n     * @returns 完全限定的基类名称，或 null（如果不存在基类名称）。\n     * @example\n     * <pre>\n     *  egret.getQualifiedSuperclassName(egret.Sprite) //返回 \"egret.DisplayObject\"\n     * </pre>\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getQualifiedSuperclassName.ts\n     * @language zh_CN\n     */\n    function getQualifiedSuperclassName(value: any): string;\n}\ndeclare namespace egret {\n    /**\n     * Used to compute relative time.this method returns the number of milliseconds since the Egret framework was initialized\n     * @returns The number of milliseconds since the Egret framework was initialized\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getTimer.ts\n     * @language en_US\n     */\n    /**\n     * 用于计算相对时间。此方法返回自启动 Egret 框架以来经过的毫秒数。\n     * @returns 启动 Egret 框架以来经过的毫秒数。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getTimer.ts\n     * @language zh_CN\n     */\n    function getTimer(): number;\n}\ndeclare namespace egret {\n    /**\n     * Check whether a public definition exists in the specified application domain. The definition can be that of a class, a naming space or a function.\n     * @param name {string} Name of the definition.\n     * @returns {boolean} Whether the public definition exists\n     * @example\n     * egret.hasDefinition(\"egret.DisplayObject\") //return true\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/hasDefinition.ts\n     * @language en_US\n     */\n    /**\n     * 检查指定的应用程序域之内是否存在一个公共定义。该定义可以是一个类、一个命名空间或一个函数的定义。\n     * @param name {string} 定义的名称。\n     * @returns {boolean} 公共定义是否存在\n     * @example\n     * egret.hasDefinition(\"egret.DisplayObject\") //返回 true\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/hasDefinition.ts\n     * @language zh_CN\n     */\n    function hasDefinition(name: string): boolean;\n}\ndeclare namespace egret {\n    /**\n     * Indicates whether an object is a instance of the class or interface specified as the parameter.This method has better performance\n     * compared width the instanceOf operator,and it can indicate whether an object is a instance of the specific interface.\n     * @param instance the instance to be checked.\n     * @param typeName the string value representing a specific class or interface.\n     * @returns A value of true if the object is a instance of the class or interface specified as the parameter.\n     * @example\n     * <pre>\n     *     let instance = new egret.Sprite();\n     *     egret.log(egret.is(instance,\"egret.Sprite\"))  //true\n     *     egret.log(egret.is(instance,\"egret.DisplayObjectContainer\"))  //true\n     *     egret.log(egret.is(instance,\"egret.Bitmap\"))  //false\n     * </pre>\n     * @see egret.registerClass()\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 检查指定对象是否为 Egret 框架内指定接口或类或其子类的实例。此方法与使用 instanceOf 关键字相比具有更高的性能，并且能判断接口的实现。\n     * @param instance 要判断的实例。\n     * @param typeName 类或接口的完全名称.\n     * @returns 返回true表示当前对象是指定类或接口的实例。\n     * @example\n     * <pre>\n     *     let instance = new egret.Sprite();\n     *     egret.log(egret.is(instance,\"egret.Sprite\"))  //true\n     *     egret.log(egret.is(instance,\"egret.DisplayObjectContainer\"))  //true\n     *     egret.log(egret.is(instance,\"egret.Bitmap\"))  //false\n     * </pre>\n     * @see egret.registerClass()\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function is(instance: any, typeName: string): boolean;\n}\ndeclare namespace egret {\n    /**\n     * Register and start a timer,which will notify the callback method at a rate of 60 FPS ,and pass the current time stamp as parameters.<br/>\n     * Note: After the registration,it will notify the callback method continuously,you can call the stopTick () method to stop it.\n     * @param callBack the call back method. the timeStamp parameter of this method represents the number of milliseconds\n     * since the Egret framework was initialized. If the return value of this method is true, it will force Egret runtime\n     * to render after processing of this method completes.\n     * @param thisObject the call back method's \"this\"\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 注册并启动一个计时器，通常会以60FPS的速率触发回调方法，并传入当前时间戳。注意：注册后将会持续触发回调方法，若要停止回调，需要手动调用stopTick()方法。\n     * @param callBack 要执行的回调方法。参数 timeStamp 表示从启动Egret框架开始经过的时间(毫秒)。\n     * 若回调方法返回值为true，其作用与TimerEvent.updateAfterEvent()类似，将会忽略帧频限制，在此方法处理完成后立即重绘屏幕。\n     * @param thisObject 回调方法的this对象引用。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function startTick(callBack: (timeStamp: number) => boolean, thisObject: any): void;\n}\ndeclare namespace egret {\n    /**\n     * Stops the timer started by the egret.startTick() method.\n     * @param callBack the call back method. the timeStamp parameter of this method represents the number of milliseconds\n     * since the Egret framework was initialized. If the return value of this method is true, it will force Egret runtime\n     * to render after processing of this method completes.\n     * @param thisObject the call back method's \"this\"\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 停止之前用 startTick() 方法启动的计时器。\n     * @param callBack 要执行的回调方法。参数 timeStamp 表示从启动Egret框架开始经过的时间(毫秒)。\n     * 若回调方法返回值为true，其作用与TimerEvent.updateAfterEvent()类似，将会忽略帧频限制，在此方法处理完成后立即重绘屏幕。\n     * @param thisObject 回调方法的this对象引用。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function stopTick(callBack: (timeStamp: number) => boolean, thisObject: any): void;\n}\ndeclare namespace egret {\n    /**\n     * Transfer number to color character string\n     * @param value {number} color value ,such as 0xffffff\n     * @returns {string} Color character string, for example, #ffffff.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/toColorString.ts\n     * @language en_US\n     */\n    /**\n     * 转换数字为颜色字符串\n     * @param value {number} 颜色值，例如 0xffffff\n     * @returns {string} 颜色字符串，例如\"#ffffff\"。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/toColorString.ts\n     * @language zh_CN\n     */\n    function toColorString(value: number): string;\n}\n/**\n * @private\n */\ninterface PlayerOption {\n    /**\n     * 入口类完整类名\n     */\n    entryClassName?: string;\n    /**\n     * 默认帧率\n     */\n    frameRate?: number;\n    /**\n     * 屏幕适配模式\n     */\n    scaleMode?: string;\n    /**\n     * 初始内容宽度\n     */\n    contentWidth?: number;\n    /**\n     * 初始内容高度\n     */\n    contentHeight?: number;\n    /**\n     * 屏幕方向\n     */\n    orientation?: string;\n    /**\n     * 显示FPS\n     */\n    showFPS?: boolean;\n    /**\n     *\n     */\n    fpsStyles?: Object;\n    /**\n     * 显示日志\n     */\n    showLog?: boolean;\n    /**\n     * 过滤日志的正则表达式\n     */\n    logFilter?: string;\n    /**\n     *\n     */\n    maxTouches?: number;\n    /**\n     *\n     */\n    textureScaleFactor?: number;\n}\n"
  },
  {
    "path": "demo/libs/modules/egret/egret.js",
    "content": "var __reflect = (this && this.__reflect) || function (p, c, t) {\n    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;\n};\nvar __extends = this && this.__extends || function __extends(t, e) { \n function r() { \n this.constructor = t;\n}\nfor (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);\nr.prototype = e.prototype, t.prototype = new r();\n};\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n/// <reference path=\"registerClass.ts\" />\nif (typeof global == 'undefined') {\n    var global = window;\n}\nif (typeof __global == 'undefined') {\n    var __global = global;\n}\nvar __define = this && this.__define || function (o, p, g, s) { Object.defineProperty(o, p, { configurable: true, enumerable: true, get: g, set: s }); };\nvar egret;\n(function (egret) {\n    /**\n     * @private\n     * 哈希计数\n     */\n    egret.$hashCount = 1;\n    /**\n     * The HashObject class is the base class for all objects in the Egret framework.The HashObject\n     * class includes a hashCode property, which is a unique identification number of the instance.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * Egret顶级对象。框架内所有对象的基类，为对象实例提供唯一的hashCode值。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var HashObject = (function () {\n        /**\n         * Initializes a HashObject\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 HashObject 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function HashObject() {\n            this.$hashCode = egret.$hashCount++;\n        }\n        Object.defineProperty(HashObject.prototype, \"hashCode\", {\n            /**\n             * a unique identification number assigned to this instance.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 返回此对象唯一的哈希值,用于唯一确定一个对象。hashCode为大于等于1的整数。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$hashCode;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        return HashObject;\n    }());\n    egret.HashObject = HashObject;\n    __reflect(HashObject.prototype, \"egret.HashObject\", [\"egret.IHashObject\"]);\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var ONCE_EVENT_LIST = [];\n    /**\n     * The EventDispatcher class is the base class for all classes that dispatchEvent events. The EventDispatcher class implements\n     * the IEventDispatcher interface and is the base class for the DisplayObject class. The EventDispatcher class allows\n     * any object on the display list to be an event target and as such, to use the methods of the IEventDispatcher interface.\n     * Event targets are an important part of the Egret event model. The event target serves as the focal point for how events\n     * flow through the display list hierarchy. When an event such as a touch tap, Egret dispatches an event object into the\n     * event flow from the root of the display list. The event object then makes its way through the display list until it\n     * reaches the event target, at which point it begins its return trip through the display list. This round-trip journey\n     * to the event target is conceptually divided into three phases: <br/>\n     * the capture phase comprises the journey from the root to the last node before the event target's node, the target\n     * phase comprises only the event target node, and the bubbling phase comprises any subsequent nodes encountered on\n     * the return trip to the root of the display list. In general, the easiest way for a user-defined class to gain event\n     * dispatching capabilities is to extend EventDispatcher. If this is impossible (that is, if the class is already extending\n     * another class), you can instead implement the IEventDispatcher interface, create an EventDispatcher member, and write simple\n     * hooks to route calls into the aggregated EventDispatcher.\n     * @see egret.IEventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/EventDispatcher.ts\n     * @language en_US\n     */\n    /**\n     * EventDispatcher 是 Egret 的事件派发器类，负责进行事件的发送和侦听。\n     * 事件目标是事件如何通过显示列表层次结构这一问题的焦点。当发生鼠标单击、触摸或按键等事件时，\n     * 框架会将事件对象调度到从显示列表根开始的事件流中。然后该事件对象在显示列表中前进，直到到达事件目标，\n     * 然后从这一点开始其在显示列表中的回程。在概念上，到事件目标的此往返行程被划分为三个阶段：\n     * 捕获阶段包括从根到事件目标节点之前的最后一个节点的行程，目标阶段仅包括事件目标节点，冒泡阶段包括回程上遇到的任何后续节点到显示列表的根。\n     * 通常，使用户定义的类能够调度事件的最简单方法是扩展 EventDispatcher。如果无法扩展（即，如果该类已经扩展了另一个类），则可以实现\n     * IEventDispatcher 接口，创建 EventDispatcher 成员，并编写一些简单的映射，将调用连接到聚合的 EventDispatcher 中。\n     * @see egret.IEventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/EventDispatcher.ts\n     * @language zh_CN\n     */\n    var EventDispatcher = (function (_super) {\n        __extends(EventDispatcher, _super);\n        /**\n         * create an instance of the EventDispatcher class.\n         * @param target The target object for events dispatched to the EventDispatcher object. This parameter is used when\n         * the EventDispatcher instance is aggregated by a class that implements IEventDispatcher; it is necessary so that the\n         * containing object can be the target for events. Do not use this parameter in simple cases in which a class extends EventDispatcher.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 EventDispatcher 类的实例\n         * @param target 此 EventDispatcher 所抛出事件对象的 target 指向。此参数主要用于一个实现了 IEventDispatcher 接口的自定义类，\n         * 以便抛出的事件对象的 target 属性可以指向自定义类自身。请勿在直接继承 EventDispatcher 的情况下使用此参数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function EventDispatcher(target) {\n            if (target === void 0) { target = null; }\n            var _this = _super.call(this) || this;\n            _this.$EventDispatcher = {\n                0: target ? target : _this,\n                1: {},\n                2: {},\n                3: 0\n            };\n            return _this;\n        }\n        /**\n         * @private\n         *\n         * @param useCapture\n         */\n        EventDispatcher.prototype.$getEventMap = function (useCapture) {\n            var values = this.$EventDispatcher;\n            var eventMap = useCapture ? values[2 /* captureEventsMap */] : values[1 /* eventsMap */];\n            return eventMap;\n        };\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        EventDispatcher.prototype.addEventListener = function (type, listener, thisObject, useCapture, priority) {\n            this.$addListener(type, listener, thisObject, useCapture, priority);\n        };\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        EventDispatcher.prototype.once = function (type, listener, thisObject, useCapture, priority) {\n            this.$addListener(type, listener, thisObject, useCapture, priority, true);\n        };\n        /**\n         * @private\n         */\n        EventDispatcher.prototype.$addListener = function (type, listener, thisObject, useCapture, priority, dispatchOnce) {\n            if (true && !listener) {\n                egret.$error(1003, \"listener\");\n            }\n            var values = this.$EventDispatcher;\n            var eventMap = useCapture ? values[2 /* captureEventsMap */] : values[1 /* eventsMap */];\n            var list = eventMap[type];\n            if (!list) {\n                list = eventMap[type] = [];\n            }\n            else if (values[3 /* notifyLevel */] !== 0) {\n                eventMap[type] = list = list.concat();\n            }\n            this.$insertEventBin(list, type, listener, thisObject, useCapture, priority, dispatchOnce);\n        };\n        EventDispatcher.prototype.$insertEventBin = function (list, type, listener, thisObject, useCapture, priority, dispatchOnce) {\n            priority = +priority | 0;\n            var insertIndex = -1;\n            var length = list.length;\n            for (var i = 0; i < length; i++) {\n                var bin = list[i];\n                if (bin.listener == listener && bin.thisObject == thisObject && bin.target == this) {\n                    return false;\n                }\n                if (insertIndex == -1 && bin.priority < priority) {\n                    insertIndex = i;\n                }\n            }\n            var eventBin = {\n                type: type, listener: listener, thisObject: thisObject, priority: priority,\n                target: this, useCapture: useCapture, dispatchOnce: !!dispatchOnce\n            };\n            if (insertIndex !== -1) {\n                list.splice(insertIndex, 0, eventBin);\n            }\n            else {\n                list.push(eventBin);\n            }\n            return true;\n        };\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        EventDispatcher.prototype.removeEventListener = function (type, listener, thisObject, useCapture) {\n            var values = this.$EventDispatcher;\n            var eventMap = useCapture ? values[2 /* captureEventsMap */] : values[1 /* eventsMap */];\n            var list = eventMap[type];\n            if (!list) {\n                return;\n            }\n            if (values[3 /* notifyLevel */] !== 0) {\n                eventMap[type] = list = list.concat();\n            }\n            this.$removeEventBin(list, listener, thisObject);\n            if (list.length == 0) {\n                eventMap[type] = null;\n            }\n        };\n        EventDispatcher.prototype.$removeEventBin = function (list, listener, thisObject) {\n            var length = list.length;\n            for (var i = 0; i < length; i++) {\n                var bin = list[i];\n                if (bin.listener == listener && bin.thisObject == thisObject && bin.target == this) {\n                    list.splice(i, 1);\n                    return true;\n                }\n            }\n            return false;\n        };\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        EventDispatcher.prototype.hasEventListener = function (type) {\n            var values = this.$EventDispatcher;\n            return !!(values[1 /* eventsMap */][type] || values[2 /* captureEventsMap */][type]);\n        };\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        EventDispatcher.prototype.willTrigger = function (type) {\n            return this.hasEventListener(type);\n        };\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        EventDispatcher.prototype.dispatchEvent = function (event) {\n            event.$currentTarget = this.$EventDispatcher[0 /* eventTarget */];\n            event.$setTarget(event.$currentTarget);\n            return this.$notifyListener(event, false);\n        };\n        /**\n         * @private\n         */\n        EventDispatcher.prototype.$notifyListener = function (event, capturePhase) {\n            var values = this.$EventDispatcher;\n            var eventMap = capturePhase ? values[2 /* captureEventsMap */] : values[1 /* eventsMap */];\n            var list = eventMap[event.$type];\n            if (!list) {\n                return true;\n            }\n            var length = list.length;\n            if (length == 0) {\n                return true;\n            }\n            var onceList = ONCE_EVENT_LIST;\n            //做个标记，防止外部修改原始数组导致遍历错误。这里不直接调用list.concat()因为dispatch()方法调用通常比on()等方法频繁。\n            values[3 /* notifyLevel */]++;\n            for (var i = 0; i < length; i++) {\n                var eventBin = list[i];\n                eventBin.listener.call(eventBin.thisObject, event);\n                if (eventBin.dispatchOnce) {\n                    onceList.push(eventBin);\n                }\n                if (event.$isPropagationImmediateStopped) {\n                    break;\n                }\n            }\n            values[3 /* notifyLevel */]--;\n            while (onceList.length) {\n                var eventBin = onceList.pop();\n                eventBin.target.removeEventListener(eventBin.type, eventBin.listener, eventBin.thisObject, eventBin.useCapture);\n            }\n            return !event.$isDefaultPrevented;\n        };\n        /**\n         * Distribute a specified event parameters.\n         * @param type The type of the event. Event listeners can access this information through the inherited type property.\n         * @param bubbles Determines whether the Event object bubbles. Event listeners can access this information through\n         * the inherited bubbles property.\n         * @param data {any} data\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 派发一个指定参数的事件。\n         * @param type {string} 事件类型\n         * @param bubbles {boolean} 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param data {any} 事件data\n         * @param cancelable {boolean} 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        EventDispatcher.prototype.dispatchEventWith = function (type, bubbles, data, cancelable) {\n            if (bubbles || this.hasEventListener(type)) {\n                var event_1 = egret.Event.create(egret.Event, type, bubbles, cancelable);\n                event_1.data = data;\n                var result = this.dispatchEvent(event_1);\n                egret.Event.release(event_1);\n                return result;\n            }\n            return true;\n        };\n        return EventDispatcher;\n    }(egret.HashObject));\n    egret.EventDispatcher = EventDispatcher;\n    __reflect(EventDispatcher.prototype, \"egret.EventDispatcher\", [\"egret.IEventDispatcher\"]);\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    var Filter = (function (_super) {\n        __extends(Filter, _super);\n        function Filter() {\n            var _this = _super.call(this) || this;\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            _this.type = null;\n            /**\n             * @private\n             */\n            _this.$id = null;\n            /**\n             * @private\n             */\n            _this.paddingTop = 0;\n            /**\n             * @private\n             */\n            _this.paddingBottom = 0;\n            /**\n             * @private\n             */\n            _this.paddingLeft = 0;\n            /**\n             * @private\n             */\n            _this.paddingRight = 0;\n            _this.$uniforms = {};\n            if (egret.nativeRender) {\n                egret_native.NativeDisplayObject.createFilter(_this);\n            }\n            return _this;\n        }\n        /**\n         * @private\n         */\n        Filter.prototype.$toJson = function () {\n            return '';\n        };\n        Filter.prototype.updatePadding = function () {\n        };\n        Filter.prototype.onPropertyChange = function () {\n            var self = this;\n            self.updatePadding();\n            if (egret.nativeRender) {\n                egret_native.NativeDisplayObject.setFilterPadding(self.$id, self.paddingTop, self.paddingBottom, self.paddingLeft, self.paddingRight);\n                egret_native.NativeDisplayObject.setDataToFilter(self);\n            }\n        };\n        return Filter;\n    }(egret.HashObject));\n    egret.Filter = Filter;\n    __reflect(Filter.prototype, \"egret.Filter\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    ;\n    /**\n     * @private\n     * 格式化旋转角度的值\n     */\n    function clampRotation(value) {\n        value %= 360;\n        if (value > 180) {\n            value -= 360;\n        }\n        else if (value < -180) {\n            value += 360;\n        }\n        return value;\n    }\n    /**\n     * The DisplayObject class is the base class for all objects that can be placed on the display list. The display list\n     * manages all objects displayed in the runtime. Use the DisplayObjectContainer class to arrange the display\n     * objects in the display list. DisplayObjectContainer objects can have child display objects, while other display objects,\n     * such as Shape and TextField objects, are \"leaf\" nodes that have only parents and siblings, no children.\n     * The DisplayObject class supports basic functionality like the x and y position of an object, as well as more advanced\n     * properties of the object such as its transformation matrix.<br/>\n     * The DisplayObject class contains several broadcast events.Normally, the target of any particular event is a specific\n     * DisplayObject instance. For example, the target of an added event is the specific DisplayObject instance that was added\n     * to the display list. Having a single target restricts the placement of event listeners to that target and in some cases\n     * the target's ancestors on the display list. With broadcast events, however, the target is not a specific DisplayObject\n     * instance, but rather all DisplayObject instances, including those that are not on the display list. This means that you\n     * can add a listener to any DisplayObject instance to listen for broadcast events.\n     *\n     * @event egret.Event.ADDED Dispatched when a display object is added to the display list.\n     * @event egret.Event.ADDED_TO_STAGE Dispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained.\n     * @event egret.Event.REMOVED Dispatched when a display object is about to be removed from the display list.\n     * @event egret.Event.REMOVED_FROM_STAGE Dispatched when a display object is about to be removed from the display list, either directly or through the removal of a sub tree in which the display object is contained.\n     * @event egret.Event.ENTER_FRAME [broadcast event] Dispatched when the playhead is entering a new frame.\n     * @event egret.Event.RENDER [broadcast event] Dispatched when the display list is about to be updated and rendered.\n     * @event egret.TouchEvent.TOUCH_MOVE Dispatched when the user touches the device, and is continuously dispatched until the point of contact is removed.\n     * @event egret.TouchEvent.TOUCH_BEGIN Dispatched when the user first contacts a touch-enabled device (such as touches a finger to a mobile phone or tablet with a touch screen).\n     * @event egret.TouchEvent.TOUCH_END Dispatched when the user removes contact with a touch-enabled device (such as lifts a finger off a mobile phone or tablet with a touch screen).\n     * @event egret.TouchEvent.TOUCH_TAP Dispatched when the user lifts the point of contact over the same DisplayObject instance on which the contact was initiated on a touch-enabled device (such as presses and releases a finger from a single point over a display object on a mobile phone or tablet with a touch screen).\n     * @event egret.TouchEvent.TOUCH_RELEASE_OUTSIDE Dispatched when the user lifts the point of contact over the different DisplayObject instance on which the contact was initiated on a touch-enabled device (such as presses and releases a finger from a single point over a display object on a mobile phone or tablet with a touch screen).\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/DisplayObject.ts\n     * @language en_US\n     */\n    /**\n     * DisplayObject 类是可放在显示列表中的所有对象的基类。该显示列表管理运行时中显示的所有对象。使用 DisplayObjectContainer 类排列\n     * 显示列表中的显示对象。DisplayObjectContainer 对象可以有子显示对象，而其他显示对象（如 Shape 和 TextField 对象）是“叶”节点，没有子项，只有父级和\n     * 同级。DisplayObject 类有一些基本的属性（如确定坐标位置的 x 和 y 属性），也有一些高级的对象属性（如 Matrix 矩阵变换）。<br/>\n     * DisplayObject 类包含若干广播事件。通常，任何特定事件的目标均为一个特定的 DisplayObject 实例。例如，added 事件的目标是已添加到显示列表\n     * 的目标 DisplayObject 实例。若只有一个目标，则会将事件侦听器限制为只能监听在该目标上（在某些情况下，可监听在显示列表中该目标的祖代上）。\n     * 但是对于广播事件，目标不是特定的 DisplayObject 实例，而是所有 DisplayObject 实例（包括那些不在显示列表中的实例）。这意味着您可以向任何\n     * DisplayObject 实例添加侦听器来侦听广播事件。\n     *\n     * @event egret.Event.ADDED 将显示对象添加到显示列表中时调度。\n     * @event egret.Event.ADDED_TO_STAGE 在将显示对象直接添加到舞台显示列表或将包含显示对象的子树添加至舞台显示列表中时调度。\n     * @event egret.Event.REMOVED 将要从显示列表中删除显示对象时调度。\n     * @event egret.Event.REMOVED_FROM_STAGE 在从显示列表中直接删除显示对象或删除包含显示对象的子树时调度。\n     * @event egret.Event.ENTER_FRAME [广播事件] 播放头进入新帧时调度。\n     * @event egret.Event.RENDER [广播事件] 将要更新和呈现显示列表时调度。\n     * @event egret.TouchEvent.TOUCH_MOVE 当用户触碰设备时进行调度，而且会连续调度，直到接触点被删除。\n     * @event egret.TouchEvent.TOUCH_BEGIN 当用户第一次触摸启用触摸的设备时（例如，用手指触摸手机屏幕）调度。\n     * @event egret.TouchEvent.TOUCH_END 当用户移除与启用触摸的设备的接触时（例如，将手指从屏幕上抬起）调度。\n     * @event egret.TouchEvent.TOUCH_TAP 当用户在启用触摸设备上的已启动接触的同一 DisplayObject 实例上抬起接触点时（例如，手机点击屏幕后抬起）调度。\n     * @event egret.TouchEvent.TOUCH_RELEASE_OUTSIDE 当用户在启用触摸设备上的已启动接触的不同 DisplayObject 实例上抬起接触点时（例如，按住屏幕上的某个对象,然后从它上面挪开后再松开手指）调度。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/DisplayObject.ts\n     * @language zh_CN\n     */\n    var DisplayObject = (function (_super) {\n        __extends(DisplayObject, _super);\n        /**\n         * Initializes a DisplayObject object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个显示对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function DisplayObject() {\n            var _this = _super.call(this) || this;\n            /**\n             * @private\n             * 能够含有子项的类将子项列表存储在这个属性里。\n             */\n            _this.$children = null;\n            _this.$name = \"\";\n            /**\n             * @private\n             */\n            _this.$parent = null;\n            /**\n             * @private\n             */\n            _this.$stage = null;\n            /**\n             * @private\n             * 这个对象在显示列表中的嵌套深度，舞台为1，它的子项为2，子项的子项为3，以此类推。当对象不在显示列表中时此属性值为0.\n             */\n            _this.$nestLevel = 0;\n            _this.$useTranslate = false;\n            _this.$matrix = new egret.Matrix();\n            _this.$matrixDirty = false;\n            _this.$x = 0;\n            _this.$y = 0;\n            _this.$scaleX = 1;\n            _this.$scaleY = 1;\n            _this.$rotation = 0;\n            _this.$skewX = 0;\n            _this.$skewXdeg = 0;\n            _this.$skewY = 0;\n            _this.$skewYdeg = 0;\n            _this.$explicitWidth = NaN;\n            _this.$explicitHeight = NaN;\n            _this.$anchorOffsetX = 0;\n            _this.$anchorOffsetY = 0;\n            /**\n             * @private\n             */\n            _this.$visible = true;\n            /**\n             * @private\n             * cacheAsBitmap创建的缓存位图节点。\n             */\n            _this.$displayList = null;\n            _this.$cacheAsBitmap = false;\n            _this.$cacheDirty = false;\n            /**\n             * @private\n             */\n            _this.$alpha = 1;\n            _this.$touchEnabled = DisplayObject.defaultTouchEnabled;\n            /**\n             * @private\n             */\n            _this.$scrollRect = null;\n            /**\n             * @private\n             */\n            _this.$blendMode = 0;\n            /**\n             * @private\n             * 被遮罩的对象\n             */\n            _this.$maskedObject = null;\n            /**\n             * @private\n             */\n            _this.$mask = null;\n            /**\n             * @private\n             */\n            _this.$maskRect = null;\n            /**\n             * @private\n             */\n            _this.$parentDisplayList = null;\n            /**\n             * @private\n             * 渲染节点,不为空表示自身有绘制到屏幕的内容\n             */\n            _this.$renderNode = null;\n            _this.$renderDirty = false;\n            _this.$renderMode = null;\n            /**\n             * inspired by pixi.js\n             */\n            _this._tint = 0;\n            /**\n             * @private\n             */\n            _this.$tintRGB = 0;\n            /**\n             * @private\n             * inspired by pixi.js\n             */\n            _this.$sortDirty = false;\n            /**\n             * @private\n             */\n            _this._zIndex = 0;\n            /**\n             * @private\n             */\n            _this.$lastSortedIndex = 0;\n            /**\n             * Allow objects to use zIndex sorting\n             * @version Egret 5.2.24\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 允许对象使用 zIndex 排序\n             * @version Egret 5.2.24\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.sortableChildren = false;\n            if (egret.nativeRender) {\n                _this.createNativeDisplayObject();\n            }\n            //默认都是纯白\n            _this.tint = 0xFFFFFF;\n            return _this;\n        }\n        DisplayObject.prototype.createNativeDisplayObject = function () {\n            this.$nativeDisplayObject = new egret_native.NativeDisplayObject(0 /* CONTAINER */);\n        };\n        Object.defineProperty(DisplayObject.prototype, \"name\", {\n            /**\n             * Indicates the instance name of the DisplayObject. The object can be identified in the child list of its parent\n             * display object container by calling the getChildByName() method of the display object container.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示 DisplayObject 的实例名称。\n             * 通过调用父显示对象容器的 getChildByName() 方法，可以在父显示对象容器的子列表中标识该对象。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$name;\n            },\n            set: function (value) {\n                this.$name = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(DisplayObject.prototype, \"parent\", {\n            /**\n             * Indicates the DisplayObjectContainer object that contains this display object. Use the parent property to specify\n             * a relative path to display objects that are above the current display object in the display list hierarchy.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示包含此显示对象的 DisplayObjectContainer 对象。\n             * 使用 parent 属性可以指定高于显示列表层次结构中当前显示对象的显示对象的相对路径。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$parent;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         * 设置父级显示对象\n         */\n        DisplayObject.prototype.$setParent = function (parent) {\n            this.$parent = parent;\n        };\n        /**\n         * @private\n         * 显示对象添加到舞台\n         */\n        DisplayObject.prototype.$onAddToStage = function (stage, nestLevel) {\n            var self = this;\n            self.$stage = stage;\n            self.$nestLevel = nestLevel;\n            self.$hasAddToStage = true;\n            egret.Sprite.$EVENT_ADD_TO_STAGE_LIST.push(self);\n        };\n        /**\n         * @private\n         * 显示对象从舞台移除\n         */\n        DisplayObject.prototype.$onRemoveFromStage = function () {\n            var self = this;\n            self.$nestLevel = 0;\n            egret.Sprite.$EVENT_REMOVE_FROM_STAGE_LIST.push(self);\n        };\n        DisplayObject.prototype.$updateUseTransform = function () {\n            var self = this;\n            if (self.$scaleX == 1 && self.$scaleY == 1 && self.$skewX == 0 && self.$skewY == 0) {\n                self.$useTranslate = false;\n            }\n            else {\n                self.$useTranslate = true;\n            }\n        };\n        Object.defineProperty(DisplayObject.prototype, \"stage\", {\n            /**\n             * The Stage of the display object. you can create and load multiple display objects into the display list, and\n             * the stage property of each display object refers to the same Stage object.<br/>\n             * If a display object is not added to the display list, its stage property is set to null.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 显示对象的舞台。\n             * 例如，您可以创建多个显示对象并加载到显示列表中，每个显示对象的 stage 属性是指向相同的 Stage 对象。<br/>\n             * 如果显示对象未添加到显示列表，则其 stage 属性会设置为 null。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$stage;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(DisplayObject.prototype, \"matrix\", {\n            /**\n             * A Matrix object containing values that alter the scaling, rotation, and translation of the display object.<br/>\n             * Note: to change the value of a display object's matrix, you must make a copy of the entire matrix object, then copy\n             * the new object into the matrix property of the display object.\n             * @example the following code increases the tx value of a display object's matrix\n             * <pre>\n             *     let myMatrix:Matrix = myDisplayObject.matrix;\n             *     myMatrix.tx += 10;\n             *     myDisplayObject.matrix = myMatrix;\n             * </pre>\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 一个 Matrix 对象，其中包含更改显示对象的缩放、旋转和平移的值。<br/>\n             * 注意：要改变一个显示对象矩阵的值，您必引用整个矩阵对象，然后将它重新赋值给显示对象的 matrix 属性。\n             * @example 以下代码改变了显示对象矩阵的tx属性值：\n             * <pre>\n             *     let myMatrix:Matrix = myDisplayObject.matrix;\n             *     myMatrix.tx += 10;\n             *     myDisplayObject.matrix = myMatrix;\n             * </pre>\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$getMatrix().clone();\n            },\n            set: function (value) {\n                this.$setMatrix(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         * 获取矩阵\n         */\n        DisplayObject.prototype.$getMatrix = function () {\n            var self = this;\n            if (self.$matrixDirty) {\n                self.$matrixDirty = false;\n                self.$matrix.$updateScaleAndRotation(self.$scaleX, self.$scaleY, self.$skewX, self.$skewY);\n            }\n            self.$matrix.tx = self.$x;\n            self.$matrix.ty = self.$y;\n            return self.$matrix;\n        };\n        /**\n         * @private\n         * 设置矩阵\n         */\n        DisplayObject.prototype.$setMatrix = function (matrix, needUpdateProperties) {\n            if (needUpdateProperties === void 0) { needUpdateProperties = true; }\n            var self = this;\n            var m = self.$matrix;\n            m.a = matrix.a;\n            m.b = matrix.b;\n            m.c = matrix.c;\n            m.d = matrix.d;\n            self.$x = matrix.tx;\n            self.$y = matrix.ty;\n            self.$matrixDirty = false;\n            if (m.a == 1 && m.b == 0 && m.c == 0 && m.d == 1) {\n                self.$useTranslate = false;\n            }\n            else {\n                self.$useTranslate = true;\n            }\n            if (needUpdateProperties) {\n                self.$scaleX = m.$getScaleX();\n                self.$scaleY = m.$getScaleY();\n                self.$skewX = matrix.$getSkewX();\n                self.$skewY = matrix.$getSkewY();\n                self.$skewXdeg = clampRotation(self.$skewX * 180 / Math.PI);\n                self.$skewYdeg = clampRotation(self.$skewY * 180 / Math.PI);\n                self.$rotation = clampRotation(self.$skewY * 180 / Math.PI);\n            }\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setMatrix(matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty);\n            }\n        };\n        /**\n         * @private\n         * 获得这个显示对象以及它所有父级对象的连接矩阵。\n         */\n        DisplayObject.prototype.$getConcatenatedMatrix = function () {\n            var self = this;\n            var matrix = self.$concatenatedMatrix;\n            if (!matrix) {\n                matrix = self.$concatenatedMatrix = new egret.Matrix();\n            }\n            if (self.$parent) {\n                self.$parent.$getConcatenatedMatrix().$preMultiplyInto(self.$getMatrix(), matrix);\n            }\n            else {\n                matrix.copyFrom(self.$getMatrix());\n            }\n            var offsetX = self.$anchorOffsetX;\n            var offsetY = self.$anchorOffsetY;\n            var rect = self.$scrollRect;\n            if (rect) {\n                matrix.$preMultiplyInto(egret.$TempMatrix.setTo(1, 0, 0, 1, -rect.x - offsetX, -rect.y - offsetY), matrix);\n            }\n            else if (offsetX != 0 || offsetY != 0) {\n                matrix.$preMultiplyInto(egret.$TempMatrix.setTo(1, 0, 0, 1, -offsetX, -offsetY), matrix);\n            }\n            return self.$concatenatedMatrix;\n        };\n        /**\n         * @private\n         * 获取链接矩阵\n         */\n        DisplayObject.prototype.$getInvertedConcatenatedMatrix = function () {\n            var self = this;\n            if (!self.$invertedConcatenatedMatrix) {\n                self.$invertedConcatenatedMatrix = new egret.Matrix();\n            }\n            self.$getConcatenatedMatrix().$invertInto(self.$invertedConcatenatedMatrix);\n            return self.$invertedConcatenatedMatrix;\n        };\n        Object.defineProperty(DisplayObject.prototype, \"x\", {\n            /**\n             * Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent\n             * DisplayObjectContainer.<br/>\n             * If the object is inside a DisplayObjectContainer that has transformations, it is in\n             * the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer\n             * rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is\n             * rotated 90° counterclockwise. The object's coordinates refer to the registration point position.\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示 DisplayObject 实例相对于父级 DisplayObjectContainer 本地坐标的 x 坐标。<br/>\n             * 如果该对象位于具有变形的 DisplayObjectContainer 内，则它也位于包含 DisplayObjectContainer 的本地坐标系中。\n             * 因此，对于逆时针旋转 90 度的 DisplayObjectContainer，该 DisplayObjectContainer 的子级将继承逆时针旋转 90 度的坐标系。\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$getX();\n            },\n            set: function (value) {\n                this.$setX(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         * 获取x坐标\n         */\n        DisplayObject.prototype.$getX = function () {\n            return this.$x;\n        };\n        /**\n         * @private\n         * 设置x坐标\n         */\n        DisplayObject.prototype.$setX = function (value) {\n            var self = this;\n            if (self.$x == value) {\n                return false;\n            }\n            self.$x = value;\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setX(value);\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n            return true;\n        };\n        Object.defineProperty(DisplayObject.prototype, \"y\", {\n            /**\n             * Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent\n             * DisplayObjectContainer. <br/>\n             * If the object is inside a DisplayObjectContainer that has transformations, it is in\n             * the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated\n             * 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90°\n             * counterclockwise. The object's coordinates refer to the registration point position.\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示 DisplayObject 实例相对于父级 DisplayObjectContainer 本地坐标的 y 坐标。<br/>\n             * 如果该对象位于具有变形的 DisplayObjectContainer 内，则它也位于包含 DisplayObjectContainer 的本地坐标系中。\n             * 因此，对于逆时针旋转 90 度的 DisplayObjectContainer，该 DisplayObjectContainer 的子级将继承逆时针旋转 90 度的坐标系。\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$getY();\n            },\n            set: function (value) {\n                this.$setY(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         * 获取y坐标\n         */\n        DisplayObject.prototype.$getY = function () {\n            return this.$y;\n        };\n        /**\n         * @private\n         * 设置y坐标\n         */\n        DisplayObject.prototype.$setY = function (value) {\n            var self = this;\n            if (self.$y == value) {\n                return false;\n            }\n            self.$y = value;\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setY(value);\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n            return true;\n        };\n        Object.defineProperty(DisplayObject.prototype, \"scaleX\", {\n            /**\n             * Indicates the horizontal scale (percentage) of the object as applied from the registration point. <br/>\n             * The default 1.0 equals 100% scale.\n             * @default 1\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示从注册点开始应用的对象的水平缩放比例（百分比）。<br/>\n             * 1.0 等于 100% 缩放。\n             * @default 1\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$getScaleX();\n            },\n            set: function (value) {\n                this.$setScaleX(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @returns\n         */\n        DisplayObject.prototype.$getScaleX = function () {\n            return this.$scaleX;\n        };\n        /**\n         * @private\n         * 设置水平缩放值\n         */\n        DisplayObject.prototype.$setScaleX = function (value) {\n            var self = this;\n            if (self.$scaleX == value) {\n                return;\n            }\n            self.$scaleX = value;\n            self.$matrixDirty = true;\n            self.$updateUseTransform();\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setScaleX(value);\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        Object.defineProperty(DisplayObject.prototype, \"scaleY\", {\n            /**\n             * Indicates the vertical scale (percentage) of an object as applied from the registration point of the object.\n             * 1.0 is 100% scale.\n             * @default 1\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示从对象注册点开始应用的对象的垂直缩放比例（百分比）。1.0 是 100% 缩放。\n             * @default 1\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$getScaleY();\n            },\n            set: function (value) {\n                this.$setScaleY(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @returns\n         */\n        DisplayObject.prototype.$getScaleY = function () {\n            return this.$scaleY;\n        };\n        /**\n         * @private\n         * 设置垂直缩放值\n         */\n        DisplayObject.prototype.$setScaleY = function (value) {\n            var self = this;\n            if (self.$scaleY == value) {\n                return;\n            }\n            self.$scaleY = value;\n            self.$matrixDirty = true;\n            self.$updateUseTransform();\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setScaleY(value);\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        Object.defineProperty(DisplayObject.prototype, \"rotation\", {\n            /**\n             * Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation. Values from\n             * 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. Values outside\n             * this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement\n             * myDisplayObject.rotation = 450 is the same as myDisplayObject.rotation = 90.\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示 DisplayObject 实例距其原始方向的旋转程度，以度为单位。\n             * 从 0 到 180 的值表示顺时针方向旋转；从 0 到 -180 的值表示逆时针方向旋转。对于此范围之外的值，可以通过加上或\n             * 减去 360 获得该范围内的值。例如，myDisplayObject.rotation = 450语句与 myDisplayObject.rotation = 90 是相同的。\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$getRotation();\n            },\n            set: function (value) {\n                this.$setRotation(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         */\n        DisplayObject.prototype.$getRotation = function () {\n            return this.$rotation;\n        };\n        DisplayObject.prototype.$setRotation = function (value) {\n            value = clampRotation(value);\n            var self = this;\n            if (value == self.$rotation) {\n                return;\n            }\n            var delta = value - self.$rotation;\n            var angle = delta / 180 * Math.PI;\n            self.$skewX += angle;\n            self.$skewY += angle;\n            self.$rotation = value;\n            self.$matrixDirty = true;\n            self.$updateUseTransform();\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setRotation(value);\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        Object.defineProperty(DisplayObject.prototype, \"skewX\", {\n            /**\n             * 表示DisplayObject的x方向斜切\n             * @member {number} egret.DisplayObject#skewX\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$skewXdeg;\n            },\n            set: function (value) {\n                this.$setSkewX(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        DisplayObject.prototype.$setSkewX = function (value) {\n            var self = this;\n            if (value == self.$skewXdeg) {\n                return;\n            }\n            self.$skewXdeg = value;\n            value = clampRotation(value);\n            value = value / 180 * Math.PI;\n            self.$skewX = value;\n            self.$matrixDirty = true;\n            self.$updateUseTransform();\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setSkewX(self.$skewXdeg);\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        Object.defineProperty(DisplayObject.prototype, \"skewY\", {\n            /**\n             * 表示DisplayObject的y方向斜切\n             * @member {number} egret.DisplayObject#skewY\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$skewYdeg;\n            },\n            set: function (value) {\n                this.$setSkewY(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        DisplayObject.prototype.$setSkewY = function (value) {\n            var self = this;\n            if (value == self.$skewYdeg) {\n                return;\n            }\n            self.$skewYdeg = value;\n            value = clampRotation(value);\n            value = (value + self.$rotation) / 180 * Math.PI;\n            self.$skewY = value;\n            self.$matrixDirty = true;\n            self.$updateUseTransform();\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setSkewY(self.$skewYdeg);\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        Object.defineProperty(DisplayObject.prototype, \"width\", {\n            /**\n             * Indicates the width of the display object, in pixels. The width is calculated based on the bounds of the content\n             * of the display object.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示显示对象的宽度，以像素为单位。宽度是根据显示对象内容的范围来计算的。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$getWidth();\n            },\n            set: function (value) {\n                this.$setWidth(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        DisplayObject.prototype.$getWidth = function () {\n            var self = this;\n            return isNaN(self.$explicitWidth) ? self.$getOriginalBounds().width : self.$explicitWidth;\n        };\n        /**\n         * @private\n         * 设置显示宽度\n         */\n        DisplayObject.prototype.$setWidth = function (value) {\n            value = isNaN(value) ? NaN : value;\n            if (this.$explicitWidth == value) {\n                return;\n            }\n            this.$explicitWidth = value;\n        };\n        Object.defineProperty(DisplayObject.prototype, \"height\", {\n            /**\n             * Indicates the height of the display object, in pixels. The height is calculated based on the bounds of the\n             * content of the display object.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示显示对象的高度，以像素为单位。高度是根据显示对象内容的范围来计算的。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$getHeight();\n            },\n            set: function (value) {\n                this.$setHeight(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         * 获取显示高度\n         */\n        DisplayObject.prototype.$getHeight = function () {\n            var self = this;\n            return isNaN(self.$explicitHeight) ? self.$getOriginalBounds().height : self.$explicitHeight;\n        };\n        /**\n         * @private\n         * 设置显示高度\n         */\n        DisplayObject.prototype.$setHeight = function (value) {\n            value = isNaN(value) ? NaN : value;\n            if (this.$explicitHeight == value) {\n                return;\n            }\n            this.$explicitHeight = value;\n        };\n        Object.defineProperty(DisplayObject.prototype, \"measuredWidth\", {\n            /**\n             * 测量宽度\n             * @returns {number}\n             * @member {egret.Rectangle} egret.DisplayObject#measuredWidth\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$getOriginalBounds().width;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(DisplayObject.prototype, \"measuredHeight\", {\n            /**\n             * 测量高度\n             * @returns {number}\n             * @member {egret.Rectangle} egret.DisplayObject#measuredWidth\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$getOriginalBounds().height;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(DisplayObject.prototype, \"anchorOffsetX\", {\n            /**\n             * X represents the object of which is the anchor.\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示从对象绝对锚点X。\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$anchorOffsetX;\n            },\n            set: function (value) {\n                this.$setAnchorOffsetX(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        DisplayObject.prototype.$setAnchorOffsetX = function (value) {\n            var self = this;\n            if (self.$anchorOffsetX == value) {\n                return;\n            }\n            self.$anchorOffsetX = value;\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setAnchorOffsetX(value);\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        Object.defineProperty(DisplayObject.prototype, \"anchorOffsetY\", {\n            /**\n             * Y represents the object of which is the anchor.\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示从对象绝对锚点Y。\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$anchorOffsetY;\n            },\n            set: function (value) {\n                this.$setAnchorOffsetY(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        DisplayObject.prototype.$setAnchorOffsetY = function (value) {\n            var self = this;\n            if (self.$anchorOffsetY == value) {\n                return;\n            }\n            self.$anchorOffsetY = value;\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setAnchorOffsetY(value);\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        Object.defineProperty(DisplayObject.prototype, \"visible\", {\n            /**\n             * Whether or not the display object is visible. Display objects that are not visible are disabled. For example,\n             * if visible=false for an DisplayObject instance, it cannot receive touch or other user input.\n             * @default true\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 显示对象是否可见。不可见的显示对象将被禁用。例如，如果实例的 visible 为 false，则无法接受触摸或用户交互操作。\n             * @default true\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$visible;\n            },\n            set: function (value) {\n                this.$setVisible(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        DisplayObject.prototype.$setVisible = function (value) {\n            var self = this;\n            if (self.$visible == value) {\n                return;\n            }\n            self.$visible = value;\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setVisible(value);\n            }\n            else {\n                self.$updateRenderMode();\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        Object.defineProperty(DisplayObject.prototype, \"cacheAsBitmap\", {\n            /**\n             * If set to true, Egret runtime caches an internal bitmap representation of the display object. This caching can\n             * increase performance for display objects that contain complex vector content. After you set the cacheAsBitmap\n             * property to true, the rendering does not change, however the display object performs pixel snapping automatically.\n             * The execution speed can be significantly faster depending on the complexity of the content.The cacheAsBitmap\n             * property is best used with display objects that have mostly static content and that do not scale and rotate frequently.<br/>\n             * Note: The display object will not create the bitmap caching when the memory exceeds the upper limit,even if you set it to true.\n             * @default false\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 如果设置为 true，则 Egret 运行时将缓存显示对象的内部位图表示形式。此缓存可以提高包含复杂矢量内容的显示对象的性能。\n             * 将 cacheAsBitmap 属性设置为 true 后，呈现并不更改，但是，显示对象将自动执行像素贴紧。执行速度可能会大大加快，\n             * 具体取决于显示对象内容的复杂性。最好将 cacheAsBitmap 属性与主要具有静态内容且不频繁缩放或旋转的显示对象一起使用。<br/>\n             * 注意：在内存超过上限的情况下，即使将 cacheAsBitmap 属性设置为 true，显示对象也不使用位图缓存。\n             * @default false\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$cacheAsBitmap;\n            },\n            set: function (value) {\n                var self = this;\n                self.$cacheAsBitmap = value;\n                if (egret.nativeRender) {\n                    self.$nativeDisplayObject.setCacheAsBitmap(value);\n                }\n                else {\n                    self.$setHasDisplayList(value);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        DisplayObject.prototype.$setHasDisplayList = function (value) {\n            var self = this;\n            var hasDisplayList = !!self.$displayList;\n            if (hasDisplayList == value) {\n                return;\n            }\n            if (value) {\n                var displayList = egret.sys.DisplayList.create(self);\n                if (displayList) {\n                    self.$displayList = displayList;\n                    self.$cacheDirty = true;\n                }\n            }\n            else {\n                self.$displayList = null;\n            }\n        };\n        DisplayObject.prototype.$cacheDirtyUp = function () {\n            var p = this.$parent;\n            if (p && !p.$cacheDirty) {\n                p.$cacheDirty = true;\n                p.$cacheDirtyUp();\n            }\n        };\n        Object.defineProperty(DisplayObject.prototype, \"alpha\", {\n            /**\n             * Indicates the alpha transparency value of the object specified. Valid values are 0 (fully transparent) to 1 (fully opaque).\n             * The default value is 1. Display objects with alpha set to 0 are active, even though they are invisible.\n             * @default 1\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示指定对象的 Alpha 透明度值。\n             * 有效值为 0（完全透明）到 1（完全不透明）。alpha 设置为 0 的显示对象是可触摸的，即使它们不可见。\n             * @default 1\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$alpha;\n            },\n            set: function (value) {\n                this.$setAlpha(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        DisplayObject.prototype.$setAlpha = function (value) {\n            var self = this;\n            if (self.$alpha == value) {\n                return;\n            }\n            self.$alpha = value;\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setAlpha(value);\n            }\n            else {\n                self.$updateRenderMode();\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        Object.defineProperty(DisplayObject.prototype, \"touchEnabled\", {\n            /**\n             * Specifies whether this object receives touch or other user input. The default value is false, which means that\n             * by default any DisplayObject instance that is on the display list cannot receive touch events. If touchEnabled is\n             * set to false, the instance does not receive any touch events (or other user input events). Any children of\n             * this instance on the display list are not affected. To change the touchEnabled behavior for all children of\n             * an object on the display list, use DisplayObjectContainer.touchChildren.\n             * @see egret.DisplayObjectContainer#touchChildren\n             * @default false\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 指定此对象是否接收触摸或其他用户输入。默认值为 false，这表示默认情况下，显示列表上的任何 DisplayObject 实例都不会接收触摸事件或\n             * 其他用户输入事件。如果将 touchEnabled 设置为 false，则实例将不接收任何触摸事件（或其他用户输入事件）。显示列表上的该实例的任\n             * 何子级都不会受到影响。要更改显示列表上对象的所有子级的 touchEnabled 行为，请使用 DisplayObjectContainer.touchChildren。\n             * @see egret.DisplayObjectContainer#touchChildren\n             * @default false\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$getTouchEnabled();\n            },\n            set: function (value) {\n                this.$setTouchEnabled(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         */\n        DisplayObject.prototype.$getTouchEnabled = function () {\n            return this.$touchEnabled;\n        };\n        /**\n         * @private\n         */\n        DisplayObject.prototype.$setTouchEnabled = function (value) {\n            this.$touchEnabled = !!value;\n        };\n        Object.defineProperty(DisplayObject.prototype, \"scrollRect\", {\n            /**\n             * The scroll rectangle bounds of the display object. The display object is cropped to the size defined by the rectangle,\n             * and it scrolls within the rectangle when you change the x and y properties of the scrollRect object. A scrolled display\n             * object always scrolls in whole pixel increments.You can scroll an object left and right by setting the x property of\n             * the scrollRect Rectangle object. You can scroll an object up and down by setting the y property of the scrollRect\n             * Rectangle object. If the display object is rotated 90° and you scroll it left and right, the display object actually\n             * scrolls up and down.<br/>\n             *\n             * Note: to change the value of a display object's scrollRect, you must make a copy of the entire scrollRect object, then copy\n             * the new object into the scrollRect property of the display object.\n             * @example the following code increases the x value of a display object's scrollRect\n             * <pre>\n             *     let myRectangle:Rectangle = myDisplayObject.scrollRect;\n             *     myRectangle.x += 10;\n             *     myDisplayObject.scrollRect = myRectangle;\n             * </pre>\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 显示对象的滚动矩形范围。显示对象被裁切为矩形定义的大小，当您更改 scrollRect 对象的 x 和 y 属性时，它会在矩形内滚动。\n             * 滚动的显示对象始终以整像素为增量进行滚动。您可以通过设置 scrollRect Rectangle 对象的 x 属性来左右滚动对象， 还可以通过设置\n             * scrollRect 对象的 y 属性来上下滚动对象。如果显示对象旋转了 90 度，并且您左右滚动它，则实际上显示对象会上下滚动。<br/>\n             *\n             * 注意：要改变一个显示对象 scrollRect 属性的值，您必引用整个 scrollRect 对象，然后将它重新赋值给显示对象的 scrollRect 属性。\n             * @example 以下代码改变了显示对象 scrollRect 的 x 属性值：\n             * <pre>\n             *     let myRectangle:Rectangle = myDisplayObject.scrollRect;\n             *     myRectangle.x += 10;\n             *     myDisplayObject.scrollRect = myRectangle;//设置完scrollRect的x、y、width、height值之后，一定要对myDisplayObject重新赋值scrollRect，不然会出问题。\n             * </pre>\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$scrollRect;\n            },\n            set: function (value) {\n                this.$setScrollRect(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        DisplayObject.prototype.$setScrollRect = function (value) {\n            var self = this;\n            if (!value && !self.$scrollRect) {\n                self.$updateRenderMode();\n                return;\n            }\n            if (value) {\n                if (!self.$scrollRect) {\n                    self.$scrollRect = new egret.Rectangle();\n                }\n                self.$scrollRect.copyFrom(value);\n                if (egret.nativeRender) {\n                    self.$nativeDisplayObject.setScrollRect(value.x, value.y, value.width, value.height);\n                }\n            }\n            else {\n                self.$scrollRect = null;\n                if (egret.nativeRender) {\n                    self.$nativeDisplayObject.setScrollRect(0, 0, 0, 0);\n                }\n            }\n            if (!egret.nativeRender) {\n                self.$updateRenderMode();\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        Object.defineProperty(DisplayObject.prototype, \"blendMode\", {\n            /**\n             * A value from the BlendMode class that specifies which blend mode to use. Determine how a source image (new one)\n             * is drawn on the target image (old one).<br/>\n             * If you attempt to set this property to an invalid value, Egret runtime set the value to BlendMode.NORMAL.\n             * @default egret.BlendMode.NORMAL\n             * @see egret.BlendMode\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * BlendMode 枚举中的一个值，用于指定要使用的混合模式，确定如何将一个源（新的）图像绘制到目标（已有）的图像上<br/>\n             * 如果尝试将此属性设置为无效值，则运行时会将此值设置为 BlendMode.NORMAL。\n             * @default egret.BlendMode.NORMAL\n             * @see egret.BlendMode\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return egret.sys.numberToBlendMode(this.$blendMode);\n            },\n            set: function (value) {\n                var self = this;\n                var mode = egret.sys.blendModeToNumber(value);\n                if (self.$blendMode == mode) {\n                    return;\n                }\n                self.$blendMode = mode;\n                if (egret.nativeRender) {\n                    self.$nativeDisplayObject.setBlendMode(mode);\n                }\n                else {\n                    self.$updateRenderMode();\n                    var p = self.$parent;\n                    if (p && !p.$cacheDirty) {\n                        p.$cacheDirty = true;\n                        p.$cacheDirtyUp();\n                    }\n                    var maskedObject = self.$maskedObject;\n                    if (maskedObject && !maskedObject.$cacheDirty) {\n                        maskedObject.$cacheDirty = true;\n                        maskedObject.$cacheDirtyUp();\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(DisplayObject.prototype, \"mask\", {\n            /**\n             * The calling display object is masked by the specified mask object. To ensure that masking works when the Stage\n             * is scaled, the mask display object must be in an active part of the display list. The mask object itself is not drawn.\n             * Set mask to null to remove the mask. To be able to scale a mask object, it must be on the display list. To be\n             * able to drag a mask object , it must be on the display list.<br/>\n             * Note: A single mask object cannot be used to mask more than one calling display object. When the mask is assigned\n             * to a second display object, it is removed as the mask of the first object, and that object's mask property becomes null.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 调用显示对象被指定的 mask 对象遮罩。要确保当舞台缩放时蒙版仍然有效，mask 显示对象必须处于显示列表的活动部分。\n             * 但不绘制 mask 对象本身。将 mask 设置为 null 可删除蒙版。要能够缩放遮罩对象，它必须在显示列表中。要能够拖动蒙版\n             * 对象，它必须在显示列表中。<br/>\n             * 注意：单个 mask 对象不能用于遮罩多个执行调用的显示对象。在将 mask 分配给第二个显示对象时，会撤消其作为第一个对象的遮罩，\n             * 该对象的 mask 属性将变为 null。\n             *\n             * 下面例子为 mask 为 Rectangle 类型对象，这种情况下，修改 mask 的值后，一定要对 myDisplayObject 重新赋值 mask，不然会出问题。\n             * @example 以下代码改变了显示对象 mask 的 x 属性值：\n             * <pre>\n             *     let myMask:Rectangle = myDisplayObject.mask;\n             *     myMask.x += 10;\n             *     myDisplayObject.mask = myMask;//设置完 mask 的x、y、width、height值之后，一定要对myDisplayObject重新赋值 mask，不然会出问题。\n             * </pre>\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                var self = this;\n                return self.$mask ? self.$mask : self.$maskRect;\n            },\n            set: function (value) {\n                var self = this;\n                if (value === self) {\n                    return;\n                }\n                if (value) {\n                    if (value instanceof DisplayObject) {\n                        if (value == self.$mask) {\n                            return;\n                        }\n                        if (value.$maskedObject) {\n                            value.$maskedObject.mask = null;\n                        }\n                        value.$maskedObject = self;\n                        self.$mask = value;\n                        if (!egret.nativeRender) {\n                            value.$updateRenderMode();\n                        }\n                        if (self.$maskRect) {\n                            if (egret.nativeRender) {\n                                self.$nativeDisplayObject.setMaskRect(0, 0, 0, 0);\n                            }\n                            self.$maskRect = null;\n                        }\n                        if (egret.nativeRender) {\n                            self.$nativeDisplayObject.setMask(value.$nativeDisplayObject.id);\n                        }\n                    }\n                    else {\n                        if (!self.$maskRect) {\n                            self.$maskRect = new egret.Rectangle();\n                        }\n                        self.$maskRect.copyFrom(value);\n                        if (egret.nativeRender) {\n                            self.$nativeDisplayObject.setMaskRect(value.x, value.y, value.width, value.height);\n                        }\n                        if (self.$mask) {\n                            self.$mask.$maskedObject = null;\n                            if (!egret.nativeRender) {\n                                self.$mask.$updateRenderMode();\n                            }\n                        }\n                        if (self.mask) {\n                            if (egret.nativeRender) {\n                                self.$nativeDisplayObject.setMask(-1);\n                            }\n                            self.$mask = null;\n                        }\n                    }\n                }\n                else {\n                    if (self.$mask) {\n                        self.$mask.$maskedObject = null;\n                        if (!egret.nativeRender) {\n                            self.$mask.$updateRenderMode();\n                        }\n                    }\n                    if (self.mask) {\n                        if (egret.nativeRender) {\n                            self.$nativeDisplayObject.setMask(-1);\n                        }\n                        self.$mask = null;\n                    }\n                    if (self.$maskRect) {\n                        if (egret.nativeRender) {\n                            self.$nativeDisplayObject.setMaskRect(0, 0, 0, 0);\n                        }\n                        self.$maskRect = null;\n                    }\n                }\n                if (!egret.nativeRender) {\n                    self.$updateRenderMode();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        DisplayObject.prototype.$setMaskRect = function (value) {\n            var self = this;\n            if (!value && !self.$maskRect) {\n                return;\n            }\n            if (value) {\n                if (!self.$maskRect) {\n                    self.$maskRect = new egret.Rectangle();\n                }\n                self.$maskRect.copyFrom(value);\n            }\n            else {\n                self.$maskRect = null;\n            }\n        };\n        Object.defineProperty(DisplayObject.prototype, \"filters\", {\n            /**\n             * An indexed array that contains each filter object currently associated with the display object.\n             * @version Egret 3.1.0\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 包含当前与显示对象关联的每个滤镜对象的索引数组。\n             * @version Egret 3.1.0\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$filters;\n            },\n            set: function (value) {\n                var self = this;\n                var filters = self.$filters;\n                if (!filters && !value) {\n                    self.$filters = value;\n                    if (egret.nativeRender) {\n                        self.$nativeDisplayObject.setFilters(null);\n                    }\n                    else {\n                        self.$updateRenderMode();\n                        var p = self.$parent;\n                        if (p && !p.$cacheDirty) {\n                            p.$cacheDirty = true;\n                            p.$cacheDirtyUp();\n                        }\n                        var maskedObject = self.$maskedObject;\n                        if (maskedObject && !maskedObject.$cacheDirty) {\n                            maskedObject.$cacheDirty = true;\n                            maskedObject.$cacheDirtyUp();\n                        }\n                    }\n                    return;\n                }\n                if (value && value.length) {\n                    value = value.concat();\n                    self.$filters = value;\n                    if (egret.nativeRender) {\n                        self.$nativeDisplayObject.setFilters(value);\n                    }\n                }\n                else {\n                    self.$filters = value;\n                    if (egret.nativeRender) {\n                        self.$nativeDisplayObject.setFilters(null);\n                    }\n                }\n                if (!egret.nativeRender) {\n                    self.$updateRenderMode();\n                    var p = self.$parent;\n                    if (p && !p.$cacheDirty) {\n                        p.$cacheDirty = true;\n                        p.$cacheDirtyUp();\n                    }\n                    var maskedObject = self.$maskedObject;\n                    if (maskedObject && !maskedObject.$cacheDirty) {\n                        maskedObject.$cacheDirty = true;\n                        maskedObject.$cacheDirtyUp();\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * Returns a rectangle that defines the area of the display object relative to the coordinate system of the targetCoordinateSpace object.\n         * @param targetCoordinateSpace The display object that defines the coordinate system to use.\n         * @param resultRect A reusable instance of Rectangle for saving the results. Passing this parameter can reduce the number of reallocate objects\n         *, which allows you to get better code execution performance..\n         * @returns The rectangle that defines the area of the display object relative to the targetCoordinateSpace object's coordinate system.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回一个矩形，该矩形定义相对于 targetCoordinateSpace 对象坐标系的显示对象区域。\n         * @param targetCoordinateSpace 定义要使用的坐标系的显示对象。\n         * @param resultRect 一个用于存储结果的可复用Rectangle实例，传入此参数能够减少内部创建对象的次数，从而获得更高的运行性能。\n         * @returns 定义与 targetCoordinateSpace 对象坐标系统相关的显示对象面积的矩形。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObject.prototype.getTransformedBounds = function (targetCoordinateSpace, resultRect) {\n            targetCoordinateSpace = targetCoordinateSpace || this;\n            return this.$getTransformedBounds(targetCoordinateSpace, resultRect);\n        };\n        /**\n         * Obtain measurement boundary of display object\n         * @param resultRect {Rectangle} Optional. It is used to import Rectangle object for saving results, preventing duplicate object creation.\n         * @param calculateAnchor {boolean} Optional. It is used to determine whether to calculate anchor point.\n         * @returns {Rectangle}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取显示对象的测量边界\n         * @param resultRect {Rectangle} 可选参数，传入用于保存结果的Rectangle对象，避免重复创建对象。\n         * @param calculateAnchor {boolean} 可选参数，是否会计算锚点。\n         * @returns {Rectangle}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObject.prototype.getBounds = function (resultRect, calculateAnchor) {\n            if (calculateAnchor === void 0) { calculateAnchor = true; }\n            var self = this;\n            resultRect = self.$getTransformedBounds(self, resultRect);\n            if (calculateAnchor) {\n                if (self.$anchorOffsetX != 0) {\n                    resultRect.x -= self.$anchorOffsetX;\n                }\n                if (self.$anchorOffsetY != 0) {\n                    resultRect.y -= self.$anchorOffsetY;\n                }\n            }\n            return resultRect;\n        };\n        /**\n         * @private\n         */\n        DisplayObject.prototype.$getTransformedBounds = function (targetCoordinateSpace, resultRect) {\n            var self = this;\n            var bounds = self.$getOriginalBounds();\n            if (!resultRect) {\n                resultRect = new egret.Rectangle();\n            }\n            resultRect.copyFrom(bounds);\n            if (targetCoordinateSpace == self) {\n                return resultRect;\n            }\n            var m;\n            if (targetCoordinateSpace) {\n                m = egret.$TempMatrix;\n                var invertedTargetMatrix = targetCoordinateSpace.$getInvertedConcatenatedMatrix();\n                invertedTargetMatrix.$preMultiplyInto(self.$getConcatenatedMatrix(), m);\n            }\n            else {\n                m = self.$getConcatenatedMatrix();\n            }\n            m.$transformBounds(resultRect);\n            return resultRect;\n        };\n        /**\n         * Converts the point object from the Stage (global) coordinates to the display object's (local) coordinates.\n         * @param stageX the x value in the global coordinates\n         * @param stageY the y value in the global coordinates\n         * @param resultPoint A reusable instance of Point for saving the results. Passing this parameter can reduce the\n         * number of reallocate objects, which allows you to get better code execution performance.\n         * @returns A Point object with coordinates relative to the display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将从舞台（全局）坐标转换为显示对象的（本地）坐标。\n         * @param stageX 舞台坐标x\n         * @param stageY 舞台坐标y\n         * @param resultPoint 一个用于存储结果的可复用 Point 实例，传入此参数能够减少内部创建对象的次数，从而获得更高的运行性能。\n         * @returns 具有相对于显示对象的坐标的 Point 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObject.prototype.globalToLocal = function (stageX, stageY, resultPoint) {\n            if (stageX === void 0) { stageX = 0; }\n            if (stageY === void 0) { stageY = 0; }\n            if (egret.nativeRender) {\n                egret_native.updateNativeRender();\n                var result = egret_native.nrGlobalToLocal(this.$nativeDisplayObject.id, stageX, stageY);\n                var arr = result.split(\",\");\n                var x = parseFloat(arr[0]);\n                var y = parseFloat(arr[1]);\n                if (resultPoint) {\n                    resultPoint.setTo(x, y);\n                }\n                else {\n                    resultPoint = new egret.Point(x, y);\n                }\n                return resultPoint;\n            }\n            else {\n                var m = this.$getInvertedConcatenatedMatrix();\n                return m.transformPoint(stageX, stageY, resultPoint);\n            }\n        };\n        /**\n         * Converts the point object from the display object's (local) coordinates to the Stage (global) coordinates.\n         * @param localX the x value in the local coordinates\n         * @param localY the x value in the local coordinates\n         * @param resultPoint A reusable instance of Point for saving the results. Passing this parameter can reduce the\n         * number of reallocate objects, which allows you to get better code execution performance.\n         * @returns  A Point object with coordinates relative to the Stage.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将显示对象的（本地）坐标转换为舞台（全局）坐标。\n         * @param localX 本地坐标 x\n         * @param localY 本地坐标 y\n         * @param resultPoint 一个用于存储结果的可复用 Point 实例，传入此参数能够减少内部创建对象的次数，从而获得更高的运行性能。\n         * @returns 一个具有相对于舞台坐标的 Point 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObject.prototype.localToGlobal = function (localX, localY, resultPoint) {\n            if (localX === void 0) { localX = 0; }\n            if (localY === void 0) { localY = 0; }\n            if (egret.nativeRender) {\n                egret_native.updateNativeRender();\n                var result = egret_native.nrLocalToGlobal(this.$nativeDisplayObject.id, localX, localY);\n                var arr = result.split(\",\");\n                var x = parseFloat(arr[0]);\n                var y = parseFloat(arr[1]);\n                if (resultPoint) {\n                    resultPoint.setTo(x, y);\n                }\n                else {\n                    resultPoint = new egret.Point(x, y);\n                }\n                return resultPoint;\n            }\n            else {\n                var m = this.$getConcatenatedMatrix();\n                return m.transformPoint(localX, localY, resultPoint);\n            }\n        };\n        /**\n         * @private\n         * 获取显示对象占用的矩形区域集合，通常包括自身绘制的测量区域，如果是容器，还包括所有子项占据的区域。\n         */\n        DisplayObject.prototype.$getOriginalBounds = function () {\n            var self = this;\n            var bounds = self.$getContentBounds();\n            self.$measureChildBounds(bounds);\n            var offset = self.$measureFiltersOffset(false);\n            if (offset) {\n                bounds.x += offset.minX;\n                bounds.y += offset.minY;\n                bounds.width += -offset.minX + offset.maxX;\n                bounds.height += -offset.minY + offset.maxY;\n            }\n            return bounds;\n        };\n        /**\n         * @private\n         * 测量子项占用的矩形区域\n         * @param bounds 测量结果存储在这个矩形对象内\n         */\n        DisplayObject.prototype.$measureChildBounds = function (bounds) {\n        };\n        /**\n         * @private\n         */\n        DisplayObject.prototype.$getContentBounds = function () {\n            var bounds = egret.$TempRectangle;\n            bounds.setEmpty();\n            this.$measureContentBounds(bounds);\n            return bounds;\n        };\n        /**\n         * @private\n         * 测量自身占用的矩形区域，注意：此测量结果并不包括子项占据的区域。\n         * @param bounds 测量结果存储在这个矩形对象内\n         */\n        DisplayObject.prototype.$measureContentBounds = function (bounds) {\n        };\n        /**\n         * @private\n         * 获取渲染节点\n         */\n        DisplayObject.prototype.$getRenderNode = function () {\n            var self = this;\n            var node = self.$renderNode;\n            if (!node) {\n                return null;\n            }\n            if (self.$renderDirty) {\n                node.cleanBeforeRender();\n                self.$updateRenderNode();\n                self.$renderDirty = false;\n                node = self.$renderNode;\n            }\n            return node;\n        };\n        DisplayObject.prototype.$updateRenderMode = function () {\n            var self = this;\n            if (!self.$visible || self.$alpha <= 0 || self.$maskedObject) {\n                self.$renderMode = 1 /* NONE */;\n            }\n            else if (self.filters && self.filters.length > 0) {\n                self.$renderMode = 2 /* FILTER */;\n            }\n            else if (self.$blendMode !== 0 || (self.$mask && self.$mask.$stage)) {\n                self.$renderMode = 3 /* CLIP */;\n            }\n            else if (self.$scrollRect || self.$maskRect) {\n                self.$renderMode = 4 /* SCROLLRECT */;\n            }\n            else {\n                self.$renderMode = null;\n            }\n        };\n        /**\n         * @private\n         */\n        DisplayObject.prototype.$measureFiltersOffset = function (fromParent) {\n            var display = this;\n            var minX = 0;\n            var minY = 0;\n            var maxX = 0;\n            var maxY = 0;\n            while (display) {\n                var filters = display.$filters;\n                if (filters && filters.length) {\n                    var length_1 = filters.length;\n                    for (var i = 0; i < length_1; i++) {\n                        var filter = filters[i];\n                        //todo 缓存这个数据\n                        if (filter.type == \"blur\") {\n                            var offsetX = filter.blurX;\n                            var offsetY = filter.blurY;\n                            minX -= offsetX;\n                            minY -= offsetY;\n                            maxX += offsetX;\n                            maxY += offsetY;\n                        }\n                        else if (filter.type == \"glow\") {\n                            var offsetX = filter.blurX;\n                            var offsetY = filter.blurY;\n                            minX -= offsetX;\n                            minY -= offsetY;\n                            maxX += offsetX;\n                            maxY += offsetY;\n                            var distance = filter.distance || 0;\n                            var angle = filter.angle || 0;\n                            var distanceX = 0;\n                            var distanceY = 0;\n                            if (distance != 0) {\n                                distanceX = distance * egret.NumberUtils.cos(angle);\n                                if (distanceX > 0) {\n                                    distanceX = Math.ceil(distanceX);\n                                }\n                                else {\n                                    distanceX = Math.floor(distanceX);\n                                }\n                                distanceY = distance * egret.NumberUtils.sin(angle);\n                                if (distanceY > 0) {\n                                    distanceY = Math.ceil(distanceY);\n                                }\n                                else {\n                                    distanceY = Math.floor(distanceY);\n                                }\n                                minX += distanceX;\n                                maxX += distanceX;\n                                minY += distanceY;\n                                maxY += distanceY;\n                            }\n                        }\n                        else if (filter.type == \"custom\") {\n                            var padding = filter.padding;\n                            minX -= padding;\n                            minY -= padding;\n                            maxX += padding;\n                            maxY += padding;\n                        }\n                    }\n                }\n                if (fromParent) {\n                    display = display.$parent;\n                }\n                else {\n                    display = null;\n                }\n            }\n            minX = Math.min(minX, 0);\n            minY = Math.min(minY, 0);\n            maxX = Math.max(maxX, 0);\n            maxY = Math.max(maxY, 0);\n            return { minX: minX, minY: minY, maxX: maxX, maxY: maxY };\n        };\n        /**\n         * @private\n         * 获取相对于指定根节点的连接矩阵。\n         * @param root 根节点显示对象\n         * @param matrix 目标显示对象相对于舞台的完整连接矩阵。\n         */\n        DisplayObject.prototype.$getConcatenatedMatrixAt = function (root, matrix) {\n            var invertMatrix = root.$getInvertedConcatenatedMatrix();\n            if (invertMatrix.a === 0 || invertMatrix.d === 0) {\n                var target = this;\n                var rootLevel = root.$nestLevel;\n                matrix.identity();\n                while (target.$nestLevel > rootLevel) {\n                    var rect = target.$scrollRect;\n                    if (rect) {\n                        matrix.concat(egret.$TempMatrix.setTo(1, 0, 0, 1, -rect.x, -rect.y));\n                    }\n                    matrix.concat(target.$getMatrix());\n                    target = target.$parent;\n                }\n            }\n            else {\n                invertMatrix.$preMultiplyInto(matrix, matrix);\n            }\n        };\n        /**\n         * @private\n         * 更新renderNode\n         */\n        DisplayObject.prototype.$updateRenderNode = function () {\n        };\n        /**\n         * @private\n         */\n        DisplayObject.prototype.$hitTest = function (stageX, stageY) {\n            var self = this;\n            if ((!egret.nativeRender && !self.$renderNode) || !self.$visible || self.$scaleX == 0 || self.$scaleY == 0) {\n                return null;\n            }\n            var m = self.$getInvertedConcatenatedMatrix();\n            if (m.a == 0 && m.b == 0 && m.c == 0 && m.d == 0) {\n                return null;\n            }\n            var bounds = self.$getContentBounds();\n            var localX = m.a * stageX + m.c * stageY + m.tx;\n            var localY = m.b * stageX + m.d * stageY + m.ty;\n            if (bounds.contains(localX, localY)) {\n                if (!self.$children) {\n                    var rect = self.$scrollRect ? self.$scrollRect : self.$maskRect;\n                    if (rect && !rect.contains(localX, localY)) {\n                        return null;\n                    }\n                    if (self.$mask && !self.$mask.$hitTest(stageX, stageY)) {\n                        return null;\n                    }\n                }\n                return self;\n            }\n            return null;\n        };\n        /**\n         * Calculate the display object to determine whether it overlaps or crosses with the points specified by the x and y parameters. The x and y parameters specify the points in the coordinates of the stage, rather than the points in the display object container that contains display objects (except the situation where the display object container is a stage).\n         * Note: Don't use accurate pixel collision detection on a large number of objects. Otherwise, this will cause serious performance deterioration.\n         * @param x {number}  x coordinate of the object to be tested.\n         * @param y {number}  y coordinate of the object to be tested.\n         * @param shapeFlag {boolean} Whether to check the actual pixel of object (true) or check that of border (false).Write realized.\n         * @returns {boolean} If display object overlaps or crosses with the specified point, it is true; otherwise, it is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 计算显示对象，以确定它是否与 x 和 y 参数指定的点重叠或相交。x 和 y 参数指定舞台的坐标空间中的点，而不是包含显示对象的显示对象容器中的点（除非显示对象容器是舞台）。\n         * 注意，不要在大量物体中使用精确碰撞像素检测，这回带来巨大的性能开销\n         * @param x {number}  要测试的此对象的 x 坐标。\n         * @param y {number}  要测试的此对象的 y 坐标。\n         * @param shapeFlag {boolean} 是检查对象 (true) 的实际像素，还是检查边框 (false) 的实际像素。\n         * @returns {boolean} 如果显示对象与指定的点重叠或相交，则为 true；否则为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObject.prototype.hitTestPoint = function (x, y, shapeFlag) {\n            var self = this;\n            if (!shapeFlag) {\n                if (self.$scaleX == 0 || self.$scaleY == 0) {\n                    return false;\n                }\n                var m = self.$getInvertedConcatenatedMatrix();\n                var bounds = self.getBounds(null, false);\n                var localX = m.a * x + m.c * y + m.tx;\n                var localY = m.b * x + m.d * y + m.ty;\n                if (bounds.contains(localX, localY)) {\n                    //这里不考虑设置mask的情况\n                    var rect = self.$scrollRect ? self.$scrollRect : self.$maskRect;\n                    if (rect && !rect.contains(localX, localY)) {\n                        return false;\n                    }\n                    return true;\n                }\n                return false;\n            }\n            else {\n                var m = self.$getInvertedConcatenatedMatrix();\n                var localX = m.a * x + m.c * y + m.tx;\n                var localY = m.b * x + m.d * y + m.ty;\n                var data = void 0;\n                if (egret.nativeRender) {\n                    var buffer = egret.sys.customHitTestBuffer;\n                    buffer.resize(3, 3);\n                    egret_native.forHitTest = true;\n                    egret_native.activateBuffer(buffer);\n                    egret_native.updateNativeRender();\n                    egret_native.nrRenderDisplayObject2(self.$nativeDisplayObject.id, 1 - localX, 1 - localY, true);\n                    try {\n                        data = new Uint8Array(4);\n                        egret_native.nrGetPixels(1, 1, 1, 1, data);\n                    }\n                    catch (e) {\n                        throw new Error(egret.sys.tr(1039));\n                    }\n                    egret_native.activateBuffer(null);\n                    egret_native.forHitTest = false;\n                    if (data[3] === 0) {\n                        return false;\n                    }\n                    return true;\n                }\n                else {\n                    var displayList = self.$displayList;\n                    if (displayList) {\n                        var buffer = displayList.renderBuffer;\n                        try {\n                            data = buffer.getPixels(localX - displayList.offsetX, localY - displayList.offsetY);\n                        }\n                        catch (e) {\n                            throw new Error(egret.sys.tr(1039));\n                        }\n                    }\n                    else {\n                        var buffer = egret.sys.customHitTestBuffer;\n                        buffer.resize(3, 3);\n                        var matrix = egret.Matrix.create();\n                        matrix.identity();\n                        matrix.translate(1 - localX, 1 - localY);\n                        egret.sys.systemRenderer.render(this, buffer, matrix, true);\n                        egret.Matrix.release(matrix);\n                        try {\n                            data = buffer.getPixels(1, 1);\n                        }\n                        catch (e) {\n                            throw new Error(egret.sys.tr(1039));\n                        }\n                    }\n                    if (data[3] === 0) {\n                        return false;\n                    }\n                    return true;\n                }\n            }\n        };\n        /**\n         * @private\n         */\n        DisplayObject.prototype.$addListener = function (type, listener, thisObject, useCapture, priority, dispatchOnce) {\n            _super.prototype.$addListener.call(this, type, listener, thisObject, useCapture, priority, dispatchOnce);\n            var isEnterFrame = (type == egret.Event.ENTER_FRAME);\n            if (isEnterFrame || type == egret.Event.RENDER) {\n                var list = isEnterFrame ? DisplayObject.$enterFrameCallBackList : DisplayObject.$renderCallBackList;\n                if (list.indexOf(this) == -1) {\n                    list.push(this);\n                }\n            }\n        };\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        DisplayObject.prototype.removeEventListener = function (type, listener, thisObject, useCapture) {\n            _super.prototype.removeEventListener.call(this, type, listener, thisObject, useCapture);\n            var isEnterFrame = (type == egret.Event.ENTER_FRAME);\n            if ((isEnterFrame || type == egret.Event.RENDER) && !this.hasEventListener(type)) {\n                var list = isEnterFrame ? DisplayObject.$enterFrameCallBackList : DisplayObject.$renderCallBackList;\n                var index = list.indexOf(this);\n                if (index !== -1) {\n                    list.splice(index, 1);\n                }\n            }\n        };\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        DisplayObject.prototype.dispatchEvent = function (event) {\n            if (!event.$bubbles) {\n                return _super.prototype.dispatchEvent.call(this, event);\n            }\n            var list = this.$getPropagationList(this);\n            var targetIndex = list.length * 0.5;\n            event.$setTarget(this);\n            this.$dispatchPropagationEvent(event, list, targetIndex);\n            return !event.$isDefaultPrevented;\n        };\n        /**\n         * @private\n         * 获取事件流列表。注意：Egret框架的事件流与Flash实现并不一致。\n         *\n         * 事件流有三个阶段：捕获，目标，冒泡。\n         * Flash里默认的的事件监听若不开启useCapture将监听目标和冒泡阶段。若开始capture将只能监听捕获当不包括目标的事件。\n         * 可以在Flash中写一个简单的测试：实例化一个非容器显示对象，例如TextField。分别监听useCapture为true和false时的鼠标事件。\n         * 点击后将只有useCapture为false的回调函数输出信息。也就带来一个问题「Flash的捕获阶段不能监听到最内层对象本身，只在父级列表有效」。\n         *\n         * 而HTML里的事件流设置useCapture为true时是能监听到目标阶段的，也就是目标阶段会被触发两次，在捕获和冒泡过程各触发一次。这样可以避免\n         * 前面提到的监听捕获无法监听目标本身的问题。\n         *\n         * Egret最终采用了HTML里目标节点触发两次的事件流方式。\n         */\n        DisplayObject.prototype.$getPropagationList = function (target) {\n            var list = [];\n            while (target) {\n                list.push(target);\n                target = target.$parent;\n            }\n            var captureList = list.concat();\n            captureList.reverse(); //使用一次reverse()方法比多次调用unshift()性能高。\n            list = captureList.concat(list);\n            return list;\n        };\n        /**\n         * @private\n         */\n        DisplayObject.prototype.$dispatchPropagationEvent = function (event, list, targetIndex) {\n            var length = list.length;\n            var captureIndex = targetIndex - 1;\n            for (var i = 0; i < length; i++) {\n                var currentTarget = list[i];\n                event.$currentTarget = currentTarget;\n                if (i < captureIndex)\n                    event.$eventPhase = 1 /* CAPTURING_PHASE */;\n                else if (i == targetIndex || i == captureIndex)\n                    event.$eventPhase = 2 /* AT_TARGET */;\n                else\n                    event.$eventPhase = 3 /* BUBBLING_PHASE */;\n                currentTarget.$notifyListener(event, i < targetIndex);\n                if (event.$isPropagationStopped || event.$isPropagationImmediateStopped) {\n                    return;\n                }\n            }\n        };\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        DisplayObject.prototype.willTrigger = function (type) {\n            var parent = this;\n            while (parent) {\n                if (parent.hasEventListener(type))\n                    return true;\n                parent = parent.$parent;\n            }\n            return false;\n        };\n        Object.defineProperty(DisplayObject.prototype, \"tint\", {\n            /**\n             * Set a tint color for the current object\n             * @version Egret 5.2.24\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 给当前对象设置填充色\n             * @version Egret 5.2.24\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._tint;\n            },\n            set: function (value) {\n                this._tint = value;\n                this.$tintRGB = (value >> 16) + (value & 0xff00) + ((value & 0xff) << 16);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        DisplayObject.prototype.sortChildren = function () {\n            this.$sortDirty = false;\n        };\n        Object.defineProperty(DisplayObject.prototype, \"zIndex\", {\n            /**\n             * the z-order (front-to-back order) of the object\n             * @version Egret 5.2.24\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 设置对象的 Z 轴顺序（前后顺序）\n             * @version Egret 5.2.24\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._zIndex;\n            },\n            set: function (value) {\n                this._zIndex = value;\n                if (this.parent) {\n                    this.parent.$sortDirty = true;\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         * The default touchEnabled property of DisplayObject\n         * @default false\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * @private\n         * 显示对象默认的 touchEnabled 属性\n         * @default false\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObject.defaultTouchEnabled = false;\n        /**\n         * @private\n         */\n        DisplayObject.$enterFrameCallBackList = [];\n        /**\n         * @private\n         */\n        DisplayObject.$renderCallBackList = [];\n        return DisplayObject;\n    }(egret.EventDispatcher));\n    egret.DisplayObject = DisplayObject;\n    __reflect(DisplayObject.prototype, \"egret.DisplayObject\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    egret.$TextureScaleFactor = 1;\n    /**\n     * The Texture class encapsulates different image resources on different platforms.\n     * In HTML5, resource is an HTMLElement object\n     * In OpenGL / WebGL, resource is a texture ID obtained after the GPU is submitted\n     * The Texture class encapsulates the details implemented on the underlayer. Developers just need to focus on interfaces\n     * @see http://edn.egret.com/cn/docs/page/135 The use of texture packs\n     * @see http://edn.egret.com/cn/docs/page/123 Several ways of access to resources\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Texture.ts\n     * @language en_US\n     */\n    /**\n     * 纹理类是对不同平台不同的图片资源的封装\n     * 在HTML5中，资源是一个HTMLElement对象\n     * 在OpenGL / WebGL中，资源是一个提交GPU后获取的纹理id\n     * Texture类封装了这些底层实现的细节，开发者只需要关心接口即可\n     * @see http://edn.egret.com/cn/docs/page/135 纹理集的使用\n     * @see http://edn.egret.com/cn/docs/page/123 获取资源的几种方式\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Texture.ts\n     * @language zh_CN\n     */\n    var Texture = (function (_super) {\n        __extends(Texture, _super);\n        /**\n         * Create an egret.Texture object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.Texture 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function Texture() {\n            var _this = _super.call(this) || this;\n            /**\n             * Whether to destroy the corresponding BitmapData when the texture is destroyed\n             * @version Egret 5.0.8\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 销毁纹理时是否销毁对应BitmapData\n             * @version Egret 5.0.8\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.disposeBitmapData = true;\n            /**\n             * @private\n             * 表示这个纹理在 bitmapData 上的 x 起始位置\n             */\n            _this.$bitmapX = 0;\n            /**\n             * @private\n             * 表示这个纹理在 bitmapData 上的 y 起始位置\n             */\n            _this.$bitmapY = 0;\n            /**\n             * @private\n             * 表示这个纹理在 bitmapData 上的宽度\n             */\n            _this.$bitmapWidth = 0;\n            /**\n             * @private\n             * 表示这个纹理在 bitmapData 上的高度\n             */\n            _this.$bitmapHeight = 0;\n            /**\n             * @private\n             * 表示这个纹理显示了之后在 x 方向的渲染偏移量\n             */\n            _this.$offsetX = 0;\n            /**\n             * @private\n             * 表示这个纹理显示了之后在 y 方向的渲染偏移量\n             */\n            _this.$offsetY = 0;\n            /**\n             * @private\n             * 纹理宽度\n             */\n            _this.$textureWidth = 0;\n            /**\n             * @private\n             * 纹理高度\n             */\n            _this.$textureHeight = 0;\n            /**\n             * @private\n             * 表示bitmapData.width\n             */\n            _this.$sourceWidth = 0;\n            /**\n             * @private\n             * 表示bitmapData.height\n             */\n            _this.$sourceHeight = 0;\n            /**\n             * @private\n             */\n            _this.$bitmapData = null;\n            /**\n             * @private\n             */\n            _this.$ktxData = null;\n            /**\n             * @private\n             */\n            _this.$rotated = false;\n            return _this;\n        }\n        Object.defineProperty(Texture.prototype, \"textureWidth\", {\n            /**\n             * Texture width, read only\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 纹理宽度，只读属性，不可以设置\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$getTextureWidth();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Texture.prototype.$getTextureWidth = function () {\n            return this.$textureWidth;\n        };\n        Object.defineProperty(Texture.prototype, \"textureHeight\", {\n            /**\n             * Texture height, read only\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 纹理高度，只读属性，不可以设置\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$getTextureHeight();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Texture.prototype.$getTextureHeight = function () {\n            return this.$textureHeight;\n        };\n        Texture.prototype.$getScaleBitmapWidth = function () {\n            return this.$bitmapWidth * egret.$TextureScaleFactor;\n        };\n        Texture.prototype.$getScaleBitmapHeight = function () {\n            return this.$bitmapHeight * egret.$TextureScaleFactor;\n        };\n        Object.defineProperty(Texture.prototype, \"bitmapData\", {\n            /**\n             * The BitmapData object being referenced.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 被引用的 BitmapData 对象。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$bitmapData;\n            },\n            set: function (value) {\n                this.$ktxData = null;\n                this._setBitmapData(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n        * Set the BitmapData object.\n        * @version Egret 3.2.1\n        * @platform Web,Native\n        * @language en_US\n        */\n        /**\n         * 设置 BitmapData 对象。\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Texture.prototype._setBitmapData = function (value) {\n            this.$bitmapData = value;\n            var scale = egret.$TextureScaleFactor;\n            var w = value.width * scale;\n            var h = value.height * scale;\n            this.$initData(0, 0, w, h, 0, 0, w, h, value.width, value.height);\n        };\n        Object.defineProperty(Texture.prototype, \"ktxData\", {\n            /**\n             * The KTX object being referenced.\n            * @version Egret 5.2.21\n            * @platform Web,Native\n            * @language en_US\n            */\n            /**\n             * 被引用的 KTXData 对象。\n             * @version Egret 5.2.21\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$ktxData;\n            },\n            set: function (data) {\n                this._setKtxData(data);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n        * Set the KTXData object.\n        * @version Egret 3.2.1\n        * @platform Web,Native\n        * @language en_US\n        */\n        /**\n         * 设置 KTXData 对象。\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Texture.prototype._setKtxData = function (value) {\n            if (!value) {\n                egret.error('ktx data is null');\n                return;\n            }\n            if (value == this.$ktxData) {\n                return;\n            }\n            var ktx = new egret.KTXContainer(value, 1);\n            if (ktx.isInvalid) {\n                egret.error('ktx data is invalid');\n                return;\n            }\n            this.$ktxData = value;\n            var bitmapData = new egret.BitmapData(value);\n            bitmapData.format = 'ktx';\n            ktx.uploadLevels(bitmapData, false);\n            this._setBitmapData(bitmapData);\n        };\n        /**\n         * @private\n         * 设置Texture数据\n         * @param bitmapX\n         * @param bitmapY\n         * @param bitmapWidth\n         * @param bitmapHeight\n         * @param offsetX\n         * @param offsetY\n         * @param textureWidth\n         * @param textureHeight\n         * @param sourceWidth\n         * @param sourceHeight\n         */\n        Texture.prototype.$initData = function (bitmapX, bitmapY, bitmapWidth, bitmapHeight, offsetX, offsetY, textureWidth, textureHeight, sourceWidth, sourceHeight, rotated) {\n            if (rotated === void 0) { rotated = false; }\n            var scale = egret.$TextureScaleFactor;\n            this.$bitmapX = bitmapX / scale;\n            this.$bitmapY = bitmapY / scale;\n            this.$bitmapWidth = bitmapWidth / scale;\n            this.$bitmapHeight = bitmapHeight / scale;\n            this.$offsetX = offsetX;\n            this.$offsetY = offsetY;\n            this.$textureWidth = textureWidth;\n            this.$textureHeight = textureHeight;\n            this.$sourceWidth = sourceWidth;\n            this.$sourceHeight = sourceHeight;\n            this.$rotated = rotated;\n            //todo\n            egret.BitmapData.$invalidate(this.$bitmapData);\n        };\n        /**\n         * @deprecated\n         */\n        Texture.prototype.getPixel32 = function (x, y) {\n            throw new Error();\n        };\n        /**\n         * Obtain the color value for the specified pixel region\n         * @param x  The x coordinate of the pixel region\n         * @param y  The y coordinate of the pixel region\n         * @param width  The width of the pixel region\n         * @param height  The height of the pixel region\n         * @returns  Specifies the color value for the pixel region\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取指定像素区域的颜色值\n         * @param x  像素区域的X轴坐标\n         * @param y  像素区域的Y轴坐标\n         * @param width  像素区域的宽度\n         * @param height  像素区域的高度\n         * @returns  指定像素区域的颜色值\n         * @version Egret 3.2.1\n         * @platform Web\n         * @language zh_CN\n         */\n        Texture.prototype.getPixels = function (x, y, width, height) {\n            if (width === void 0) { width = 1; }\n            if (height === void 0) { height = 1; }\n            throw new Error();\n        };\n        /**\n         * Convert base64 string, if the picture (or pictures included) cross-border or null\n         * @param type Type conversions, such as \"image / png\"\n         * @param rect The need to convert the area\n         * @param smoothing Whether to convert data to the smoothing process\n         * @returns {any} base64 string\n         * @version Egret 2.4\n         * @language en_US\n         */\n        /**\n         * 转换成base64字符串，如果图片（或者包含的图片）跨域，则返回null\n         * @param type 转换的类型，如  \"image/png\"\n         * @param rect 需要转换的区域\n         * @param {any} encoderOptions 编码用的参数\n         * @returns {any} base64字符串\n         * @version Egret 2.4\n         * @language zh_CN\n         */\n        Texture.prototype.toDataURL = function (type, rect, encoderOptions) {\n            throw new Error();\n        };\n        /**\n         * Crop designated area and save it as image.\n         * native support only \"image / png\" and \"image / jpeg\"; Web browser because of the various implementations are not the same, it is recommended to use only these two kinds.\n         * @param type Type conversions, such as \"image / png\"\n         * @param filePath The path name of the image (the home directory for the game's private space, the path can not have \"../\",Web supports only pass names.)\n         * @param rect The need to convert the area\n         * @version Egret 2.4\n         * @platform Native\n         * @language en_US\n         */\n        /**\n         * 裁剪指定区域并保存成图片。\n         * native只支持 \"image/png\" 和 \"image/jpeg\"；Web中由于各个浏览器的实现不一样，因此建议也只用这2种。\n         * @param type 转换的类型，如  \"image/png\"\n         * @param filePath 图片的名称的路径（主目录为游戏的私有空间，路径中不能有 \"../\"，Web只支持传名称。）\n         * @param rect 需要转换的区域\n         * @version Egret 2.4\n         * @platform Native\n         * @language zh_CN\n         */\n        Texture.prototype.saveToFile = function (type, filePath, rect) {\n            throw new Error();\n        };\n        /**\n         * dispose texture\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放纹理\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Texture.prototype.dispose = function () {\n            if (this.$bitmapData) {\n                if (this.disposeBitmapData) {\n                    this.$bitmapData.$dispose();\n                }\n                this.$bitmapData = null;\n            }\n        };\n        return Texture;\n    }(egret.HashObject));\n    egret.Texture = Texture;\n    __reflect(Texture.prototype, \"egret.Texture\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The Event class is used as the base class for the creation of Event objects, which are passed as parameters to event\n     * listeners when an event occurs.The properties of the Event class carry basic information about an event, such as\n     * the event's type or whether the event's default behavior can be canceled. For many events, such as the events represented\n     * by the Event class constants, this basic information is sufficient. Other events, however, may require more detailed\n     * information. Events associated with a touch tap, for example, need to include additional information about the\n     * location of the touch event. You can pass such additional information to event listeners by extending the Event class,\n     * which is what the TouchEvent class does. Egret API defines several Event subclasses for common events that require\n     * additional information. Events associated with each of the Event subclasses are described in the documentation for\n     * each class.The methods of the Event class can be used in event listener functions to affect the behavior of the event\n     * object. Some events have an associated default behavior. Your event listener can cancel this behavior by calling the\n     * preventDefault() method. You can also make the current event listener the last one to process an event by calling\n     * the stopPropagation() or stopImmediatePropagation() method.\n     * @see egret.EventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/Event.ts\n     * @see http://edn.egret.com/cn/docs/page/798 取消触摸事件\n     * @language en_US\n     */\n    /**\n     * Event 类作为创建事件实例的基类，当发生事件时，Event 实例将作为参数传递给事件侦听器。Event 类的属性包含有关事件的基本信息，例如事件\n     * 的类型或者是否可以取消事件的默认行为。对于许多事件（如由 Event 类常量表示的事件），此基本信息就足够了。但其他事件可能需要更详细的信息。\n     * 例如，与触摸关联的事件需要包括有关触摸事件的位置信息。您可以通过扩展 Event 类（TouchEvent 类执行的操作）将此类其他信息传递给事件侦听器。\n     * Egret API 为需要其他信息的常见事件定义多个 Event 子类。与每个 Event 子类关联的事件将在每个类的文档中加以介绍。Event 类的方法可以在\n     * 事件侦听器函数中使用以影响事件对象的行为。某些事件有关联的默认行为，通过调用 preventDefault() 方法，您的事件侦听器可以取消此行为。\n     * 可以通过调用 stopPropagation() 或 stopImmediatePropagation() 方法，将当前事件侦听器作为处理事件的最后一个事件侦听器。\n     * @see egret.EventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/Event.ts\n     * @see http://edn.egret.com/cn/docs/page/798 取消触摸事件\n     * @language zh_CN\n     */\n    var Event = (function (_super) {\n        __extends(Event, _super);\n        /**\n         * Creates an Event object to pass as a parameter to event listeners.\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @param data the optional data associated with this event\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个作为参数传递给事件侦听器的 Event 对象。\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param data 与此事件对象关联的可选数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function Event(type, bubbles, cancelable, data) {\n            var _this = _super.call(this) || this;\n            /**\n             * @private\n             */\n            _this.$eventPhase = 2;\n            /**\n             * @private\n             */\n            _this.$currentTarget = null;\n            /**\n             * @private\n             */\n            _this.$target = null;\n            /**\n             * @private\n             */\n            _this.$isDefaultPrevented = false;\n            /**\n             * @private\n             */\n            _this.$isPropagationStopped = false;\n            /**\n             * @private\n             */\n            _this.$isPropagationImmediateStopped = false;\n            _this.$type = type;\n            _this.$bubbles = !!bubbles;\n            _this.$cancelable = !!cancelable;\n            _this.data = data;\n            return _this;\n        }\n        Object.defineProperty(Event.prototype, \"type\", {\n            /**\n             * The type of event. The type is case-sensitive.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 事件的类型。类型区分大小写。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$type;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Event.prototype, \"bubbles\", {\n            /**\n             * Indicates whether an event is a bubbling event.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示事件是否为冒泡事件。如果事件可以冒泡，则此值为 true；否则为 false。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$bubbles;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Event.prototype, \"cancelable\", {\n            /**\n             * Indicates whether the behavior associated with the event can be prevented. If the behavior can be\n             * canceled, this value is true; otherwise it is false.\n             * @see #preventDefault()\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示是否可以阻止与事件相关联的行为。如果可以取消该行为，则此值为 true；否则为 false。\n             * @see #preventDefault()\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$cancelable;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Event.prototype, \"eventPhase\", {\n            /**\n             * The current phase in the event flow. This property can contain the following numeric values:\n             * The capture phase (EventPhase.CAPTURING_PHASE).\n             * The target phase (EventPhase.AT_TARGET)\n             * The bubbling phase (EventPhase.BUBBLING_PHASE).\n             * @see egret.EventPhase\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 事件流中的当前阶段。此属性可以包含以下数值：\n             * 捕获阶段 (EventPhase.CAPTURING_PHASE)。\n             * 目标阶段 (EventPhase.AT_TARGET)。\n             * 冒泡阶段 (EventPhase.BUBBLING_PHASE)。\n             * @see egret.EventPhase\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$eventPhase;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Event.prototype, \"currentTarget\", {\n            /**\n             * The object that is actively processing the Event object with an event listener. For example, if a\n             * user clicks an OK button, the current target could be the node containing that button or one of its ancestors\n             * that has registered an event listener for that event.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 当前正在使用某个事件侦听器处理 Event 对象的对象。例如，如果用户单击“确定”按钮，\n             * 则当前目标可以是包含该按钮的节点，也可以是它的已为该事件注册了事件侦听器的始祖之一。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$currentTarget;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Event.prototype, \"target\", {\n            /**\n             * The event target. This property contains the target node. For example, if a user clicks an OK button,\n             * the target node is the display list node containing that button.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 事件目标。此属性包含目标节点。例如，如果用户单击“确定”按钮，则目标节点就是包含该按钮的显示列表节点。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$target;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Event.prototype.$setTarget = function (target) {\n            this.$target = target;\n            return true;\n        };\n        /**\n         * Checks whether the preventDefault() method has been called on the event. If the preventDefault() method has been\n         * called, returns true; otherwise, returns false.\n         * @returns If preventDefault() has been called, returns true; otherwise, returns false.\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 检查是否已对事件调用 preventDefault() 方法。\n         * @returns 如果已调用 preventDefault() 方法，则返回 true；否则返回 false。\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.prototype.isDefaultPrevented = function () {\n            return this.$isDefaultPrevented;\n        };\n        /**\n         * Cancels an event's default behavior if that behavior can be canceled.Many events have associated behaviors that\n         * are carried out by default. For example, if a user types a character into a text input, the default behavior\n         * is that the character is displayed in the text input. Because the TextEvent.TEXT_INPUT event's default behavior\n         * can be canceled, you can use the preventDefault() method to prevent the character from appearing.\n         * You can use the Event.cancelable property to check whether you can prevent the default behavior associated with\n         * a particular event. If the value of Event.cancelable is true, then preventDefault() can be used to cancel the event;\n         * otherwise, preventDefault() has no effect.\n         * @see #cancelable\n         * @see #isDefaultPrevented\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果可以取消事件的默认行为，则取消该行为。\n         * 许多事件都有默认执行的关联行为。例如，如果用户在文本字段中键入一个字符，则默认行为就是在文本字段中显示该字符。\n         * 由于可以取消 TextEvent.TEXT_INPUT 事件的默认行为，因此您可以使用 preventDefault() 方法来防止显示该字符。\n         * 您可以使用 Event.cancelable 属性来检查是否可以防止与特定事件关联的默认行为。如果 Event.cancelable 的值为 true，\n         * 则可以使用 preventDefault() 来取消事件；否则，preventDefault() 无效。\n         * @see #cancelable\n         * @see #isDefaultPrevented\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.prototype.preventDefault = function () {\n            if (this.$cancelable)\n                this.$isDefaultPrevented = true;\n        };\n        /**\n         * Prevents processing of any event listeners in nodes subsequent to the current node in the event flow. This method\n         * does not affect any event listeners in the current node (currentTarget). In contrast, the stopImmediatePropagation()\n         * method prevents processing of event listeners in both the current node and subsequent nodes. Additional calls to this\n         * method have no effect. This method can be called in any phase of the event flow.<br/>\n         * Note: This method does not cancel the behavior associated with this event; see preventDefault() for that functionality.\n         * @see #stopImmediatePropagation()\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 防止对事件流中当前节点的后续节点中的所有事件侦听器进行处理。此方法不会影响当前节点 currentTarget 中的任何事件侦听器。\n         * 相比之下，stopImmediatePropagation() 方法可以防止对当前节点中和后续节点中的事件侦听器进行处理。\n         * 对此方法的其它调用没有任何效果。可以在事件流的任何阶段中调用此方法。<br/>\n         * 注意：此方法不会取消与此事件相关联的行为；有关此功能的信息，请参阅 preventDefault()。\n         * @see #stopImmediatePropagation()\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.prototype.stopPropagation = function () {\n            if (this.$bubbles)\n                this.$isPropagationStopped = true;\n        };\n        /**\n         * Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow.\n         * This method takes effect immediately, and it affects event listeners in the current node. In contrast, the\n         * stopPropagation() method doesn't take effect until all the event listeners in the current node finish processing.<br/>\n         * Note: This method does not cancel the behavior associated with this event; see preventDefault() for that functionality.\n         * @see #stopPropagation()\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 防止对事件流中当前节点中和所有后续节点中的事件侦听器进行处理。此方法会立即生效，并且会影响当前节点中的事件侦听器。\n         * 相比之下，在当前节点中的所有事件侦听器都完成处理之前，stopPropagation() 方法不会生效。<br/>\n         * 注意：此方法不会取消与此事件相关联的行为；有关此功能的信息，请参阅 preventDefault()。\n         * @see #stopPropagation()\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.prototype.stopImmediatePropagation = function () {\n            if (this.$bubbles)\n                this.$isPropagationImmediateStopped = true;\n        };\n        /**\n         * This method will be called automatically when you pass the event object as the parameters to the Event.release() method.\n         * If your custom event is designed for reusable,you should override this method to make sure all the references to external\n         * objects are cleaned. if not,it may cause memory leaking.\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当事件实例传递给Event.release()静态方法时，实例上的clean()方法将会被自动调用。\n         * 若此自定义事件的实例设计为可以循环复用的，为了避免引起内存泄露，自定义事件需要覆盖此方法来确保实例被缓存前断开对外部对象的一切引用。\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.prototype.clean = function () {\n            this.data = this.$currentTarget = null;\n            this.$setTarget(null);\n        };\n        /**\n         * EventDispatcher object using the specified event object thrown Event. Objects thrown objects will be cached in the pool for the next round robin.\n         * @param target the event target\n         * @param type The type of the event. Event listeners can access this information through the inherited type property.\n         * @param bubbles Determines whether the Event object bubbles. Event listeners can access this information through\n         * the inherited bubbles property.\n         * @param data {any} data\n         * @method egret.Event.dispatchEvent\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的 EventDispatcher 对象来抛出 Event 事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @param type {string} 事件类型\n         * @param bubbles {boolean} 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param data {any} 事件data\n         * @method egret.Event.dispatchEvent\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.dispatchEvent = function (target, type, bubbles, data) {\n            if (bubbles === void 0) { bubbles = false; }\n            var event = Event.create(Event, type, bubbles);\n            var props = Event._getPropertyData(Event);\n            if (data != undefined) {\n                props.data = data;\n            }\n            var result = target.dispatchEvent(event);\n            Event.release(event);\n            return result;\n        };\n        /**\n         * @private\n         *\n         * @param EventClass\n         * @returns\n         */\n        Event._getPropertyData = function (EventClass) {\n            var props = EventClass._props;\n            if (!props)\n                props = EventClass._props = {};\n            return props;\n        };\n        /**\n         * Gets one event instance from the object pool or create a new one. We highly recommend using the Event.create()\n         * and Event.release() methods to create and release an event object,it can reduce the number of reallocate objects,\n         * which allows you to get better code execution performance.<br/>\n         * Note: If you want to use this method to initialize your custom event object,you must make sure the constructor\n         * of your custom event is the same as the constructor of egret.Event.\n         * @param EventClass Event Class。\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @example\n         * <pre>\n         *    let event = Event.create(Event,type, bubbles);\n         *    event.data = data;    //optional,initializes custom data here\n         *    this.dispatchEvent(event);\n         *    Event.release(event);\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从对象池中取出或创建一个新的事件实例。我们建议您尽可能使用Event.create()和Event.release() 这一对方法来创建和释放事件对象，\n         * 这一对方法会将事件实例在内部缓存下来供下次循环使用，减少对象的创建次数,从而获得更高的代码运行性能。<br/>\n         * 注意：若使用此方法来创建自定义事件的实例，自定义的构造函数参数列表必须跟Event类一致。\n         * @param EventClass Event类名。\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @example\n         * <pre>\n         *    let event = Event.create(Event,type, bubbles);\n         *    event.data = data;  //可选，若指定义事件上需要附加其他参数，可以在获取实例后在此处设置。\n         *    this.dispatchEvent(event);\n         *    Event.release(event);\n         * </pre>\n         * @see #clean()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.create = function (EventClass, type, bubbles, cancelable) {\n            var eventPool;\n            var hasEventPool = EventClass.hasOwnProperty(\"eventPool\");\n            if (hasEventPool) {\n                eventPool = EventClass.eventPool;\n            }\n            if (!eventPool) {\n                eventPool = EventClass.eventPool = [];\n            }\n            if (eventPool.length) {\n                var event_2 = eventPool.pop();\n                event_2.$type = type;\n                event_2.$bubbles = !!bubbles;\n                event_2.$cancelable = !!cancelable;\n                event_2.$isDefaultPrevented = false;\n                event_2.$isPropagationStopped = false;\n                event_2.$isPropagationImmediateStopped = false;\n                event_2.$eventPhase = 2 /* AT_TARGET */;\n                return event_2;\n            }\n            return new EventClass(type, bubbles, cancelable);\n        };\n        /**\n         * Releases an event object and cache it into the object pool.We highly recommend using the Event.create()\n         * and Event.release() methods to create and release an event object,it can reduce the number of reallocate objects,\n         * which allows you to get better code execution performance.<br/>\n         * Note: The parameters of this method only accepts an instance created by the Event.create() method.\n         * if not,it may throw an error.\n         * @example\n         * <pre>\n         *    let event = Event.create(Event,type, bubbles);\n         *    event.data = data; //optional,initializes custom data here\n         *    this.dispatchEvent(event);\n         *    Event.release(event);\n         * </pre>\n         * @see #clean()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放一个事件对象，并缓存到对象池。我们建议您尽可能使用Event.create()和Event.release() 这一对方法来创建和释放事件对象，\n         * 这一对方法会将事件实例在内部缓存下来供下次循环使用，减少对象的创建次数,从而获得更高的代码运行性能。<br/>\n         * 注意：此方法只能传入由Event.create()创建的事件实例，传入非法对象实例可能会导致报错。\n         * @example\n         * <pre>\n         *    let event = Event.create(Event,type, bubbles);\n         *    event.data = data;   //可选，若指定义事件上需要附加其他参数，可以在获取实例后在此处设置。\n         *    this.dispatchEvent(event);\n         *    Event.release(event);\n         * </pre>\n         * @see #clean()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.release = function (event) {\n            event.clean();\n            var EventClass = Object.getPrototypeOf(event).constructor;\n            EventClass.eventPool.push(event);\n        };\n        /**\n         * Dispatched when a display object is added to the on stage display list, either directly or through the addition\n         * of a sub tree in which the display object is contained.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在将显示对象直接添加到舞台显示列表或将包含显示对象的子树添加至舞台显示列表中时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.ADDED_TO_STAGE = \"addedToStage\";\n        /**\n         * Dispatched when a display object is about to be removed from the display list, either directly or through the removal\n         * of a sub tree in which the display object is contained.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在从显示列表中直接删除显示对象或删除包含显示对象的子树时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.REMOVED_FROM_STAGE = \"removedFromStage\";\n        /**\n         * Dispatched when a display object is added to the display list.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将显示对象添加到显示列表中时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.ADDED = \"added\";\n        /**\n         * Dispatched when a display object is about to be removed from the display list.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将要从显示列表中删除显示对象时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.REMOVED = \"removed\";\n        /**\n         * [broadcast event] Dispatched when the playhead is entering a new frame.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * [广播事件] 进入新的一帧,监听此事件将会在下一帧开始时触发一次回调。这是一个广播事件，可以在任何一个显示对象上监听，无论它是否在显示列表中。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.ENTER_FRAME = \"enterFrame\";\n        /**\n         * Dispatched when the display list is about to be updated and rendered.\n         * Note: Every time you want to receive a render event,you must call the stage.invalidate() method.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 渲染事件，监听此事件将会在本帧末即将开始渲染的前一刻触发回调，这是一个广播事件，可以在任何一个显示对象上监听，无论它是否在显示列表中。\n         * 注意：每次您希望 Egret 发送 Event.RENDER 事件时，都必须调用 stage.invalidate() 方法，由于每帧只会触发一次屏幕刷新，\n         * 若在 Event.RENDER 回调函数执行期间再次调用stage.invalidate()，将会被忽略。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.RENDER = \"render\";\n        /**\n         * Dispatched when the size of stage or UIComponent is changed.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 舞台尺寸或UI组件尺寸发生改变\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.RESIZE = \"resize\";\n        /**\n         * Dispatched when the value or selection of a property is chaned.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 属性值或状态发生改变。通常是按钮的选中状态，或者列表的选中项索引改变。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.CHANGE = \"change\";\n        /**\n         * Dispatched when the value or selection of a property is going to change.you can cancel this by calling the\n         * preventDefault() method.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 属性值或状态即将发生改变,通常是按钮的选中状态，或者列表的选中项索引改变。可以通过调用 preventDefault() 方法阻止索引发生更改。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.CHANGING = \"changing\";\n        /**\n         * Dispatched when the net request is complete.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 网络请求加载完成\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.COMPLETE = \"complete\";\n        /**\n         * Dispatched when loop completed.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 循环完成。循环最后一次只派发 COMPLETE 事件，不派发 LOOP_COMPLETE 事件。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.LOOP_COMPLETE = \"loopComplete\";\n        /**\n         * Dispatched when the TextInput instance gets focus.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * TextInput实例获得焦点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.FOCUS_IN = \"focusIn\";\n        /**\n         * Dispatched when the TextInput instance loses focus.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * TextInput实例失去焦点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.FOCUS_OUT = \"focusOut\";\n        /**\n         * Dispatched when the playback is ended.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 动画声音等播放完成\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Event.ENDED = \"ended\";\n        /**\n         * 游戏激活\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        Event.ACTIVATE = \"activate\";\n        /**\n         * 取消激活\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        Event.DEACTIVATE = \"deactivate\";\n        /**\n         * Event.CLOSE 常量定义 close 事件对象的 type 属性的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        Event.CLOSE = \"close\";\n        /**\n         * Event.CONNECT 常量定义 connect 事件对象的 type 属性的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        Event.CONNECT = \"connect\";\n        /**\n         * Event.LEAVE_STAGE 常量定义 leaveStage 事件对象的 type 属性的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        Event.LEAVE_STAGE = \"leaveStage\";\n        /**\n         * Event.SOUND_COMPLETE 常量定义 在声音完成播放后调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        Event.SOUND_COMPLETE = \"soundComplete\";\n        return Event;\n    }(egret.HashObject));\n    egret.Event = Event;\n    __reflect(Event.prototype, \"egret.Event\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nglobal.DEBUG = true;\nglobal.RELEASE = false;\nvar egret;\n(function (egret) {\n    /**\n     * @private\n     */\n    function _getString(code) {\n        var params = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            params[_i - 1] = arguments[_i];\n        }\n        return egret.sys.tr.apply(egret.sys, arguments);\n    }\n    egret.getString = _getString;\n    function _error(code) {\n        var params = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            params[_i - 1] = arguments[_i];\n        }\n        var text = egret.sys.tr.apply(null, arguments);\n        if (true) {\n            egret.sys.$errorToFPS(\"Error #\" + code + \": \" + text);\n        }\n        throw new Error(\"#\" + code + \": \" + text); //使用这种方式报错能够终止后续代码继续运行\n    }\n    egret.$error = _error;\n    function _warn(code) {\n        var params = [];\n        for (var _i = 1; _i < arguments.length; _i++) {\n            params[_i - 1] = arguments[_i];\n        }\n        var text = egret.sys.tr.apply(null, arguments);\n        if (true) {\n            egret.sys.$warnToFPS(\"Warning #\" + code + \": \" + text);\n        }\n        egret.warn(\"Warning #\" + code + \": \" + text);\n    }\n    egret.$warn = _warn;\n    function _markReadOnly(instance, property, isProperty) {\n        if (isProperty === void 0) { isProperty = true; }\n        var data = Object.getOwnPropertyDescriptor(isProperty ? instance.prototype : instance, property);\n        if (data == null) {\n            console.log(instance);\n            return;\n        }\n        data.set = function (value) {\n            if (isProperty) {\n                egret.$warn(1010, egret.getQualifiedClassName(instance), property);\n            }\n            else {\n                egret.$warn(1014, egret.getQualifiedClassName(instance), property);\n            }\n        };\n        Object.defineProperty(instance.prototype, property, data);\n    }\n    function markCannotUse(instance, property, defaultValue) {\n        Object.defineProperty(instance.prototype, property, {\n            get: function () {\n                egret.$warn(1009, egret.getQualifiedClassName(instance), property);\n                return defaultValue;\n            },\n            set: function (value) {\n                egret.$error(1009, egret.getQualifiedClassName(instance), property);\n            },\n            enumerable: true,\n            configurable: true\n        });\n    }\n    egret.$markCannotUse = markCannotUse;\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var pointPool = [];\n    var DEG_TO_RAD = Math.PI / 180;\n    /**\n     * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal\n     * axis and y represents the vertical axis.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Point.ts\n     * @language en_US\n     */\n    /**\n     * Point 对象表示二维坐标系统中的某个位置，其中 x 表示水平轴，y 表示垂直轴。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Point.ts\n     * @language zh_CN\n     */\n    var Point = (function (_super) {\n        __extends(Point, _super);\n        /**\n         * Creates a new point. If you pass no parameters to this method, a point is created at (0,0).\n         * @param x The horizontal coordinate.\n         * @param y The vertical coordinate.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.Point 对象.若不传入任何参数，将会创建一个位于（0，0）位置的点。\n         * @param x 该对象的x属性值，默认为0\n         * @param y 该对象的y属性值，默认为0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function Point(x, y) {\n            if (x === void 0) { x = 0; }\n            if (y === void 0) { y = 0; }\n            var _this = _super.call(this) || this;\n            _this.x = x;\n            _this.y = y;\n            return _this;\n        }\n        /**\n         * Releases a point instance to the object pool\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放一个Point实例到对象池\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Point.release = function (point) {\n            if (!point) {\n                return;\n            }\n            pointPool.push(point);\n        };\n        /**\n         * get a point instance from the object pool or create a new one.\n         * @param x The horizontal coordinate.\n         * @param y The vertical coordinate.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从对象池中取出或创建一个新的Point对象。\n         * @param x 该对象的x属性值，默认为0\n         * @param y 该对象的y属性值，默认为0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Point.create = function (x, y) {\n            var point = pointPool.pop();\n            if (!point) {\n                point = new Point();\n            }\n            return point.setTo(x, y);\n        };\n        Object.defineProperty(Point.prototype, \"length\", {\n            /**\n             * The length of the line segment from (0,0) to this point.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 从 (0,0) 到此点的线段长度。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return Math.sqrt(this.x * this.x + this.y * this.y);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * Sets the members of Point to the specified values\n         * @param x The horizontal coordinate.\n         * @param y The vertical coordinate.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Point 的成员设置为指定值\n         * @param x 该对象的x属性值\n         * @param y 该对象的y属性值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Point.prototype.setTo = function (x, y) {\n            this.x = x;\n            this.y = y;\n            return this;\n        };\n        /**\n         * Creates a copy of this Point object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 克隆点对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Point.prototype.clone = function () {\n            return new Point(this.x, this.y);\n        };\n        /**\n         * Determines whether two points are equal. Two points are equal if they have the same x and y values.\n         * @param toCompare The point to be compared.\n         * @returns A value of true if the object is equal to this Point object; false if it is not equal.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定两个点是否相同。如果两个点具有相同的 x 和 y 值，则它们是相同的点。\n         * @param toCompare 要比较的点。\n         * @returns 如果该对象与此 Point 对象相同，则为 true 值，如果不相同，则为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Point.prototype.equals = function (toCompare) {\n            return this.x == toCompare.x && this.y == toCompare.y;\n        };\n        /**\n         * Returns the distance between pt1 and pt2.\n         * @param p1 The first point.\n         * @param p2 The second point.\n         * @returns The distance between the first and second points.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回 pt1 和 pt2 之间的距离。\n         * @param p1 第一个点\n         * @param p2 第二个点\n         * @returns 第一个点和第二个点之间的距离。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Point.distance = function (p1, p2) {\n            return Math.sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));\n        };\n        /**\n         * Copies all of the point data from the source Point object into the calling Point object.\n         * @param sourcePoint The Point object from which to copy the data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将源 Point 对象中的所有点数据复制到调用方 Point 对象中。\n         * @param sourcePoint 要从中复制数据的 Point 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Point.prototype.copyFrom = function (sourcePoint) {\n            this.x = sourcePoint.x;\n            this.y = sourcePoint.y;\n        };\n        /**\n         * Adds the coordinates of another point to the coordinates of this point to create a new point.\n         * @param v The point to be added.\n         * @returns The new point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将另一个点的坐标添加到此点的坐标以创建一个新点。\n         * @param v 要添加的点。\n         * @returns 新点。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Point.prototype.add = function (v) {\n            return new Point(this.x + v.x, this.y + v.y);\n        };\n        /**\n         * Determines a point between two specified points.\n         * The parameter f determines where the new interpolated point is located relative to the two end points specified by parameters pt1 and pt2. The closer the value of the parameter f is to 1.0, the closer the interpolated point is to the first point (parameter pt1). The closer the value of the parameter f is to 0, the closer the interpolated point is to the second point (parameter pt2).\n         * @param pt1 The first point.\n         * @param pt2 The second point.\n         * @param f The level of interpolation between the two points. Indicates where the new point will be, along the line between pt1 and pt2. If f=1, pt1 is returned; if f=0, pt2 is returned.\n         * @returns The new interpolated point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定两个指定点之间的点。\n         * 参数 f 确定新的内插点相对于参数 pt1 和 pt2 指定的两个端点所处的位置。参数 f 的值越接近 1.0，则内插点就越接近第一个点（参数 pt1）。参数 f 的值越接近 0，则内插点就越接近第二个点（参数 pt2）。\n         * @param pt1 第一个点。\n         * @param pt2 第二个点。\n         * @param f 两个点之间的内插级别。表示新点将位于 pt1 和 pt2 连成的直线上的什么位置。如果 f=1，则返回 pt1；如果 f=0，则返回 pt2。\n         * @returns 新的内插点。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Point.interpolate = function (pt1, pt2, f) {\n            var f1 = 1 - f;\n            return new Point(pt1.x * f + pt2.x * f1, pt1.y * f + pt2.y * f1);\n        };\n        /**\n         * Scales the line segment between (0,0) and the current point to a set length.\n         * @param thickness The scaling value. For example, if the current point is (0,5), and you normalize it to 1, the point returned is at (0,1).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 (0,0) 和当前点之间的线段缩放为设定的长度。\n         * @param thickness 缩放值。例如，如果当前点为 (0,5) 并且您将它规范化为 1，则返回的点位于 (0,1) 处。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Point.prototype.normalize = function (thickness) {\n            if (this.x != 0 || this.y != 0) {\n                var relativeThickness = thickness / this.length;\n                this.x *= relativeThickness;\n                this.y *= relativeThickness;\n            }\n        };\n        /**\n         * Offsets the Point object by the specified amount. The value of dx is added to the original value of x to create the new x value. The value of dy is added to the original value of y to create the new y value.\n         * @param dx The amount by which to offset the horizontal coordinate, x.\n         * @param dy The amount by which to offset the vertical coordinate, y.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 按指定量偏移 Point 对象。dx 的值将添加到 x 的原始值中以创建新的 x 值。dy 的值将添加到 y 的原始值中以创建新的 y 值。\n         * @param dx 水平坐标 x 的偏移量。\n         * @param dy 水平坐标 y 的偏移量。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Point.prototype.offset = function (dx, dy) {\n            this.x += dx;\n            this.y += dy;\n        };\n        /**\n         * Converts a pair of polar coordinates to a Cartesian point coordinate.\n         * @param len The length coordinate of the polar pair.\n         * @param angle The angle, in radians, of the polar pair.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将一对极坐标转换为笛卡尔点坐标。\n         * @param len 极坐标对的长度。\n         * @param angle 极坐标对的角度（以弧度表示）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Point.polar = function (len, angle) {\n            return new Point(len * egret.NumberUtils.cos(angle / DEG_TO_RAD), len * egret.NumberUtils.sin(angle / DEG_TO_RAD));\n        };\n        /**\n         * Subtracts the coordinates of another point from the coordinates of this point to create a new point.\n         * @param v The point to be subtracted.\n         * @returns The new point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从此点的坐标中减去另一个点的坐标以创建一个新点。\n         * @param v 要减去的点。\n         * @returns 新点。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Point.prototype.subtract = function (v) {\n            return new Point(this.x - v.x, this.y - v.y);\n        };\n        /**\n         * Returns a string that contains the values of the x and y coordinates. The string has the form \"(x=x, y=y)\", so calling the toString() method for a point at 23,17 would return \"(x=23, y=17)\".\n         * @returns The string representation of the coordinates.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回包含 x 和 y 坐标的值的字符串。该字符串的格式为 \"(x=x, y=y)\"，因此为点 23,17 调用 toString() 方法将返回 \"(x=23, y=17)\"。\n         * @returns 坐标的字符串表示形式。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Point.prototype.toString = function () {\n            return \"(x=\" + this.x + \", y=\" + this.y + \")\";\n        };\n        return Point;\n    }(egret.HashObject));\n    egret.Point = Point;\n    __reflect(Point.prototype, \"egret.Point\");\n    /**\n     * @private\n     * 仅供框架内复用，要防止暴露引用到外部。\n     */\n    egret.$TempPoint = new Point();\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The DisplayObjectContainer class is a basic display list building block: a display list node that can contain children.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/DisplayObjectContainer.ts\n     * @language en_US\n     */\n    /**\n     * DisplayObjectContainer 类是基本显示列表构造块：一个可包含子项的显示列表节点。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/DisplayObjectContainer.ts\n     * @language zh_CN\n     */\n    var DisplayObjectContainer = (function (_super) {\n        __extends(DisplayObjectContainer, _super);\n        /**\n         * Creates a new DisplayObjectContainer instance.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 实例化一个容器\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function DisplayObjectContainer() {\n            var _this = _super.call(this) || this;\n            _this.$touchChildren = true;\n            _this.$children = [];\n            return _this;\n        }\n        Object.defineProperty(DisplayObjectContainer.prototype, \"numChildren\", {\n            /**\n             * Returns the number of children of this object.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 返回此对象的子项数目。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$children.length;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * Set children sort mode.\n         * @param value {string} The sort mode\n         * @see egret.ChildrenSortMode\n         * @version Egret 5.2.19\n         * @platform Native\n         * @language en_US\n         */\n        /**\n         * 设置子项目的排序方式\n         * @param value {string} 排序方式\n         * @see egret.ChildrenSortMode\n         * @version Egret 5.2.19\n         * @platform Native\n         * @language en_US\n         */\n        DisplayObjectContainer.prototype.setChildrenSortMode = function (value) {\n            if (egret.nativeRender && this.$nativeDisplayObject.setChildrenSortMode) {\n                this.$nativeDisplayObject.setChildrenSortMode(value);\n            }\n        };\n        /**\n         * Adds a child DisplayObject instance to this DisplayObjectContainer instance. The child is added to the front\n         * (top) of all other children in this DisplayObjectContainer instance. (To add a child to a specific index position,\n         * use the addChildAt() method.)If you add a child object that already has a different display object container\n         * as a parent, the object is removed from the child list of the other display object container.\n         * @param child The DisplayObject instance to add as a child of this DisplayObjectContainer instance.\n         * @returns 在 child The DisplayObject instance that you pass in the child parameter.\n         * @see #addChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将一个 DisplayObject 子实例添加到该 DisplayObjectContainer 实例中。子项将被添加到该 DisplayObjectContainer 实例中其他\n         * 所有子项的前（上）面。（要将某子项添加到特定索引位置，请使用 addChildAt() 方法。）\n         * @param child 要作为该 DisplayObjectContainer 实例的子项添加的 DisplayObject 实例。\n         * @returns 在 child 参数中传递的 DisplayObject 实例。\n         * @see #addChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObjectContainer.prototype.addChild = function (child) {\n            var index = this.$children.length;\n            if (child.$parent == this)\n                index--;\n            return this.$doAddChild(child, index);\n        };\n        /**\n         * Adds a child DisplayObject instance to this DisplayObjectContainer instance. The child is added at the index position\n         * specified. An index of 0 represents the back (bottom) of the display list for this DisplayObjectContainer object.\n         * If you add a child object that already has a different display object container as a parent, the object is removed\n         * from the child list of the other display object container.\n         * @param child The DisplayObject instance to add as a child of this DisplayObjectContainer instance.\n         * @param index The index position to which the child is added. If you specify a currently occupied index position,\n         * the child object that exists at that position and all higher positions are moved up one position in the child list.\n         * @returns The DisplayObject instance that you pass in the child parameter.\n         * @see #addChild()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将一个 DisplayObject 子实例添加到该 DisplayObjectContainer 实例中。该子项将被添加到指定的索引位置。索引为 0 表示该\n         * DisplayObjectContainer 对象的显示列表的后（底）部。如果添加一个已将其它显示对象容器作为父项的子对象，则会从其它显示对象容器的子列表中删除该对象。\n         * @param child 要作为该 DisplayObjectContainer 实例的子项添加的 DisplayObject 实例。\n         * @param index 添加该子项的索引位置。 如果指定当前占用的索引位置，则该位置以及所有更高位置上的子对象会在子级列表中上移一个位置。\n         * @returns 在 child 参数中传递的 DisplayObject 实例。\n         * @see #addChild()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObjectContainer.prototype.addChildAt = function (child, index) {\n            index = +index | 0;\n            if (index < 0 || index >= this.$children.length) {\n                index = this.$children.length;\n                if (child.$parent == this) {\n                    index--;\n                }\n            }\n            return this.$doAddChild(child, index);\n        };\n        /**\n         * @private\n         */\n        DisplayObjectContainer.prototype.$doAddChild = function (child, index, notifyListeners) {\n            if (notifyListeners === void 0) { notifyListeners = true; }\n            var self = this;\n            if (true) {\n                if (child == self) {\n                    egret.$error(1005);\n                }\n                else if ((child instanceof egret.DisplayObjectContainer) && child.contains(self)) {\n                    egret.$error(1004);\n                }\n            }\n            var host = child.$parent;\n            if (host == self) {\n                self.doSetChildIndex(child, index);\n                return child;\n            }\n            if (host) {\n                host.removeChild(child);\n            }\n            self.$children.splice(index, 0, child);\n            child.$setParent(self);\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.addChildAt(child.$nativeDisplayObject.id, index);\n            }\n            var stage = self.$stage;\n            if (stage) {\n                child.$onAddToStage(stage, self.$nestLevel + 1);\n            }\n            if (notifyListeners) {\n                child.dispatchEventWith(egret.Event.ADDED, true);\n            }\n            if (stage) {\n                var list = DisplayObjectContainer.$EVENT_ADD_TO_STAGE_LIST;\n                while (list.length) {\n                    var childAddToStage = list.shift();\n                    if (childAddToStage.$stage && notifyListeners) {\n                        childAddToStage.dispatchEventWith(egret.Event.ADDED_TO_STAGE);\n                    }\n                }\n            }\n            if (!egret.nativeRender) {\n                if (child.$maskedObject) {\n                    child.$maskedObject.$updateRenderMode();\n                }\n                if (!self.$cacheDirty) {\n                    self.$cacheDirty = true;\n                    var p = self.$parent;\n                    if (p && !p.$cacheDirty) {\n                        p.$cacheDirty = true;\n                        p.$cacheDirtyUp();\n                    }\n                    var maskedObject = self.$maskedObject;\n                    if (maskedObject && !maskedObject.$cacheDirty) {\n                        maskedObject.$cacheDirty = true;\n                        maskedObject.$cacheDirtyUp();\n                    }\n                }\n            }\n            this.$childAdded(child, index);\n            return child;\n        };\n        /**\n         * Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance\n         * itself. The search includes the entire display list including this DisplayObjectContainer instance. Grandchildren,\n         * great-grandchildren, and so on each return true.\n         * @param child The child object to test.\n         * @returns true if the child object is a child of the DisplayObjectContainer or the container itself; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定指定显示对象是 DisplayObjectContainer 实例的子项或该实例本身。搜索包括整个显示列表（其中包括此 DisplayObjectContainer 实例）。\n         * 孙项、曾孙项等，每项都返回 true。\n         * @param child 要测试的子对象。\n         * @returns 如果 child 对象是 DisplayObjectContainer 的子项或容器本身，则为 true；否则为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObjectContainer.prototype.contains = function (child) {\n            while (child) {\n                if (child == this) {\n                    return true;\n                }\n                child = child.$parent;\n            }\n            return false;\n        };\n        /**\n         * Returns the child display object instance that exists at the specified index.\n         * @param index The index position of the child object.\n         * @returns The child display object at the specified index position.\n         * @see #getChildByName()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回位于指定索引处的子显示对象实例。\n         * @param index 子对象的索引位置。\n         * @returns 位于指定索引位置处的子显示对象。\n         * @see #getChildByName()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObjectContainer.prototype.getChildAt = function (index) {\n            index = +index | 0;\n            if (index >= 0 && index < this.$children.length) {\n                return this.$children[index];\n            }\n            else {\n                true && egret.$error(1007);\n                return null;\n            }\n        };\n        /**\n         * Returns the index position of a child DisplayObject instance.\n         * @param child The DisplayObject instance to identify.\n         * @returns The index position of the child display object to identify.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回 DisplayObject 的 child 实例的索引位置。\n         * @param child 要测试的子对象。\n         * @returns 要查找的子显示对象的索引位置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObjectContainer.prototype.getChildIndex = function (child) {\n            return this.$children.indexOf(child);\n        };\n        /**\n         * Returns the child display object that exists with the specified name. If more that one child display object has\n         * the specified name, the method returns the first object in the child list.The getChildAt() method is faster than\n         * the getChildByName() method. The getChildAt() method accesses a child from a cached array, whereas the getChildByName()\n         * method has to traverse a linked list to access a child.\n         * @param name The name of the child to return.\n         * @returns The child display object with the specified name.\n         * @see #getChildAt()\n         * @see egret.DisplayObject#name\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回具有指定名称的子显示对象。如果多个子显示对象具有指定名称，则该方法会返回子级列表中的第一个对象。\n         * getChildAt() 方法比 getChildByName() 方法快。getChildAt() 方法从缓存数组中访问子项，而 getChildByName() 方法则必须遍历链接的列表来访问子项。\n         * @param name 要返回的子项的名称。\n         * @returns 具有指定名称的子显示对象。\n         * @see #getChildAt()\n         * @see egret.DisplayObject#name\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObjectContainer.prototype.getChildByName = function (name) {\n            var children = this.$children;\n            var length = children.length;\n            var displayObject;\n            for (var i = 0; i < length; i++) {\n                displayObject = children[i];\n                if (displayObject.name == name) {\n                    return displayObject;\n                }\n            }\n            return null;\n        };\n        /**\n         * Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance.\n         * The parent property of the removed child is set to null , and the object is garbage collected if no other references\n         * to the child exist. The index positions of any display objects above the child in the DisplayObjectContainer are\n         * decreased by 1.\n         * @param child The DisplayObject instance to remove.\n         * @returns The DisplayObject instance that you pass in the child parameter.\n         * @see #removeChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从 DisplayObjectContainer 实例的子列表中删除指定的 child DisplayObject 实例。将已删除子项的 parent 属性设置为 null；\n         * 如果不存在对该子项的任何其它引用，则将该对象作为垃圾回收。DisplayObjectContainer 中该子项之上的任何显示对象的索引位置都减去 1。\n         * @param child 要删除的 DisplayObject 实例。\n         * @returns 在 child 参数中传递的 DisplayObject 实例。\n         * @see #removeChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObjectContainer.prototype.removeChild = function (child) {\n            var index = this.$children.indexOf(child);\n            if (index >= 0) {\n                return this.$doRemoveChild(index);\n            }\n            else {\n                true && egret.$error(1006);\n                return null;\n            }\n        };\n        /**\n         * Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer.\n         * The parent property of the removed child is set to null, and the object is garbage collected if no other references\n         * to the child exist. The index positions of any display objects above the child in the DisplayObjectContainer are decreased by 1.\n         * @param index The child index of the DisplayObject to remove.\n         * @returns The DisplayObject instance that was removed.\n         * @see #removeChild()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从 DisplayObjectContainer 的子列表中指定的 index 位置删除子 DisplayObject。将已删除子项的 parent 属性设置为 null；\n         * 如果没有对该子项的任何其他引用，则将该对象作为垃圾回收。DisplayObjectContainer 中该子项之上的任何显示对象的索引位置都减去 1。\n         * @param index 要删除的 DisplayObject 的子索引。\n         * @returns 已删除的 DisplayObject 实例。\n         * @see #removeChild()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObjectContainer.prototype.removeChildAt = function (index) {\n            index = +index | 0;\n            if (index >= 0 && index < this.$children.length) {\n                return this.$doRemoveChild(index);\n            }\n            else {\n                true && egret.$error(1007);\n                return null;\n            }\n        };\n        /**\n         * @private\n         */\n        DisplayObjectContainer.prototype.$doRemoveChild = function (index, notifyListeners) {\n            if (notifyListeners === void 0) { notifyListeners = true; }\n            index = +index | 0;\n            var self = this;\n            var children = this.$children;\n            var child = children[index];\n            this.$childRemoved(child, index);\n            if (notifyListeners) {\n                child.dispatchEventWith(egret.Event.REMOVED, true);\n            }\n            if (this.$stage) {\n                child.$onRemoveFromStage();\n                var list = DisplayObjectContainer.$EVENT_REMOVE_FROM_STAGE_LIST;\n                while (list.length > 0) {\n                    var childAddToStage = list.shift();\n                    if (notifyListeners && childAddToStage.$hasAddToStage) {\n                        childAddToStage.$hasAddToStage = false;\n                        childAddToStage.dispatchEventWith(egret.Event.REMOVED_FROM_STAGE);\n                    }\n                    childAddToStage.$hasAddToStage = false;\n                    childAddToStage.$stage = null;\n                }\n            }\n            var displayList = this.$displayList || this.$parentDisplayList;\n            child.$setParent(null);\n            var indexNow = children.indexOf(child);\n            if (indexNow != -1) {\n                children.splice(indexNow, 1);\n            }\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.removeChild(child.$nativeDisplayObject.id);\n            }\n            else {\n                if (child.$maskedObject) {\n                    child.$maskedObject.$updateRenderMode();\n                }\n                if (!self.$cacheDirty) {\n                    self.$cacheDirty = true;\n                    var p = self.$parent;\n                    if (p && !p.$cacheDirty) {\n                        p.$cacheDirty = true;\n                        p.$cacheDirtyUp();\n                    }\n                    var maskedObject = self.$maskedObject;\n                    if (maskedObject && !maskedObject.$cacheDirty) {\n                        maskedObject.$cacheDirty = true;\n                        maskedObject.$cacheDirtyUp();\n                    }\n                }\n            }\n            return child;\n        };\n        /**\n         * Changes the position of an existing child in the display object container. This affects the layering of child objects.\n         * @param child The child DisplayObject instance for which you want to change the index number.\n         * @param index The resulting index number for the child display object.\n         * @see #addChildAt()\n         * @see #getChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 更改现有子项在显示对象容器中的位置。这会影响子对象的分层。\n         * @param child 要为其更改索引编号的 DisplayObject 子实例。\n         * @param index 生成的 child 显示对象的索引编号。当新的索引编号小于0或大于已有子元件数量时，新加入的DisplayObject对象将会放置于最上层。\n         * @see #addChildAt()\n         * @see #getChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObjectContainer.prototype.setChildIndex = function (child, index) {\n            index = +index | 0;\n            if (index < 0 || index >= this.$children.length) {\n                index = this.$children.length - 1;\n            }\n            this.doSetChildIndex(child, index);\n        };\n        /**\n         * @private\n         */\n        DisplayObjectContainer.prototype.doSetChildIndex = function (child, index) {\n            var self = this;\n            var lastIndex = this.$children.indexOf(child);\n            if (lastIndex < 0) {\n                true && egret.$error(1006);\n            }\n            if (lastIndex == index) {\n                return;\n            }\n            this.$childRemoved(child, lastIndex);\n            //从原来的位置删除\n            this.$children.splice(lastIndex, 1);\n            //放到新的位置\n            this.$children.splice(index, 0, child);\n            this.$childAdded(child, index);\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.removeChild(child.$nativeDisplayObject.id);\n                this.$nativeDisplayObject.addChildAt(child.$nativeDisplayObject.id, index);\n            }\n            else {\n                if (!self.$cacheDirty) {\n                    self.$cacheDirty = true;\n                    var p = self.$parent;\n                    if (p && !p.$cacheDirty) {\n                        p.$cacheDirty = true;\n                        p.$cacheDirtyUp();\n                    }\n                    var maskedObject = self.$maskedObject;\n                    if (maskedObject && !maskedObject.$cacheDirty) {\n                        maskedObject.$cacheDirty = true;\n                        maskedObject.$cacheDirtyUp();\n                    }\n                }\n            }\n        };\n        /**\n         * Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child\n         * list. All other child objects in the display object container remain in the same index positions.\n         * @param index1 The index position of the first child object.\n         * @param index2 The index position of the second child object.\n         * @see #swapChildren()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在子级列表中两个指定的索引位置，交换子对象的 Z 轴顺序（前后顺序）。显示对象容器中所有其他子对象的索引位置保持不变。\n         * @param index1 第一个子对象的索引位置。\n         * @param index2 第二个子对象的索引位置。\n         * @see #swapChildren()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObjectContainer.prototype.swapChildrenAt = function (index1, index2) {\n            index1 = +index1 | 0;\n            index2 = +index2 | 0;\n            if (index1 >= 0 && index1 < this.$children.length && index2 >= 0 && index2 < this.$children.length) {\n                this.doSwapChildrenAt(index1, index2);\n            }\n            else {\n                true && egret.$error(1007);\n            }\n        };\n        /**\n         * Swaps the z-order (front-to-back order) of the two specified child objects. All other child objects in the\n         * display object container remain in the same index positions.\n         * @param child1 The first child object.\n         * @param child2 The second child object.\n         * @see #swapChildrenAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 交换两个指定子对象的 Z 轴顺序（从前到后顺序）。显示对象容器中所有其他子对象的索引位置保持不变。\n         * @param child1 第一个子对象。\n         * @param child2 第二个子对象。\n         * @see #swapChildrenAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObjectContainer.prototype.swapChildren = function (child1, child2) {\n            var index1 = this.$children.indexOf(child1);\n            var index2 = this.$children.indexOf(child2);\n            if (index1 == -1 || index2 == -1) {\n                true && egret.$error(1006);\n            }\n            else {\n                this.doSwapChildrenAt(index1, index2);\n            }\n        };\n        /**\n         * @private\n         */\n        DisplayObjectContainer.prototype.doSwapChildrenAt = function (index1, index2) {\n            var self = this;\n            if (index1 > index2) {\n                var temp = index2;\n                index2 = index1;\n                index1 = temp;\n            }\n            else if (index1 == index2) {\n                return;\n            }\n            var list = this.$children;\n            var child1 = list[index1];\n            var child2 = list[index2];\n            this.$childRemoved(child1, index1);\n            this.$childRemoved(child2, index2);\n            list[index1] = child2;\n            list[index2] = child1;\n            this.$childAdded(child2, index1);\n            this.$childAdded(child1, index2);\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.swapChild(index1, index2);\n            }\n            else {\n                if (!self.$cacheDirty) {\n                    self.$cacheDirty = true;\n                    var p = self.$parent;\n                    if (p && !p.$cacheDirty) {\n                        p.$cacheDirty = true;\n                        p.$cacheDirtyUp();\n                    }\n                    var maskedObject = self.$maskedObject;\n                    if (maskedObject && !maskedObject.$cacheDirty) {\n                        maskedObject.$cacheDirty = true;\n                        maskedObject.$cacheDirtyUp();\n                    }\n                }\n            }\n        };\n        /**\n         * Removes all child DisplayObject instances from the child list of the DisplayObjectContainer instance. The parent\n         * property of the removed children is set to null , and the objects are garbage collected if no other references to the children exist.\n         * @see #removeChild()\n         * @see #removeChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从 DisplayObjectContainer 实例的子级列表中删除所有 child DisplayObject 实例。\n         * @see #removeChild()\n         * @see #removeChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        DisplayObjectContainer.prototype.removeChildren = function () {\n            var children = this.$children;\n            for (var i = children.length - 1; i >= 0; i--) {\n                this.$doRemoveChild(i);\n            }\n        };\n        /**\n         * @private\n         * 一个子项被添加到容器内，此方法不仅在操作addChild()时会被回调，在操作setChildIndex()或swapChildren时也会回调。\n         * 当子项索引发生改变时，会先触发$childRemoved()方法，然后触发$childAdded()方法。\n         */\n        DisplayObjectContainer.prototype.$childAdded = function (child, index) {\n        };\n        /**\n         * @private\n         * 一个子项从容器内移除，此方法不仅在操作removeChild()时会被回调，在操作setChildIndex()或swapChildren时也会回调。\n         * 当子项索引发生改变时，会先触发$childRemoved()方法，然后触发$childAdded()方法。\n         */\n        DisplayObjectContainer.prototype.$childRemoved = function (child, index) {\n        };\n        /**\n         * @private\n         */\n        DisplayObjectContainer.prototype.$onAddToStage = function (stage, nestLevel) {\n            _super.prototype.$onAddToStage.call(this, stage, nestLevel);\n            var children = this.$children;\n            var length = children.length;\n            nestLevel++;\n            for (var i = 0; i < length; i++) {\n                var child = this.$children[i];\n                child.$onAddToStage(stage, nestLevel);\n                if (child.$maskedObject) {\n                    child.$maskedObject.$updateRenderMode();\n                }\n            }\n        };\n        /**\n         * @private\n         *\n         */\n        DisplayObjectContainer.prototype.$onRemoveFromStage = function () {\n            _super.prototype.$onRemoveFromStage.call(this);\n            var children = this.$children;\n            var length = children.length;\n            for (var i = 0; i < length; i++) {\n                var child = children[i];\n                child.$onRemoveFromStage();\n            }\n        };\n        /**\n         * @private\n         */\n        DisplayObjectContainer.prototype.$measureChildBounds = function (bounds) {\n            var children = this.$children;\n            var length = children.length;\n            if (length == 0) {\n                return;\n            }\n            var xMin = 0, xMax = 0, yMin = 0, yMax = 0;\n            var found = false;\n            for (var i = -1; i < length; i++) {\n                var childBounds = void 0;\n                if (i == -1) {\n                    childBounds = bounds;\n                }\n                else {\n                    children[i].getBounds(egret.$TempRectangle);\n                    children[i].$getMatrix().$transformBounds(egret.$TempRectangle);\n                    childBounds = egret.$TempRectangle;\n                }\n                if (childBounds.isEmpty()) {\n                    continue;\n                }\n                if (found) {\n                    xMin = Math.min(xMin, childBounds.x);\n                    xMax = Math.max(xMax, childBounds.x + childBounds.width);\n                    yMin = Math.min(yMin, childBounds.y);\n                    yMax = Math.max(yMax, childBounds.y + childBounds.height);\n                }\n                else {\n                    found = true;\n                    xMin = childBounds.x;\n                    xMax = xMin + childBounds.width;\n                    yMin = childBounds.y;\n                    yMax = yMin + childBounds.height;\n                }\n            }\n            bounds.setTo(xMin, yMin, xMax - xMin, yMax - yMin);\n        };\n        Object.defineProperty(DisplayObjectContainer.prototype, \"touchChildren\", {\n            /**\n             * Determines whether or not the children of the object are touch, or user input device, enabled. If an object is\n             * enabled, a user can interact with it by using a touch or user input device.\n             * @default true\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 确定对象的子级是否支持触摸或用户输入设备。如果对象支持触摸或用户输入设备，用户可以通过使用触摸或用户输入设备与之交互。\n             * @default true\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$getTouchChildren();\n            },\n            set: function (value) {\n                this.$setTouchChildren(!!value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @returns\n         */\n        DisplayObjectContainer.prototype.$getTouchChildren = function () {\n            return this.$touchChildren;\n        };\n        /**\n         * @private\n         */\n        DisplayObjectContainer.prototype.$setTouchChildren = function (value) {\n            if (this.$touchChildren == value) {\n                return false;\n            }\n            this.$touchChildren = value;\n            return true;\n        };\n        /**\n         * @private\n         */\n        DisplayObjectContainer.prototype.$hitTest = function (stageX, stageY) {\n            if (!this.$visible) {\n                return null;\n            }\n            var m = this.$getInvertedConcatenatedMatrix();\n            var localX = m.a * stageX + m.c * stageY + m.tx;\n            var localY = m.b * stageX + m.d * stageY + m.ty;\n            var rect = this.$scrollRect ? this.$scrollRect : this.$maskRect;\n            if (rect && !rect.contains(localX, localY)) {\n                return null;\n            }\n            if (this.$mask && !this.$mask.$hitTest(stageX, stageY)) {\n                return null;\n            }\n            var children = this.$children;\n            var found = false;\n            var target = null;\n            for (var i = children.length - 1; i >= 0; i--) {\n                var child = children[i];\n                if (child.$maskedObject) {\n                    continue;\n                }\n                target = child.$hitTest(stageX, stageY);\n                if (target) {\n                    found = true;\n                    if (target.$touchEnabled) {\n                        break;\n                    }\n                    else {\n                        target = null;\n                    }\n                }\n            }\n            if (target) {\n                if (this.$touchChildren) {\n                    return target;\n                }\n                return this;\n            }\n            if (found) {\n                return this;\n            }\n            return _super.prototype.$hitTest.call(this, stageX, stageY);\n        };\n        DisplayObjectContainer.prototype._sortChildrenFunc = function (a, b) {\n            if (a.zIndex === b.zIndex) {\n                return a.$lastSortedIndex - b.$lastSortedIndex;\n            }\n            return a.zIndex - b.zIndex;\n        };\n        DisplayObjectContainer.prototype.sortChildren = function () {\n            //关掉脏的标记\n            _super.prototype.sortChildren.call(this);\n            this.$sortDirty = false;\n            //准备重新排序\n            var sortRequired = false;\n            var children = this.$children;\n            var child = null;\n            for (var i = 0, j = children.length; i < j; ++i) {\n                child = children[i];\n                child.$lastSortedIndex = i;\n                if (!sortRequired && child.zIndex !== 0) {\n                    sortRequired = true;\n                }\n            }\n            if (sortRequired && children.length > 1) {\n                //开始排\n                children.sort(this._sortChildrenFunc);\n            }\n        };\n        /**\n         * @private\n         */\n        DisplayObjectContainer.$EVENT_ADD_TO_STAGE_LIST = [];\n        /**\n         * @private\n         */\n        DisplayObjectContainer.$EVENT_REMOVE_FROM_STAGE_LIST = [];\n        return DisplayObjectContainer;\n    }(egret.DisplayObject));\n    egret.DisplayObjectContainer = DisplayObjectContainer;\n    __reflect(DisplayObjectContainer.prototype, \"egret.DisplayObjectContainer\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * SpriteSheet is a mosaic of multiple sub-bitmaps, comprising a plurality of Texture objects.\n     * Each Texture object shares the set bitmap of SpriteSheet, but it points to its different areas.\n     * On WebGL / OpenGL, this operation can significantly improve performance.\n     * At the same time, SpriteSheet can carry out material integration easily to reduce the number of HTTP requests\n     * For specification of the SpriteSheet format, see the document https://github.com/egret-labs/egret-core/wiki/Egret-SpriteSheet-Specification\n     * @see http://edn.egret.com/cn/docs/page/135 The use of texture packs\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/SpriteSheet.ts\n     * @language en_US\n     */\n    /**\n     * SpriteSheet 是一张由多个子位图拼接而成的集合位图，它包含多个 Texture 对象。\n     * 每一个 Texture 都共享 SpriteSheet 的集合位图，但是指向它的不同的区域。\n     * 在WebGL / OpenGL上，这种做法可以显著提升性能\n     * 同时，SpriteSheet可以很方便的进行素材整合，降低HTTP请求数量\n     * SpriteSheet 格式的具体规范可以参见此文档  https://github.com/egret-labs/egret-core/wiki/Egret-SpriteSheet-Specification\n     * @see http://edn.egret.com/cn/docs/page/135 纹理集的使用\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/SpriteSheet.ts\n     * @language zh_CN\n     */\n    var SpriteSheet = (function (_super) {\n        __extends(SpriteSheet, _super);\n        /**\n         * Create an egret.SpriteSheet object\n         * @param texture {Texture} Texture\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.SpriteSheet 对象\n         * @param texture {Texture} 纹理\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function SpriteSheet(texture) {\n            var _this = _super.call(this) || this;\n            /**\n             * @private\n             * 表示这个SpriteSheet的位图区域在bitmapData上的起始位置x。\n             */\n            _this._bitmapX = 0;\n            /**\n             * @private\n             * 表示这个SpriteSheet的位图区域在bitmapData上的起始位置y。\n             */\n            _this._bitmapY = 0;\n            /**\n             * @private\n             * 纹理缓存字典\n             */\n            _this._textureMap = egret.createMap();\n            _this.$texture = texture;\n            _this._bitmapX = texture.$bitmapX - texture.$offsetX;\n            _this._bitmapY = texture.$bitmapY - texture.$offsetY;\n            return _this;\n        }\n        /**\n         * Obtain a cached Texture object according to the specified texture name\n         * @param name {string} Cache the name of this Texture object\n         * @returns {egret.Texture} The Texture object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 根据指定纹理名称获取一个缓存的 Texture 对象\n         * @param name {string} 缓存这个 Texture 对象所使用的名称\n         * @returns {egret.Texture} Texture 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        SpriteSheet.prototype.getTexture = function (name) {\n            return this._textureMap[name];\n        };\n        /**\n         * Create a new Texture object for the specified area on SpriteSheet and cache it\n         * @param name {string} Cache the name of this Texture object. If the name already exists, the previous Texture object will be overwrited.\n         * @param bitmapX {number} Starting coordinate x of texture area on bitmapData\n         * @param bitmapY {number} Starting coordinate y of texture area on bitmapData\n         * @param bitmapWidth {number} Width of texture area on bitmapData\n         * @param bitmapHeight {number} Height of texture area on bitmapData\n         * @param offsetX {number} Starting point x for a non-transparent area of the original bitmap\n         * @param offsetY {number} Starting point y for a non-transparent area of the original bitmap\n         * @param textureWidth {number} Width of the original bitmap. If it is not passed, use the bitmapWidth  value.\n         * @param textureHeight {number} Height of the original bitmap. If it is not passed, use the bitmapHeight value.\n         * @returns {egret.Texture} The created Texture object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 为 SpriteSheet 上的指定区域创建一个新的 Texture 对象并缓存它\n         * @param name {string} 缓存这个 Texture 对象所使用的名称，如果名称已存在，将会覆盖之前的 Texture 对象\n         * @param bitmapX {number} 纹理区域在 bitmapData 上的起始坐标x\n         * @param bitmapY {number} 纹理区域在 bitmapData 上的起始坐标y\n         * @param bitmapWidth {number} 纹理区域在 bitmapData 上的宽度\n         * @param bitmapHeight {number} 纹理区域在 bitmapData 上的高度\n         * @param offsetX {number} 原始位图的非透明区域 x 起始点\n         * @param offsetY {number} 原始位图的非透明区域 y 起始点\n         * @param textureWidth {number} 原始位图的高度，若不传入，则使用 bitmapWidth 的值。\n         * @param textureHeight {number} 原始位图的宽度，若不传入，则使用 bitmapHeight 的值。\n         * @returns {egret.Texture} 创建的 Texture 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        SpriteSheet.prototype.createTexture = function (name, bitmapX, bitmapY, bitmapWidth, bitmapHeight, offsetX, offsetY, textureWidth, textureHeight) {\n            if (offsetX === void 0) { offsetX = 0; }\n            if (offsetY === void 0) { offsetY = 0; }\n            if (textureWidth === void 0) {\n                textureWidth = offsetX + bitmapWidth;\n            }\n            if (textureHeight === void 0) {\n                textureHeight = offsetY + bitmapHeight;\n            }\n            var texture = new egret.Texture();\n            texture.disposeBitmapData = false;\n            texture.$bitmapData = this.$texture.$bitmapData;\n            texture.$initData(this._bitmapX + bitmapX, this._bitmapY + bitmapY, bitmapWidth, bitmapHeight, offsetX, offsetY, textureWidth, textureHeight, this.$texture.$sourceWidth, this.$texture.$sourceHeight);\n            this._textureMap[name] = texture;\n            return texture;\n        };\n        /**\n         * dispose texture\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放纹理\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        SpriteSheet.prototype.dispose = function () {\n            if (this.$texture) {\n                this.$texture.dispose();\n            }\n        };\n        return SpriteSheet;\n    }(egret.HashObject));\n    egret.SpriteSheet = SpriteSheet;\n    __reflect(SpriteSheet.prototype, \"egret.SpriteSheet\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @private\n     */\n    egret.$locale_strings = egret.$locale_strings || {};\n    /**\n     * @private\n     */\n    egret.$language = \"en_US\";\n})(egret || (egret = {}));\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         * 全局多语言翻译函数\n         * @param code 要查询的字符串代码\n         * @param args 替换字符串中{0}标志的参数列表\n         * @returns 返回拼接后的字符串\n         */\n        function tr(code) {\n            var args = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                args[_i - 1] = arguments[_i];\n            }\n            var text = egret.$locale_strings[egret.$language][code];\n            if (!text) {\n                return \"{\" + code + \"}\";\n            }\n            var length = args.length;\n            for (var i = 0; i < length; i++) {\n                text = text.replace(\"{\" + i + \"}\", args[i]);\n            }\n            return text;\n        }\n        sys.tr = tr;\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The Bitmap class represents display objects that represent bitmap images.\n     * The Bitmap() constructor allows you to create a Bitmap object that contains a reference to a BitmapData object.\n     * After you create a Bitmap object, use the addChild() or addChildAt() method of the parent DisplayObjectContainer\n     * instance to place the bitmap on the display list.A Bitmap object can share its texture reference among several\n     * Bitmap objects, independent of translation or rotation properties. Because you can create multiple Bitmap objects\n     * that reference the same texture object, multiple display objects can use the same complex texture object\n     * without incurring the memory overhead of a texture object for each display object instance.\n     *\n     * @see egret.Texture\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Bitmap.ts\n     * @language en_US\n     */\n    /**\n     * Bitmap 类表示用于显示位图图片的显示对象。\n     * 利用 Bitmap() 构造函数，可以创建包含对 BitmapData 对象引用的 Bitmap 对象。创建了 Bitmap 对象后，\n     * 使用父级 DisplayObjectContainer 实例的 addChild() 或 addChildAt() 方法可以将位图放在显示列表中。\n     * 一个 Bitmap 对象可在若干 Bitmap 对象之中共享其 texture 引用，与缩放或旋转属性无关。\n     * 由于能够创建引用相同 texture 对象的多个 Bitmap 对象，因此，多个显示对象可以使用相同的 texture 对象，\n     * 而不会因为每个显示对象实例使用一个 texture 对象而产生额外内存开销。\n     *\n     * @see egret.Texture\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Bitmap.ts\n     * @language zh_CN\n     */\n    var Bitmap = (function (_super) {\n        __extends(Bitmap, _super);\n        /**\n         * Initializes a Bitmap object to refer to the specified Texture object.\n         * @param value The Texture object being referenced.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个引用指定 Texture 实例的 Bitmap 对象\n         * @param value 被引用的 Texture 实例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function Bitmap(value) {\n            var _this = _super.call(this) || this;\n            _this.$texture = null;\n            _this.$bitmapData = null;\n            _this.$bitmapX = 0;\n            _this.$bitmapY = 0;\n            _this.$bitmapWidth = 0;\n            _this.$bitmapHeight = 0;\n            _this.$offsetX = 0;\n            _this.$offsetY = 0;\n            _this.$textureWidth = 0;\n            _this.$textureHeight = 0;\n            _this.$sourceWidth = 0;\n            _this.$sourceHeight = 0;\n            _this.$smoothing = Bitmap.defaultSmoothing;\n            _this.$explicitBitmapWidth = NaN;\n            _this.$explicitBitmapHeight = NaN;\n            /**\n             * @private\n             */\n            _this.$scale9Grid = null;\n            /**\n             * @private\n             */\n            _this.$fillMode = \"scale\";\n            _this._pixelHitTest = false;\n            _this.$renderNode = new egret.sys.NormalBitmapNode();\n            _this.$setTexture(value);\n            if (value) {\n                _this.$renderNode.rotated = value.$rotated;\n            }\n            return _this;\n        }\n        Bitmap.prototype.createNativeDisplayObject = function () {\n            this.$nativeDisplayObject = new egret_native.NativeDisplayObject(1 /* BITMAP */);\n        };\n        /**\n         * @private\n         * 显示对象添加到舞台\n         */\n        Bitmap.prototype.$onAddToStage = function (stage, nestLevel) {\n            _super.prototype.$onAddToStage.call(this, stage, nestLevel);\n            var texture = this.$texture;\n            if (texture && texture.$bitmapData) {\n                egret.BitmapData.$addDisplayObject(this, texture.$bitmapData);\n            }\n        };\n        /**\n         * @private\n         * 显示对象从舞台移除\n         */\n        Bitmap.prototype.$onRemoveFromStage = function () {\n            _super.prototype.$onRemoveFromStage.call(this);\n            var texture = this.$texture;\n            if (texture) {\n                egret.BitmapData.$removeDisplayObject(this, texture.$bitmapData);\n            }\n        };\n        Object.defineProperty(Bitmap.prototype, \"texture\", {\n            /**\n             * The Texture object being referenced.\n             * If you pass the constructor of type BitmapData or last set for bitmapData, this value returns null.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 被引用的 Texture 对象。\n             * 如果传入构造函数的类型为 BitmapData 或者最后设置的为 bitmapData，则此值返回 null。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$texture;\n            },\n            set: function (value) {\n                var self = this;\n                self.$setTexture(value);\n                if (value && self.$renderNode) {\n                    self.$renderNode.rotated = value.$rotated;\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         */\n        Bitmap.prototype.$setTexture = function (value) {\n            var self = this;\n            var oldTexture = self.$texture;\n            if (value == oldTexture) {\n                return false;\n            }\n            self.$texture = value;\n            if (value) {\n                self.$refreshImageData();\n            }\n            else {\n                if (oldTexture) {\n                    egret.BitmapData.$removeDisplayObject(self, oldTexture.$bitmapData);\n                }\n                self.setImageData(null, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);\n                self.$renderDirty = true;\n                var p_1 = self.$parent;\n                if (p_1 && !p_1.$cacheDirty) {\n                    p_1.$cacheDirty = true;\n                    p_1.$cacheDirtyUp();\n                }\n                var maskedObject_1 = self.$maskedObject;\n                if (maskedObject_1 && !maskedObject_1.$cacheDirty) {\n                    maskedObject_1.$cacheDirty = true;\n                    maskedObject_1.$cacheDirtyUp();\n                }\n                if (egret.nativeRender) {\n                    this.setBitmapDataToWasm(null);\n                }\n                return true;\n            }\n            if (self.$stage) {\n                if (oldTexture && oldTexture.$bitmapData) {\n                    var oldHashCode = oldTexture.$bitmapData.hashCode;\n                    var newHashCode = value.$bitmapData ? value.$bitmapData.hashCode : -1;\n                    if (oldHashCode == newHashCode) {\n                        self.$renderDirty = true;\n                        var p_2 = self.$parent;\n                        if (p_2 && !p_2.$cacheDirty) {\n                            p_2.$cacheDirty = true;\n                            p_2.$cacheDirtyUp();\n                        }\n                        var maskedObject_2 = self.$maskedObject;\n                        if (maskedObject_2 && !maskedObject_2.$cacheDirty) {\n                            maskedObject_2.$cacheDirty = true;\n                            maskedObject_2.$cacheDirtyUp();\n                        }\n                        return true;\n                    }\n                    egret.BitmapData.$removeDisplayObject(self, oldTexture.$bitmapData);\n                }\n                egret.BitmapData.$addDisplayObject(self, value.$bitmapData);\n            }\n            self.$renderDirty = true;\n            var p = self.$parent;\n            if (p && !p.$cacheDirty) {\n                p.$cacheDirty = true;\n                p.$cacheDirtyUp();\n            }\n            var maskedObject = self.$maskedObject;\n            if (maskedObject && !maskedObject.$cacheDirty) {\n                maskedObject.$cacheDirty = true;\n                maskedObject.$cacheDirtyUp();\n            }\n            return true;\n        };\n        Bitmap.prototype.$setBitmapData = function (value) {\n            this.$setTexture(value);\n        };\n        /**\n         * @private\n         */\n        Bitmap.prototype.setBitmapDataToWasm = function (data) {\n            this.$nativeDisplayObject.setTexture(data);\n        };\n        /**\n         * @private\n         */\n        Bitmap.prototype.$refreshImageData = function () {\n            var texture = this.$texture;\n            if (texture) {\n                if (egret.nativeRender) {\n                    this.setBitmapDataToWasm(texture);\n                }\n                this.setImageData(texture.$bitmapData, texture.$bitmapX, texture.$bitmapY, texture.$bitmapWidth, texture.$bitmapHeight, texture.$offsetX, texture.$offsetY, texture.$getTextureWidth(), texture.$getTextureHeight(), texture.$sourceWidth, texture.$sourceHeight);\n            }\n            else {\n                if (egret.nativeRender) {\n                    this.setBitmapDataToWasm(null);\n                }\n            }\n        };\n        /**\n         * @private\n         */\n        Bitmap.prototype.setImageData = function (bitmapData, bitmapX, bitmapY, bitmapWidth, bitmapHeight, offsetX, offsetY, textureWidth, textureHeight, sourceWidth, sourceHeight) {\n            this.$bitmapData = bitmapData;\n            this.$bitmapX = bitmapX;\n            this.$bitmapY = bitmapY;\n            this.$bitmapWidth = bitmapWidth;\n            this.$bitmapHeight = bitmapHeight;\n            this.$offsetX = offsetX;\n            this.$offsetY = offsetY;\n            this.$textureWidth = textureWidth;\n            this.$textureHeight = textureHeight;\n            this.$sourceWidth = sourceWidth;\n            this.$sourceHeight = sourceHeight;\n        };\n        Object.defineProperty(Bitmap.prototype, \"scale9Grid\", {\n            /**\n             * Represent a Rectangle Area that the 9 scale area of Image.\n             * Notice: This property is valid only when <code>fillMode</code>\n             * is <code>BitmapFillMode.SCALE</code>.\n             *\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 矩形区域，它定义素材对象的九个缩放区域。\n             * 注意:此属性仅在<code>fillMode</code>为<code>BitmapFillMode.SCALE</code>时有效。\n             *\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$scale9Grid;\n            },\n            set: function (value) {\n                this.$setScale9Grid(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Bitmap.prototype.$setScale9Grid = function (value) {\n            var self = this;\n            self.$scale9Grid = value;\n            self.$renderDirty = true;\n            if (egret.nativeRender) {\n                if (value) {\n                    self.$nativeDisplayObject.setScale9Grid(value.x, value.y, value.width, value.height);\n                }\n                else {\n                    self.$nativeDisplayObject.setScale9Grid(0, 0, -1, -1);\n                }\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        Object.defineProperty(Bitmap.prototype, \"fillMode\", {\n            /**\n             * Determines how the bitmap fills in the dimensions.\n             * <p>When set to <code>BitmapFillMode.REPEAT</code>, the bitmap\n             * repeats to fill the region.</p>\n             * <p>When set to <code>BitmapFillMode.SCALE</code>, the bitmap\n             * stretches to fill the region.</p>\n             *\n             * @default <code>BitmapFillMode.SCALE</code>\n             *\n             * @version Egret 2.4\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 确定位图填充尺寸的方式。\n             * <p>设置为 <code>BitmapFillMode.REPEAT</code>时，位图将重复以填充区域。</p>\n             * <p>设置为 <code>BitmapFillMode.SCALE</code>时，位图将拉伸以填充区域。</p>\n             *\n             * @default <code>BitmapFillMode.SCALE</code>\n             *\n             * @version Egret 2.4\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$fillMode;\n            },\n            set: function (value) {\n                this.$setFillMode(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Bitmap.prototype.$setFillMode = function (value) {\n            var self = this;\n            if (value == self.$fillMode) {\n                return false;\n            }\n            self.$fillMode = value;\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setBitmapFillMode(self.$fillMode);\n            }\n            else {\n                self.$renderDirty = true;\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n            return true;\n        };\n        Object.defineProperty(Bitmap.prototype, \"smoothing\", {\n            /**\n             * Whether or not the bitmap is smoothed when scaled.\n             * @version Egret 2.4\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 控制在缩放时是否对位图进行平滑处理。\n             * @version Egret 2.4\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$smoothing;\n            },\n            set: function (value) {\n                var self = this;\n                if (value == this.$smoothing) {\n                    return;\n                }\n                this.$smoothing = value;\n                this.$renderNode.smoothing = value;\n                if (!egret.nativeRender) {\n                    var p = self.$parent;\n                    if (p && !p.$cacheDirty) {\n                        p.$cacheDirty = true;\n                        p.$cacheDirtyUp();\n                    }\n                    var maskedObject = self.$maskedObject;\n                    if (maskedObject && !maskedObject.$cacheDirty) {\n                        maskedObject.$cacheDirty = true;\n                        maskedObject.$cacheDirtyUp();\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        Bitmap.prototype.$setWidth = function (value) {\n            var self = this;\n            if (value < 0 || value == self.$explicitBitmapWidth) {\n                return false;\n            }\n            self.$explicitBitmapWidth = value;\n            self.$renderDirty = true;\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setWidth(value);\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n            return true;\n        };\n        /**\n         * @private\n         *\n         * @param value\n         */\n        Bitmap.prototype.$setHeight = function (value) {\n            var self = this;\n            if (value < 0 || value == self.$explicitBitmapHeight) {\n                return false;\n            }\n            self.$explicitBitmapHeight = value;\n            self.$renderDirty = true;\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setHeight(value);\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n            return true;\n        };\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        Bitmap.prototype.$getWidth = function () {\n            return isNaN(this.$explicitBitmapWidth) ? this.$getContentBounds().width : this.$explicitBitmapWidth;\n        };\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        Bitmap.prototype.$getHeight = function () {\n            return isNaN(this.$explicitBitmapHeight) ? this.$getContentBounds().height : this.$explicitBitmapHeight;\n        };\n        /**\n         * @private\n         */\n        Bitmap.prototype.$measureContentBounds = function (bounds) {\n            if (this.$bitmapData) {\n                var w = !isNaN(this.$explicitBitmapWidth) ? this.$explicitBitmapWidth : this.$textureWidth;\n                var h = !isNaN(this.$explicitBitmapHeight) ? this.$explicitBitmapHeight : this.$textureHeight;\n                bounds.setTo(0, 0, w, h);\n            }\n            else {\n                var w = !isNaN(this.$explicitBitmapWidth) ? this.$explicitBitmapWidth : 0;\n                var h = !isNaN(this.$explicitBitmapHeight) ? this.$explicitBitmapHeight : 0;\n                bounds.setTo(0, 0, w, h);\n            }\n        };\n        /**\n         * @private\n         */\n        Bitmap.prototype.$updateRenderNode = function () {\n            if (this.$texture) {\n                var destW = !isNaN(this.$explicitBitmapWidth) ? this.$explicitBitmapWidth : this.$textureWidth;\n                var destH = !isNaN(this.$explicitBitmapHeight) ? this.$explicitBitmapHeight : this.$textureHeight;\n                var scale9Grid = this.scale9Grid || this.$texture[\"scale9Grid\"];\n                if (scale9Grid) {\n                    if (this.$renderNode instanceof egret.sys.NormalBitmapNode) {\n                        this.$renderNode = new egret.sys.BitmapNode();\n                    }\n                    egret.sys.BitmapNode.$updateTextureDataWithScale9Grid(this.$renderNode, this.$bitmapData, scale9Grid, this.$bitmapX, this.$bitmapY, this.$bitmapWidth, this.$bitmapHeight, this.$offsetX, this.$offsetY, this.$textureWidth, this.$textureHeight, destW, destH, this.$sourceWidth, this.$sourceHeight, this.$smoothing);\n                }\n                else {\n                    if (this.fillMode == egret.BitmapFillMode.REPEAT && this.$renderNode instanceof egret.sys.NormalBitmapNode) {\n                        this.$renderNode = new egret.sys.BitmapNode();\n                    }\n                    egret.sys.BitmapNode.$updateTextureData(this.$renderNode, this.$bitmapData, this.$bitmapX, this.$bitmapY, this.$bitmapWidth, this.$bitmapHeight, this.$offsetX, this.$offsetY, this.$textureWidth, this.$textureHeight, destW, destH, this.$sourceWidth, this.$sourceHeight, this.$fillMode, this.$smoothing);\n                }\n            }\n        };\n        Object.defineProperty(Bitmap.prototype, \"pixelHitTest\", {\n            /**\n             * Specifies whether this object use precise hit testing by checking the alpha value of each pixel.If pixelHitTest\n             * is set to true,the transparent area of the bitmap will be touched through.<br/>\n             * Note:If the image is loaded from cross origin,that we can't access to the pixel data,so it might cause\n             * the pixelHitTest property invalid.\n             * @default false\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 是否开启精确像素碰撞。设置为true显示对象本身的透明区域将能够被穿透。<br/>\n             * 注意：若图片资源是以跨域方式从外部服务器加载的，将无法访问图片的像素数据，而导致此属性失效。\n             * @default false\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._pixelHitTest;\n            },\n            set: function (value) {\n                this._pixelHitTest = !!value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Bitmap.prototype.$hitTest = function (stageX, stageY) {\n            var target = _super.prototype.$hitTest.call(this, stageX, stageY);\n            if (target && this._pixelHitTest) {\n                var boo = this.hitTestPoint(stageX, stageY, true);\n                if (!boo) {\n                    target = null;\n                }\n            }\n            return target;\n        };\n        /**\n         * The default value of whether or not is smoothed when scaled.\n         * When object such as Bitmap is created,smoothing property will be set to this value.\n         * @default true。\n         * @version Egret 3.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 控制在缩放时是否进行平滑处理的默认值。\n         * 在 Bitmap 等对象创建时,smoothing 属性会被设置为该值。\n         * @default true。\n         * @version Egret 3.0\n         * @platform Web\n         * @language zh_CN\n         */\n        Bitmap.defaultSmoothing = true;\n        return Bitmap;\n    }(egret.DisplayObject));\n    egret.Bitmap = Bitmap;\n    __reflect(Bitmap.prototype, \"egret.Bitmap\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         * 渲染节点基类\n         */\n        var RenderNode = (function () {\n            function RenderNode() {\n                /**\n                 * 节点类型..\n                 */\n                this.type = 0;\n                /**\n                 * 绘制数据\n                 */\n                this.drawData = [];\n                /**\n                 * 绘制次数\n                 */\n                this.renderCount = 0;\n            }\n            /**\n             * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n             */\n            RenderNode.prototype.cleanBeforeRender = function () {\n                this.drawData.length = 0;\n                this.renderCount = 0;\n            };\n            RenderNode.prototype.$getRenderCount = function () {\n                return this.renderCount;\n            };\n            return RenderNode;\n        }());\n        sys.RenderNode = RenderNode;\n        __reflect(RenderNode.prototype, \"egret.sys.RenderNode\");\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         * 2D路径\n         */\n        var Path2D = (function () {\n            function Path2D() {\n                /**\n                 * 路径类型\n                 */\n                this.type = 0;\n                this.$commands = [];\n                this.$data = [];\n                this.commandPosition = 0;\n                this.dataPosition = 0;\n                /**\n                 * 当前移动到的坐标X\n                 * 注意：目前只有drawArc之前会被赋值\n                 */\n                this.$lastX = 0;\n                /**\n                 * 当前移动到的坐标Y\n                 * 注意：目前只有drawArc之前会被赋值\n                 */\n                this.$lastY = 0;\n            }\n            /**\n             * 将当前绘图位置移动到 (x, y)。如果缺少任何一个参数，则此方法将失败，并且当前绘图位置不改变。\n             * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n             * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n             */\n            Path2D.prototype.moveTo = function (x, y) {\n                this.$commands[this.commandPosition++] = 1 /* MoveTo */;\n                var pos = this.dataPosition;\n                this.$data[pos++] = x;\n                this.$data[pos++] = y;\n                this.dataPosition = pos;\n            };\n            /**\n             * 使用当前线条样式绘制一条从当前绘图位置开始到 (x, y) 结束的直线；当前绘图位置随后会设置为 (x, y)。\n             * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n             * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n             */\n            Path2D.prototype.lineTo = function (x, y) {\n                this.$commands[this.commandPosition++] = 2 /* LineTo */;\n                var pos = this.dataPosition;\n                this.$data[pos++] = x;\n                this.$data[pos++] = y;\n                this.dataPosition = pos;\n            };\n            /**\n             * 使用当前线条样式和由 (controlX, controlY) 指定的控制点绘制一条从当前绘图位置开始到 (anchorX, anchorY) 结束的二次贝塞尔曲线。当前绘图位置随后设置为 (anchorX, anchorY)。\n             * 如果在调用 moveTo() 方法之前调用了 curveTo() 方法，则当前绘图位置的默认值为 (0, 0)。如果缺少任何一个参数，则此方法将失败，并且当前绘图位置不改变。\n             * 绘制的曲线是二次贝塞尔曲线。二次贝塞尔曲线包含两个锚点和一个控制点。该曲线内插这两个锚点，并向控制点弯曲。\n             * @param controlX 一个数字，指定控制点相对于父显示对象注册点的水平位置。\n             * @param controlY 一个数字，指定控制点相对于父显示对象注册点的垂直位置。\n             * @param anchorX 一个数字，指定下一个锚点相对于父显示对象注册点的水平位置。\n             * @param anchorY 一个数字，指定下一个锚点相对于父显示对象注册点的垂直位置。\n             */\n            Path2D.prototype.curveTo = function (controlX, controlY, anchorX, anchorY) {\n                this.$commands[this.commandPosition++] = 3 /* CurveTo */;\n                var pos = this.dataPosition;\n                this.$data[pos++] = controlX;\n                this.$data[pos++] = controlY;\n                this.$data[pos++] = anchorX;\n                this.$data[pos++] = anchorY;\n                this.dataPosition = pos;\n            };\n            /**\n             * 从当前绘图位置到指定的锚点绘制一条三次贝塞尔曲线。三次贝塞尔曲线由两个锚点和两个控制点组成。该曲线内插这两个锚点，并向两个控制点弯曲。\n             * @param controlX1 指定首个控制点相对于父显示对象的注册点的水平位置。\n             * @param controlY1 指定首个控制点相对于父显示对象的注册点的垂直位置。\n             * @param controlX2 指定第二个控制点相对于父显示对象的注册点的水平位置。\n             * @param controlY2 指定第二个控制点相对于父显示对象的注册点的垂直位置。\n             * @param anchorX 指定锚点相对于父显示对象的注册点的水平位置。\n             * @param anchorY 指定锚点相对于父显示对象的注册点的垂直位置。\n             */\n            Path2D.prototype.cubicCurveTo = function (controlX1, controlY1, controlX2, controlY2, anchorX, anchorY) {\n                this.$commands[this.commandPosition++] = 4 /* CubicCurveTo */;\n                var pos = this.dataPosition;\n                this.$data[pos++] = controlX1;\n                this.$data[pos++] = controlY1;\n                this.$data[pos++] = controlX2;\n                this.$data[pos++] = controlY2;\n                this.$data[pos++] = anchorX;\n                this.$data[pos++] = anchorY;\n                this.dataPosition = pos;\n            };\n            /**\n             * 绘制一个矩形\n             * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n             * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n             * @param width 矩形的宽度（以像素为单位）。\n             * @param height 矩形的高度（以像素为单位）。\n             */\n            Path2D.prototype.drawRect = function (x, y, width, height) {\n                var x2 = x + width;\n                var y2 = y + height;\n                this.moveTo(x, y);\n                this.lineTo(x2, y);\n                this.lineTo(x2, y2);\n                this.lineTo(x, y2);\n                this.lineTo(x, y);\n            };\n            /**\n             * 绘制一个圆角矩形。\n             * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n             * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n             * @param width 矩形的宽度（以像素为单位）。\n             * @param height 矩形的高度（以像素为单位）。\n             * @param ellipseWidth 用于绘制圆角的椭圆的宽度（以像素为单位）。\n             * @param ellipseHeight 用于绘制圆角的椭圆的高度（以像素为单位）。 （可选）如果未指定值，则默认值与为 ellipseWidth 参数提供的值相匹配。\n             */\n            Path2D.prototype.drawRoundRect = function (x, y, width, height, ellipseWidth, ellipseHeight) {\n                var radiusX = (ellipseWidth * 0.5) | 0;\n                var radiusY = ellipseHeight ? (ellipseHeight * 0.5) | 0 : radiusX;\n                if (!radiusX || !radiusY) {\n                    this.drawRect(x, y, width, height);\n                    return;\n                }\n                var hw = width * 0.5;\n                var hh = height * 0.5;\n                if (radiusX > hw) {\n                    radiusX = hw;\n                }\n                if (radiusY > hh) {\n                    radiusY = hh;\n                }\n                if (hw === radiusX && hh === radiusY) {\n                    if (radiusX === radiusY) {\n                        this.drawCircle(x + radiusX, y + radiusY, radiusX);\n                    }\n                    else {\n                        this.drawEllipse(x, y, radiusX * 2, radiusY * 2);\n                    }\n                    return;\n                }\n                //    A-----B\n                //  H         C\n                //  G         D\n                //    F-----E\n                // 从D点开始，结束在D点\n                var right = x + width;\n                var bottom = y + height;\n                var xlw = x + radiusX;\n                var xrw = right - radiusX;\n                var ytw = y + radiusY;\n                var ybw = bottom - radiusY;\n                this.moveTo(right, ybw);\n                this.curveTo(right, bottom, xrw, bottom);\n                this.lineTo(xlw, bottom);\n                this.curveTo(x, bottom, x, ybw);\n                this.lineTo(x, ytw);\n                this.curveTo(x, y, xlw, y);\n                this.lineTo(xrw, y);\n                this.curveTo(right, y, right, ytw);\n                this.lineTo(right, ybw);\n            };\n            /**\n             * 绘制一个圆。\n             * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n             * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n             * @param radius 圆的半径（以像素为单位）。\n             */\n            Path2D.prototype.drawCircle = function (x, y, radius) {\n                this.arcToBezier(x, y, radius, radius, 0, Math.PI * 2);\n            };\n            /**\n             * 绘制一个椭圆。\n             * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n             * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n             * @param width 矩形的宽度（以像素为单位）。\n             * @param height 矩形的高度（以像素为单位）。\n             */\n            Path2D.prototype.drawEllipse = function (x, y, width, height) {\n                var radiusX = width * 0.5;\n                var radiusY = height * 0.5;\n                // 移动x和y到椭圆的中心.\n                x += radiusX;\n                y += radiusY;\n                this.arcToBezier(x, y, radiusX, radiusY, 0, Math.PI * 2);\n            };\n            /**\n             * 绘制一段圆弧路径。圆弧路径的圆心在 (x, y) 位置，半径为 r ，根据anticlockwise （默认为顺时针）指定的方向从 startAngle 开始绘制，到 endAngle 结束。\n             * @param x 圆弧中心（圆心）的 x 轴坐标。\n             * @param y 圆弧中心（圆心）的 y 轴坐标。\n             * @param radius 圆弧的半径。\n             * @param startAngle 圆弧的起始点， x轴方向开始计算，单位以弧度表示。\n             * 注意，必须在0~2π之间。\n             * @param endAngle 圆弧的终点， 单位以弧度表示。\n             * 注意，必须在0~2π之间。\n             * @param anticlockwise 如果为 true，逆时针绘制圆弧，反之，顺时针绘制。\n             */\n            Path2D.prototype.drawArc = function (x, y, radius, startAngle, endAngle, anticlockwise) {\n                if (anticlockwise) {\n                    if (endAngle >= startAngle) {\n                        endAngle -= Math.PI * 2;\n                    }\n                }\n                else {\n                    if (endAngle <= startAngle) {\n                        endAngle += Math.PI * 2;\n                    }\n                }\n                this.arcToBezier(x, y, radius, radius, startAngle, endAngle, anticlockwise);\n            };\n            /**\n             * 绘制一段圆弧路径\n             * @param x 圆弧中心（圆心）的 x 轴坐标。\n             * @param y 圆弧中心（圆心）的 y 轴坐标。\n             * @param radiusX 圆弧的半径 x。\n             * @param radiusY 圆弧的半径 y。\n             * @param startAngle 圆弧的起始点， x轴方向开始计算，单位以弧度表示。\n             * 注意：必须为正数。\n             * @param endAngle 圆弧的终点， 单位以弧度表示。\n             * 注意：与startAngle差值必须在0~2π之间。\n             * @param anticlockwise 如果为 true，逆时针绘制圆弧，反之，顺时针绘制。\n             * 注意：如果为true，endAngle必须小于startAngle，反之必须大于。\n             */\n            Path2D.prototype.arcToBezier = function (x, y, radiusX, radiusY, startAngle, endAngle, anticlockwise) {\n                var halfPI = Math.PI * 0.5;\n                var start = startAngle;\n                var end = start;\n                if (anticlockwise) {\n                    end += -halfPI - (start % halfPI);\n                    if (end < endAngle) {\n                        end = endAngle;\n                    }\n                }\n                else {\n                    end += halfPI - (start % halfPI);\n                    if (end > endAngle) {\n                        end = endAngle;\n                    }\n                }\n                var currentX = x + Math.cos(start) * radiusX;\n                var currentY = y + Math.sin(start) * radiusY;\n                if (this.$lastX != currentX || this.$lastY != currentY) {\n                    this.moveTo(currentX, currentY);\n                }\n                var u = Math.cos(start);\n                var v = Math.sin(start);\n                for (var i = 0; i < 4; i++) {\n                    var addAngle = end - start;\n                    var a = 4 * Math.tan(addAngle / 4) / 3;\n                    var x1 = currentX - v * a * radiusX;\n                    var y1 = currentY + u * a * radiusY;\n                    u = Math.cos(end);\n                    v = Math.sin(end);\n                    currentX = x + u * radiusX;\n                    currentY = y + v * radiusY;\n                    var x2 = currentX + v * a * radiusX;\n                    var y2 = currentY - u * a * radiusY;\n                    this.cubicCurveTo(x1, y1, x2, y2, currentX, currentY);\n                    if (end === endAngle) {\n                        break;\n                    }\n                    start = end;\n                    if (anticlockwise) {\n                        end = start - halfPI;\n                        if (end < endAngle) {\n                            end = endAngle;\n                        }\n                    }\n                    else {\n                        end = start + halfPI;\n                        if (end > endAngle) {\n                            end = endAngle;\n                        }\n                    }\n                }\n            };\n            return Path2D;\n        }());\n        sys.Path2D = Path2D;\n        __reflect(Path2D.prototype, \"egret.sys.Path2D\");\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n/**\n * @private\n */\nvar egret;\n(function (egret) {\n    //todo remove\n    /**\n     * @private\n     */\n    egret.fontMapping = {};\n})(egret || (egret = {}));\nvar egret;\n(function (egret) {\n    /**\n     * @private\n     */\n    function createMap() {\n        var obj = Object.create(null);\n        obj.__v8__ = undefined;\n        delete obj.__v8__;\n        return obj;\n    }\n    egret.createMap = createMap;\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @class egret.GlowFilter\n     * @classdesc\n     * 使用 GlowFilter 类可以对显示对象应用发光效果。在投影滤镜的 distance 和 angle 属性设置为 0 时，发光滤镜与投影滤镜极为相似。\n     * @extends egret.Filter\n     * @version Egret 3.1.4\n     * @platform Web,Native\n     */\n    var GlowFilter = (function (_super) {\n        __extends(GlowFilter, _super);\n        /**\n         * Initializes a new GlowFilter instance.\n         * @method egret.GlowFilter#constructor\n         * @param color {number} The color of the glow. Valid values are in the hexadecimal format 0xRRGGBB. The default value is 0xFF0000.\n         * @param alpha {number} The alpha transparency value for the color. Valid values are 0 to 1. For example, .25 sets a transparency value of 25%. The default value is 1.\n         * @param blurX {number} The amount of horizontal blur. Valid values are 0 to 255 (floating point).\n         * @param blurY {number} The amount of vertical blur. Valid values are 0 to 255 (floating point).\n         * @param strength {number} The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the glow and the background. Valid values are 0 to 255.\n         * @param quality {number} The number of times to apply the filter.\n         * @param inner {boolean} Specifies whether the glow is an inner glow. The value true indicates an inner glow. The default is false, an outer glow (a glow around the outer edges of the object).\n         * @param knockout {number} Specifies whether the object has a knockout effect. A value of true makes the object's fill transparent and reveals the background color of the document. The default value is false (no knockout effect).\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 初始化 GlowFilter 对象\n         * @method egret.GlowFilter#constructor\n         * @param color {number} 光晕颜色，采用十六进制格式 0xRRGGBB。默认值为 0xFF0000。\n         * @param alpha {number} 颜色的 Alpha 透明度值。有效值为 0 到 1。例如，0.25 设置透明度值为 25%。\n         * @param blurX {number} 水平模糊量。有效值为 0 到 255（浮点）。\n         * @param blurY {number} 垂直模糊量。有效值为 0 到 255（浮点）。\n         * @param strength {number} 印记或跨页的强度。该值越高，压印的颜色越深，而且发光与背景之间的对比度也越强。有效值为 0 到 255。\n         * @param quality {number} 应用滤镜的次数。暂未实现。\n         * @param inner {boolean} 指定发光是否为内侧发光。值 true 指定发光是内侧发光。值 false 指定发光是外侧发光（对象外缘周围的发光）。\n         * @param knockout {number} 指定对象是否具有挖空效果。值为 true 将使对象的填充变为透明，并显示文档的背景颜色。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        function GlowFilter(color, alpha, blurX, blurY, strength, quality, inner, knockout) {\n            if (color === void 0) { color = 0xFF0000; }\n            if (alpha === void 0) { alpha = 1.0; }\n            if (blurX === void 0) { blurX = 6.0; }\n            if (blurY === void 0) { blurY = 6.0; }\n            if (strength === void 0) { strength = 2; }\n            if (quality === void 0) { quality = 1; }\n            if (inner === void 0) { inner = false; }\n            if (knockout === void 0) { knockout = false; }\n            var _this = _super.call(this) || this;\n            var self = _this;\n            self.type = \"glow\";\n            self.$color = color;\n            self.$blue = color & 0x0000FF;\n            self.$green = (color & 0x00ff00) >> 8;\n            self.$red = color >> 16;\n            self.$alpha = alpha;\n            self.$blurX = blurX;\n            self.$blurY = blurY;\n            self.$strength = strength;\n            self.$quality = quality;\n            self.$inner = inner;\n            self.$knockout = knockout;\n            self.$uniforms.color = { x: _this.$red / 255, y: _this.$green / 255, z: _this.$blue / 255, w: 1 };\n            self.$uniforms.alpha = alpha;\n            self.$uniforms.blurX = blurX;\n            self.$uniforms.blurY = blurY;\n            self.$uniforms.strength = strength;\n            // this.$uniforms.quality = quality;\n            self.$uniforms.inner = inner ? 1 : 0;\n            self.$uniforms.knockout = knockout ? 0 : 1;\n            self.$uniforms.dist = 0;\n            self.$uniforms.angle = 0;\n            self.$uniforms.hideObject = 0;\n            self.onPropertyChange();\n            return _this;\n        }\n        Object.defineProperty(GlowFilter.prototype, \"color\", {\n            /**\n             * The color of the glow.\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 光晕颜色。\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$color;\n            },\n            set: function (value) {\n                if (this.$color == value) {\n                    return;\n                }\n                this.$color = value;\n                this.$blue = value & 0x0000FF;\n                this.$green = (value & 0x00ff00) >> 8;\n                this.$red = value >> 16;\n                this.$uniforms.color.x = this.$red / 255;\n                this.$uniforms.color.y = this.$green / 255;\n                this.$uniforms.color.z = this.$blue / 255;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GlowFilter.prototype, \"alpha\", {\n            /**\n             * The alpha transparency value for the color.\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 颜色的 Alpha 透明度值。\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$alpha;\n            },\n            set: function (value) {\n                if (this.$alpha == value) {\n                    return;\n                }\n                this.$alpha = value;\n                this.$uniforms.alpha = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GlowFilter.prototype, \"blurX\", {\n            /**\n             * The amount of horizontal blur.\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 水平模糊量。\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$blurX;\n            },\n            set: function (value) {\n                var self = this;\n                if (self.$blurX == value) {\n                    return;\n                }\n                self.$blurX = value;\n                self.$uniforms.blurX = value;\n                self.onPropertyChange();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GlowFilter.prototype, \"blurY\", {\n            /**\n             * The amount of vertical blur.\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 垂直模糊量。\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$blurY;\n            },\n            set: function (value) {\n                var self = this;\n                if (self.$blurY == value) {\n                    return;\n                }\n                self.$blurY = value;\n                self.$uniforms.blurY = value;\n                self.onPropertyChange();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GlowFilter.prototype, \"strength\", {\n            /**\n             * The strength of the imprint or spread.\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 印记或跨页的强度。\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$strength;\n            },\n            set: function (value) {\n                if (this.$strength == value) {\n                    return;\n                }\n                this.$strength = value;\n                this.$uniforms.strength = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GlowFilter.prototype, \"quality\", {\n            /**\n             * The number of times to apply the filter.\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 应用滤镜的次数。\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$quality;\n            },\n            set: function (value) {\n                if (this.$quality == value) {\n                    return;\n                }\n                this.$quality = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GlowFilter.prototype, \"inner\", {\n            /**\n             * Specifies whether the glow is an inner glow.\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 指定发光是否为内侧发光。\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$inner;\n            },\n            set: function (value) {\n                if (this.$inner == value) {\n                    return;\n                }\n                this.$inner = value;\n                this.$uniforms.inner = value ? 1 : 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GlowFilter.prototype, \"knockout\", {\n            /**\n             * Specifies whether the object has a knockout effect.\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 指定对象是否具有挖空效果。\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$knockout;\n            },\n            set: function (value) {\n                if (this.$knockout == value) {\n                    return;\n                }\n                this.$knockout = value;\n                this.$uniforms.knockout = value ? 0 : 1;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         */\n        GlowFilter.prototype.$toJson = function () {\n            return '{\"color\": ' + this.$color + ', \"red\": ' + this.$red + ', \"green\": ' + this.$green + ', \"blue\": ' + this.$blue + ', \"alpha\": ' + this.$alpha + ', \"blurX\": ' + this.$blurX + ', \"blurY\": ' + this.blurY + ', \"strength\": ' + this.$strength + ', \"quality\": ' + this.$quality + ', \"inner\": ' + this.$inner + ', \"knockout\": ' + this.$knockout + '}';\n        };\n        GlowFilter.prototype.updatePadding = function () {\n            var self = this;\n            self.paddingLeft = self.blurX;\n            self.paddingRight = self.blurX;\n            self.paddingTop = self.blurY;\n            self.paddingBottom = self.blurY;\n        };\n        return GlowFilter;\n    }(egret.Filter));\n    egret.GlowFilter = GlowFilter;\n    __reflect(GlowFilter.prototype, \"egret.GlowFilter\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The Stage class represents the main drawing area.The Stage object is not globally accessible. You need to access\n     * it through the stage property of a DisplayObject instance.<br/>\n     * The Stage class has several ancestor classes — Sprite, DisplayObject, and EventDispatcher — from which it inherits\n     * properties and methods. Many of these properties and methods are inapplicable to Stage objects.\n     * @event egret.Event.RESIZE Dispatched when the stageWidth or stageHeight property of the Stage object is changed.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Stage.ts\n     * @language en_US\n     */\n    /**\n     * Stage 类代表主绘图区。\n     * 可以利用 DisplayObject 实例的 stage 属性进行访问。<br/>\n     * Stage 类具有多个祖代类: Sprite、DisplayObject 和 EventDispatcher，属性和方法便是从这些类继承而来的。\n     * 从这些继承的许多属性和方法不适用于 Stage 对象。\n     * @event egret.Event.RESIZE 当stageWidth或stageHeight属性发生改变时调度\n     * @event egret.Event.DEACTIVATE 当stage失去焦点后调度\n     * @event egret.Event.ACTIVATE 当stage获得焦点后调度\n     *\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Stage.ts\n     * @language zh_CN\n     */\n    var Stage = (function (_super) {\n        __extends(Stage, _super);\n        /**\n         * @private\n         * Stage不许允许自行实例化\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function Stage() {\n            var _this = _super.call(this) || this;\n            /**\n             * @private\n             */\n            _this.$stageWidth = 0;\n            /**\n             * @private\n             */\n            _this.$stageHeight = 0;\n            _this.$scaleMode = egret.StageScaleMode.SHOW_ALL;\n            _this.$orientation = egret.OrientationMode.AUTO;\n            _this.$maxTouches = 99;\n            _this.$stage = _this;\n            _this.$nestLevel = 1;\n            return _this;\n        }\n        Stage.prototype.createNativeDisplayObject = function () {\n            this.$nativeDisplayObject = new egret_native.NativeDisplayObject(13 /* STAGE */);\n        };\n        Object.defineProperty(Stage.prototype, \"frameRate\", {\n            /**\n             * Gets and sets the frame rate of the stage. The frame rate is defined as frames per second. Valid range for the\n             * frame rate is from 0.01 to 1000 frames per second.<br/>\n             * Note: setting the frameRate property of one Stage object changes the frame rate for all Stage objects\n             * @default 30\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 获取并设置舞台的帧速率。帧速率是指每秒显示的帧数。帧速率的有效范围为每秒 0.01 到 60 个帧。<br/>\n             * 注意: 修改任何一个Stage的frameRate属性都会同步修改其他Stage的帧率。\n             * @default 30\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return egret.ticker.$frameRate;\n            },\n            set: function (value) {\n                egret.ticker.$setFrameRate(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Stage.prototype, \"stageWidth\", {\n            /**\n             * Indicates the width of the stage, in pixels.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 舞台的当前宽度（以像素为单位）。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$stageWidth;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Stage.prototype, \"stageHeight\", {\n            /**\n             * Indicates the height of the stage, in pixels.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 舞台的当前高度（以像素为单位）。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$stageHeight;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * After you call the invalidate() method, when the display list is next rendered, the Egret runtime sends a render\n         * event to each display object that has registered to listen for the render event. You must call the invalidate()\n         * method each time you want the Egret runtime to send render events.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 调用 invalidate() 方法后，在显示列表下次呈现时，Egret 会向每个已注册侦听 Event.RENDER 事件的显示对象发送一个 Event.RENDER 事件。\n         * 每次您希望 Egret 发送 Event.RENDER 事件时，都必须调用 invalidate() 方法。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Stage.prototype.invalidate = function () {\n            egret.sys.$invalidateRenderFlag = true;\n        };\n        /**\n         * @deprecated\n         */\n        Stage.prototype.registerImplementation = function (interfaceName, instance) {\n            egret.registerImplementation(interfaceName, instance);\n        };\n        /**\n         * @deprecated\n         */\n        Stage.prototype.getImplementation = function (interfaceName) {\n            return egret.getImplementation(interfaceName);\n        };\n        Object.defineProperty(Stage.prototype, \"scaleMode\", {\n            /**\n             * A StageScaleMode class that specifies which scale mode to use. The following are valid values:<br/>\n             * <ul>\n             * <li>StageScaleMode.EXACT_FIT -- The entire application be visible in the specified area without trying to preserve the original aspect ratio. Distortion can occur, the application may be stretched or compressed.</li>\n             * <li>StageScaleMode.SHOW_ALL -- The entire application is visible in the specified area without distortion while maintaining the application of the original aspect ratio. Applications may display border.</li>\n             * <li>StageScaleMode.NO_SCALE -- The size of the entire application is fixed, so that even if the size of the player window changes, it remains unchanged. If the player window is smaller than the content, it may do some trimming.</li>\n             * <li>StageScaleMode.NO_BORDER -- Keep the original aspect ratio scaling application content, after scaling a narrow direction of application content to fill the viewport players on both sides in the other direction may exceed the viewport and the player is cut.</li>\n             * <li>StageScaleMode.FIXED_WIDTH -- Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, but only to keep the contents of the original application constant width, height may change.</li>\n             * <li>StageScaleMode.FIXED_HEIGHT -- Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, but only to keep the contents of the original application constant height, width may change.</li>\n             * </ul>\n             * @default egret.StageScaleMode.SHOW_ALL\n             * @language en_US\n             */\n            /**\n             * 一个 StageScaleMode 类中指定要使用哪种缩放模式的值。以下是有效值：<br/>\n             * <ul>\n             * <li>StageScaleMode.EXACT_FIT -- 整个应用程序在指定区域中可见，但不尝试保持原始高宽比。可能会发生扭曲，应用程序可能会拉伸或压缩显示。</li>\n             * <li>StageScaleMode.SHOW_ALL -- 整个应用程序在指定区域中可见，且不发生扭曲，同时保持应用程序的原始高宽比。应用程序的可能会显示边框。</li>\n             * <li>StageScaleMode.NO_SCALE -- 整个应用程序的大小固定，因此，即使播放器窗口的大小更改，它也会保持不变。如果播放器窗口比内容小，则可能进行一些裁切。</li>\n             * <li>StageScaleMode.NO_BORDER -- 保持原始宽高比缩放应用程序内容，缩放后应用程序内容的较窄方向填满播放器视口，另一个方向的两侧可能会超出播放器视口而被裁切。</li>\n             * <li>StageScaleMode.FIXED_WIDTH -- 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，但只保持应用程序内容的原始宽度不变，高度可能会改变。</li>\n             * <li>StageScaleMode.FIXED_HEIGHT -- 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，但只保持应用程序内容的原始高度不变，宽度可能会改变。</li>\n             * </ul>\n             * @default egret.StageScaleMode.SHOW_ALL\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$scaleMode;\n            },\n            set: function (value) {\n                if (this.$scaleMode == value) {\n                    return;\n                }\n                this.$scaleMode = value;\n                this.$screen.updateScreenSize();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Stage.prototype, \"orientation\", {\n            /**\n             * Horizontal and vertical screen display screen, can only be set under the current Native in the configuration file. A egret.OrientationMode class that specifies which display mode to use. The following are valid values:<br/>\n             * <ul>\n             * <li>egret.OrientationMode.AUTO -- Always follow the direction of application display screen, always guaranteed by the look down.</li>\n             * <li>egret.OrientationMode.PORTRAIT -- Applications remain portrait mode, namely horizontal screen look, the screen from left to right.</li>\n             * <li>egret.OrientationMode.LANDSCAPE -- Applications remain horizontal screen mode, namely vertical screen, the screen from right to left.</li>\n             * <li>egret.OrientationMode.LANDSCAPE_FLIPPED -- Applications remain horizontal screen mode, namely vertical screen, the screen from left to right.</li>\n             * </ul>\n             * @platform Web\n             * @version 2.4\n             * @language en_US\n             */\n            /**\n             * 屏幕横竖屏显示方式，目前 Native 下只能在配置文件里设置。一个 egret.OrientationMode 类中指定要使用哪种显示方式。以下是有效值：<br/>\n             * <ul>\n             * <li>egret.OrientationMode.AUTO -- 应用始终跟随屏幕的方向显示，始终保证由上往下看。</li>\n             * <li>egret.OrientationMode.PORTRAIT -- 应用始终保持竖屏模式，即横屏看时，屏幕由左往右看。</li>\n             * <li>egret.OrientationMode.LANDSCAPE -- 应用始终保持横屏模式，即竖屏看时，屏幕显示由右往左。</li>\n             * <li>egret.OrientationMode.LANDSCAPE_FLIPPED -- 应用始终保持横屏模式，即竖屏看时，屏幕显示由左往右。</li>\n             * </ul>\n             * @platform Web\n             * @version 2.4\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$orientation;\n            },\n            set: function (value) {\n                if (this.$orientation == value) {\n                    return;\n                }\n                this.$orientation = value;\n                this.$screen.updateScreenSize();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Stage.prototype, \"textureScaleFactor\", {\n            /**\n             * Draw texture zoom ratio\n             * @default 1\n             * @language en_US\n             */\n            /**\n             * 绘制纹理的缩放比率，默认值为1\n             * @default 1\n             * @language zh_CN\n             */\n            get: function () {\n                return egret.$TextureScaleFactor;\n            },\n            set: function (value) {\n                egret.$TextureScaleFactor = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Stage.prototype, \"maxTouches\", {\n            /**\n             * Set the number of screens can simultaneously touch. Above this amount will not be triggered in response.\n             * @default 99\n             * @language en_US\n             */\n            /**\n             * 设置屏幕同时可以触摸的数量。高于这个数量将不会被触发响应。\n             * @default 99\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$maxTouches;\n            },\n            set: function (value) {\n                if (this.$maxTouches == value) {\n                    return;\n                }\n                this.$maxTouches = value;\n                this.$screen.updateMaxTouches();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * Set resolution size\n         * @param width width\n         * @param height height\n         * @version Egret 2.5.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置分辨率尺寸\n         * @param width 宽度\n         * @param height 高度\n         * @version Egret 2.5.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Stage.prototype.setContentSize = function (width, height) {\n            this.$screen.setContentSize(width, height);\n        };\n        return Stage;\n    }(egret.DisplayObjectContainer));\n    egret.Stage = Stage;\n    __reflect(Stage.prototype, \"egret.Stage\");\n    if (true) {\n        egret.$markCannotUse(Stage, \"alpha\", 1);\n        egret.$markCannotUse(Stage, \"visible\", true);\n        egret.$markCannotUse(Stage, \"x\", 0);\n        egret.$markCannotUse(Stage, \"y\", 0);\n        egret.$markCannotUse(Stage, \"scaleX\", 1);\n        egret.$markCannotUse(Stage, \"scaleY\", 1);\n        egret.$markCannotUse(Stage, \"rotation\", 0);\n        egret.$markCannotUse(Stage, \"cacheAsBitmap\", false);\n        egret.$markCannotUse(Stage, \"scrollRect\", null);\n        egret.$markCannotUse(Stage, \"filters\", null);\n        egret.$markCannotUse(Stage, \"blendMode\", null);\n        egret.$markCannotUse(Stage, \"touchEnabled\", true);\n        egret.$markCannotUse(Stage, \"matrix\", null);\n    }\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    //混合模式在Web端只有部分被支持，在 Native 中全部都支持。\n    //目前所有平台的浏览器都支持的有：Layer,Alpha,Normal,Add,ERASE。\n    //IOS中的所有浏览器以及Android内的部分浏览器还支持：Multiply,Screen,Lighten,Darken,Difference,Overlay,HardLight。\n    //仅在 Native 端支持的有：Subtract,Invert。\n    /**\n     * A class that provides constant values for visual blend mode effects. These constants are used in the blendMode\n     * property of the DisplayObject class.\n     * @see egret.DisplayObject#blendMode\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/BlendMode.ts\n     * @see http://edn.egret.com/cn/docs/page/108 显示容器的概念与实现\n     * @language en_US\n     */\n    /**\n     * 提供混合模式可视效果的常量值的类,通常用于 DisplayObject 的 blendMode 属性上。\n     * @see egret.DisplayObject#blendMode\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/BlendMode.ts\n     * @see http://edn.egret.com/cn/docs/page/108 显示容器的概念与实现\n     * @language zh_CN\n     */\n    var BlendMode = (function () {\n        function BlendMode() {\n        }\n        /**\n         * The display object appears in front of the background. Pixel values of the display object override the pixel\n         * values of the background. Where the display object is transparent, the background is visible.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 该显示对象出现在背景前面。显示对象的像素值会覆盖背景的像素值。在显示对象为透明的区域，背景是可见的。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        BlendMode.NORMAL = \"normal\";\n        /**\n         * Adds the values of the constituent colors of the display object to the colors of its background, applying a\n         * ceiling of 0xFF. This setting is commonly used for animating a lightening dissolve between two objects.<br/>\n         * For example, if the display object has a pixel with an RGB value of 0xAAA633, and the background pixel has an\n         * RGB value of 0xDD2200, the resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD > 0xFF,\n         * 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将显示对象的原色值添加到它的背景颜色中，上限值为 0xFF。此设置通常用于使两个对象间的加亮溶解产生动画效果。<br/>\n         * 例如，如果显示对象的某个像素的 RGB 值为 0xAAA633，背景像素的 RGB 值为 0xDD2200，则显示像素的结果 RGB 值为 0xFFC833\n         * （因为 0xAA + 0xDD > 0xFF，0xA6 + 0x22 = 0xC8，且 0x33 + 0x00 = 0x33）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        BlendMode.ADD = \"add\";\n        /**\n         * Erases the background based on the alpha value of the display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 根据显示对象的 Alpha 值擦除背景。Alpha 值不为0的区域将被擦除。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        BlendMode.ERASE = \"erase\";\n        return BlendMode;\n    }());\n    egret.BlendMode = BlendMode;\n    __reflect(BlendMode.prototype, \"egret.BlendMode\");\n})(egret || (egret = {}));\n(function (egret) {\n    var sys;\n    (function (sys) {\n        var blendModeString = [\"normal\", \"add\", \"erase\"];\n        var blendModeNumber = {};\n        var length = blendModeString.length;\n        for (var i = 0; i < length; i++) {\n            var str = blendModeString[i];\n            blendModeNumber[str] = i;\n        }\n        /**\n         * @private\n         * 转换 blendMode 字符串为数字。\n         */\n        function blendModeToNumber(blendMode) {\n            var num = blendModeNumber[blendMode];\n            return num === undefined ? 0 : num;\n        }\n        sys.blendModeToNumber = blendModeToNumber;\n        /**\n         * @private\n         * 转换数字为 blendMode 字符串。\n         */\n        function numberToBlendMode(blendMode) {\n            var str = blendModeString[blendMode];\n            return str === undefined ? \"normal\" : str;\n        }\n        sys.numberToBlendMode = numberToBlendMode;\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The ChildrenSortMode class defines a pattern enumeration for children sort mode of egret.DisplayObjectContainer.\n     * @version Egret 5.2.19\n     * @platform Native\n     * @language en_US\n     */\n    /**\n     * BitmapFillMode 类定义egret.DisplayObjectContainer的子项目排序方式。\n     * @version Egret 5.2.19\n     * @platform Native\n     * @language zh_CN\n     */\n    egret.ChildrenSortMode = {\n        /**\n         * Default mode.\n         * @version Egret 5.2.19\n         * @platform Native\n         * @language en_US\n         */\n        /**\n         * 默认方式。\n         * @version Egret 5.2.19\n         * @platform Native\n         * @language zh_CN\n         */\n        DEFAULT: \"default\",\n        /**\n         * Y increase mode. Automatic sorted ascending by y coordinates.\n         * @version Egret 5.2.19\n         * @platform Native\n         * @language en_US\n         */\n        /**\n         * Y递增模式。自动按y坐标升序排序。\n         * @version Egret 5.2.19\n         * @platform Native\n         * @language en_US\n         */\n        INCREASE_Y: \"increaseY\",\n        /**\n         * Y decrease mode. Automatic sorted descending by y coordinates.\n         * @version Egret 5.2.19\n         * @platform Native\n         * @language en_US\n         */\n        /**\n         * Y递减模式。自动按y坐标降序排序。\n         * @version Egret 5.2.19\n         * @platform Native\n         * @language en_US\n         */\n        DECREASE_Y: \"decreaseY\"\n    };\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The CapsStyle class is an enumeration of constant values that specify the caps style to use in drawing lines.\n     * The constants are provided for use as values in the caps parameter of the egret.Graphics.lineStyle() method.\n     * @see egret.Graphics#lineStyle()\n     * @version Egret 2.5\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * CapsStyle 类是可指定在绘制线条中使用的端点样式的常量值枚举。常量可用作 egret.Graphics.lineStyle() 方法的 caps 参数中的值。\n     * @see egret.Graphics#lineStyle()\n     * @version Egret 2.5\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    egret.CapsStyle = {\n        /**\n         * Used to specify no caps in the caps parameter of the egret.Graphics.lineStyle() method.\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于在 egret.Graphics.lineStyle() 方法的 caps 参数中指定没有端点。\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        NONE: \"none\",\n        /**\n         * Used to specify round caps in the caps parameter of the egret.Graphics.lineStyle() method.\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于在 egret.Graphics.lineStyle() 方法的 caps 参数中指定圆头端点。\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ROUND: \"round\",\n        /**\n         * Used to specify square caps in the caps parameter of the egret.Graphics.lineStyle() method.\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于在 egret.Graphics.lineStyle() 方法的 caps 参数中指定方头端点。\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        SQUARE: \"square\"\n    };\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @private\n     */\n    var WebGLUtils = (function () {\n        function WebGLUtils() {\n        }\n        WebGLUtils.compileProgram = function (gl, vertexSrc, fragmentSrc) {\n            var fragmentShader = WebGLUtils.compileFragmentShader(gl, fragmentSrc);\n            var vertexShader = WebGLUtils.compileVertexShader(gl, vertexSrc);\n            var shaderProgram = gl.createProgram();\n            gl.attachShader(shaderProgram, vertexShader);\n            gl.attachShader(shaderProgram, fragmentShader);\n            gl.linkProgram(shaderProgram);\n            if (!gl.getProgramParameter(shaderProgram, gl.LINK_STATUS)) {\n                egret.$warn(1020);\n            }\n            return shaderProgram;\n        };\n        WebGLUtils.compileFragmentShader = function (gl, shaderSrc) {\n            return WebGLUtils._compileShader(gl, shaderSrc, gl.FRAGMENT_SHADER);\n        };\n        WebGLUtils.compileVertexShader = function (gl, shaderSrc) {\n            return WebGLUtils._compileShader(gl, shaderSrc, gl.VERTEX_SHADER);\n        };\n        WebGLUtils._compileShader = function (gl, shaderSrc, shaderType) {\n            var shader = gl.createShader(shaderType);\n            gl.shaderSource(shader, shaderSrc);\n            gl.compileShader(shader);\n            if (!gl.getShaderParameter(shader, gl.COMPILE_STATUS)) {\n                //egret.info(gl.getShaderInfoLog(shader));\n                return null;\n            }\n            return shader;\n        };\n        WebGLUtils.checkCanUseWebGL = function () {\n            if (WebGLUtils.canUseWebGL == undefined) {\n                try {\n                    var canvas = document.createElement(\"canvas\");\n                    WebGLUtils.canUseWebGL = !!window[\"WebGLRenderingContext\"]\n                        && !!(canvas.getContext(\"webgl\") || canvas.getContext(\"experimental-webgl\"));\n                }\n                catch (e) {\n                    WebGLUtils.canUseWebGL = false;\n                }\n            }\n            return WebGLUtils.canUseWebGL;\n        };\n        WebGLUtils.deleteWebGLTexture = function (webglTexture) {\n            if (!webglTexture) {\n                return;\n            }\n            if (webglTexture[egret.engine_default_empty_texture]) {\n                if (true) {\n                    //引擎默认的空白纹理，不允许删除\n                    console.warn('deleteWebGLTexture:' + egret.engine_default_empty_texture);\n                }\n                return;\n            }\n            var gl = webglTexture[egret.glContext];\n            if (gl) {\n                gl.deleteTexture(webglTexture);\n            }\n            else {\n                if (true) {\n                    console.error('deleteWebGLTexture gl = ' + gl);\n                }\n            }\n            /*old\n            if (webglTexture && !webglTexture['engine_default_empty_texture']) {\n                const gl = webglTexture['glContext'] as WebGLRenderingContext;//bitmapData.glContext;\n                if (gl) {\n                    gl.deleteTexture(webglTexture);\n                }\n                else {\n                    console.error('deleteWebGLTexture gl = ' + gl);\n                }\n            }\n            */\n        };\n        /**\n         * inspired by pixi.js\n         */\n        WebGLUtils.premultiplyTint = function (tint, alpha) {\n            if (alpha === 1.0) {\n                return (alpha * 255 << 24) + tint;\n            }\n            if (alpha === 0.0) {\n                return 0;\n            }\n            var R = ((tint >> 16) & 0xFF);\n            var G = ((tint >> 8) & 0xFF);\n            var B = (tint & 0xFF);\n            R = ((R * alpha) + 0.5) | 0;\n            G = ((G * alpha) + 0.5) | 0;\n            B = ((B * alpha) + 0.5) | 0;\n            return (alpha * 255 << 24) + (R << 16) + (G << 8) + B;\n        };\n        return WebGLUtils;\n    }());\n    egret.WebGLUtils = WebGLUtils;\n    __reflect(WebGLUtils.prototype, \"egret.WebGLUtils\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    // export interface TextField{\n    //     addEventListener<Z>(type: \"focusIn\" |\n    //                               \"focusOut\"\n    //         , listener: (this: Z, e: FocusEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number);\n    //     addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number);\n    // }\n    /**\n     * When the user changes the focus from one object in the display list to another object, the object dispatches a FocusEvent object. Currently only supports input text.\n     * Focus events: FocusEvent.FOCUS_IN FocusEvent.FOCUS_OUT\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 用户将焦点从显示列表中的一个对象更改到另一个对象时，对象将调度 FocusEvent 对象。目前只支持输入文本。\n     * 焦点事件：FocusEvent.FOCUS_IN FocusEvent.FOCUS_OUT\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var FocusEvent = (function (_super) {\n        __extends(FocusEvent, _super);\n        /**\n         * Create a egret.FocusEvent objects\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.FocusEvent 对象\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function FocusEvent(type, bubbles, cancelable) {\n            if (bubbles === void 0) { bubbles = false; }\n            if (cancelable === void 0) { cancelable = false; }\n            return _super.call(this, type, bubbles, cancelable) || this;\n        }\n        /**\n         * Gets focus\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获得焦点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        FocusEvent.FOCUS_IN = \"focusIn\";\n        /**\n         * Loses focus\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 失去焦点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        FocusEvent.FOCUS_OUT = \"focusOut\";\n        return FocusEvent;\n    }(egret.Event));\n    egret.FocusEvent = FocusEvent;\n    __reflect(FocusEvent.prototype, \"egret.FocusEvent\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The GeolocationEvent represents the position and altitude of the device on Earth,\n     * and show errors occurred while getting the location of the device.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/Geolocation.ts\n     * @see http://edn.egret.com/cn/docs/page/662 获取位置信息\n     * @language en_US\n     */\n    /**\n     * GeolocationEvent 提供设备的地理位置信息和获取位置时发生的错误信息\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/Geolocation.ts\n     * @see http://edn.egret.com/cn/docs/page/662 获取位置信息\n     * @language zh_CN\n     */\n    var GeolocationEvent = (function (_super) {\n        __extends(GeolocationEvent, _super);\n        function GeolocationEvent() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        /**\n         * The acquisition of the location information failed because of app don't have permission.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 由于用户拒绝访问位置信息，获取位置信息失败\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        GeolocationEvent.PERMISSION_DENIED = \"permissionDenied\";\n        /**\n         * The acquisition of the location failed because at least one internal source of position returned an internal error.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设备位置服务不可用或者超时等原因没有得到位置信息\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        GeolocationEvent.UNAVAILABLE = \"unavailable\";\n        return GeolocationEvent;\n    }(egret.Event));\n    egret.GeolocationEvent = GeolocationEvent;\n    __reflect(GeolocationEvent.prototype, \"egret.GeolocationEvent\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * When a network request returns an HTTP status code, the application dispatches HTTPStatusEvent objects.\n     * Before error or completion events will always send HTTPStatusEvent object. HTTPStatusEvent object does not necessarily indicate an error condition; it simply reflects the HTTP status code provided by the network stack (if any).\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 在网络请求返回 HTTP 状态代码时，应用程序将调度 HTTPStatusEvent 对象。\n     * 在错误或完成事件之前，将始终发送 HTTPStatusEvent 对象。HTTPStatusEvent 对象不一定表示错误条件；它仅反映网络堆栈提供的 HTTP 状态代码（如果有的话）。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var HTTPStatusEvent = (function (_super) {\n        __extends(HTTPStatusEvent, _super);\n        /**\n         * Create a egret.HTTPStatusEvent objects\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.HTTPStatusEvent 对象\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function HTTPStatusEvent(type, bubbles, cancelable) {\n            if (bubbles === void 0) { bubbles = false; }\n            if (cancelable === void 0) { cancelable = false; }\n            var _this = _super.call(this, type, bubbles, cancelable) || this;\n            /**\n             * @private\n             */\n            _this._status = 0;\n            return _this;\n        }\n        Object.defineProperty(HTTPStatusEvent.prototype, \"status\", {\n            /**\n             * he server returns the HTTP status code.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 由服务器返回的 HTTP 状态代码。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._status;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * EventDispatcher object using the specified event object thrown Event. The objects will be thrown in the object cache pool for the next round robin.\n         * @param target {egret.IEventDispatcher} Distribute event target\n         * @param status {number} The server returns the HTTP status code\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出Event事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @param status {number} 由服务器返回的 HTTP 状态代码\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        HTTPStatusEvent.dispatchHTTPStatusEvent = function (target, status) {\n            var event = egret.Event.create(HTTPStatusEvent, HTTPStatusEvent.HTTP_STATUS);\n            event._status = status;\n            var result = target.dispatchEvent(event);\n            egret.Event.release(event);\n            return result;\n        };\n        /**\n         * HTTPStatusEvent.HTTP_STATUS constant defines the value of the type property httpStatus event object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * HTTPStatusEvent.HTTP_STATUS 常量定义 httpStatus 事件对象的 type 属性值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        HTTPStatusEvent.HTTP_STATUS = \"httpStatus\";\n        return HTTPStatusEvent;\n    }(egret.Event));\n    egret.HTTPStatusEvent = HTTPStatusEvent;\n    __reflect(HTTPStatusEvent.prototype, \"egret.HTTPStatusEvent\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @classdesc IO流事件，当错误导致输入或输出操作失败时调度 IOErrorEvent 对象。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/IOErrorEvent.ts\n     * @language en_US\n     */\n    /**\n     * @classdesc IO流事件，当错误导致输入或输出操作失败时调度 IOErrorEvent 对象。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/IOErrorEvent.ts\n     * @language zh_CN\n     */\n    var IOErrorEvent = (function (_super) {\n        __extends(IOErrorEvent, _super);\n        /**\n         * Create a egret.IOErrorEvent objects\n         * @param type {string} Type of event, accessible as Event.type.\n         * @param bubbles {boolean} Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable {boolean} Determine whether the Event object can be canceled. The default value is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.IOErrorEvent 对象\n         * @param type {string} 事件的类型，可以作为 Event.type 访问。\n         * @param bubbles {boolean} 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable {boolean} 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function IOErrorEvent(type, bubbles, cancelable) {\n            if (bubbles === void 0) { bubbles = false; }\n            if (cancelable === void 0) { cancelable = false; }\n            return _super.call(this, type, bubbles, cancelable) || this;\n        }\n        /**\n         * EventDispatcher object using the specified event object thrown Event. The objects will be thrown in the object cache pool for the next round robin.\n         * @param target {egret.IEventDispatcher} Distribute event target\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出Event事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        IOErrorEvent.dispatchIOErrorEvent = function (target) {\n            var event = egret.Event.create(IOErrorEvent, IOErrorEvent.IO_ERROR);\n            var result = target.dispatchEvent(event);\n            egret.Event.release(event);\n            return result;\n        };\n        /**\n         * io error\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * io发生错误\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        IOErrorEvent.IO_ERROR = \"ioError\";\n        return IOErrorEvent;\n    }(egret.Event));\n    egret.IOErrorEvent = IOErrorEvent;\n    __reflect(IOErrorEvent.prototype, \"egret.IOErrorEvent\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * MotionEvent represents the device's movement\n     * Acceleration and accelerationIncludingGravity to represents the device's acceleration\n     * RotationRate to represents the device's rotation\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/Motion.ts\n     * @language en_US\n     */\n    /**\n     * MotionEvent 类呈现设备运动的具体信息\n     * Acceleration 和 accelerationIncludingGravity 呈现设备三个维度的加速度信息\n     * RotationRate 呈现设备的旋转状态信息\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/Motion.ts\n     * @language zh_CN\n     */\n    var MotionEvent = (function (_super) {\n        __extends(MotionEvent, _super);\n        function MotionEvent() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        return MotionEvent;\n    }(egret.Event));\n    egret.MotionEvent = MotionEvent;\n    __reflect(MotionEvent.prototype, \"egret.MotionEvent\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The OrientationEvent provides information from the physical orientation of the device.\n     * Note: Currently, Browsers on the iOS and Android does not handle the coordinates the same way.\n     * Take care about this while using them.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/DeviceOrientation.ts\n     * @language en_US\n     */\n    /**\n     * OrientationEvent 提供设备的方向信息\n     * 注意: 目前各个浏览器和操作系统处理方向的方式不完全相同，请根据使用场景做相应的校正，\n     * 比如使用两次方向数据的变化而不是直接使用方向的值\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/DeviceOrientation.ts\n     * @language zh_CN\n     */\n    var OrientationEvent = (function (_super) {\n        __extends(OrientationEvent, _super);\n        function OrientationEvent() {\n            return _super !== null && _super.apply(this, arguments) || this;\n        }\n        return OrientationEvent;\n    }(egret.Event));\n    egret.OrientationEvent = OrientationEvent;\n    __reflect(OrientationEvent.prototype, \"egret.OrientationEvent\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * When a load operation has begun or a socket has received data, ProgressEvent object is dispatched.\n     * There are two types of progress events: ProgressEvent.PROGRESS and ProgressEvent.SOCKET_DATA.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 当加载操作已开始或套接字已接收到数据时，将调度 ProgressEvent 对象。\n     * 有两种类型的进程事件：ProgressEvent.PROGRESS 和 ProgressEvent.SOCKET_DATA。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var ProgressEvent = (function (_super) {\n        __extends(ProgressEvent, _super);\n        /**\n         * 创建一个 egret.ProgressEvent 对象\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @param bytesLoaded {number} Number of items or bytes loaded\n         * @param bytesTotal {number} The total number of items or bytes loaded\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.ProgressEvent 对象\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param bytesLoaded {number} 加载的项数或字节数\n         * @param bytesTotal {number} 加载的总项数或总字节数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function ProgressEvent(type, bubbles, cancelable, bytesLoaded, bytesTotal) {\n            if (bubbles === void 0) { bubbles = false; }\n            if (cancelable === void 0) { cancelable = false; }\n            if (bytesLoaded === void 0) { bytesLoaded = 0; }\n            if (bytesTotal === void 0) { bytesTotal = 0; }\n            var _this = _super.call(this, type, bubbles, cancelable) || this;\n            /**\n             * Number of items or bytes when the listener processes the event。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 在侦听器处理事件时加载的项数或字节数。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.bytesLoaded = 0;\n            /**\n             * If the loading process succeeds, the total number or the total number of bytes that will be loaded term.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 如果加载过程成功，将加载的总项数或总字节数。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.bytesTotal = 0;\n            _this.bytesLoaded = bytesLoaded;\n            _this.bytesTotal = bytesTotal;\n            return _this;\n        }\n        /**\n         * EventDispatcher object using the specified event object thrown Event. The objects will be thrown in the object cache pool for the next round robin.\n         * @param target {egret.IEventDispatcher} Distribute event target\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bytesLoaded {number} Number of items or bytes loaded\n         * @param bytesTotal {number} The total number of items or bytes loaded\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出Event事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @param type {string} 事件类型\n         * @param bytesLoaded {number} 加载的项数或字节数\n         * @param bytesTotal {number} 加载的总项数或总字节数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ProgressEvent.dispatchProgressEvent = function (target, type, bytesLoaded, bytesTotal) {\n            if (bytesLoaded === void 0) { bytesLoaded = 0; }\n            if (bytesTotal === void 0) { bytesTotal = 0; }\n            var event = egret.Event.create(ProgressEvent, type);\n            event.bytesLoaded = bytesLoaded;\n            event.bytesTotal = bytesTotal;\n            var result = target.dispatchEvent(event);\n            egret.Event.release(event);\n            return result;\n        };\n        /**\n         * Changes in the loading progress\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 加载进度发生变化\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ProgressEvent.PROGRESS = \"progress\";\n        /**\n         * Get the data\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取到数据\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ProgressEvent.SOCKET_DATA = \"socketData\";\n        return ProgressEvent;\n    }(egret.Event));\n    egret.ProgressEvent = ProgressEvent;\n    __reflect(ProgressEvent.prototype, \"egret.ProgressEvent\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * When the direction of the stage of change, Stage object dispatches StageOrientationEvent object.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/StageOrientationEvent.ts\n     * @language en_US\n     */\n    /**\n     * 当舞台的方向更改时，Stage 对象将调度 StageOrientationEvent 对象。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/StageOrientationEvent.ts\n     * @language zh_CN\n     */\n    var StageOrientationEvent = (function (_super) {\n        __extends(StageOrientationEvent, _super);\n        /**\n         * Creating contains specific information related to the event and the stage direction of StageOrientationEvent object.\n         * @param type Event types:StageOrientationEvent.ORIENTATION_CHANGE\n         * @param bubbles It indicates whether the Event object participates in the bubbling stage of the event flow.\n         * @param cancelable It indicates whether the Event object can be canceled.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建包含与舞台方向事件相关的特定信息的 StageOrientationEvent 对象。\n         * @param type 事件的类型：StageOrientationEvent.ORIENTATION_CHANGE\n         * @param bubbles 表示 Event 对象是否参与事件流的冒泡阶段。\n         * @param cancelable 表示是否可以取消 Event 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function StageOrientationEvent(type, bubbles, cancelable) {\n            if (bubbles === void 0) { bubbles = false; }\n            if (cancelable === void 0) { cancelable = false; }\n            return _super.call(this, type, bubbles, cancelable) || this;\n        }\n        /**\n         * 派发一个屏幕旋转的事件。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @param type {egret.IEventDispatcher} 派发事件类型\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 派发一个屏幕旋转的事件。\n         * @param target {egret.IEventDispatcher} Distribute event target\n         * @param type {egret.IEventDispatcher} Distribute event type\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        StageOrientationEvent.dispatchStageOrientationEvent = function (target, type) {\n            var event = egret.Event.create(StageOrientationEvent, type);\n            var result = target.dispatchEvent(event);\n            egret.Event.release(event);\n            return result;\n        };\n        /**\n         * After screen rotation distribute events.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 屏幕旋转后派发的事件。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        StageOrientationEvent.ORIENTATION_CHANGE = \"orientationChange\";\n        return StageOrientationEvent;\n    }(egret.Event));\n    egret.StageOrientationEvent = StageOrientationEvent;\n    __reflect(StageOrientationEvent.prototype, \"egret.StageOrientationEvent\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    // export interface TextField{\n    //     addEventListener<Z>(type: \"link\"\n    //         , listener: (this: Z, e: TextEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number);\n    //     addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number);\n    // }\n    /**\n     * When a user clicks a hyperlink rich text object dispatches TextEvent object. Text Event Type: TextEvent.LINK.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TextEvent.ts\n     * @language en_US\n     */\n    /**\n     * 用户在富文本中单击超链接时，对象将调度 TextEvent 对象。文本事件类型：TextEvent.LINK。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TextEvent.ts\n     * @language zh_CN\n     */\n    var TextEvent = (function (_super) {\n        __extends(TextEvent, _super);\n        /**\n         * TextEvent create an object that contains information about text events.\n         * @param type Type of event, you can access the TextEvent.type.\n         * @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determine whether the Event object can be canceled. The default value is false.\n         * @param text One or more characters of text entered by the user. Event listeners can access this information through the text property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 TextEvent 对象，其中包含有关文本事件的信息。\n         * @param type 事件的类型，可以作为 TextEvent.type 访问。\n         * @param bubbles 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param text 用户输入的一个或多个文本字符。事件侦听器可以通过 text 属性访问此信息。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function TextEvent(type, bubbles, cancelable, text) {\n            if (bubbles === void 0) { bubbles = false; }\n            if (cancelable === void 0) { cancelable = false; }\n            if (text === void 0) { text = \"\"; }\n            var _this = _super.call(this, type, bubbles, cancelable) || this;\n            _this.text = text;\n            return _this;\n        }\n        /**\n         * EventDispatcher object using the specified event object thrown TextEvent. The objects will be thrown in the object cache pool for the next round robin.\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param text  Text TextEvent object assignment\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出TextEvent事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target 派发事件目标\n         * @param type  事件类型\n         * @param text  TextEvent对象的text赋值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TextEvent.dispatchTextEvent = function (target, type, text) {\n            var event = egret.Event.create(TextEvent, type);\n            event.text = text;\n            var result = target.dispatchEvent(event);\n            egret.Event.release(event);\n            return result;\n        };\n        /**\n         * It defines the value of the type property of a link event object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 定义 link 事件对象的 type 属性值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TextEvent.LINK = \"link\";\n        return TextEvent;\n    }(egret.Event));\n    egret.TextEvent = TextEvent;\n    __reflect(TextEvent.prototype, \"egret.TextEvent\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * A Timer object dispatches a TimerEvent objects whenever the Timer object reaches the interval specified by the Timer.delay property.\n     * @see egret.Timer\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TimerEvent.ts\n     * @language en_US\n     */\n    /**\n     * 每当 Timer 对象达到由 Timer.delay 属性指定的间隔时，Timer 对象即会调度 TimerEvent 对象。\n     * @see egret.Timer\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TimerEvent.ts\n     * @language zh_CN\n     */\n    var TimerEvent = (function (_super) {\n        __extends(TimerEvent, _super);\n        /**\n         * Creates an Event object with specific information relevant to timer events.\n         * @param type The type of the event. Event listeners can access this information through the inherited type property.\n         * @param bubbles Determines whether the Event object bubbles. Event listeners can access this information through\n         * the inherited bubbles property.\n         * @param cancelable Determines whether the Event object can be canceled. Event listeners can access this information\n         * through the inherited cancelable property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 Event 对象，其中包含有关 timer 事件的特定信息。\n         * @param type 事件的类型。事件侦听器可以通过继承的 type 属性访问此信息。\n         * @param bubbles 确定 Event 对象是否冒泡。事件侦听器可以通过继承的 bubbles 属性访问此信息。\n         * @param cancelable 确定是否可以取消 Event 对象。事件侦听器可以通过继承的 cancelable 属性访问此信息。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function TimerEvent(type, bubbles, cancelable) {\n            return _super.call(this, type, bubbles, cancelable) || this;\n        }\n        /**\n         * Instructs Egret runtime to render after processing of this event completes, if the display list has been modified.\n         * @example\n         * <pre>\n         *    function onTimer(event:TimerEvent):void {\n         *        if (40 < mySp.x && mySp.x < 375) {\n         *            mySp.x-= 50;\n         *        } else {\n         *            mySp.x=374;\n         *        }\n         *        event.updateAfterEvent();\n         *    }\n         *\n         *    let moveTimer:Timer=new Timer(50,250);\n         *    moveTimer.addEventListener(TimerEvent.TIMER,onTimer);\n         *    moveTimer.start();\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果已修改显示列表，调用此方法将会忽略帧频限制，在此事件处理完成后立即重绘屏幕。\n         * @example\n         * <pre>\n         *    function onTimer(event:TimerEvent):void {\n         *        if (40 < mySp.x && mySp.x < 375) {\n         *            mySp.x-= 50;\n         *        } else {\n         *            mySp.x=374;\n         *        }\n         *        event.updateAfterEvent();\n         *    }\n         *\n         *    let moveTimer:Timer=new Timer(50,250);\n         *    moveTimer.addEventListener(TimerEvent.TIMER,onTimer);\n         *    moveTimer.start();\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TimerEvent.prototype.updateAfterEvent = function () {\n            egret.sys.$requestRenderingFlag = true;\n        };\n        /**\n         * uses a specified target to dispatchEvent an event. Using this method can reduce the number of\n         * reallocate event objects, which allows you to get better code execution performance.\n         * @param target the event target\n         * @param type The type of the event. Event listeners can access this information through the inherited type property.\n         * @param bubbles Determines whether the Event object bubbles. Event listeners can access this information through\n         * the inherited bubbles property.\n         * @param cancelable Determines whether the Event object can be canceled. Event listeners can access this information\n         * through the inherited cancelable property.\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target 事件派发目标\n         * @param type 事件的类型。事件侦听器可以通过继承的 type 属性访问此信息。\n         * @param bubbles 确定 Event 对象是否冒泡。事件侦听器可以通过继承的 bubbles 属性访问此信息。\n         * @param cancelable 确定是否可以取消 Event 对象。事件侦听器可以通过继承的 cancelable 属性访问此信息。\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TimerEvent.dispatchTimerEvent = function (target, type, bubbles, cancelable) {\n            var event = egret.Event.create(TimerEvent, type, bubbles, cancelable);\n            var result = target.dispatchEvent(event);\n            egret.Event.release(event);\n            return result;\n        };\n        /**\n         * Dispatched whenever a Timer object reaches an interval specified according to the Timer.delay property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 每当 Timer 对象达到根据 Timer.delay 属性指定的间隔时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TimerEvent.TIMER = \"timer\";\n        /**\n         * Dispatched whenever it has completed the number of requests set by Timer.repeatCount.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 每当它完成 Timer.repeatCount 设置的请求数后调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TimerEvent.TIMER_COMPLETE = \"timerComplete\";\n        return TimerEvent;\n    }(egret.Event));\n    egret.TimerEvent = TimerEvent;\n    __reflect(TimerEvent.prototype, \"egret.TimerEvent\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    //refactor\n    var CompressedTextureData = (function () {\n        function CompressedTextureData() {\n        }\n        return CompressedTextureData;\n    }());\n    egret.CompressedTextureData = CompressedTextureData;\n    __reflect(CompressedTextureData.prototype, \"egret.CompressedTextureData\");\n    egret.etc_alpha_mask = 'etc_alpha_mask';\n    egret.engine_default_empty_texture = 'engine_default_empty_texture';\n    egret.is_compressed_texture = 'is_compressed_texture';\n    egret.glContext = 'glContext';\n    egret.UNPACK_PREMULTIPLY_ALPHA_WEBGL = 'UNPACK_PREMULTIPLY_ALPHA_WEBGL';\n    /**\n     * A BitmapData object contains an array of pixel data. This data can represent either a fully opaque bitmap or a\n     * transparent bitmap that contains alpha channel data. Either type of BitmapData object is stored as a buffer of 32-bit\n     * integers. Each 32-bit integer determines the properties of a single pixel in the bitmap.<br/>\n     * Each 32-bit integer is a combination of four 8-bit channel values (from 0 to 255) that describe the alpha transparency\n     * and the red, green, and blue (ARGB) values of the pixel. (For ARGB values, the most significant byte represents the\n     * alpha channel value, followed by red, green, and blue.)\n     * @see egret.Bitmap\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * BitmapData 对象是一个包含像素数据的数组。此数据可以表示完全不透明的位图，或表示包含 Alpha 通道数据的透明位图。\n     * 以上任一类型的 BitmapData 对象都作为 32 位整数的缓冲区进行存储。每个 32 位整数确定位图中单个像素的属性。<br/>\n     * 每个 32 位整数都是四个 8 位通道值（从 0 到 255）的组合，这些值描述像素的 Alpha 透明度以及红色、绿色、蓝色 (ARGB) 值。\n     * （对于 ARGB 值，最高有效字节代表 Alpha 通道值，其后的有效字节分别代表红色、绿色和蓝色通道值。）\n     * @see egret.Bitmap\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var BitmapData = (function (_super) {\n        __extends(BitmapData, _super);\n        /**\n         * Initializes a BitmapData object to refer to the specified source object.\n         * @param source The source object being referenced.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个引用指定 source 实例的 BitmapData 对象\n         * @param source 被引用的 source 实例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function BitmapData(source) {\n            var _this = _super.call(this) || this;\n            /**\n             * Texture format.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 纹理格式。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.format = \"image\";\n            /**\n             * @private\n             * webgl纹理生成后，是否删掉原始图像数据\n             */\n            _this.$deleteSource = true;\n            /**\n             * @private\n             *\n             */\n            _this.compressedTextureData = [];\n            _this.debugCompressedTextureURL = '';\n            _this.etcAlphaMask = null;\n            if (egret.nativeRender) {\n                var nativeBitmapData = new egret_native.NativeBitmapData();\n                nativeBitmapData.$init();\n                _this.$nativeBitmapData = nativeBitmapData;\n            }\n            _this.source = source;\n            // this.width = source.width;\n            // this.height = source.height;\n            _this.source = source;\n            if (_this.source) {\n                _this.width = +source.width;\n                _this.height = +source.height;\n            }\n            else {\n                ///compressed texture?\n            }\n            return _this;\n        }\n        Object.defineProperty(BitmapData.prototype, \"source\", {\n            get: function () {\n                return this.$source;\n            },\n            set: function (value) {\n                this.$source = value;\n                if (egret.nativeRender) {\n                    egret_native.NativeDisplayObject.setSourceToNativeBitmapData(this.$nativeBitmapData, value);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        BitmapData.create = function (type, data, callback) {\n            var base64 = \"\";\n            if (type === \"arraybuffer\") {\n                base64 = egret.Base64Util.encode(data);\n            }\n            else {\n                base64 = data;\n            }\n            var imageType = \"image/png\"; //default value\n            if (base64.charAt(0) === '/') {\n                imageType = \"image/jpeg\";\n            }\n            else if (base64.charAt(0) === 'R') {\n                imageType = \"image/gif\";\n            }\n            else if (base64.charAt(0) === 'i') {\n                imageType = \"image/png\";\n            }\n            var img = new Image();\n            img.src = \"data:\" + imageType + \";base64,\" + base64;\n            img.crossOrigin = '*';\n            var bitmapData = new BitmapData(img);\n            img.onload = function () {\n                img.onload = undefined;\n                bitmapData.source = img;\n                bitmapData.height = img.height;\n                bitmapData.width = img.width;\n                if (callback) {\n                    callback(bitmapData);\n                }\n            };\n            return bitmapData;\n        };\n        BitmapData.prototype.$dispose = function () {\n            if (egret.Capabilities.renderMode == \"webgl\" && this.webGLTexture) {\n                egret.WebGLUtils.deleteWebGLTexture(this.webGLTexture);\n                this.webGLTexture = null;\n            }\n            //native or WebGLRenderTarget\n            if (this.source && this.source.dispose) {\n                this.source.dispose();\n            }\n            // WeChat Memory leakage bug\n            if (this.source && this.source.src) {\n                this.source.src = \"\";\n            }\n            this.source = null;\n            ///dispose compressed texture info\n            //this.bitmapCompressedData.length = 0;\n            this.clearCompressedTextureData();\n            this.debugCompressedTextureURL = '';\n            this.etcAlphaMask = null;\n            ///\n            if (egret.nativeRender) {\n                egret_native.NativeDisplayObject.disposeNativeBitmapData(this.$nativeBitmapData);\n            }\n            BitmapData.$dispose(this);\n        };\n        BitmapData.$addDisplayObject = function (displayObject, bitmapData) {\n            if (!bitmapData) {\n                return;\n            }\n            var hashCode = bitmapData.hashCode;\n            if (!hashCode) {\n                return;\n            }\n            if (!BitmapData._displayList[hashCode]) {\n                BitmapData._displayList[hashCode] = [displayObject];\n                return;\n            }\n            var tempList = BitmapData._displayList[hashCode];\n            if (tempList.indexOf(displayObject) < 0) {\n                tempList.push(displayObject);\n            }\n        };\n        BitmapData.$removeDisplayObject = function (displayObject, bitmapData) {\n            if (!bitmapData) {\n                return;\n            }\n            var hashCode = bitmapData.hashCode;\n            if (!hashCode) {\n                return;\n            }\n            if (!BitmapData._displayList[hashCode]) {\n                return;\n            }\n            var tempList = BitmapData._displayList[hashCode];\n            var index = tempList.indexOf(displayObject);\n            if (index >= 0) {\n                tempList.splice(index, 1);\n            }\n        };\n        BitmapData.$invalidate = function (bitmapData) {\n            if (!bitmapData) {\n                return;\n            }\n            var hashCode = bitmapData.hashCode;\n            if (!hashCode) {\n                return;\n            }\n            if (!BitmapData._displayList[hashCode]) {\n                return;\n            }\n            var tempList = BitmapData._displayList[hashCode];\n            for (var i = 0; i < tempList.length; i++) {\n                if (tempList[i] instanceof egret.Bitmap) {\n                    tempList[i].$refreshImageData();\n                }\n                var bitmap = tempList[i];\n                bitmap.$renderDirty = true;\n                var p = bitmap.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = bitmap.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        BitmapData.$dispose = function (bitmapData) {\n            if (!bitmapData) {\n                return;\n            }\n            var hashCode = bitmapData.hashCode;\n            if (!hashCode) {\n                return;\n            }\n            if (!BitmapData._displayList[hashCode]) {\n                return;\n            }\n            var tempList = BitmapData._displayList[hashCode];\n            for (var _i = 0, tempList_1 = tempList; _i < tempList_1.length; _i++) {\n                var node = tempList_1[_i];\n                if (node instanceof egret.Bitmap) {\n                    node.$bitmapData = null;\n                }\n                node.$renderDirty = true;\n                var p = node.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = node.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n            delete BitmapData._displayList[hashCode];\n        };\n        BitmapData.prototype._getCompressedTextureData = function (level, face) {\n            var levelData = this.compressedTextureData[level];\n            return levelData ? levelData[face] : null;\n        };\n        BitmapData.prototype.getCompressed2dTextureData = function () {\n            return this._getCompressedTextureData(0, 0);\n        };\n        BitmapData.prototype.hasCompressed2d = function () {\n            return !!this.getCompressed2dTextureData();\n        };\n        BitmapData.prototype.clearCompressedTextureData = function () {\n            this.compressedTextureData.length = 0;\n        };\n        BitmapData._displayList = egret.createMap();\n        return BitmapData;\n    }(egret.HashObject));\n    egret.BitmapData = BitmapData;\n    __reflect(BitmapData.prototype, \"egret.BitmapData\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n/// <reference path=\"../geom/Point.ts\" />\nvar egret;\n(function (egret) {\n    var localPoint = new egret.Point();\n    /**\n     * The TouchEvent class lets you handle events on devices that detect user contact with the device (such as a finger\n     * on a touch screen).When a user interacts with a device such as a mobile phone or tablet with a touch screen, the\n     * user typically touches the screen with his or her fingers or a pointing device. You can develop applications that\n     * respond to basic touch events (such as a single finger tap) with the TouchEvent class. Create event listeners using\n     * the event types defined in this class.\n     * Note: When objects are nested on the display list, touch events target the deepest possible nested object that is\n     * visible in the display list. This object is called the target node. To have a target node's ancestor (an object\n     * containing the target node in the display list) receive notification of a touch event, use EventDispatcher.addEventListener()\n     * on the ancestor node with the type parameter set to the specific touch event you want to detect.\n     *\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TouchEvent.ts\n     * @language en_US\n     */\n    /**\n     * 使用 TouchEvent 类，您可以处理设备上那些检测用户与设备之间的接触的事件。\n     * 当用户与带有触摸屏的移动电话或平板电脑等设备交互时，用户通常使用手指或指针设备接触屏幕。可使用 TouchEvent\n     * 类开发响应基本触摸事件（如单个手指点击）的应用程序。使用此类中定义的事件类型创建事件侦听器。\n     * 注意：当对象嵌套在显示列表中时，触摸事件的目标将是显示列表中可见的最深的可能嵌套对象。\n     * 此对象称为目标节点。要使目标节点的祖代（祖代是一个包含显示列表中所有目标节点的对象，从舞台到目标节点的父节点均包括在内）\n     * 接收触摸事件的通知，请对祖代节点使用 EventDispatcher.on() 并将 type 参数设置为要检测的特定触摸事件。\n     *\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TouchEvent.ts\n     * @language zh_CN\n     */\n    var TouchEvent = (function (_super) {\n        __extends(TouchEvent, _super);\n        /**\n         * Creates an Event object that contains information about touch events.\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @param stageX The horizontal coordinate at which the event occurred in global Stage coordinates.\n         * @param stageY The vertical coordinate at which the event occurred in global Stage coordinates.\n         * @param touchPointID A unique identification number assigned to the touch point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 TouchEvent 对象，其中包含有关Touch事件的信息\n         * @param type 事件的类型，可以作为 Event.type 访问。\n         * @param bubbles 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param stageX 事件发生点在全局舞台坐标系中的水平坐标\n         * @param stageY 事件发生点在全局舞台坐标系中的垂直坐标\n         * @param touchPointID 分配给触摸点的唯一标识号\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function TouchEvent(type, bubbles, cancelable, stageX, stageY, touchPointID) {\n            var _this = _super.call(this, type, bubbles, cancelable) || this;\n            _this.targetChanged = true;\n            /**\n             * Whether the touch is pressed (true) or not pressed (false).\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 表示触摸已按下 (true) 还是未按下 (false)。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.touchDown = false;\n            _this.$initTo(stageX, stageY, touchPointID);\n            return _this;\n        }\n        /**\n         * @private\n         */\n        TouchEvent.prototype.$initTo = function (stageX, stageY, touchPointID) {\n            this.touchPointID = +touchPointID || 0;\n            this.$stageX = +stageX || 0;\n            this.$stageY = +stageY || 0;\n        };\n        Object.defineProperty(TouchEvent.prototype, \"stageX\", {\n            /**\n             * The horizontal coordinate at which the event occurred in global Stage coordinates.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 事件发生点在全局舞台坐标中的水平坐标。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$stageX;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(TouchEvent.prototype, \"stageY\", {\n            /**\n             * The vertical coordinate at which the event occurred in global Stage coordinates.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 事件发生点在全局舞台坐标中的垂直坐标。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$stageY;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(TouchEvent.prototype, \"localX\", {\n            /**\n             * The horizontal coordinate at which the event occurred relative to the display object.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 事件发生点相对于所属显示对象的水平坐标。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                if (this.targetChanged) {\n                    this.getLocalXY();\n                }\n                return this._localX;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(TouchEvent.prototype, \"localY\", {\n            /**\n             * The vertical coordinate at which the event occurred relative to the display object.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 事件发生点相对于所属显示对象的垂直坐标。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                if (this.targetChanged) {\n                    this.getLocalXY();\n                }\n                return this._localY;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         */\n        TouchEvent.prototype.getLocalXY = function () {\n            this.targetChanged = false;\n            var m = this.$target.$getInvertedConcatenatedMatrix();\n            m.transformPoint(this.$stageX, this.$stageY, localPoint);\n            this._localX = localPoint.x;\n            this._localY = localPoint.y;\n        };\n        TouchEvent.prototype.$setTarget = function (target) {\n            this.$target = target;\n            this.targetChanged = !!target;\n            return true;\n        };\n        /**\n         * Instructs Egret runtime to render after processing of this event completes, if the display list has been modified.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果已修改显示列表，调用此方法将会忽略帧频限制，在此事件处理完成后立即重绘屏幕。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TouchEvent.prototype.updateAfterEvent = function () {\n            egret.sys.$requestRenderingFlag = true;\n        };\n        /**\n         * uses a specified target to dispatchEvent an event. Using this method can reduce the number of\n         * reallocate event objects, which allows you to get better code execution performance.\n         * @param target the event target\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @param stageX The horizontal coordinate at which the event occurred in global Stage coordinates.\n         * @param stageY The vertical coordinate at which the event occurred in global Stage coordinates.\n         * @param touchPointID A unique identification number (as an int) assigned to the touch point.\n         *\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         *\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出Event事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target 派发事件目标\n         * @param type 事件的类型，可以作为 Event.type 访问。\n         * @param bubbles 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param stageX 事件发生点在全局舞台坐标系中的水平坐标\n         * @param stageY 事件发生点在全局舞台坐标系中的垂直坐标\n         * @param touchPointID 分配给触摸点的唯一标识号\n         *\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         *\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TouchEvent.dispatchTouchEvent = function (target, type, bubbles, cancelable, stageX, stageY, touchPointID, touchDown) {\n            if (touchDown === void 0) { touchDown = false; }\n            if (!bubbles && !target.hasEventListener(type)) {\n                return true;\n            }\n            var event = egret.Event.create(TouchEvent, type, bubbles, cancelable);\n            event.$initTo(stageX, stageY, touchPointID);\n            event.touchDown = touchDown;\n            var result = target.dispatchEvent(event);\n            egret.Event.release(event);\n            return result;\n        };\n        /**\n         * Dispatched when the user touches the device, and is continuously dispatched until the point of contact is removed.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户触碰设备时进行调度，而且会连续调度，直到接触点被删除。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TouchEvent.TOUCH_MOVE = \"touchMove\";\n        /**\n         * Dispatched when the user first contacts a touch-enabled device (such as touches a finger to a mobile phone or tablet with a touch screen).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户第一次触摸启用触摸的设备时（例如，用手指触摸配有触摸屏的移动电话或平板电脑）调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TouchEvent.TOUCH_BEGIN = \"touchBegin\";\n        /**\n         * Dispatched when the user removes contact with a touch-enabled device (such as lifts a finger off a mobile phone\n         * or tablet with a touch screen).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户移除与启用触摸的设备的接触时（例如，将手指从配有触摸屏的移动电话或平板电脑上抬起）调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TouchEvent.TOUCH_END = \"touchEnd\";\n        /**\n         * Dispatched when an event of some kind occurred that canceled the touch.\n         * Such as the eui.Scroller will dispatch 'TOUCH_CANCEL' when it start move, the 'TOUCH_END' and 'TOUCH_TAP' will not be triggered.\n         * @version Egret 3.0.1\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 由于某个事件取消了触摸时触发。比如 eui.Scroller 在开始滚动后会触发 'TOUCH_CANCEL' 事件，不再触发后续的 'TOUCH_END' 和 'TOUCH_TAP' 事件\n         * @version Egret 3.0.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TouchEvent.TOUCH_CANCEL = \"touchCancel\";\n        /**\n         * Dispatched when the user lifts the point of contact over the same DisplayObject instance on which the contact\n         * was initiated on a touch-enabled device.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户在触摸设备上与开始触摸的同一 DisplayObject 实例上抬起接触点时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TouchEvent.TOUCH_TAP = \"touchTap\";\n        /**\n         * Dispatched when the user lifts the point of contact over the different DisplayObject instance on which the contact\n         * was initiated on a touch-enabled device (such as presses and releases a finger from a single point over a display\n         * object on a mobile phone or tablet with a touch screen).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户在触摸设备上与开始触摸的不同 DisplayObject 实例上抬起接触点时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TouchEvent.TOUCH_RELEASE_OUTSIDE = \"touchReleaseOutside\";\n        return TouchEvent;\n    }(egret.Event));\n    egret.TouchEvent = TouchEvent;\n    __reflect(TouchEvent.prototype, \"egret.TouchEvent\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The BlurFilter class lets you apply a blur visual effect to display objects. A blur effect softens the details of an image.\n     * You can produce blurs that range from a softly unfocused look to a Gaussian blur, a hazy appearance like viewing an image through semi-opaque glass.\n     * @version Egret 3.0.1\n     * @platform Web\n     * @see http://edn.egret.com/cn/docs/page/947#模糊滤镜 模糊滤镜\n     * @language en_US\n     */\n    /**\n     * 可使用 BlurFilter 类将模糊视觉效果应用于显示对象。模糊效果可以柔化图像的细节。\n     * 您可以生成一些模糊效果，范围从创建一个柔化的、未聚焦的外观到高斯模糊（就像通过半透明玻璃查看图像一样的朦胧的外观）。\n     * @version Egret 3.1.0\n     * @platform Web\n     * @see http://edn.egret.com/cn/docs/page/947#模糊滤镜 模糊滤镜\n     * @language zh_CN\n     */\n    var BlurFilter = (function (_super) {\n        __extends(BlurFilter, _super);\n        /**\n         * Initializes a BlurFilter object.\n         * @param blurX {number} The amount of horizontal blur. Valid values are 0 to 255 (floating point).\n         * @param blurY {number} The amount of vertical blur. Valid values are 0 to 255 (floating point).\n         * @param quality {number} The number of times to apply the filter.\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 创建一个 BlurFilter 对象。\n         * @param blurX {number} 水平模糊量。有效值为 0 到 255（浮点）。\n         * @param blurY {number} 垂直模糊量。有效值为 0 到 255（浮点）。\n         * @param quality {number} 应用滤镜的次数。暂未实现。\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        function BlurFilter(blurX, blurY, quality) {\n            if (blurX === void 0) { blurX = 4; }\n            if (blurY === void 0) { blurY = 4; }\n            if (quality === void 0) { quality = 1; }\n            var _this = _super.call(this) || this;\n            var self = _this;\n            self.type = \"blur\";\n            self.$blurX = blurX;\n            self.$blurY = blurY;\n            self.$quality = quality;\n            self.blurXFilter = new BlurXFilter(blurX);\n            self.blurYFilter = new BlurYFilter(blurY);\n            self.onPropertyChange();\n            return _this;\n        }\n        Object.defineProperty(BlurFilter.prototype, \"blurX\", {\n            /**\n             * The amount of horizontal blur.\n             * @version Egret 3.1.0\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 水平模糊量。\n             * @version Egret 3.1.0\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$blurX;\n            },\n            set: function (value) {\n                var self = this;\n                if (self.$blurX == value) {\n                    return;\n                }\n                self.$blurX = value;\n                self.blurXFilter.blurX = value;\n                self.onPropertyChange();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(BlurFilter.prototype, \"blurY\", {\n            /**\n             * The amount of vertical blur.\n             * @version Egret 3.1.0\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 垂直模糊量。\n             * @version Egret 3.1.0\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$blurY;\n            },\n            set: function (value) {\n                var self = this;\n                if (self.$blurY == value) {\n                    return;\n                }\n                self.$blurY = value;\n                self.blurYFilter.blurY = value;\n                self.onPropertyChange();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         */\n        BlurFilter.prototype.$toJson = function () {\n            return '{\"blurX\": ' + this.$blurX + ', \"blurY\": ' + this.$blurY + ', \"quality\": 1}';\n        };\n        BlurFilter.prototype.updatePadding = function () {\n            var self = this;\n            self.paddingLeft = self.blurX;\n            self.paddingRight = self.blurX;\n            self.paddingTop = self.blurY;\n            self.paddingBottom = self.blurY;\n        };\n        BlurFilter.prototype.onPropertyChange = function () {\n            var self = this;\n            self.updatePadding();\n            if (egret.nativeRender) {\n                egret_native.NativeDisplayObject.setFilterPadding(self.blurXFilter.$id, 0, 0, self.paddingLeft, self.paddingRight);\n                egret_native.NativeDisplayObject.setFilterPadding(self.blurYFilter.$id, self.paddingTop, self.paddingBottom, 0, 0);\n                egret_native.NativeDisplayObject.setDataToFilter(self);\n            }\n        };\n        return BlurFilter;\n    }(egret.Filter));\n    egret.BlurFilter = BlurFilter;\n    __reflect(BlurFilter.prototype, \"egret.BlurFilter\");\n    var BlurXFilter = (function (_super) {\n        __extends(BlurXFilter, _super);\n        function BlurXFilter(blurX) {\n            if (blurX === void 0) { blurX = 4; }\n            var _this = _super.call(this) || this;\n            if (egret.nativeRender) {\n                _this.type = \"blur\";\n            }\n            else {\n                _this.type = \"blurX\";\n            }\n            _this.$uniforms.blur = { x: blurX, y: 0 };\n            _this.onPropertyChange();\n            return _this;\n        }\n        Object.defineProperty(BlurXFilter.prototype, \"blurX\", {\n            get: function () {\n                return this.$uniforms.blur.x;\n            },\n            set: function (value) {\n                this.$uniforms.blur.x = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        return BlurXFilter;\n    }(egret.Filter));\n    __reflect(BlurXFilter.prototype, \"BlurXFilter\", [\"egret.IBlurXFilter\"]);\n    var BlurYFilter = (function (_super) {\n        __extends(BlurYFilter, _super);\n        function BlurYFilter(blurY) {\n            if (blurY === void 0) { blurY = 4; }\n            var _this = _super.call(this) || this;\n            if (egret.nativeRender) {\n                _this.type = \"blur\";\n            }\n            else {\n                _this.type = \"blurY\";\n            }\n            _this.$uniforms.blur = { x: 0, y: blurY };\n            _this.onPropertyChange();\n            return _this;\n        }\n        Object.defineProperty(BlurYFilter.prototype, \"blurY\", {\n            get: function () {\n                return this.$uniforms.blur.y;\n            },\n            set: function (value) {\n                this.$uniforms.blur.y = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        return BlurYFilter;\n    }(egret.Filter));\n    __reflect(BlurYFilter.prototype, \"BlurYFilter\", [\"egret.IBlurYFilter\"]);\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The ColorMatrixFilter class lets you apply a 4 x 5 matrix transformation on the RGBA color and alpha values of every pixel in the input image to produce a result with a new set of RGBA color and alpha values.\n     * It allows saturation changes, hue rotation, luminance to alpha, and various other effects.\n     * @version Egret 3.1.0\n     * @platform Web\n     * @see http://edn.egret.com/cn/docs/page/947 颜色矩阵滤镜\n     * @language en_US\n     */\n    /**\n     * 使用 ColorMatrixFilter 类可以将 4 x 5 矩阵转换应用于输入图像上的每个像素的 RGBA 颜色和 Alpha 值，以生成具有一组新的 RGBA 颜色和 Alpha 值的结果。\n     * 该类允许饱和度更改、色相旋转、亮度为 Alpha 以及各种其他效果。\n     * @version Egret 3.1.0\n     * @platform Web\n     * @see http://edn.egret.com/cn/docs/page/947 颜色矩阵滤镜\n     * @language zh_CN\n     */\n    var ColorMatrixFilter = (function (_super) {\n        __extends(ColorMatrixFilter, _super);\n        /**\n         * Initializes a ColorMatrixFilter object.\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 创建一个 ColorMatrixFilter 对象。\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        function ColorMatrixFilter(matrix) {\n            if (matrix === void 0) { matrix = null; }\n            var _this = _super.call(this) || this;\n            /**\n             * @private\n             */\n            _this.$matrix = [];\n            /**\n             * @private\n             */\n            _this.matrix2 = [];\n            _this.type = \"colorTransform\";\n            _this.$uniforms.matrix = [\n                1, 0, 0, 0,\n                0, 1, 0, 0,\n                0, 0, 1, 0,\n                0, 0, 0, 1\n            ];\n            _this.$uniforms.colorAdd = { x: 0, y: 0, z: 0, w: 0 };\n            _this.setMatrix(matrix);\n            _this.onPropertyChange();\n            return _this;\n        }\n        Object.defineProperty(ColorMatrixFilter.prototype, \"matrix\", {\n            /**\n             * A comma delimited list of 20 doubles that comprise a 4x5 matrix applied to the rendered element.\n             * The matrix is in row major order -- that is, the first five elements are multipled by the vector [srcR,srcG,srcB,srcA,1] to determine the output red value, the second five determine the output green value, etc.\n             * The value must either be an array or comma delimited string of 20 numbers.\n             * @version Egret 3.1.0\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 构成应用于所呈示的元素的一个 4x5 矩阵的、以逗号分隔的 20 个双精度数的列表。\n             * 矩阵以行作为主要顺序，即用第一行五个元素乘以矢量 [srcR,srcG,srcB,srcA,1] 以确定输出的红色值，用第二行的五个元素确定输出的绿色值，等等。\n             * 该值必须为 20 个数字组成的数组或以逗号分隔的字符串。\n             * @version Egret 3.1.0\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                for (var i = 0; i < 20; i++) {\n                    this.matrix2[i] = this.$matrix[i];\n                }\n                return this.matrix2;\n            },\n            set: function (value) {\n                this.setMatrix(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         */\n        ColorMatrixFilter.prototype.setMatrix = function (value) {\n            if (value) {\n                for (var i = 0; i < 20; i++) {\n                    this.$matrix[i] = value[i];\n                }\n            }\n            else {\n                for (var i = 0; i < 20; i++) {\n                    this.$matrix[i] = (i == 0 || i == 6 || i == 12 || i == 18) ? 1 : 0;\n                }\n            }\n            var $matrix = this.$matrix;\n            var matrix = this.$uniforms.matrix;\n            var colorAdd = this.$uniforms.colorAdd;\n            for (var i = 0, j = 0; i < $matrix.length; i++) {\n                if (i === 4) {\n                    colorAdd.x = $matrix[i] / 255;\n                }\n                else if (i === 9) {\n                    colorAdd.y = $matrix[i] / 255;\n                }\n                else if (i === 14) {\n                    colorAdd.z = $matrix[i] / 255;\n                }\n                else if (i === 19) {\n                    colorAdd.w = $matrix[i] / 255;\n                }\n                else {\n                    matrix[j] = $matrix[i];\n                    j++;\n                }\n            }\n            this.onPropertyChange();\n        };\n        /**\n         * @private\n         */\n        ColorMatrixFilter.prototype.$toJson = function () {\n            return '{\"matrix\": [' + this.$matrix.toString() + ']}';\n        };\n        return ColorMatrixFilter;\n    }(egret.Filter));\n    egret.ColorMatrixFilter = ColorMatrixFilter;\n    __reflect(ColorMatrixFilter.prototype, \"egret.ColorMatrixFilter\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var SOURCE_KEY_MAP = {};\n    var chars = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'.split('');\n    var uuid = new Array(36);\n    var rnd = 0, r;\n    /**\n     * generate uuid\n     * http://www.broofa.com/Tools/Math.uuid.htm\n     */\n    var generateUUID = function () {\n        for (var i = 0; i < 36; i++) {\n            if (i === 8 || i === 13 || i === 18 || i === 23) {\n                uuid[i] = '-';\n            }\n            else if (i === 14) {\n                uuid[i] = '4';\n            }\n            else {\n                if (rnd <= 0x02)\n                    rnd = 0x2000000 + (Math.random() * 0x1000000) | 0;\n                r = rnd & 0xf;\n                rnd = rnd >> 4;\n                uuid[i] = chars[(i === 19) ? (r & 0x3) | 0x8 : r];\n            }\n        }\n        return uuid.join('');\n    };\n    /**\n     * custom filter, now support WebGL mode only.\n     * @version Egret 4.1.0\n     * @platform Web\n     * @language en_US\n     */\n    /**\n     * 自定义滤镜，目前仅支持WebGL模式\n     * @version Egret 4.1.0\n     * @platform Web\n     * @language zh_CN\n     */\n    var CustomFilter = (function (_super) {\n        __extends(CustomFilter, _super);\n        /**\n         * Initialize the CustomFilter object.\n         * @param vertexSrc Custom vertex shader program.\n         * @param fragmentSrc Custom fragment shader program.\n         * @param uniforms The initial value of the uniform in the shader (key, value one-to-one correspondence), currently only supports numbers and arrays.\n         * @version Egret 4.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 初始化 CustomFilter 对象\n         * @param vertexSrc 自定义的顶点着色器程序。\n         * @param fragmentSrc 自定义的片段着色器程序。\n         * @param uniforms 着色器中uniform的初始值（key，value一一对应），目前仅支持数字和数组。\n         * @version Egret 4.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        function CustomFilter(vertexSrc, fragmentSrc, uniforms) {\n            if (uniforms === void 0) { uniforms = {}; }\n            var _this = _super.call(this) || this;\n            _this.$padding = 0;\n            _this.$vertexSrc = vertexSrc;\n            _this.$fragmentSrc = fragmentSrc;\n            var tempKey = vertexSrc + fragmentSrc;\n            if (!SOURCE_KEY_MAP[tempKey]) {\n                SOURCE_KEY_MAP[tempKey] = generateUUID();\n            }\n            _this.$shaderKey = SOURCE_KEY_MAP[tempKey];\n            _this.$uniforms = uniforms;\n            _this.type = \"custom\";\n            return _this;\n        }\n        Object.defineProperty(CustomFilter.prototype, \"padding\", {\n            /**\n             * The inner margin of the filter.\n             * If the desired area of the custom filter is larger than the original area (stroke, etc.), you need to set it manually.\n             * @version Egret 4.1.0\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 滤镜的内边距\n             * 如果自定义滤镜所需区域比原区域大（描边等），需要手动设置\n             * @version Egret 4.1.0\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$padding;\n            },\n            set: function (value) {\n                var self = this;\n                if (self.$padding == value) {\n                    return;\n                }\n                self.$padding = value;\n                self.onPropertyChange();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(CustomFilter.prototype, \"uniforms\", {\n            /**\n             * The initial value of the uniform in the shader (key, value one-to-one correspondence), currently only supports numbers and arrays.\n             * @version Egret 4.1.0\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 着色器中uniform的初始值（key，value一一对应），目前仅支持数字和数组。\n             * @version Egret 4.1.0\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$uniforms;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        CustomFilter.prototype.onPropertyChange = function () {\n            if (egret.nativeRender) {\n                var self_1 = this;\n                egret_native.NativeDisplayObject.setFilterPadding(self_1.$id, self_1.$padding, self_1.$padding, self_1.$padding, self_1.$padding);\n                egret_native.NativeDisplayObject.setDataToFilter(self_1);\n            }\n        };\n        return CustomFilter;\n    }(egret.Filter));\n    egret.CustomFilter = CustomFilter;\n    __reflect(CustomFilter.prototype, \"egret.CustomFilter\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @class egret.DropShadowFilter\n     * @classdesc\n     * 可使用 DropShadowFilter 类向显示对象添加投影。\n     * @extends egret.GlowFilter\n     * @version Egret 3.1.4\n     * @platform Web,Native\n     */\n    var DropShadowFilter = (function (_super) {\n        __extends(DropShadowFilter, _super);\n        /**\n         * Initializes a new DropShadowFilter instance.\n         * @method egret.DropShadowFilter#constructor\n         * @param distance {number} The offset distance of the bevel. Valid values are in pixels (floating point).\n         * @param angle {number} The angle of the bevel. Valid values are from 0 to 360°.\n         * @param color {number} The color of the glow. Valid values are in the hexadecimal format 0xRRGGBB. The default value is 0xFF0000.\n         * @param alpha {number} The alpha transparency value for the color. Valid values are 0 to 1. For example, .25 sets a transparency value of 25%. The default value is 1.\n         * @param blurX {number} The amount of horizontal blur. Valid values are 0 to 255 (floating point).\n         * @param blurY {number} The amount of vertical blur. Valid values are 0 to 255 (floating point).\n         * @param strength {number} The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the glow and the background. Valid values are 0 to 255.\n         * @param quality {number} The number of times to apply the filter.\n         * @param inner {boolean} Specifies whether the glow is an inner glow. The value true indicates an inner glow. The default is false, an outer glow (a glow around the outer edges of the object).\n         * @param knockout {number} Specifies whether the object has a knockout effect. A value of true makes the object's fill transparent and reveals the background color of the document. The default value is false (no knockout effect).\n         * @param hideObject {number} Indicates whether or not the object is hidden. The value true indicates that the object itself is not drawn; only the shadow is visible. The default is false, meaning that the object is shown.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 初始化 DropShadowFilter 对象\n         * @method egret.DropShadowFilter#constructor\n         * @param distance {number} 阴影的偏移距离，以像素为单位。\n         * @param angle {number} 阴影的角度，0 到 360 度（浮点）。\n         * @param color {number} 光晕颜色，采用十六进制格式 0xRRGGBB。默认值为 0xFF0000。\n         * @param alpha {number} 颜色的 Alpha 透明度值。有效值为 0 到 1。例如，0.25 设置透明度值为 25%。\n         * @param blurX {number} 水平模糊量。有效值为 0 到 255（浮点）。\n         * @param blurY {number} 垂直模糊量。有效值为 0 到 255（浮点）。\n         * @param strength {number} 印记或跨页的强度。该值越高，压印的颜色越深，而且发光与背景之间的对比度也越强。有效值为 0 到 255。\n         * @param quality {number} 应用滤镜的次数。暂未实现。\n         * @param inner {boolean} 指定发光是否为内侧发光。值 true 指定发光是内侧发光。值 false 指定发光是外侧发光（对象外缘周围的发光）。\n         * @param knockout {number} 指定对象是否具有挖空效果。值为 true 将使对象的填充变为透明，并显示文档的背景颜色。\n         * @param hideObject {number} 表示是否隐藏对象。如果值为 true，则表示没有绘制对象本身，只有阴影是可见的。默认值为 false（显示对象）。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        function DropShadowFilter(distance, angle, color, alpha, blurX, blurY, strength, quality, inner, knockout, hideObject) {\n            if (distance === void 0) { distance = 4.0; }\n            if (angle === void 0) { angle = 45; }\n            if (color === void 0) { color = 0; }\n            if (alpha === void 0) { alpha = 1.0; }\n            if (blurX === void 0) { blurX = 4.0; }\n            if (blurY === void 0) { blurY = 4.0; }\n            if (strength === void 0) { strength = 1.0; }\n            if (quality === void 0) { quality = 1; }\n            if (inner === void 0) { inner = false; }\n            if (knockout === void 0) { knockout = false; }\n            if (hideObject === void 0) { hideObject = false; }\n            var _this = _super.call(this, color, alpha, blurX, blurY, strength, quality, inner, knockout) || this;\n            var self = _this;\n            self.$distance = distance;\n            self.$angle = angle;\n            self.$hideObject = hideObject;\n            self.$uniforms.dist = distance;\n            self.$uniforms.angle = angle / 180 * Math.PI;\n            self.$uniforms.hideObject = hideObject ? 1 : 0;\n            self.onPropertyChange();\n            return _this;\n        }\n        Object.defineProperty(DropShadowFilter.prototype, \"distance\", {\n            /**\n             * The offset distance of the bevel.\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 阴影的偏移距离，以像素为单位。\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$distance;\n            },\n            set: function (value) {\n                var self = this;\n                if (self.$distance == value) {\n                    return;\n                }\n                self.$distance = value;\n                self.$uniforms.dist = value;\n                self.onPropertyChange();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(DropShadowFilter.prototype, \"angle\", {\n            /**\n             * The angle of the bevel.\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 阴影的角度。\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$angle;\n            },\n            set: function (value) {\n                var self = this;\n                if (self.$angle == value) {\n                    return;\n                }\n                self.$angle = value;\n                self.$uniforms.angle = value / 180 * Math.PI;\n                self.onPropertyChange();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(DropShadowFilter.prototype, \"hideObject\", {\n            /**\n             * Indicates whether or not the object is hidden.\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 表示是否隐藏对象。\n             * @version Egret 3.1.4\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$hideObject;\n            },\n            set: function (value) {\n                if (this.$hideObject == value) {\n                    return;\n                }\n                this.$hideObject = value;\n                this.$uniforms.hideObject = value ? 1 : 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         */\n        DropShadowFilter.prototype.$toJson = function () {\n            return '{\"distance\": ' + this.$distance + ', \"angle\": ' + this.$angle + ', \"color\": ' + this.$color + ', \"red\": ' + this.$red + ', \"green\": ' + this.$green + ', \"blue\": ' + this.$blue + ', \"alpha\": ' + this.$alpha + ', \"blurX\": ' + this.$blurX + ', \"blurY\": ' + this.blurY + ', \"strength\": ' + this.$strength + ', \"quality\": ' + this.$quality + ', \"inner\": ' + this.$inner + ', \"knockout\": ' + this.$knockout + ', \"hideObject\": ' + this.$hideObject + '}';\n        };\n        DropShadowFilter.prototype.updatePadding = function () {\n            var self = this;\n            self.paddingLeft = self.blurX;\n            self.paddingRight = self.blurX;\n            self.paddingTop = self.blurY;\n            self.paddingBottom = self.blurY;\n            var distance = self.distance || 0;\n            var angle = self.angle || 0;\n            var distanceX = 0;\n            var distanceY = 0;\n            if (distance != 0) {\n                distanceX = distance * egret.NumberUtils.cos(angle);\n                if (distanceX > 0) {\n                    distanceX = Math.ceil(distanceX);\n                }\n                else {\n                    distanceX = Math.floor(distanceX);\n                }\n                distanceY = distance * egret.NumberUtils.sin(angle);\n                if (distanceY > 0) {\n                    distanceY = Math.ceil(distanceY);\n                }\n                else {\n                    distanceY = Math.floor(distanceY);\n                }\n                self.paddingLeft += distanceX;\n                self.paddingRight += distanceX;\n                self.paddingTop += distanceY;\n                self.paddingBottom += distanceY;\n            }\n        };\n        return DropShadowFilter;\n    }(egret.GlowFilter));\n    egret.DropShadowFilter = DropShadowFilter;\n    __reflect(DropShadowFilter.prototype, \"egret.DropShadowFilter\");\n})(egret || (egret = {}));\nvar egret;\n(function (egret) {\n    /**\n     * The GradientType class provides values for the type parameter in the beginGradientFill() methods of the egret.Graphics class.\n     *\n     * @see egret.Graphics#beginGradientFill()\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * GradientType 类为 egret.Graphics 类的 beginGradientFill() 方法中的 type 参数提供值。\n     *\n     * @see egret.Graphics#beginGradientFill()\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var GradientType = (function () {\n        function GradientType() {\n        }\n        /**\n         * Value used to specify a linear gradient fill.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于指定线性渐变填充的值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        GradientType.LINEAR = \"linear\";\n        /**\n         * Value used to specify a radial gradient fill.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于指定放射状渐变填充的值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        GradientType.RADIAL = \"radial\";\n        return GradientType;\n    }());\n    egret.GradientType = GradientType;\n    __reflect(GradientType.prototype, \"egret.GradientType\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @private\n     * 格式化弧线角度的值\n     */\n    function clampAngle(value) {\n        value %= Math.PI * 2;\n        if (value < 0) {\n            value += Math.PI * 2;\n        }\n        return value;\n    }\n    /**\n     * @private\n     * 根据传入的锚点组返回贝塞尔曲线上的一组点,返回类型为egret.Point[];\n     * @param pointsData 锚点组,保存着所有控制点的x和y坐标,格式为[x0,y0,x1,y1,x2,y2...]\n     * @param pointsAmount 要获取的点的总个数，实际返回点数不一定等于该属性，与范围有关\n     * @param range 要获取的点与中心锚点的范围值，0~1之间\n     * @returns egret.Point[];\n     */\n    function createBezierPoints(pointsData, pointsAmount) {\n        var points = [];\n        for (var i = 0; i < pointsAmount; i++) {\n            var point = getBezierPointByFactor(pointsData, i / pointsAmount);\n            if (point)\n                points.push(point);\n        }\n        return points;\n    }\n    /**\n     * @private\n     * 根据锚点组与取值系数获取贝塞尔曲线上的一点\n     * @param pointsData 锚点组,保存着所有控制点的x和y坐标,格式为[x0,y0,x1,y1,x2,y2...]\n     * @param t 取值系数\n     * @returns egret.Point\n     */\n    function getBezierPointByFactor(pointsData, t) {\n        var i = 0;\n        var x = 0, y = 0;\n        var len = pointsData.length;\n        //根据传入的数据数量判断是二次贝塞尔还是三次贝塞尔\n        if (len / 2 == 3) {\n            //二次\n            var x0 = pointsData[i++];\n            var y0 = pointsData[i++];\n            var x1 = pointsData[i++];\n            var y1 = pointsData[i++];\n            var x2 = pointsData[i++];\n            var y2 = pointsData[i++];\n            x = getCurvePoint(x0, x1, x2, t);\n            y = getCurvePoint(y0, y1, y2, t);\n        }\n        else if (len / 2 == 4) {\n            //三次\n            var x0 = pointsData[i++];\n            var y0 = pointsData[i++];\n            var x1 = pointsData[i++];\n            var y1 = pointsData[i++];\n            var x2 = pointsData[i++];\n            var y2 = pointsData[i++];\n            var x3 = pointsData[i++];\n            var y3 = pointsData[i++];\n            x = getCubicCurvePoint(x0, x1, x2, x3, t);\n            y = getCubicCurvePoint(y0, y1, y2, y3, t);\n        }\n        return egret.Point.create(x, y);\n    }\n    /**\n     * 通过factor参数获取二次贝塞尔曲线上的位置\n     * 公式为B(t) = (1-t)^2 * P0 + 2t(1-t) * P1 + t^2 * P2\n     * @param value0 P0\n     * @param value1 P1\n     * @param value2 P2\n     * @param factor t，从0到1的闭区间\n     */\n    function getCurvePoint(value0, value1, value2, factor) {\n        var result = Math.pow((1 - factor), 2) * value0 + 2 * factor * (1 - factor) * value1 + Math.pow(factor, 2) * value2;\n        return result;\n    }\n    /**\n     * 通过factor参数获取三次贝塞尔曲线上的位置\n     * 公式为B(t) = (1-t)^3 * P0 + 3t(1-t)^2 * P1 + 3t^2 * (1-t) t^2 * P2 + t^3 *P3\n     * @param value0 P0\n     * @param value1 P1\n     * @param value2 P2\n     * @param value3 P3\n     * @param factor t，从0到1的闭区间\n     */\n    function getCubicCurvePoint(value0, value1, value2, value3, factor) {\n        var result = Math.pow((1 - factor), 3) * value0 + 3 * factor * Math.pow((1 - factor), 2) * value1 + 3 * (1 - factor) * Math.pow(factor, 2) * value2 + Math.pow(factor, 3) * value3;\n        return result;\n    }\n    /**\n     * The Graphics class contains a set of methods for creating vector shape. Display objects that support drawing include Sprite and Shape objects. Each class in these classes includes the graphics attribute that is a Graphics object.\n     * The following auxiliary functions are provided for ease of use: drawRect(), drawRoundRect(), drawCircle(), and drawEllipse().\n     * @see http://edn.egret.com/cn/docs/page/136 Draw Rectangle\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Graphics.ts\n     * @language en_US\n     */\n    /**\n     * Graphics 类包含一组可用来创建矢量形状的方法。支持绘制的显示对象包括 Sprite 和 Shape 对象。这些类中的每一个类都包括 graphics 属性，该属性是一个 Graphics 对象。\n     * 以下是为便于使用而提供的一些辅助函数：drawRect()、drawRoundRect()、drawCircle() 和 drawEllipse()。\n     * @see http://edn.egret.com/cn/docs/page/136 绘制矩形\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Graphics.ts\n     * @language zh_CN\n     */\n    var Graphics = (function (_super) {\n        __extends(Graphics, _super);\n        /**\n         * Initializes a Graphics object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 Graphics 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function Graphics() {\n            var _this = _super.call(this) || this;\n            /**\n             * 当前移动到的坐标X\n             */\n            _this.lastX = 0;\n            /**\n             * 当前移动到的坐标Y\n             */\n            _this.lastY = 0;\n            /**\n             * 当前正在绘制的填充\n             */\n            _this.fillPath = null;\n            /**\n             * 当前正在绘制的线条\n             */\n            _this.strokePath = null;\n            /**\n             * 线条的左上方宽度\n             */\n            _this.topLeftStrokeWidth = 0;\n            /**\n             * 线条的右下方宽度\n             */\n            _this.bottomRightStrokeWidth = 0;\n            /**\n             * @private\n             */\n            _this.minX = Infinity;\n            /**\n             * @private\n             */\n            _this.minY = Infinity;\n            /**\n             * @private\n             */\n            _this.maxX = -Infinity;\n            /**\n             * @private\n             */\n            _this.maxY = -Infinity;\n            /**\n             * 是否已经包含上一次moveTo的坐标点\n             */\n            _this.includeLastPosition = true;\n            _this.$renderNode = new egret.sys.GraphicsNode();\n            return _this;\n        }\n        /**\n         * @private\n         * 设置绑定到的目标显示对象\n         */\n        Graphics.prototype.$setTarget = function (target) {\n            if (this.$targetDisplay) {\n                this.$targetDisplay.$renderNode = null;\n            }\n            target.$renderNode = this.$renderNode;\n            this.$targetDisplay = target;\n            this.$targetIsSprite = target instanceof egret.Sprite;\n        };\n        /**\n         * 对1像素和3像素特殊处理，向右下角偏移0.5像素，以显示清晰锐利的线条。\n         */\n        Graphics.prototype.setStrokeWidth = function (width) {\n            switch (width) {\n                case 1:\n                    this.topLeftStrokeWidth = 0;\n                    this.bottomRightStrokeWidth = 1;\n                    break;\n                case 3:\n                    this.topLeftStrokeWidth = 1;\n                    this.bottomRightStrokeWidth = 2;\n                    break;\n                default:\n                    var half = Math.ceil(width * 0.5) | 0;\n                    this.topLeftStrokeWidth = half;\n                    this.bottomRightStrokeWidth = half;\n                    break;\n            }\n        };\n        /**\n         * Specify a simple single color fill that will be used for subsequent calls to other Graphics methods (for example, lineTo() and drawCircle()) when drawing.\n         * Calling the clear() method will clear the fill.\n         * @param color Filled color\n         * @param alpha Filled Alpha value\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定一种简单的单一颜色填充，在绘制时该填充将在随后对其他 Graphics 方法（如 lineTo() 或 drawCircle()）的调用中使用。\n         * 调用 clear() 方法会清除填充。\n         * @param color 填充的颜色\n         * @param alpha 填充的 Alpha 值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Graphics.prototype.beginFill = function (color, alpha) {\n            if (alpha === void 0) { alpha = 1; }\n            color = +color || 0;\n            alpha = +alpha || 0;\n            if (egret.nativeRender) {\n                this.$targetDisplay.$nativeDisplayObject.setBeginFill(color, alpha);\n            }\n            this.fillPath = this.$renderNode.beginFill(color, alpha, this.strokePath);\n            if (this.$renderNode.drawData.length > 1) {\n                this.fillPath.moveTo(this.lastX, this.lastY);\n            }\n        };\n        /**\n         * Specifies a gradient fill used by subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object.\n         * Calling the clear() method clears the fill.\n         * @param type A value from the GradientType class that specifies which gradient type to use: GradientType.LINEAR or GradientType.RADIAL.\n         * @param colors An array of RGB hexadecimal color values used in the gradient; for example, red is 0xFF0000, blue is 0x0000FF, and so on. You can specify up to 15 colors. For each color, specify a corresponding value in the alphas and ratios parameters.\n         * @param alphas An array of alpha values for the corresponding colors in the colors array;\n         * @param ratios An array of color distribution ratios; valid values are 0-255.\n         * @param matrix A transformation matrix as defined by the egret.Matrix class. The egret.Matrix class includes a createGradientBox() method, which lets you conveniently set up the matrix for use with the beginGradientFill() method.\n         * @platform Web,Native\n         * @version Egret 2.4\n         * @language en_US\n         */\n        /**\n         * 指定一种渐变填充，用于随后调用对象的其他 Graphics 方法（如 lineTo() 或 drawCircle()）。\n         * 调用 clear() 方法会清除填充。\n         * @param type 用于指定要使用哪种渐变类型的 GradientType 类的值：GradientType.LINEAR 或 GradientType.RADIAL。\n         * @param colors 渐变中使用的 RGB 十六进制颜色值的数组（例如，红色为 0xFF0000，蓝色为 0x0000FF，等等）。对于每种颜色，请在 alphas 和 ratios 参数中指定对应值。\n         * @param alphas colors 数组中对应颜色的 alpha 值数组。\n         * @param ratios 颜色分布比率的数组。有效值为 0 到 255。\n         * @param matrix 一个由 egret.Matrix 类定义的转换矩阵。egret.Matrix 类包括 createGradientBox() 方法，通过该方法可以方便地设置矩阵，以便与 beginGradientFill() 方法一起使用\n         * @platform Web,Native\n         * @version Egret 2.4\n         * @language zh_CN\n         */\n        Graphics.prototype.beginGradientFill = function (type, colors, alphas, ratios, matrix) {\n            if (matrix === void 0) { matrix = null; }\n            if (egret.nativeRender) {\n                this.$targetDisplay.$nativeDisplayObject.setBeginGradientFill(type, colors, alphas, ratios, matrix);\n            }\n            this.fillPath = this.$renderNode.beginGradientFill(type, colors, alphas, ratios, matrix, this.strokePath);\n            if (this.$renderNode.drawData.length > 1) {\n                this.fillPath.moveTo(this.lastX, this.lastY);\n            }\n        };\n        /**\n         * Apply fill to the lines and curves added after the previous calling to the beginFill() method.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 对从上一次调用 beginFill()方法之后添加的直线和曲线应用填充。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Graphics.prototype.endFill = function () {\n            if (egret.nativeRender) {\n                this.$targetDisplay.$nativeDisplayObject.setEndFill();\n            }\n            this.fillPath = null;\n        };\n        /**\n         * Specify a line style that will be used for subsequent calls to Graphics methods such as lineTo() and drawCircle().\n         * @param thickness An integer, indicating the thickness of the line in points. Valid values are 0 to 255. If a number is not specified, or if the parameter is undefined, a line is not drawn. If a value less than 0 is passed, the default value is 0. Value 0 indicates hairline thickness; the maximum thickness is 255. If a value greater than 255 is passed, the default value is 255.\n         * @param color A hexadecimal color value of the line (for example, red is 0xFF0000, and blue is 0x0000FF, etc.). If no value is specified, the default value is 0x000000 (black). Optional.\n         * @param alpha Indicates Alpha value of the line's color. Valid values are 0 to 1. If no value is specified, the default value is 1 (solid). If the value is less than 0, the default value is 0. If the value is greater than 1, the default value is 1.\n         * @param pixelHinting A boolean value that specifies whether to hint strokes to full pixels. This affects both the position of anchors of a curve and the line stroke size itself. With pixelHinting set to true, the line width is adjusted to full pixel width. With pixelHinting set to false, disjoints can appear for curves and straight lines.\n         * @param scaleMode Specifies the scale mode to be used\n         * @param caps Specifies the value of the CapsStyle class of the endpoint type at the end of the line. (default = CapsStyle.ROUND)\n         * @param joints Specifies the type of joint appearance of corner.  (default = JointStyle.ROUND)\n         * @param miterLimit Indicates the limit number of cut miter.\n         * @param lineDash set the line dash.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定一种线条样式以用于随后对 lineTo() 或 drawCircle() 等 Graphics 方法的调用。\n         * @param thickness 一个整数，以点为单位表示线条的粗细，有效值为 0 到 255。如果未指定数字，或者未定义该参数，则不绘制线条。如果传递的值小于 0，则默认值为 0。值 0 表示极细的粗细；最大粗细为 255。如果传递的值大于 255，则默认值为 255。\n         * @param color 线条的十六进制颜色值（例如，红色为 0xFF0000，蓝色为 0x0000FF 等）。如果未指明值，则默认值为 0x000000（黑色）。可选。\n         * @param alpha 表示线条颜色的 Alpha 值的数字；有效值为 0 到 1。如果未指明值，则默认值为 1（纯色）。如果值小于 0，则默认值为 0。如果值大于 1，则默认值为 1。\n         * @param pixelHinting 布尔型值，指定是否提示笔触采用完整像素。它同时影响曲线锚点的位置以及线条笔触大小本身。在 pixelHinting 设置为 true 的情况下，线条宽度会调整到完整像素宽度。在 pixelHinting 设置为 false 的情况下，对于曲线和直线可能会出现脱节。\n         * @param scaleMode 用于指定要使用的比例模式\n         * @param caps 用于指定线条末端处端点类型的 CapsStyle 类的值。默认值：CapsStyle.ROUND\n         * @param joints 指定用于拐角的连接外观的类型。默认值：JointStyle.ROUND\n         * @param miterLimit 用于表示剪切斜接的极限值的数字。\n         * @param lineDash 设置虚线样式。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Graphics.prototype.lineStyle = function (thickness, color, alpha, pixelHinting, scaleMode, caps, joints, miterLimit, lineDash) {\n            if (thickness === void 0) { thickness = NaN; }\n            if (color === void 0) { color = 0; }\n            if (alpha === void 0) { alpha = 1.0; }\n            if (pixelHinting === void 0) { pixelHinting = false; }\n            if (scaleMode === void 0) { scaleMode = \"normal\"; }\n            if (caps === void 0) { caps = null; }\n            if (joints === void 0) { joints = null; }\n            if (miterLimit === void 0) { miterLimit = 3; }\n            thickness = +thickness || 0;\n            color = +color || 0;\n            alpha = +alpha || 0;\n            miterLimit = +miterLimit || 0;\n            if (egret.nativeRender) {\n                this.$targetDisplay.$nativeDisplayObject.setLineStyle(thickness, color, alpha, pixelHinting, scaleMode, caps, joints, miterLimit);\n            }\n            if (thickness <= 0) {\n                this.strokePath = null;\n                this.setStrokeWidth(0);\n            }\n            else {\n                this.setStrokeWidth(thickness);\n                this.strokePath = this.$renderNode.lineStyle(thickness, color, alpha, caps, joints, miterLimit, lineDash);\n                if (this.$renderNode.drawData.length > 1) {\n                    this.strokePath.moveTo(this.lastX, this.lastY);\n                }\n            }\n        };\n        /**\n         * Draw a rectangle\n         * @param x x position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param y y position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param width Width of the rectangle (in pixels).\n         * @param height Height of the rectangle (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一个矩形\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Graphics.prototype.drawRect = function (x, y, width, height) {\n            x = +x || 0;\n            y = +y || 0;\n            width = +width || 0;\n            height = +height || 0;\n            if (egret.nativeRender) {\n                this.$targetDisplay.$nativeDisplayObject.setDrawRect(x, y, width, height);\n            }\n            var fillPath = this.fillPath;\n            var strokePath = this.strokePath;\n            fillPath && fillPath.drawRect(x, y, width, height);\n            strokePath && strokePath.drawRect(x, y, width, height);\n            this.extendBoundsByPoint(x + width, y + height);\n            this.updatePosition(x, y);\n            this.dirty();\n        };\n        /**\n         * Draw a rectangle with rounded corners.\n         * @param x x position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param y y position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param width Width of the rectangle (in pixels).\n         * @param height Height of the rectangle (in pixels).\n         * @param ellipseWidth Width used to draw an ellipse with rounded corners (in pixels).\n         * @param ellipseHeight Height used to draw an ellipse with rounded corners (in pixels). (Optional) If no value is specified, the default value matches the value of the ellipseWidth parameter.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一个圆角矩形。\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @param ellipseWidth 用于绘制圆角的椭圆的宽度（以像素为单位）。\n         * @param ellipseHeight 用于绘制圆角的椭圆的高度（以像素为单位）。 （可选）如果未指定值，则默认值与为 ellipseWidth 参数提供的值相匹配。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Graphics.prototype.drawRoundRect = function (x, y, width, height, ellipseWidth, ellipseHeight) {\n            x = +x || 0;\n            y = +y || 0;\n            width = +width || 0;\n            height = +height || 0;\n            ellipseWidth = +ellipseWidth || 0;\n            ellipseHeight = +ellipseHeight || 0;\n            if (egret.nativeRender) {\n                this.$targetDisplay.$nativeDisplayObject.setDrawRoundRect(x, y, width, height, ellipseWidth, ellipseHeight);\n            }\n            var fillPath = this.fillPath;\n            var strokePath = this.strokePath;\n            fillPath && fillPath.drawRoundRect(x, y, width, height, ellipseWidth, ellipseHeight);\n            strokePath && strokePath.drawRoundRect(x, y, width, height, ellipseWidth, ellipseHeight);\n            var radiusX = (ellipseWidth * 0.5) | 0;\n            var radiusY = ellipseHeight ? (ellipseHeight * 0.5) | 0 : radiusX;\n            var right = x + width;\n            var bottom = y + height;\n            var ybw = bottom - radiusY;\n            this.extendBoundsByPoint(x, y);\n            this.extendBoundsByPoint(right, bottom);\n            this.updatePosition(right, ybw);\n            this.dirty();\n        };\n        /**\n         * Draw a circle.\n         * @param x x position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param y y position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param r Radius of the circle (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一个圆。\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param radius 圆的半径（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Graphics.prototype.drawCircle = function (x, y, radius) {\n            x = +x || 0;\n            y = +y || 0;\n            radius = +radius || 0;\n            if (egret.nativeRender) {\n                this.$targetDisplay.$nativeDisplayObject.setDrawCircle(x, y, radius);\n            }\n            var fillPath = this.fillPath;\n            var strokePath = this.strokePath;\n            fillPath && fillPath.drawCircle(x, y, radius);\n            strokePath && strokePath.drawCircle(x, y, radius);\n            //-1 +2 解决WebGL裁切问题\n            this.extendBoundsByPoint(x - radius - 1, y - radius - 1);\n            this.extendBoundsByPoint(x + radius + 2, y + radius + 2);\n            this.updatePosition(x + radius, y);\n            this.dirty();\n        };\n        /**\n         * Draw an ellipse.\n         * @param x A number indicating the horizontal position, relative to the registration point of the parent display object (in pixels).\n         * @param y A number indicating the vertical position, relative to the registration point of the parent display object (in pixels).\n         * @param width Width of the rectangle (in pixels).\n         * @param height Height of the rectangle (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一个椭圆。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Graphics.prototype.drawEllipse = function (x, y, width, height) {\n            x = +x || 0;\n            y = +y || 0;\n            width = +width || 0;\n            height = +height || 0;\n            if (egret.nativeRender) {\n                this.$targetDisplay.$nativeDisplayObject.setDrawEllipse(x, y, width, height);\n            }\n            var fillPath = this.fillPath;\n            var strokePath = this.strokePath;\n            fillPath && fillPath.drawEllipse(x, y, width, height);\n            strokePath && strokePath.drawEllipse(x, y, width, height);\n            //-1 +2 解决WebGL裁切问题\n            this.extendBoundsByPoint(x - 1, y - 1);\n            this.extendBoundsByPoint(x + width + 2, y + height + 2);\n            this.updatePosition(x + width, y + height * 0.5);\n            this.dirty();\n        };\n        /**\n         * Move the current drawing position to (x, y). If any of these parameters is missed, calling this method will fail and the current drawing position keeps unchanged.\n         * @param x A number indicating the horizontal position, relative to the registration point of the parent display object (in pixels).\n         * @param y A number indicating the vertical position, relative to the registration point of the parent display object (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将当前绘图位置移动到 (x, y)。如果缺少任何一个参数，则此方法将失败，并且当前绘图位置不改变。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Graphics.prototype.moveTo = function (x, y) {\n            x = +x || 0;\n            y = +y || 0;\n            if (egret.nativeRender) {\n                this.$targetDisplay.$nativeDisplayObject.setMoveTo(x, y);\n            }\n            var fillPath = this.fillPath;\n            var strokePath = this.strokePath;\n            fillPath && fillPath.moveTo(x, y);\n            strokePath && strokePath.moveTo(x, y);\n            this.includeLastPosition = false;\n            this.lastX = x;\n            this.lastY = y;\n            this.dirty();\n        };\n        /**\n         * Draw a straight line from the current drawing position to (x, y) using the current line style; the current drawing position is then set to (x, y).\n         * @param x A number indicating the horizontal position, relative to the registration point of the parent display object (in pixels).\n         * @param y A number indicating the vertical position, relative to the registration point of the parent display object (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用当前线条样式绘制一条从当前绘图位置开始到 (x, y) 结束的直线；当前绘图位置随后会设置为 (x, y)。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Graphics.prototype.lineTo = function (x, y) {\n            x = +x || 0;\n            y = +y || 0;\n            if (egret.nativeRender) {\n                this.$targetDisplay.$nativeDisplayObject.setLineTo(x, y);\n            }\n            var fillPath = this.fillPath;\n            var strokePath = this.strokePath;\n            fillPath && fillPath.lineTo(x, y);\n            strokePath && strokePath.lineTo(x, y);\n            this.updatePosition(x, y);\n            this.dirty();\n        };\n        /**\n         * Draw a quadratic Bezier curve from the current drawing position to (anchorX, anchorY) using the current line style according to the control points specified by (controlX, controlY). The current drawing position is then set to (anchorX, anchorY).\n         * If the curveTo() method is called before the moveTo() method, the default value of the current drawing position is (0, 0). If any of these parameters is missed, calling this method will fail and the current drawing position keeps unchanged.\n         * The drawn curve is a quadratic Bezier curve. A quadratic Bezier curve contains two anchor points and one control point. The curve interpolates the two anchor points and bends to the control point.\n         * @param controlX A number indicating the horizontal position of the control point, relative to the registration point of the parent display object.\n         * @param controlY A number indicating the vertical position of the control point, relative to the registration point of the parent display object.\n         * @param anchorX A number indicating the horizontal position of the next anchor point, relative to the registration point of the parent display object.\n         * @param anchorY A number indicating the vertical position of the next anchor point, relative to the registration point of the parent display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用当前线条样式和由 (controlX, controlY) 指定的控制点绘制一条从当前绘图位置开始到 (anchorX, anchorY) 结束的二次贝塞尔曲线。当前绘图位置随后设置为 (anchorX, anchorY)。\n         * 如果在调用 moveTo() 方法之前调用了 curveTo() 方法，则当前绘图位置的默认值为 (0, 0)。如果缺少任何一个参数，则此方法将失败，并且当前绘图位置不改变。\n         * 绘制的曲线是二次贝塞尔曲线。二次贝塞尔曲线包含两个锚点和一个控制点。该曲线内插这两个锚点，并向控制点弯曲。\n         * @param controlX 一个数字，指定控制点相对于父显示对象注册点的水平位置。\n         * @param controlY 一个数字，指定控制点相对于父显示对象注册点的垂直位置。\n         * @param anchorX 一个数字，指定下一个锚点相对于父显示对象注册点的水平位置。\n         * @param anchorY 一个数字，指定下一个锚点相对于父显示对象注册点的垂直位置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Graphics.prototype.curveTo = function (controlX, controlY, anchorX, anchorY) {\n            controlX = +controlX || 0;\n            controlY = +controlY || 0;\n            anchorX = +anchorX || 0;\n            anchorY = +anchorY || 0;\n            if (egret.nativeRender) {\n                this.$targetDisplay.$nativeDisplayObject.setCurveTo(controlX, controlY, anchorX, anchorY);\n            }\n            var fillPath = this.fillPath;\n            var strokePath = this.strokePath;\n            fillPath && fillPath.curveTo(controlX, controlY, anchorX, anchorY);\n            strokePath && strokePath.curveTo(controlX, controlY, anchorX, anchorY);\n            var lastX = this.lastX || 0;\n            var lastY = this.lastY || 0;\n            var bezierPoints = createBezierPoints([lastX, lastY, controlX, controlY, anchorX, anchorY], 50);\n            for (var i = 0; i < bezierPoints.length; i++) {\n                var point = bezierPoints[i];\n                this.extendBoundsByPoint(point.x, point.y);\n                egret.Point.release(point);\n            }\n            this.extendBoundsByPoint(anchorX, anchorY);\n            this.updatePosition(anchorX, anchorY);\n            this.dirty();\n        };\n        /**\n         * Draws a cubic Bezier curve from the current drawing position to the specified anchor. Cubic Bezier curves consist of two anchor points and two control points. The curve interpolates the two anchor points and two control points to the curve.\n         * @param controlX1 Specifies the first control point relative to the registration point of the parent display the horizontal position of the object.\n         * @param controlY1 Specifies the first control point relative to the registration point of the parent display the vertical position of the object.\n         * @param controlX2 Specify the second control point relative to the registration point of the parent display the horizontal position of the object.\n         * @param controlY2 Specify the second control point relative to the registration point of the parent display the vertical position of the object.\n         * @param anchorX Specifies the anchor point relative to the registration point of the parent display the horizontal position of the object.\n         * @param anchorY Specifies the anchor point relative to the registration point of the parent display the vertical position of the object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从当前绘图位置到指定的锚点绘制一条三次贝塞尔曲线。三次贝塞尔曲线由两个锚点和两个控制点组成。该曲线内插这两个锚点，并向两个控制点弯曲。\n         * @param controlX1 指定首个控制点相对于父显示对象的注册点的水平位置。\n         * @param controlY1 指定首个控制点相对于父显示对象的注册点的垂直位置。\n         * @param controlX2 指定第二个控制点相对于父显示对象的注册点的水平位置。\n         * @param controlY2 指定第二个控制点相对于父显示对象的注册点的垂直位置。\n         * @param anchorX 指定锚点相对于父显示对象的注册点的水平位置。\n         * @param anchorY 指定锚点相对于父显示对象的注册点的垂直位置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Graphics.prototype.cubicCurveTo = function (controlX1, controlY1, controlX2, controlY2, anchorX, anchorY) {\n            controlX1 = +controlX1 || 0;\n            controlY1 = +controlY1 || 0;\n            controlX2 = +controlX2 || 0;\n            controlY2 = +controlY2 || 0;\n            anchorX = +anchorX || 0;\n            anchorY = +anchorY || 0;\n            if (egret.nativeRender) {\n                this.$targetDisplay.$nativeDisplayObject.setCubicCurveTo(controlX1, controlY1, controlX2, controlY2, anchorX, anchorY);\n            }\n            var fillPath = this.fillPath;\n            var strokePath = this.strokePath;\n            fillPath && fillPath.cubicCurveTo(controlX1, controlY1, controlX2, controlY2, anchorX, anchorY);\n            strokePath && strokePath.cubicCurveTo(controlX1, controlY1, controlX2, controlY2, anchorX, anchorY);\n            var lastX = this.lastX || 0;\n            var lastY = this.lastY || 0;\n            var bezierPoints = createBezierPoints([lastX, lastY, controlX1, controlY1, controlX2, controlY2, anchorX, anchorY], 50);\n            for (var i = 0; i < bezierPoints.length; i++) {\n                var point = bezierPoints[i];\n                this.extendBoundsByPoint(point.x, point.y);\n                egret.Point.release(point);\n            }\n            this.extendBoundsByPoint(anchorX, anchorY);\n            this.updatePosition(anchorX, anchorY);\n            this.dirty();\n        };\n        /**\n         * adds an arc to the path which is centered at (x, y) position with radius r starting at startAngle and ending\n         * at endAngle going in the given direction by anticlockwise (defaulting to clockwise).\n         * @param x The x coordinate of the arc's center.\n         * @param y The y coordinate of the arc's center.\n         * @param radius The arc's radius.\n         * @param startAngle The angle at which the arc starts, measured clockwise from the positive x axis and expressed in radians.\n         * @param endAngle The angle at which the arc ends, measured clockwise from the positive x axis and expressed in radians.\n         * @param anticlockwise if true, causes the arc to be drawn counter-clockwise between the two angles. By default it is drawn clockwise.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一段圆弧路径。圆弧路径的圆心在 (x, y) 位置，半径为 r ，根据anticlockwise （默认为顺时针）指定的方向从 startAngle 开始绘制，到 endAngle 结束。\n         * @param x 圆弧中心（圆心）的 x 轴坐标。\n         * @param y 圆弧中心（圆心）的 y 轴坐标。\n         * @param radius 圆弧的半径。\n         * @param startAngle 圆弧的起始点， x轴方向开始计算，单位以弧度表示。\n         * @param endAngle 圆弧的终点， 单位以弧度表示。\n         * @param anticlockwise 如果为 true，逆时针绘制圆弧，反之，顺时针绘制。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Graphics.prototype.drawArc = function (x, y, radius, startAngle, endAngle, anticlockwise) {\n            if (radius < 0 || startAngle === endAngle) {\n                return;\n            }\n            x = +x || 0;\n            y = +y || 0;\n            radius = +radius || 0;\n            startAngle = +startAngle || 0;\n            endAngle = +endAngle || 0;\n            anticlockwise = !!anticlockwise;\n            startAngle = clampAngle(startAngle);\n            endAngle = clampAngle(endAngle);\n            if (egret.nativeRender) {\n                this.$targetDisplay.$nativeDisplayObject.setDrawArc(x, y, radius, startAngle, endAngle, anticlockwise);\n            }\n            var fillPath = this.fillPath;\n            var strokePath = this.strokePath;\n            if (fillPath) {\n                fillPath.$lastX = this.lastX;\n                fillPath.$lastY = this.lastY;\n                fillPath.drawArc(x, y, radius, startAngle, endAngle, anticlockwise);\n            }\n            if (strokePath) {\n                strokePath.$lastX = this.lastX;\n                strokePath.$lastY = this.lastY;\n                strokePath.drawArc(x, y, radius, startAngle, endAngle, anticlockwise);\n            }\n            if (anticlockwise) {\n                this.arcBounds(x, y, radius, endAngle, startAngle);\n            }\n            else {\n                this.arcBounds(x, y, radius, startAngle, endAngle);\n            }\n            var endX = x + Math.cos(endAngle) * radius;\n            var endY = y + Math.sin(endAngle) * radius;\n            this.updatePosition(endX, endY);\n            this.dirty();\n        };\n        Graphics.prototype.dirty = function () {\n            var self = this;\n            self.$renderNode.dirtyRender = true;\n            if (!egret.nativeRender) {\n                var target = self.$targetDisplay;\n                target.$cacheDirty = true;\n                var p = target.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = target.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        /**\n         * @private\n         * 测量圆弧的矩形大小\n         */\n        Graphics.prototype.arcBounds = function (x, y, radius, startAngle, endAngle) {\n            var PI = Math.PI;\n            if (Math.abs(startAngle - endAngle) < 0.01) {\n                this.extendBoundsByPoint(x - radius, y - radius);\n                this.extendBoundsByPoint(x + radius, y + radius);\n                return;\n            }\n            if (startAngle > endAngle) {\n                endAngle += PI * 2;\n            }\n            var startX = Math.cos(startAngle) * radius;\n            var endX = Math.cos(endAngle) * radius;\n            var xMin = Math.min(startX, endX);\n            var xMax = Math.max(startX, endX);\n            var startY = Math.sin(startAngle) * radius;\n            var endY = Math.sin(endAngle) * radius;\n            var yMin = Math.min(startY, endY);\n            var yMax = Math.max(startY, endY);\n            var startRange = startAngle / (PI * 0.5);\n            var endRange = endAngle / (PI * 0.5);\n            for (var i = Math.ceil(startRange); i <= endRange; i++) {\n                switch (i % 4) {\n                    case 0:\n                        xMax = radius;\n                        break;\n                    case 1:\n                        yMax = radius;\n                        break;\n                    case 2:\n                        xMin = -radius;\n                        break;\n                    case 3:\n                        yMin = -radius;\n                        break;\n                }\n            }\n            xMin = Math.floor(xMin);\n            yMin = Math.floor(yMin);\n            xMax = Math.ceil(xMax);\n            yMax = Math.ceil(yMax);\n            this.extendBoundsByPoint(xMin + x, yMin + y);\n            this.extendBoundsByPoint(xMax + x, yMax + y);\n        };\n        /**\n         * Clear graphics that are drawn to this Graphics object, and reset fill and line style settings.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 清除绘制到此 Graphics 对象的图形，并重置填充和线条样式设置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Graphics.prototype.clear = function () {\n            if (egret.nativeRender) {\n                this.$targetDisplay.$nativeDisplayObject.setGraphicsClear();\n            }\n            this.$renderNode.clear();\n            this.updatePosition(0, 0);\n            this.minX = Infinity;\n            this.minY = Infinity;\n            this.maxX = -Infinity;\n            this.maxY = -Infinity;\n            this.dirty();\n        };\n        /**\n         * @private\n         */\n        Graphics.prototype.extendBoundsByPoint = function (x, y) {\n            this.extendBoundsByX(x);\n            this.extendBoundsByY(y);\n        };\n        /**\n         * @private\n         */\n        Graphics.prototype.extendBoundsByX = function (x) {\n            this.minX = Math.min(this.minX, x - this.topLeftStrokeWidth);\n            this.maxX = Math.max(this.maxX, x + this.bottomRightStrokeWidth);\n            this.updateNodeBounds();\n        };\n        /**\n         * @private\n         */\n        Graphics.prototype.extendBoundsByY = function (y) {\n            this.minY = Math.min(this.minY, y - this.topLeftStrokeWidth);\n            this.maxY = Math.max(this.maxY, y + this.bottomRightStrokeWidth);\n            this.updateNodeBounds();\n        };\n        /**\n         * @private\n         */\n        Graphics.prototype.updateNodeBounds = function () {\n            var node = this.$renderNode;\n            node.x = this.minX;\n            node.y = this.minY;\n            node.width = Math.ceil(this.maxX - this.minX);\n            node.height = Math.ceil(this.maxY - this.minY);\n        };\n        /**\n         * 更新当前的lineX和lineY值，并标记尺寸失效。\n         * @private\n         */\n        Graphics.prototype.updatePosition = function (x, y) {\n            if (!this.includeLastPosition) {\n                this.extendBoundsByPoint(this.lastX, this.lastY);\n                this.includeLastPosition = true;\n            }\n            this.lastX = x;\n            this.lastY = y;\n            this.extendBoundsByPoint(x, y);\n        };\n        /**\n         * @private\n         */\n        Graphics.prototype.$measureContentBounds = function (bounds) {\n            if (this.minX === Infinity) {\n                bounds.setEmpty();\n            }\n            else {\n                bounds.setTo(this.minX, this.minY, this.maxX - this.minX, this.maxY - this.minY);\n            }\n        };\n        /**\n         * @private\n         *\n         */\n        Graphics.prototype.$hitTest = function (stageX, stageY) {\n            var target = this.$targetDisplay;\n            var m = target.$getInvertedConcatenatedMatrix();\n            var localX = m.a * stageX + m.c * stageY + m.tx;\n            var localY = m.b * stageX + m.d * stageY + m.ty;\n            var buffer = egret.sys.canvasHitTestBuffer;\n            buffer.resize(3, 3);\n            var node = this.$renderNode;\n            var matrix = egret.Matrix.create();\n            matrix.identity();\n            matrix.translate(1 - localX, 1 - localY);\n            egret.sys.canvasRenderer.drawNodeToBuffer(node, buffer, matrix, true);\n            egret.Matrix.release(matrix);\n            try {\n                var data = buffer.getPixels(1, 1);\n                if (data[3] === 0) {\n                    return null;\n                }\n            }\n            catch (e) {\n                throw new Error(egret.sys.tr(1039));\n            }\n            return target;\n        };\n        /**\n         * @private\n         */\n        Graphics.prototype.$onRemoveFromStage = function () {\n            if (this.$renderNode) {\n                this.$renderNode.clean();\n            }\n            if (egret.nativeRender) {\n                egret_native.NativeDisplayObject.disposeGraphicData(this);\n            }\n        };\n        return Graphics;\n    }(egret.HashObject));\n    egret.Graphics = Graphics;\n    __reflect(Graphics.prototype, \"egret.Graphics\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var PI = Math.PI;\n    var TwoPI = PI * 2;\n    var DEG_TO_RAD = PI / 180;\n    var matrixPool = [];\n    /**\n     * The Matrix class represents a transformation matrix that determines how to map points from one coordinate space to\n     * another. You can perform various graphical transformations on a display object by setting the properties of a Matrix\n     * object, applying that Matrix object to the matrix property of a display object, These transformation functions include\n     * translation (x and y repositioning), rotation, scaling, and skewing.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Matrix.ts\n     * @language en_US\n     */\n    /**\n     * Matrix 类表示一个转换矩阵，它确定如何将点从一个坐标空间映射到另一个坐标空间。\n     * 您可以对一个显示对象执行不同的图形转换，方法是设置 Matrix 对象的属性，将该 Matrix\n     * 对象应用于显示对象的 matrix 属性。这些转换函数包括平移（x 和 y 重新定位）、旋转、缩放和倾斜。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Matrix.ts\n     * @language zh_CN\n     */\n    var Matrix = (function (_super) {\n        __extends(Matrix, _super);\n        /**\n         * Creates a new Matrix object with the specified parameters.\n         * @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image..\n         * @param tx The distance by which to translate each point along the x axis.\n         * @param ty The distance by which to translate each point along the y axis.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定参数创建一个 Matrix 对象\n         * @param a 缩放或旋转图像时影响像素沿 x 轴定位的值。\n         * @param b 旋转或倾斜图像时影响像素沿 y 轴定位的值。\n         * @param c 旋转或倾斜图像时影响像素沿 x 轴定位的值。\n         * @param d 缩放或旋转图像时影响像素沿 y 轴定位的值。\n         * @param tx 沿 x 轴平移每个点的距离。\n         * @param ty 沿 y 轴平移每个点的距离。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function Matrix(a, b, c, d, tx, ty) {\n            if (a === void 0) { a = 1; }\n            if (b === void 0) { b = 0; }\n            if (c === void 0) { c = 0; }\n            if (d === void 0) { d = 1; }\n            if (tx === void 0) { tx = 0; }\n            if (ty === void 0) { ty = 0; }\n            var _this = _super.call(this) || this;\n            _this.a = a;\n            _this.b = b;\n            _this.c = c;\n            _this.d = d;\n            _this.tx = tx;\n            _this.ty = ty;\n            return _this;\n        }\n        /**\n         * Releases a matrix instance to the object pool\n         * @param matrix matrix that Needs to be recycled\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放一个Matrix实例到对象池\n         * @param matrix 需要回收的 matrix\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.release = function (matrix) {\n            if (!matrix) {\n                return;\n            }\n            matrixPool.push(matrix);\n        };\n        /**\n         * get a matrix instance from the object pool or create a new one.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从对象池中取出或创建一个新的Matrix对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.create = function () {\n            var matrix = matrixPool.pop();\n            if (!matrix) {\n                matrix = new Matrix();\n            }\n            return matrix;\n        };\n        /**\n         * Returns a new Matrix object that is a clone of this matrix, with an exact copy of the contained object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回一个新的 Matrix 对象，它是此矩阵的克隆，带有与所含对象完全相同的副本。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.clone = function () {\n            return new Matrix(this.a, this.b, this.c, this.d, this.tx, this.ty);\n        };\n        /**\n         * Concatenates a matrix with the current matrix, effectively combining the geometric effects of the two. In mathematical\n         * terms, concatenating two matrixes is the same as combining them using matrix multiplication.\n         * @param other The matrix to be concatenated to the source matrix.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将某个矩阵与当前矩阵连接，从而将这两个矩阵的几何效果有效地结合在一起。在数学术语中，将两个矩阵连接起来与使用矩阵乘法将它们结合起来是相同的。\n         * @param other 要连接到源矩阵的矩阵。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.concat = function (other) {\n            var a = this.a * other.a;\n            var b = 0.0;\n            var c = 0.0;\n            var d = this.d * other.d;\n            var tx = this.tx * other.a + other.tx;\n            var ty = this.ty * other.d + other.ty;\n            if (this.b !== 0.0 || this.c !== 0.0 || other.b !== 0.0 || other.c !== 0.0) {\n                a += this.b * other.c;\n                d += this.c * other.b;\n                b += this.a * other.b + this.b * other.d;\n                c += this.c * other.a + this.d * other.c;\n                tx += this.ty * other.c;\n                ty += this.tx * other.b;\n            }\n            this.a = a;\n            this.b = b;\n            this.c = c;\n            this.d = d;\n            this.tx = tx;\n            this.ty = ty;\n        };\n        /**\n         * Copies all of the matrix data from the source Point object into the calling Matrix object.\n         * @param other  The Matrix object from which to copy the data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将源 Matrix 对象中的所有矩阵数据复制到调用方 Matrix 对象中。\n         * @param other 要拷贝的目标矩阵\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.copyFrom = function (other) {\n            this.a = other.a;\n            this.b = other.b;\n            this.c = other.c;\n            this.d = other.d;\n            this.tx = other.tx;\n            this.ty = other.ty;\n            return this;\n        };\n        /**\n         * Sets each matrix property to a value that causes a null transformation. An object transformed by applying an\n         * identity matrix will be identical to the original. After calling the identity() method, the resulting matrix\n         * has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 为每个矩阵属性设置一个值，该值将导致矩阵无转换。通过应用恒等矩阵转换的对象将与原始对象完全相同。\n         * 调用 identity() 方法后，生成的矩阵具有以下属性：a=1、b=0、c=0、d=1、tx=0 和 ty=0。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.identity = function () {\n            this.a = this.d = 1;\n            this.b = this.c = this.tx = this.ty = 0;\n        };\n        /**\n         * Performs the opposite transformation of the original matrix. You can apply an inverted matrix to an object to\n         * undo the transformation performed when applying the original matrix.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 执行原始矩阵的逆转换。\n         * 您可以将一个逆矩阵应用于对象来撤消在应用原始矩阵时执行的转换。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.invert = function () {\n            this.$invertInto(this);\n        };\n        /**\n         * @private\n         */\n        Matrix.prototype.$invertInto = function (target) {\n            var a = this.a;\n            var b = this.b;\n            var c = this.c;\n            var d = this.d;\n            var tx = this.tx;\n            var ty = this.ty;\n            if (b == 0 && c == 0) {\n                target.b = target.c = 0;\n                if (a == 0 || d == 0) {\n                    target.a = target.d = target.tx = target.ty = 0;\n                }\n                else {\n                    a = target.a = 1 / a;\n                    d = target.d = 1 / d;\n                    target.tx = -a * tx;\n                    target.ty = -d * ty;\n                }\n                return;\n            }\n            var determinant = a * d - b * c;\n            if (determinant == 0) {\n                target.identity();\n                return;\n            }\n            determinant = 1 / determinant;\n            var k = target.a = d * determinant;\n            b = target.b = -b * determinant;\n            c = target.c = -c * determinant;\n            d = target.d = a * determinant;\n            target.tx = -(k * tx + c * ty);\n            target.ty = -(b * tx + d * ty);\n        };\n        /**\n         * Applies a rotation transformation to the Matrix object.\n         * The rotate() method alters the a, b, c, and d properties of the Matrix object.\n         * @param angle The rotation angle in radians.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 对 Matrix 对象应用旋转转换。\n         * rotate() 方法将更改 Matrix 对象的 a、b、c 和 d 属性。\n         * @param angle 以弧度为单位的旋转角度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.rotate = function (angle) {\n            angle = +angle;\n            if (angle !== 0) {\n                angle = angle / DEG_TO_RAD;\n                var u = egret.NumberUtils.cos(angle);\n                var v = egret.NumberUtils.sin(angle);\n                var ta = this.a;\n                var tb = this.b;\n                var tc = this.c;\n                var td = this.d;\n                var ttx = this.tx;\n                var tty = this.ty;\n                this.a = ta * u - tb * v;\n                this.b = ta * v + tb * u;\n                this.c = tc * u - td * v;\n                this.d = tc * v + td * u;\n                this.tx = ttx * u - tty * v;\n                this.ty = ttx * v + tty * u;\n            }\n        };\n        /**\n         * Applies a scaling transformation to the matrix. The x axis is multiplied by sx, and the y axis it is multiplied by sy.\n         * The scale() method alters the a and d properties of the Matrix object.\n         * @param sx A multiplier used to scale the object along the x axis.\n         * @param sy A multiplier used to scale the object along the y axis.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 对矩阵应用缩放转换。x 轴乘以 sx，y 轴乘以 sy。\n         * scale() 方法将更改 Matrix 对象的 a 和 d 属性。\n         * @param sx 用于沿 x 轴缩放对象的乘数。\n         * @param sy 用于沿 y 轴缩放对象的乘数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.scale = function (sx, sy) {\n            if (sx !== 1) {\n                this.a *= sx;\n                this.c *= sx;\n                this.tx *= sx;\n            }\n            if (sy !== 1) {\n                this.b *= sy;\n                this.d *= sy;\n                this.ty *= sy;\n            }\n        };\n        /**\n         * Sets the members of Matrix to the specified values\n         * @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image..\n         * @param tx The distance by which to translate each point along the x axis.\n         * @param ty The distance by which to translate each point along the y axis.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Matrix 的成员设置为指定值\n         * @param a 缩放或旋转图像时影响像素沿 x 轴定位的值。\n         * @param b 旋转或倾斜图像时影响像素沿 y 轴定位的值。\n         * @param c 旋转或倾斜图像时影响像素沿 x 轴定位的值。\n         * @param d 缩放或旋转图像时影响像素沿 y 轴定位的值。\n         * @param tx 沿 x 轴平移每个点的距离。\n         * @param ty 沿 y 轴平移每个点的距离。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.setTo = function (a, b, c, d, tx, ty) {\n            this.a = a;\n            this.b = b;\n            this.c = c;\n            this.d = d;\n            this.tx = tx;\n            this.ty = ty;\n            return this;\n        };\n        /**\n         * Returns the result of applying the geometric transformation represented by the Matrix object to the specified point.\n         * @param pointX The x coordinate for which you want to get the result of the Matrix transformation.\n         * @param pointY The y coordinate for which you want to get the result of the Matrix transformation.\n         * @param resultPoint A reusable instance of Point for saving the results. Passing this parameter can reduce the\n         * number of reallocate objects, which allows you to get better code execution performance.\n         * @returns The point resulting from applying the Matrix transformation.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回将 Matrix 对象表示的几何转换应用于指定点所产生的结果。\n         * @param pointX 想要获得其矩阵转换结果的点的x坐标。\n         * @param pointY 想要获得其矩阵转换结果的点的y坐标。\n         * @param resultPoint 框架建议尽可能减少创建对象次数来优化性能，可以从外部传入一个复用的Point对象来存储结果，若不传入将创建一个新的Point对象返回。\n         * @returns 由应用矩阵转换所产生的点。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.transformPoint = function (pointX, pointY, resultPoint) {\n            var x = this.a * pointX + this.c * pointY + this.tx;\n            var y = this.b * pointX + this.d * pointY + this.ty;\n            if (resultPoint) {\n                resultPoint.setTo(x, y);\n                return resultPoint;\n            }\n            return new egret.Point(x, y);\n        };\n        /**\n         * Translates the matrix along the x and y axes, as specified by the dx and dy parameters.\n         * @param dx The amount of movement along the x axis to the right, in pixels.\n         * @param dy The amount of movement down along the y axis, in pixels.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 沿 x 和 y 轴平移矩阵，由 dx 和 dy 参数指定。\n         * @param dx 沿 x 轴向右移动的量（以像素为单位）。\n         * @param dy 沿 y 轴向下移动的量（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.translate = function (dx, dy) {\n            this.tx += dx;\n            this.ty += dy;\n        };\n        /**\n         * Determines whether two matrixes are equal.\n         * @param other The matrix to be compared.\n         * @returns A value of true if the object is equal to this Matrix object; false if it is not equal.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否与另一个矩阵数据相等\n         * @param other 要比较的另一个矩阵对象。\n         * @returns 是否相等，ture表示相等。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.equals = function (other) {\n            return this.a == other.a && this.b == other.b &&\n                this.c == other.c && this.d == other.d &&\n                this.tx == other.tx && this.ty == other.ty;\n        };\n        /**\n         * prepend matrix\n         * @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image..\n         * @param tx The distance by which to translate each point along the x axis.\n         * @param ty The distance by which to translate each point along the y axis.\n         * @returns matrix\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 前置矩阵\n         * @param a 缩放或旋转图像时影响像素沿 x 轴定位的值\n         * @param b 缩放或旋转图像时影响像素沿 y 轴定位的值\n         * @param c 缩放或旋转图像时影响像素沿 x 轴定位的值\n         * @param d 缩放或旋转图像时影响像素沿 y 轴定位的值\n         * @param tx 沿 x 轴平移每个点的距离\n         * @param ty 沿 y 轴平移每个点的距离\n         * @returns 矩阵自身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.prepend = function (a, b, c, d, tx, ty) {\n            var tx1 = this.tx;\n            if (a != 1 || b != 0 || c != 0 || d != 1) {\n                var a1 = this.a;\n                var c1 = this.c;\n                this.a = a1 * a + this.b * c;\n                this.b = a1 * b + this.b * d;\n                this.c = c1 * a + this.d * c;\n                this.d = c1 * b + this.d * d;\n            }\n            this.tx = tx1 * a + this.ty * c + tx;\n            this.ty = tx1 * b + this.ty * d + ty;\n            return this;\n        };\n        /**\n         * append matrix\n         * @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image..\n         * @param tx The distance by which to translate each point along the x axis.\n         * @param ty The distance by which to translate each point along the y axis.\n         * @returns matrix\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 后置矩阵\n         * @param a 缩放或旋转图像时影响像素沿 x 轴定位的值\n         * @param b 缩放或旋转图像时影响像素沿 y 轴定位的值\n         * @param c 缩放或旋转图像时影响像素沿 x 轴定位的值\n         * @param d 缩放或旋转图像时影响像素沿 y 轴定位的值\n         * @param tx 沿 x 轴平移每个点的距离\n         * @param ty 沿 y 轴平移每个点的距离\n         * @returns 矩阵自身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.append = function (a, b, c, d, tx, ty) {\n            var a1 = this.a;\n            var b1 = this.b;\n            var c1 = this.c;\n            var d1 = this.d;\n            if (a != 1 || b != 0 || c != 0 || d != 1) {\n                this.a = a * a1 + b * c1;\n                this.b = a * b1 + b * d1;\n                this.c = c * a1 + d * c1;\n                this.d = c * b1 + d * d1;\n            }\n            this.tx = tx * a1 + ty * c1 + this.tx;\n            this.ty = tx * b1 + ty * d1 + this.ty;\n            return this;\n        };\n        /**\n         * Given a point in the pretransform coordinate space, returns the coordinates of that point after the transformation occurs.\n         * Unlike the standard transformation applied using the transformPoint() method, the deltaTransformPoint() method's transformation does not consider the translation parameters tx and ty.\n         * @param point The point for which you want to get the result of the matrix transformation.\n         * @returns The point resulting from applying the matrix transformation.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果给定预转换坐标空间中的点，则此方法返回发生转换后该点的坐标。\n         * 与使用 transformPoint() 方法应用的标准转换不同，deltaTransformPoint() 方法的转换不考虑转换参数 tx 和 ty。\n         * @param point 想要获得其矩阵转换结果的点\n         * @returns 由应用矩阵转换所产生的点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.deltaTransformPoint = function (point) {\n            var self = this;\n            var x = self.a * point.x + self.c * point.y;\n            var y = self.b * point.x + self.d * point.y;\n            return new egret.Point(x, y);\n        };\n        /**\n         * Returns a text value listing the properties of the Matrix object.\n         * @returns A string containing the values of the properties of the Matrix object: a, b, c, d, tx, and ty.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回将 Matrix 对象表示的几何转换应用于指定点所产生的结果。\n         * @returns 一个字符串，它包含 Matrix 对象的属性值：a、b、c、d、tx 和 ty。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.toString = function () {\n            return \"(a=\" + this.a + \", b=\" + this.b + \", c=\" + this.c + \", d=\" + this.d + \", tx=\" + this.tx + \", ty=\" + this.ty + \")\";\n        };\n        /**\n         * Includes parameters for scaling, rotation, and translation. When applied to a matrix it sets the matrix's values based on those parameters.\n         * @param scaleX The factor by which to scale horizontally.\n         * @param scaleY The factor by which scale vertically.\n         * @param rotation The amount to rotate, in radians.\n         * @param tx The number of pixels to translate (move) to the right along the x axis.\n         * @param ty The number of pixels to translate (move) down along the y axis.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 包括用于缩放、旋转和转换的参数。当应用于矩阵时，该方法会基于这些参数设置矩阵的值。\n         * @param scaleX 水平缩放所用的系数\n         * @param scaleY 垂直缩放所用的系数\n         * @param rotation 旋转量（以弧度为单位）\n         * @param tx 沿 x 轴向右平移（移动）的像素数\n         * @param ty 沿 y 轴向下平移（移动）的像素数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.createBox = function (scaleX, scaleY, rotation, tx, ty) {\n            if (rotation === void 0) { rotation = 0; }\n            if (tx === void 0) { tx = 0; }\n            if (ty === void 0) { ty = 0; }\n            var self = this;\n            if (rotation !== 0) {\n                rotation = rotation / DEG_TO_RAD;\n                var u = egret.NumberUtils.cos(rotation);\n                var v = egret.NumberUtils.sin(rotation);\n                self.a = u * scaleX;\n                self.b = v * scaleY;\n                self.c = -v * scaleX;\n                self.d = u * scaleY;\n            }\n            else {\n                self.a = scaleX;\n                self.b = 0;\n                self.c = 0;\n                self.d = scaleY;\n            }\n            self.tx = tx;\n            self.ty = ty;\n        };\n        /**\n         * Creates the specific style of matrix expected by the beginGradientFill() and lineGradientStyle() methods of the Graphics class.\n         * Width and height are scaled to a scaleX/scaleY pair and the tx/ty values are offset by half the width and height.\n         * @param width The width of the gradient box.\n         * @param height The height of the gradient box.\n         * @param rotation The amount to rotate, in radians.\n         * @param tx The distance, in pixels, to translate to the right along the x axis. This value is offset by half of the width parameter.\n         * @param ty The distance, in pixels, to translate down along the y axis. This value is offset by half of the height parameter.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建 Graphics 类的 beginGradientFill() 和 lineGradientStyle() 方法所需的矩阵的特定样式。\n         * 宽度和高度被缩放为 scaleX/scaleY 对，而 tx/ty 值偏移了宽度和高度的一半。\n         * @param width 渐变框的宽度\n         * @param height 渐变框的高度\n         * @param rotation 旋转量（以弧度为单位）\n         * @param tx 沿 x 轴向右平移的距离（以像素为单位）。此值将偏移 width 参数的一半\n         * @param ty 沿 y 轴向下平移的距离（以像素为单位）。此值将偏移 height 参数的一半\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Matrix.prototype.createGradientBox = function (width, height, rotation, tx, ty) {\n            if (rotation === void 0) { rotation = 0; }\n            if (tx === void 0) { tx = 0; }\n            if (ty === void 0) { ty = 0; }\n            this.createBox(width / 1638.4, height / 1638.4, rotation, tx + width / 2, ty + height / 2);\n        };\n        /**\n         * @private\n         */\n        Matrix.prototype.$transformBounds = function (bounds) {\n            var a = this.a;\n            var b = this.b;\n            var c = this.c;\n            var d = this.d;\n            var tx = this.tx;\n            var ty = this.ty;\n            var x = bounds.x;\n            var y = bounds.y;\n            var xMax = x + bounds.width;\n            var yMax = y + bounds.height;\n            var x0 = a * x + c * y + tx;\n            var y0 = b * x + d * y + ty;\n            var x1 = a * xMax + c * y + tx;\n            var y1 = b * xMax + d * y + ty;\n            var x2 = a * xMax + c * yMax + tx;\n            var y2 = b * xMax + d * yMax + ty;\n            var x3 = a * x + c * yMax + tx;\n            var y3 = b * x + d * yMax + ty;\n            var tmp = 0;\n            if (x0 > x1) {\n                tmp = x0;\n                x0 = x1;\n                x1 = tmp;\n            }\n            if (x2 > x3) {\n                tmp = x2;\n                x2 = x3;\n                x3 = tmp;\n            }\n            bounds.x = Math.floor(x0 < x2 ? x0 : x2);\n            bounds.width = Math.ceil((x1 > x3 ? x1 : x3) - bounds.x);\n            if (y0 > y1) {\n                tmp = y0;\n                y0 = y1;\n                y1 = tmp;\n            }\n            if (y2 > y3) {\n                tmp = y2;\n                y2 = y3;\n                y3 = tmp;\n            }\n            bounds.y = Math.floor(y0 < y2 ? y0 : y2);\n            bounds.height = Math.ceil((y1 > y3 ? y1 : y3) - bounds.y);\n        };\n        /**\n         * @private\n         */\n        Matrix.prototype.getDeterminant = function () {\n            return this.a * this.d - this.b * this.c;\n        };\n        /**\n         * @private\n         */\n        Matrix.prototype.$getScaleX = function () {\n            var m = this;\n            if (m.b == 0) {\n                return m.a;\n            }\n            var result = Math.sqrt(m.a * m.a + m.b * m.b);\n            return this.getDeterminant() < 0 ? -result : result;\n        };\n        /**\n         * @private\n         */\n        Matrix.prototype.$getScaleY = function () {\n            var m = this;\n            if (m.c == 0) {\n                return m.d;\n            }\n            var result = Math.sqrt(m.c * m.c + m.d * m.d);\n            return this.getDeterminant() < 0 ? -result : result;\n        };\n        /**\n         * @private\n         */\n        Matrix.prototype.$getSkewX = function () {\n            if (this.d < 0) {\n                return Math.atan2(this.d, this.c) + (PI / 2);\n            }\n            else {\n                return Math.atan2(this.d, this.c) - (PI / 2);\n            }\n        };\n        /**\n         * @private\n         */\n        Matrix.prototype.$getSkewY = function () {\n            if (this.a < 0) {\n                return Math.atan2(this.b, this.a) - PI;\n            }\n            else {\n                return Math.atan2(this.b, this.a);\n            }\n        };\n        /**\n         * @private\n         */\n        Matrix.prototype.$updateScaleAndRotation = function (scaleX, scaleY, skewX, skewY) {\n            if ((skewX == 0 || skewX == TwoPI) && (skewY == 0 || skewY == TwoPI)) {\n                this.a = scaleX;\n                this.b = this.c = 0;\n                this.d = scaleY;\n                return;\n            }\n            skewX = skewX / DEG_TO_RAD;\n            skewY = skewY / DEG_TO_RAD;\n            var u = egret.NumberUtils.cos(skewX);\n            var v = egret.NumberUtils.sin(skewX);\n            if (skewX == skewY) {\n                this.a = u * scaleX;\n                this.b = v * scaleX;\n            }\n            else {\n                this.a = egret.NumberUtils.cos(skewY) * scaleX;\n                this.b = egret.NumberUtils.sin(skewY) * scaleX;\n            }\n            this.c = -v * scaleY;\n            this.d = u * scaleY;\n        };\n        /**\n         * @private\n         * target = other * this\n         */\n        Matrix.prototype.$preMultiplyInto = function (other, target) {\n            var a = other.a * this.a;\n            var b = 0.0;\n            var c = 0.0;\n            var d = other.d * this.d;\n            var tx = other.tx * this.a + this.tx;\n            var ty = other.ty * this.d + this.ty;\n            if (other.b !== 0.0 || other.c !== 0.0 || this.b !== 0.0 || this.c !== 0.0) {\n                a += other.b * this.c;\n                d += other.c * this.b;\n                b += other.a * this.b + other.b * this.d;\n                c += other.c * this.a + other.d * this.c;\n                tx += other.ty * this.c;\n                ty += other.tx * this.b;\n            }\n            target.a = a;\n            target.b = b;\n            target.c = c;\n            target.d = d;\n            target.tx = tx;\n            target.ty = ty;\n        };\n        return Matrix;\n    }(egret.HashObject));\n    egret.Matrix = Matrix;\n    __reflect(Matrix.prototype, \"egret.Matrix\");\n    /**\n     * @private\n     * 仅供框架内复用，要防止暴露引用到外部。\n     */\n    egret.$TempMatrix = new Matrix();\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var rectanglePool = [];\n    /**\n     * A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its\n     * width and its height.<br/>\n     * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of\n     * one property has no effect on the others. However, the right and bottom properties are integrally related to those\n     * four properties. For example, if you change the value of the right property, the value of the width property changes;\n     * if you change the bottom property, the value of the height property changes.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Rectangle.ts\n     * @language en_US\n     */\n    /**\n     * Rectangle 对象是按其位置（由它左上角的点 (x, y) 确定）以及宽度和高度定义的区域。<br/>\n     * Rectangle 类的 x、y、width 和 height 属性相互独立；更改一个属性的值不会影响其他属性。\n     * 但是，right 和 bottom 属性与这四个属性是整体相关的。例如，如果更改 right 属性的值，则 width\n     * 属性的值将发生变化；如果更改 bottom 属性，则 height 属性的值将发生变化。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Rectangle.ts\n     * @language zh_CN\n     */\n    var Rectangle = (function (_super) {\n        __extends(Rectangle, _super);\n        /**\n         * Creates a new Rectangle object with the top-left corner specified by the x and y parameters and with the specified\n         * width and height parameters.\n         * @param x The x coordinate of the top-left corner of the rectangle.\n         * @param y The y coordinate of the top-left corner of the rectangle.\n         * @param width The width of the rectangle, in pixels.\n         * @param height The height of the rectangle, in pixels.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个新 Rectangle 对象，其左上角由 x 和 y 参数指定，并具有指定的 width 和 height 参数。\n         * @param x 矩形左上角的 x 坐标。\n         * @param y 矩形左上角的 y 坐标。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function Rectangle(x, y, width, height) {\n            if (x === void 0) { x = 0; }\n            if (y === void 0) { y = 0; }\n            if (width === void 0) { width = 0; }\n            if (height === void 0) { height = 0; }\n            var _this = _super.call(this) || this;\n            _this.x = x;\n            _this.y = y;\n            _this.width = width;\n            _this.height = height;\n            return _this;\n        }\n        /**\n         * Releases a rectangle instance to the object pool.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放一个Rectangle实例到对象池\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.release = function (rect) {\n            if (!rect) {\n                return;\n            }\n            rectanglePool.push(rect);\n        };\n        /**\n         * get a rectangle instance from the object pool or create a new one.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从对象池中取出或创建一个新的Rectangle对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.create = function () {\n            var rect = rectanglePool.pop();\n            if (!rect) {\n                rect = new Rectangle();\n            }\n            return rect;\n        };\n        Object.defineProperty(Rectangle.prototype, \"right\", {\n            /**\n             * The sum of the x and width properties.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * x 和 width 属性的和。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.x + this.width;\n            },\n            set: function (value) {\n                this.width = value - this.x;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Rectangle.prototype, \"bottom\", {\n            /**\n             * The sum of the y and height properties.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * y 和 height 属性的和。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.y + this.height;\n            },\n            set: function (value) {\n                this.height = value - this.y;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Rectangle.prototype, \"left\", {\n            /**\n             * The x coordinate of the top-left corner of the rectangle. Changing the left property of a Rectangle object has\n             * no effect on the y and height properties. However it does affect the width property, whereas changing the x value\n             * does not affect the width property.\n             * The value of the left property is equal to the value of the x property.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 矩形左上角的 x 坐标。更改 Rectangle 对象的 left 属性对 y 和 height 属性没有影响。但是，它会影响 width 属性，而更改 x 值不会影响 width 属性。\n             * left 属性的值等于 x 属性的值。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.x;\n            },\n            set: function (value) {\n                this.width += this.x - value;\n                this.x = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Rectangle.prototype, \"top\", {\n            /**\n             * The y coordinate of the top-left corner of the rectangle. Changing the top property of a Rectangle object has\n             * no effect on the x and width properties. However it does affect the height property, whereas changing the y\n             * value does not affect the height property.<br/>\n             * The value of the top property is equal to the value of the y property.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 矩形左上角的 y 坐标。更改 Rectangle 对象的 top 属性对 x 和 width 属性没有影响。但是，它会影响 height 属性，而更改 y 值不会影响 height 属性。<br/>\n             * top 属性的值等于 y 属性的值。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.y;\n            },\n            set: function (value) {\n                this.height += this.y - value;\n                this.y = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Rectangle.prototype, \"topLeft\", {\n            /**\n             * The location of the Rectangle object's top-left corner, determined by the x and y coordinates of the point.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 由该点的 x 和 y 坐标确定的 Rectangle 对象左上角的位置。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return new egret.Point(this.left, this.top);\n            },\n            set: function (value) {\n                this.top = value.y;\n                this.left = value.x;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Rectangle.prototype, \"bottomRight\", {\n            /**\n             * The location of the Rectangle object's bottom-right corner, determined by the values of the right and bottom properties.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 由 right 和 bottom 属性的值确定的 Rectangle 对象的右下角的位置。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return new egret.Point(this.right, this.bottom);\n            },\n            set: function (value) {\n                this.bottom = value.y;\n                this.right = value.x;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * Copies all of rectangle data from the source Rectangle object into the calling Rectangle object.\n         * @param sourceRect The Rectangle object from which to copy the data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将源 Rectangle 对象中的所有矩形数据复制到调用方 Rectangle 对象中。\n         * @param sourceRect 要从中复制数据的 Rectangle 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.copyFrom = function (sourceRect) {\n            this.x = sourceRect.x;\n            this.y = sourceRect.y;\n            this.width = sourceRect.width;\n            this.height = sourceRect.height;\n            return this;\n        };\n        /**\n         * Sets the members of Rectangle to the specified values\n         * @param x The x coordinate of the top-left corner of the rectangle.\n         * @param y The y coordinate of the top-left corner of the rectangle.\n         * @param width The width of the rectangle, in pixels.\n         * @param height The height of the rectangle, in pixels.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Rectangle 的成员设置为指定值\n         * @param x 矩形左上角的 x 坐标。\n         * @param y 矩形左上角的 y 坐标。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.setTo = function (x, y, width, height) {\n            this.x = x;\n            this.y = y;\n            this.width = width;\n            this.height = height;\n            return this;\n        };\n        /**\n         * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object.\n         * @param x The x coordinate (horizontal position) of the point.\n         * @param y The y coordinate (vertical position) of the point.\n         * @returns A value of true if the Rectangle object contains the specified point; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定由此 Rectangle 对象定义的矩形区域内是否包含指定的点。\n         * @param x 检测点的x轴\n         * @param y 检测点的y轴\n         * @returns 如果检测点位于矩形内，返回true，否则，返回false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.contains = function (x, y) {\n            return this.x <= x &&\n                this.x + this.width >= x &&\n                this.y <= y &&\n                this.y + this.height >= y;\n        };\n        /**\n         * If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle object, returns\n         * the area of intersection as a Rectangle object. If the rectangles do not intersect, this method returns an empty\n         * Rectangle object with its properties set to 0.\n         * @param toIntersect The Rectangle object to compare against to see if it intersects with this Rectangle object.\n         * @returns A Rectangle object that equals the area of intersection. If the rectangles do not intersect, this method\n         * returns an empty Rectangle object; that is, a rectangle with its x, y, width, and height properties set to 0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果在 toIntersect 参数中指定的 Rectangle 对象与此 Rectangle 对象相交，则返回交集区域作为 Rectangle 对象。如果矩形不相交，\n         * 则此方法返回一个空的 Rectangle 对象，其属性设置为 0。\n         * @param toIntersect 要对照比较以查看其是否与此 Rectangle 对象相交的 Rectangle 对象。\n         * @returns 等于交集区域的 Rectangle 对象。如果该矩形不相交，则此方法返回一个空的 Rectangle 对象；即，其 x、y、width 和\n         * height 属性均设置为 0 的矩形。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.intersection = function (toIntersect) {\n            return this.clone().$intersectInPlace(toIntersect);\n        };\n        /**\n         * Increases the size of the Rectangle object by the specified amounts, in pixels.\n         * The center point of the Rectangle object stays the same, and its size increases to the left and right by the dx value, and to the top and the bottom by the dy value.\n         * @param dx The value to be added to the left and the right of the Rectangle object.\n         * @param dy The value to be added to the top and the bottom of the Rectangle.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 按指定量增加 Rectangle 对象的大小（以像素为单位）\n         * 保持 Rectangle 对象的中心点不变，使用 dx 值横向增加它的大小，使用 dy 值纵向增加它的大小。\n         * @param dx Rectangle 对象横向增加的值。\n         * @param dy Rectangle 对象纵向增加的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.inflate = function (dx, dy) {\n            this.x -= dx;\n            this.width += 2 * dx;\n            this.y -= dy;\n            this.height += 2 * dy;\n        };\n        /**\n         * @private\n         */\n        Rectangle.prototype.$intersectInPlace = function (clipRect) {\n            var x0 = this.x;\n            var y0 = this.y;\n            var x1 = clipRect.x;\n            var y1 = clipRect.y;\n            var l = Math.max(x0, x1);\n            var r = Math.min(x0 + this.width, x1 + clipRect.width);\n            if (l <= r) {\n                var t = Math.max(y0, y1);\n                var b = Math.min(y0 + this.height, y1 + clipRect.height);\n                if (t <= b) {\n                    this.setTo(l, t, r - l, b - t);\n                    return this;\n                }\n            }\n            this.setEmpty();\n            return this;\n        };\n        /**\n         * Determines whether the object specified in the toIntersect parameter intersects with this Rectangle object.\n         * This method checks the x, y, width, and height properties of the specified Rectangle object to see if it\n         * intersects with this Rectangle object.\n         * @param toIntersect The Rectangle object to compare against this Rectangle object.\n         * @returns A value of true if the specified object intersects with this Rectangle object; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定在 toIntersect 参数中指定的对象是否与此 Rectangle 对象相交。此方法检查指定的 Rectangle\n         * 对象的 x、y、width 和 height 属性，以查看它是否与此 Rectangle 对象相交。\n         * @param toIntersect 要与此 Rectangle 对象比较的 Rectangle 对象。\n         * @returns 如果两个矩形相交，返回true，否则返回false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.intersects = function (toIntersect) {\n            return Math.max(this.x, toIntersect.x) <= Math.min(this.right, toIntersect.right)\n                && Math.max(this.y, toIntersect.y) <= Math.min(this.bottom, toIntersect.bottom);\n        };\n        /**\n         * Determines whether or not this Rectangle object is empty.\n         * @returns A value of true if the Rectangle object's width or height is less than or equal to 0; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定此 Rectangle 对象是否为空。\n         * @returns 如果 Rectangle 对象的宽度或高度小于等于 0，则返回 true 值，否则返回 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.isEmpty = function () {\n            return this.width <= 0 || this.height <= 0;\n        };\n        /**\n         * Sets all of the Rectangle object's properties to 0. A Rectangle object is empty if its width or height is less than or equal to 0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Rectangle 对象的所有属性设置为 0。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.setEmpty = function () {\n            this.x = 0;\n            this.y = 0;\n            this.width = 0;\n            this.height = 0;\n        };\n        /**\n         * Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object.\n         * @returns A new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回一个新的 Rectangle 对象，其 x、y、width 和 height 属性的值与原始 Rectangle 对象的对应值相同。\n         * @returns 新的 Rectangle 对象，其 x、y、width 和 height 属性的值与原始 Rectangle 对象的对应值相同。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.clone = function () {\n            return new Rectangle(this.x, this.y, this.width, this.height);\n        };\n        /**\n         * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object.\n         * This method is similar to the Rectangle.contains() method, except that it takes a Point object as a parameter.\n         * @param point The point, as represented by its x and y coordinates.\n         * @returns A value of true if the Rectangle object contains the specified point; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定由此 Rectangle 对象定义的矩形区域内是否包含指定的点。\n         * 此方法与 Rectangle.contains() 方法类似，只不过它采用 Point 对象作为参数。\n         * @param point 包含点对象\n         * @returns 如果包含，返回true，否则返回false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.containsPoint = function (point) {\n            if (this.x <= point.x\n                && this.x + this.width > point.x\n                && this.y <= point.y\n                && this.y + this.height > point.y) {\n                return true;\n            }\n            return false;\n        };\n        /**\n         * Determines whether the Rectangle object specified by the rect parameter is contained within this Rectangle object.\n         * A Rectangle object is said to contain another if the second Rectangle object falls entirely within the boundaries of the first.\n         * @param rect The Rectangle object being checked.\n         * @returns A value of true if the Rectangle object that you specify is contained by this Rectangle object; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定此 Rectangle 对象内是否包含由 rect 参数指定的 Rectangle 对象。\n         * 如果一个 Rectangle 对象完全在另一个 Rectangle 的边界内，我们说第二个 Rectangle 包含第一个 Rectangle。\n         * @param rect 所检查的 Rectangle 对象\n         * @returns 如果此 Rectangle 对象包含您指定的 Rectangle 对象，则返回 true 值，否则返回 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.containsRect = function (rect) {\n            var r1 = rect.x + rect.width;\n            var b1 = rect.y + rect.height;\n            var r2 = this.x + this.width;\n            var b2 = this.y + this.height;\n            return (rect.x >= this.x) && (rect.x < r2) && (rect.y >= this.y) && (rect.y < b2) && (r1 > this.x) && (r1 <= r2) && (b1 > this.y) && (b1 <= b2);\n        };\n        /**\n         * Determines whether the object specified in the toCompare parameter is equal to this Rectangle object.\n         * This method compares the x, y, width, and height properties of an object against the same properties of this Rectangle object.\n         * @param The rectangle to compare to this Rectangle object.\n         * @returns A value of true if the object has exactly the same values for the x, y, width, and height properties as this Rectangle object; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定在 toCompare 参数中指定的对象是否等于此 Rectangle 对象。\n         * 此方法将某个对象的 x、y、width 和 height 属性与此 Rectangle 对象所对应的相同属性进行比较。\n         * @param toCompare 要与此 Rectangle 对象进行比较的矩形。\n         * @returns 如果对象具有与此 Rectangle 对象完全相同的 x、y、width 和 height 属性值，则返回 true 值，否则返回 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.equals = function (toCompare) {\n            if (this === toCompare) {\n                return true;\n            }\n            return this.x === toCompare.x && this.y === toCompare.y\n                && this.width === toCompare.width && this.height === toCompare.height;\n        };\n        /**\n         * Increases the size of the Rectangle object. This method is similar to the Rectangle.inflate() method except it takes a Point object as a parameter.\n         * @param point 此 Point 对象的 x 属性用于增加 Rectangle 对象的水平尺寸。y 属性用于增加 Rectangle 对象的垂直尺寸。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 增加 Rectangle 对象的大小。此方法与 Rectangle.inflate() 方法类似，只不过它采用 Point 对象作为参数。\n         * @param point The x property of this Point object is used to increase the horizontal dimension of the Rectangle object. The y property is used to increase the vertical dimension of the Rectangle object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.inflatePoint = function (point) {\n            this.inflate(point.x, point.y);\n        };\n        /**\n         * Adjusts the location of the Rectangle object, as determined by its top-left corner, by the specified amounts.\n         * @param dx Moves the x value of the Rectangle object by this amount.\n         * @param dy Moves the y value of the Rectangle object by this amount.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 按指定量调整 Rectangle 对象的位置（由其左上角确定）。\n         * @param dx 将 Rectangle 对象的 x 值移动此数量。\n         * @param dy 将 Rectangle 对象的 t 值移动此数量。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.offset = function (dx, dy) {\n            this.x += dx;\n            this.y += dy;\n        };\n        /**\n         * Adjusts the location of the Rectangle object using a Point object as a parameter. This method is similar to the Rectangle.offset() method, except that it takes a Point object as a parameter.\n         * @param point A Point object to use to offset this Rectangle object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Point 对象用作参数来调整 Rectangle 对象的位置。此方法与 Rectangle.offset() 方法类似，只不过它采用 Point 对象作为参数。\n         * @param point 要用于偏移此 Rectangle 对象的 Point 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.offsetPoint = function (point) {\n            this.offset(point.x, point.y);\n        };\n        /**\n         * Builds and returns a string that lists the horizontal and vertical positions and the width and height of the Rectangle object.\n         * @returns A string listing the value of each of the following properties of the Rectangle object: x, y, width, and height.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 生成并返回一个字符串，该字符串列出 Rectangle 对象的水平位置和垂直位置以及高度和宽度。\n         * @returns 一个字符串，它列出了 Rectangle 对象的下列各个属性的值：x、y、width 和 height。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.toString = function () {\n            return \"(x=\" + this.x + \", y=\" + this.y + \", width=\" + this.width + \", height=\" + this.height + \")\";\n        };\n        /**\n         * Adds two rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two rectangles.\n         * @param toUnion A Rectangle object to add to this Rectangle object.\n         * @returns A new Rectangle object that is the union of the two rectangles.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 通过填充两个矩形之间的水平和垂直空间，将这两个矩形组合在一起以创建一个新的 Rectangle 对象。\n         * @param toUnion 要添加到此 Rectangle 对象的 Rectangle 对象。\n         * @returns 充当两个矩形的联合的新 Rectangle 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Rectangle.prototype.union = function (toUnion) {\n            var result = this.clone();\n            if (toUnion.isEmpty()) {\n                return result;\n            }\n            if (result.isEmpty()) {\n                result.copyFrom(toUnion);\n                return result;\n            }\n            var l = Math.min(result.x, toUnion.x);\n            var t = Math.min(result.y, toUnion.y);\n            result.setTo(l, t, Math.max(result.right, toUnion.right) - l, Math.max(result.bottom, toUnion.bottom) - t);\n            return result;\n        };\n        /**\n         * @private\n         */\n        Rectangle.prototype.$getBaseWidth = function (angle) {\n            var u = Math.abs(Math.cos(angle));\n            var v = Math.abs(Math.sin(angle));\n            return u * this.width + v * this.height;\n        };\n        /**\n         * @private\n         */\n        Rectangle.prototype.$getBaseHeight = function (angle) {\n            var u = Math.abs(Math.cos(angle));\n            var v = Math.abs(Math.sin(angle));\n            return v * this.width + u * this.height;\n        };\n        return Rectangle;\n    }(egret.HashObject));\n    egret.Rectangle = Rectangle;\n    __reflect(Rectangle.prototype, \"egret.Rectangle\");\n    /**\n     * @private\n     * 仅供框架内复用，要防止暴露引用到外部。\n     */\n    egret.$TempRectangle = new Rectangle();\n})(egret || (egret = {}));\nvar egret;\n(function (egret) {\n    egret.$locale_strings = egret.$locale_strings || {};\n    egret.$locale_strings[\"en_US\"] = egret.$locale_strings[\"en_US\"] || {};\n    var locale_strings = egret.$locale_strings[\"en_US\"];\n    //core  1000-1999\n    locale_strings[1001] = \"Could not find Egret entry class: {0}。\";\n    locale_strings[1002] = \"Egret entry class '{0}' must inherit from egret.DisplayObject.\";\n    locale_strings[1003] = \"Parameter {0} must be non-null.\";\n    locale_strings[1004] = \"An object cannot be added as a child to one of it's children (or children's children, etc.).\";\n    locale_strings[1005] = \"An object cannot be added as a child of itself.\";\n    locale_strings[1006] = \"The supplied DisplayObject must be a child of the caller.\";\n    locale_strings[1007] = \"An index specified for a parameter was out of range.\";\n    locale_strings[1008] = \"Instantiate singleton error，singleton class {0} can not create multiple instances.\";\n    locale_strings[1009] = \"the Class {0} cannot use the property \\\"{1}\\\"\";\n    locale_strings[1010] = \"the property \\\"{1}\\\" of the Class \\\"{0}\\\" is readonly\";\n    locale_strings[1011] = \"Stream Error. URL: {0}\";\n    locale_strings[1012] = \"The type of parameter {0} must be Class.\";\n    locale_strings[1013] = \"Variable assignment is NaN, please see the code!\";\n    locale_strings[1014] = \"the constant \\\"{1}\\\" of the Class \\\"{0}\\\" is read-only\";\n    locale_strings[1015] = \"xml not found!\";\n    locale_strings[1016] = \"{0}has been obsoleted\";\n    locale_strings[1017] = \"The format of JSON file is incorrect: {0}\\ndata: {1}\";\n    locale_strings[1018] = \"the scale9Grid is not correct\";\n    locale_strings[1019] = \"Network ab:{0}\";\n    locale_strings[1020] = \"Cannot initialize Shader\";\n    locale_strings[1021] = \"Current browser does not support webgl\";\n    locale_strings[1022] = \"{0} ArgumentError\";\n    locale_strings[1023] = \"This method is not available in the ScrollView!\";\n    locale_strings[1025] = \"end of the file\";\n    locale_strings[1026] = \"! EncodingError The code point {0} could not be encoded.\";\n    locale_strings[1027] = \"DecodingError\";\n    locale_strings[1028] = \". called injection is not configured rule: {0}, please specify configuration during its initial years of injection rule, and then call the corresponding single case.\";\n    locale_strings[1029] = \"Function.prototype.bind - what is trying to be bound is not callable\";\n    locale_strings[1033] = \"Photos can not be used across domains toDataURL to convert base64\";\n    locale_strings[1034] = \"Music file decoding failed: \\\"{0}\\\", please use the standard conversion tool reconversion under mp3.\";\n    locale_strings[1035] = \"Native does not support this feature!\";\n    locale_strings[1036] = \"Sound has stopped, please recall Sound.play () to play the sound!\";\n    locale_strings[1037] = \"Non-load the correct blob!\";\n    locale_strings[1038] = \"XML format error!\";\n    locale_strings[1039] = \"Cross domains pictures can not get pixel information!\";\n    locale_strings[1040] = \"hitTestPoint can not detect crossOrigin images! Please check if the display object has crossOrigin elements.\";\n    locale_strings[1041] = \"{0} is deprecated, please use {1} replace\";\n    locale_strings[1042] = \"The parameters passed in the region needs is an integer in drawToTexture method. Otherwise, some browsers will draw abnormal.\";\n    locale_strings[1043] = \"Compile errors in {0}, the attribute name: {1}, the attribute value: {2}.\";\n    locale_strings[1044] = \"The current version of the Runtime does not support video playback, please use the latest version\";\n    locale_strings[1045] = \"The resource url is not found\";\n    locale_strings[1046] = \"BitmapText no corresponding characters: {0}, please check the configuration file\";\n    locale_strings[1047] = \"egret.localStorage.setItem save failed,key={0}&value={1}\";\n    locale_strings[1048] = \"Video loading failed\";\n    locale_strings[1049] = \"In the absence of sound is not allowed to play after loading\";\n    locale_strings[1050] = \"ExternalInterface calls the method without js registration: {0}\";\n    locale_strings[1051] = \"runtime only support webgl render mode\";\n    locale_strings[1052] = \"network request timeout{0}\";\n    //gui  3000-3099\n    locale_strings[3000] = \"Theme configuration file failed to load: {0}\";\n    locale_strings[3001] = \"Cannot find the skin name which is configured in Theme: {0}\";\n    locale_strings[3002] = \"Index:\\\"{0}\\\" is out of the collection element index range\";\n    locale_strings[3003] = \"Cannot be available in this component. If this component is container, please continue to use\";\n    locale_strings[3004] = \"addChild(){0}addElement() replace\";\n    locale_strings[3005] = \"addChildAt(){0}addElementAt() replace\";\n    locale_strings[3006] = \"removeChild(){0}removeElement() replace\";\n    locale_strings[3007] = \"removeChildAt(){0}removeElementAt() replace\";\n    locale_strings[3008] = \"setChildIndex(){0}setElementIndex() replace\";\n    locale_strings[3009] = \"swapChildren(){0}swapElements() replace\";\n    locale_strings[3010] = \"swapChildrenAt(){0}swapElementsAt() replace\";\n    locale_strings[3011] = \"Index:\\\"{0}\\\" is out of the visual element index range\";\n    locale_strings[3012] = \"This method is not available in Scroller component!\";\n    locale_strings[3013] = \"UIStage is GUI root container, and only one such instant is in the display list！\";\n    locale_strings[3014] = \"set fullscreen error\";\n    //socket 3100-3199\n    locale_strings[3100] = \"Current browser does not support WebSocket\";\n    locale_strings[3101] = \"Please connect Socket firstly\";\n    locale_strings[3102] = \"Please set the type of binary type\";\n    //RES 3200-3299\n    locale_strings[3200] = \"getResByUrl must be called after loadConfig\";\n    //db 4000-4299\n    locale_strings[4000] = \"An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)\";\n    locale_strings[4001] = \"Abstract class can not be instantiated!\";\n    locale_strings[4002] = \"Unnamed data!\";\n    locale_strings[4003] = \"Nonsupport version!\";\n    //4500-5000 platform\n    locale_strings[4500] = \"The platform does not support {0} adapter mode and has been automatically replaced with {1} mode, please modify your code adapter logic\";\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The JointStyle class is an enumeration of constant values that specify the joint style to use in drawing lines.\n     * These constants are provided for use as values in the joints parameter of the egret.Graphics.lineStyle() method.\n     * @see egret.Graphics#lineStyle()\n     * @version Egret 2.5\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * JointStyle 类是指定要在绘制线条中使用的联接点样式的常量值枚举。提供的这些常量用作 egret.Graphics.lineStyle() 方法的 joints 参数中的值。\n     * @see egret.Graphics#lineStyle()\n     * @version Egret 2.5\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    egret.JointStyle = {\n        /**\n         * Specifies beveled joints in the joints parameter of the egret.Graphics.lineStyle() method.\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在 egret.Graphics.lineStyle() 方法的 joints 参数中指定斜角连接。\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        BEVEL: \"bevel\",\n        /**\n         * Specifies mitered joints in the joints parameter of the egret.Graphics.lineStyle() method.\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在 egret.Graphics.lineStyle() 方法的 joints 参数中指定尖角连接。\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        MITER: \"miter\",\n        /**\n         * Specifies round joints in the joints parameter of the egret.Graphics.lineStyle() method.\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在 egret.Graphics.lineStyle() 方法的 joints 参数中指定圆角连接。\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ROUND: \"round\"\n    };\n})(egret || (egret = {}));\nvar egret;\n(function (egret) {\n    egret.$locale_strings = egret.$locale_strings || {};\n    egret.$locale_strings[\"zh_CN\"] = egret.$locale_strings[\"zh_CN\"] || {};\n    var locale_strings = egret.$locale_strings[\"zh_CN\"];\n    //eui 2000-2999    \n    //core  1000-1999\n    locale_strings[1001] = \"找不到Egret入口类: {0}。\";\n    locale_strings[1002] = \"Egret入口类 {0} 必须继承自egret.DisplayObject。\";\n    locale_strings[1003] = \"参数 {0} 不能为 null。\";\n    locale_strings[1004] = \"无法将对象添加为它的一个子对象（或子对象的子对象等）的子对象。\";\n    locale_strings[1005] = \"不能将对象添加为其自身的子对象。\";\n    locale_strings[1006] = \"提供的 DisplayObject 必须是调用者的子级。\";\n    locale_strings[1007] = \"为参数指定的索引不在范围内。\";\n    locale_strings[1008] = \"实例化单例出错，不允许实例化多个 {0} 对象。\";\n    locale_strings[1009] = \"类 {0} 不可以使用属性 {1}\";\n    locale_strings[1010] = \"类 {0} 属性 {1} 是只读的\";\n    locale_strings[1011] = \"流错误。URL: {0}\";\n    locale_strings[1012] = \"参数 {0} 的类型必须为 Class。\";\n    locale_strings[1013] = \"变量赋值为NaN，请查看代码！\";\n    locale_strings[1014] = \"类 {0} 常量 {1} 是只读的\";\n    locale_strings[1015] = \"xml not found!\";\n    locale_strings[1016] = \"{0}已经废弃\";\n    locale_strings[1017] = \"JSON文件格式不正确: {0}\\ndata: {1}\";\n    locale_strings[1018] = \"9宫格设置错误\";\n    locale_strings[1019] = \"网络异常:{0}\";\n    locale_strings[1020] = \"无法初始化着色器\";\n    locale_strings[1021] = \"当前浏览器不支持webgl\";\n    locale_strings[1022] = \"{0} ArgumentError\";\n    locale_strings[1023] = \"此方法在ScrollView内不可用!\";\n    locale_strings[1025] = \"遇到文件尾\";\n    locale_strings[1026] = \"EncodingError! The code point {0} could not be encoded.\";\n    locale_strings[1027] = \"DecodingError\";\n    locale_strings[1028] = \"调用了未配置的注入规则:{0}。 请先在项目初始化里配置指定的注入规则，再调用对应单例。\";\n    locale_strings[1029] = \"Function.prototype.bind - what is trying to be bound is not callable\";\n    locale_strings[1033] = \"跨域图片不可以使用toDataURL来转换成base64\";\n    locale_strings[1034] = \"音乐文件解码失败：\\\"{0}\\\"，请使用标准的转换工具重新转换下mp3。\";\n    locale_strings[1035] = \"Native 下暂未实现此功能！\";\n    locale_strings[1036] = \"声音已停止，请重新调用 Sound.play() 来播放声音！\";\n    locale_strings[1037] = \"非正确的blob加载！\";\n    locale_strings[1038] = \"XML 格式错误!\";\n    locale_strings[1039] = \"跨域图片不能获取像素信息!\";\n    locale_strings[1040] = \"hitTestPoint 不能对跨域图片进行检测! 请检查该显示对象内是否含有跨域元素\";\n    locale_strings[1041] = \"{0} 已废弃,请使用 {1} 代替\";\n    locale_strings[1042] = \"drawToTexture方法传入的区域各个参数需要为整数,否则某些浏览器绘制会出现异常\";\n    locale_strings[1043] = \"{0} 中存在编译错误，属性名 : {1}，属性值 : {2}\";\n    locale_strings[1044] = \"当前的 runtime 版本不支持视频播放,请使用最新的版本\";\n    locale_strings[1045] = \"没有设置要加载的资源地址\";\n    locale_strings[1046] = \"BitmapText 找不到对应字符:{0}，请检查配置文件\";\n    locale_strings[1047] = \"egret.localStorage.setItem保存失败,key={0}&value={1}\";\n    locale_strings[1048] = \"视频加载失败\";\n    locale_strings[1049] = \"声音在没有加载完之前不允许播放\";\n    locale_strings[1050] = \"ExternalInterface调用了js没有注册的方法: {0}\";\n    locale_strings[1051] = \"runtime 只支持 webgl 渲染模式\";\n    locale_strings[1052] = \"网络请求超时:{0}\";\n    //gui  3000-3099\n    locale_strings[3000] = \"主题配置文件加载失败: {0}\";\n    locale_strings[3001] = \"找不到主题中所配置的皮肤类名: {0}\";\n    locale_strings[3002] = \"索引:\\\"{0}\\\"超出集合元素索引范围\";\n    locale_strings[3003] = \"在此组件中不可用，若此组件为容器类，请使用\";\n    locale_strings[3004] = \"addChild(){0}addElement()代替\";\n    locale_strings[3005] = \"addChildAt(){0}addElementAt()代替\";\n    locale_strings[3006] = \"removeChild(){0}removeElement()代替\";\n    locale_strings[3007] = \"removeChildAt(){0}removeElementAt()代替\";\n    locale_strings[3008] = \"setChildIndex(){0}setElementIndex()代替\";\n    locale_strings[3009] = \"swapChildren(){0}swapElements()代替\";\n    locale_strings[3010] = \"swapChildrenAt(){0}swapElementsAt()代替\";\n    locale_strings[3011] = \"索引:\\\"{0}\\\"超出可视元素索引范围\";\n    locale_strings[3012] = \"此方法在Scroller组件内不可用!\";\n    locale_strings[3013] = \"UIStage是GUI根容器，只能有一个此实例在显示列表中！\";\n    locale_strings[3014] = \"设置全屏模式失败\";\n    //socket 3100-3199\n    locale_strings[3100] = \"当前浏览器不支持WebSocket\";\n    locale_strings[3101] = \"请先连接WebSocket\";\n    locale_strings[3102] = \"请先设置type为二进制类型\";\n    //RES 3200-3299\n    locale_strings[3200] = \"getResByUrl 必须在 loadConfig 之后调用\";\n    //db 4000-4299\n    locale_strings[4000] = \"An Bone cannot be added as a child to itself or one of its children (or children's children, etc.)\";\n    locale_strings[4001] = \"Abstract class can not be instantiated!\";\n    locale_strings[4002] = \"Unnamed data!\";\n    locale_strings[4003] = \"Nonsupport version!\";\n    //4500-5000 platform\n    locale_strings[4500] = \"该平台不支持 {0} 适配模式，已经自动替换为 {1} 模式，请修改您的代码适配逻辑\";\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n/**\n * @version Egret 2.4\n * @platform Web,Native\n * @includeExample egret/localStorage/localStorage.ts\n */\nvar egret;\n(function (egret) {\n    var localStorage;\n    (function (localStorage) {\n    })(localStorage = egret.localStorage || (egret.localStorage = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        var usingChannel = [];\n        /**\n         * @private\n         * @param channel\n         */\n        function $pushSoundChannel(channel) {\n            if (usingChannel.indexOf(channel) < 0) {\n                usingChannel.push(channel);\n            }\n        }\n        sys.$pushSoundChannel = $pushSoundChannel;\n        /**\n         * @private\n         * @param channel\n         */\n        function $popSoundChannel(channel) {\n            var index = usingChannel.indexOf(channel);\n            if (index >= 0) {\n                usingChannel.splice(index, 1);\n                return true;\n            }\n            return false;\n        }\n        sys.$popSoundChannel = $popSoundChannel;\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n(function (egret) {\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The HttpMethod class provides values that specify whether the HttpRequest object should use the POST method\n     * or the GET method when sending data to a server.\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * HttpRequestMethod 类提供了一些值，这些值可指定在将数据发送到服务器时，\n     * HttpRequest 对象应使用 POST 方法还是 GET 方法。\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var HttpMethod;\n    (function (HttpMethod) {\n        /**\n         * Specifies that the HttpRequest object is a GET.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 HttpRequest 对象是一个 GET。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        HttpMethod.GET = \"GET\";\n        /**\n         * Specifies that the HttpRequest object is a POST.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 HttpRequest 对象是一个 POST。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        HttpMethod.POST = \"POST\";\n    })(HttpMethod = egret.HttpMethod || (egret.HttpMethod = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The HttpResponseType class provides values that specify how downloaded data is received.\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * URLLoaderDataFormat 类提供了一些用于指定如何接收已下载数据的值。\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var HttpResponseType = (function () {\n        function HttpResponseType() {\n        }\n        /**\n         * Specifies that downloaded data is received as text. This is the default value of HttpRequest.responseType\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回字符串。HttpRequest.responseType属性的默认值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        HttpResponseType.TEXT = \"text\";\n        /**\n         * Specifies that downloaded data is received as raw binary data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回二进制的ArrayBuffer对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        HttpResponseType.ARRAY_BUFFER = \"arraybuffer\";\n        return HttpResponseType;\n    }());\n    egret.HttpResponseType = HttpResponseType;\n    __reflect(HttpResponseType.prototype, \"egret.HttpResponseType\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        var displayListPool = [];\n        var blendModes = [\"source-over\", \"lighter\", \"destination-out\"];\n        var defaultCompositeOp = \"source-over\";\n        /**\n         * @private\n         * 显示列表\n         */\n        var DisplayList = (function (_super) {\n            __extends(DisplayList, _super);\n            /**\n             * @private\n             * 创建一个DisplayList对象\n             */\n            function DisplayList(root) {\n                var _this = _super.call(this) || this;\n                _this.isStage = false;\n                /**\n                 * 位图渲染节点\n                 */\n                _this.$renderNode = new sys.BitmapNode();\n                /**\n                 * @private\n                 */\n                _this.renderBuffer = null;\n                /**\n                 * @private\n                 */\n                _this.offsetX = 0;\n                /**\n                 * @private\n                 */\n                _this.offsetY = 0;\n                /**\n                 * @private\n                 */\n                _this.offsetMatrix = new egret.Matrix();\n                _this.$canvasScaleX = 1;\n                _this.$canvasScaleY = 1;\n                _this.root = root;\n                _this.isStage = (root instanceof egret.Stage);\n                return _this;\n            }\n            /**\n             * 创建一个DisplayList对象，若内存不足或无法创建RenderBuffer，将会返回null。\n             */\n            DisplayList.create = function (target) {\n                var displayList = new egret.sys.DisplayList(target);\n                try {\n                    var buffer = new sys.RenderBuffer();\n                    displayList.renderBuffer = buffer;\n                }\n                catch (e) {\n                    return null;\n                }\n                displayList.root = target;\n                return displayList;\n            };\n            /**\n             * @private\n             * 获取渲染节点\n             */\n            DisplayList.prototype.$getRenderNode = function () {\n                return this.$renderNode;\n            };\n            /**\n             * @private\n             * 设置剪裁边界，不再绘制完整目标对象，画布尺寸由外部决定，超过边界的节点将跳过绘制。\n             */\n            DisplayList.prototype.setClipRect = function (width, height) {\n                width *= DisplayList.$canvasScaleX;\n                height *= DisplayList.$canvasScaleY;\n                this.renderBuffer.resize(width, height);\n            };\n            /**\n             * @private\n             * 绘制根节点显示对象到目标画布，返回draw的次数。\n             */\n            DisplayList.prototype.drawToSurface = function () {\n                var drawCalls = 0;\n                this.$canvasScaleX = this.offsetMatrix.a = DisplayList.$canvasScaleX;\n                this.$canvasScaleY = this.offsetMatrix.d = DisplayList.$canvasScaleY;\n                if (!this.isStage) {\n                    this.changeSurfaceSize();\n                }\n                var buffer = this.renderBuffer;\n                buffer.clear();\n                drawCalls = sys.systemRenderer.render(this.root, buffer, this.offsetMatrix);\n                if (!this.isStage) {\n                    var surface = buffer.surface;\n                    var renderNode = this.$renderNode;\n                    renderNode.drawData.length = 0;\n                    var width = surface.width;\n                    var height = surface.height;\n                    if (!this.bitmapData) {\n                        this.bitmapData = new egret.BitmapData(surface);\n                    }\n                    else {\n                        this.bitmapData.source = surface;\n                        this.bitmapData.width = width;\n                        this.bitmapData.height = height;\n                    }\n                    renderNode.image = this.bitmapData;\n                    renderNode.imageWidth = width;\n                    renderNode.imageHeight = height;\n                    renderNode.drawImage(0, 0, width, height, -this.offsetX, -this.offsetY, width / this.$canvasScaleX, height / this.$canvasScaleY);\n                }\n                return drawCalls;\n            };\n            /**\n             * @private\n             * 改变画布的尺寸，由于画布尺寸修改会清空原始画布。所以这里将原始画布绘制到一个新画布上，再与原始画布交换。\n             */\n            DisplayList.prototype.changeSurfaceSize = function () {\n                var root = this.root;\n                var oldOffsetX = this.offsetX;\n                var oldOffsetY = this.offsetY;\n                var bounds = this.root.$getOriginalBounds();\n                var scaleX = this.$canvasScaleX;\n                var scaleY = this.$canvasScaleY;\n                this.offsetX = -bounds.x;\n                this.offsetY = -bounds.y;\n                this.offsetMatrix.setTo(this.offsetMatrix.a, 0, 0, this.offsetMatrix.d, this.offsetX, this.offsetY);\n                var buffer = this.renderBuffer;\n                //在chrome里，小等于256*256的canvas会不启用GPU加速。\n                var width = Math.max(257, bounds.width * scaleX);\n                var height = Math.max(257, bounds.height * scaleY);\n                if (this.offsetX == oldOffsetX &&\n                    this.offsetY == oldOffsetY &&\n                    buffer.surface.width == width &&\n                    buffer.surface.height == height) {\n                    return;\n                }\n                buffer.resize(width, height);\n            };\n            /**\n             * @private\n             */\n            DisplayList.$setCanvasScale = function (x, y) {\n                DisplayList.$canvasScaleX = x;\n                DisplayList.$canvasScaleY = y;\n                if (egret.nativeRender) {\n                    egret_native.nrSetCanvasScaleFactor(DisplayList.$canvasScaleFactor, x, y);\n                }\n            };\n            DisplayList.$canvasScaleFactor = 1;\n            /**\n             * @private\n             */\n            DisplayList.$canvasScaleX = 1;\n            DisplayList.$canvasScaleY = 1;\n            return DisplayList;\n        }(egret.HashObject));\n        sys.DisplayList = DisplayList;\n        __reflect(DisplayList.prototype, \"egret.sys.DisplayList\");\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         * Egret播放器\n         */\n        var Player = (function (_super) {\n            __extends(Player, _super);\n            /**\n             * @private\n             * 实例化一个播放器对象。\n             */\n            function Player(buffer, stage, entryClassName) {\n                var _this = _super.call(this) || this;\n                /**\n                 * @private\n                 */\n                _this.isPlaying = false;\n                if (true && !buffer) {\n                    egret.$error(1003, \"buffer\");\n                }\n                _this.entryClassName = entryClassName;\n                _this.stage = stage;\n                _this.screenDisplayList = _this.createDisplayList(stage, buffer);\n                _this.showFPS = false;\n                _this.showLog = false;\n                _this.stageDisplayList = null;\n                if (egret.nativeRender) {\n                    egret_native.rootWebGLBuffer = buffer;\n                }\n                return _this;\n            }\n            /**\n             * @private\n             */\n            Player.prototype.createDisplayList = function (stage, buffer) {\n                var displayList = new sys.DisplayList(stage);\n                displayList.renderBuffer = buffer;\n                stage.$displayList = displayList;\n                return displayList;\n            };\n            /**\n             * @private\n             * 启动播放器\n             */\n            Player.prototype.start = function () {\n                if (this.isPlaying || !this.stage) {\n                    return;\n                }\n                sys.$TempStage = sys.$TempStage || this.stage;\n                this.isPlaying = true;\n                if (!this.root) {\n                    this.initialize();\n                }\n                egret.ticker.$addPlayer(this);\n            };\n            /**\n             * @private\n             */\n            Player.prototype.initialize = function () {\n                var rootClass;\n                if (this.entryClassName) {\n                    rootClass = egret.getDefinitionByName(this.entryClassName);\n                }\n                if (rootClass) {\n                    var rootContainer = new rootClass();\n                    this.root = rootContainer;\n                    if (rootContainer instanceof egret.DisplayObject) {\n                        this.stage.addChild(rootContainer);\n                    }\n                    else {\n                        true && egret.$error(1002, this.entryClassName);\n                    }\n                }\n                else {\n                    true && egret.$error(1001, this.entryClassName);\n                }\n            };\n            /**\n             * @private\n             * 停止播放器，停止后将不能重新启动。\n             */\n            Player.prototype.stop = function () {\n                this.pause();\n                this.stage = null;\n            };\n            /**\n             * @private\n             * 暂停播放器，后续可以通过调用start()重新启动播放器。\n             */\n            Player.prototype.pause = function () {\n                if (!this.isPlaying) {\n                    return;\n                }\n                this.isPlaying = false;\n                egret.ticker.$removePlayer(this);\n            };\n            /**\n             * @private\n             * 渲染屏幕\n             */\n            Player.prototype.$render = function (triggerByFrame, costTicker) {\n                if (egret.nativeRender) {\n                    egret_native.updateNativeRender();\n                    egret_native.nrRender();\n                    return;\n                }\n                var stage = this.stage;\n                var t1 = egret.getTimer();\n                var drawCalls = stage.$displayList.drawToSurface();\n                var t2 = egret.getTimer();\n                if (triggerByFrame && this.showFPS) {\n                    fpsDisplay.update(drawCalls, t2 - t1, costTicker);\n                }\n            };\n            /**\n             * @private\n             * 更新舞台尺寸\n             * @param stageWidth 舞台宽度（以像素为单位）\n             * @param stageHeight 舞台高度（以像素为单位）\n             */\n            Player.prototype.updateStageSize = function (stageWidth, stageHeight) {\n                var stage = this.stage;\n                stage.$stageWidth = stageWidth;\n                stage.$stageHeight = stageHeight;\n                if (egret.nativeRender) {\n                    egret_native.nrResize(stageWidth, stageHeight);\n                }\n                else {\n                    this.screenDisplayList.setClipRect(stageWidth, stageHeight);\n                    if (this.stageDisplayList) {\n                        this.stageDisplayList.setClipRect(stageWidth, stageHeight);\n                    }\n                }\n                stage.dispatchEventWith(egret.Event.RESIZE);\n            };\n            /**\n             * @private\n             * 显示FPS。\n             */\n            Player.prototype.displayFPS = function (showFPS, showLog, logFilter, styles) {\n                showLog = !!showLog;\n                if (showLog) {\n                    egret.log = function () {\n                        var length = arguments.length;\n                        var info = \"\";\n                        for (var i = 0; i < length; i++) {\n                            info += arguments[i] + \" \";\n                        }\n                        sys.$logToFPS(info);\n                        console.log.apply(console, toArray(arguments));\n                    };\n                    egret.warn = function () {\n                        var length = arguments.length;\n                        var info = \"\";\n                        for (var i = 0; i < length; i++) {\n                            info += arguments[i] + \" \";\n                        }\n                        sys.$warnToFPS(info);\n                        console.warn.apply(console, toArray(arguments));\n                    };\n                    egret.error = function () {\n                        var length = arguments.length;\n                        var info = \"\";\n                        for (var i = 0; i < length; i++) {\n                            info += arguments[i] + \" \";\n                        }\n                        sys.$errorToFPS(info);\n                        console.error.apply(console, toArray(arguments));\n                    };\n                }\n                this.showFPS = !!showFPS;\n                this.showLog = showLog;\n                if (!fpsDisplay) {\n                    fpsDisplay = new FPS(this.stage, showFPS, showLog, logFilter, styles);\n                    var logLength = logLines.length;\n                    for (var i = 0; i < logLength; i++) {\n                        fpsDisplay.updateInfo(logLines[i]);\n                    }\n                    logLines = null;\n                    var warnLength = warnLines.length;\n                    for (var i = 0; i < warnLength; i++) {\n                        fpsDisplay.updateWarn(warnLines[i]);\n                    }\n                    warnLines = null;\n                    var errorLength = errorLines.length;\n                    for (var i = 0; i < errorLength; i++) {\n                        fpsDisplay.updateError(errorLines[i]);\n                    }\n                    errorLines = null;\n                }\n            };\n            return Player;\n        }(egret.HashObject));\n        sys.Player = Player;\n        __reflect(Player.prototype, \"egret.sys.Player\");\n        var logLines = [];\n        var warnLines = [];\n        var errorLines = [];\n        var fpsDisplay;\n        sys.$logToFPS = function (info) {\n            if (!fpsDisplay) {\n                logLines.push(info);\n                return;\n            }\n            fpsDisplay.updateInfo(info);\n        };\n        sys.$warnToFPS = function (info) {\n            if (!fpsDisplay) {\n                warnLines.push(info);\n                return;\n            }\n            fpsDisplay.updateWarn(info);\n        };\n        sys.$errorToFPS = function (info) {\n            if (!fpsDisplay) {\n                errorLines.push(info);\n                return;\n            }\n            fpsDisplay.updateError(info);\n        };\n        var FPSImpl = (function () {\n            function FPSImpl(stage, showFPS, showLog, logFilter, styles) {\n                this.showFPS = showFPS;\n                this.showLog = showLog;\n                this.logFilter = logFilter;\n                this.styles = styles;\n                this.infoLines = [];\n                this.totalTime = 0;\n                this.totalTick = 0;\n                this.lastTime = 0;\n                this.drawCalls = 0;\n                this.costRender = 0;\n                this.costTicker = 0;\n                this.infoLines = [];\n                this.totalTime = 0;\n                this.totalTick = 0;\n                this.lastTime = 0;\n                this.drawCalls = 0;\n                this.costRender = 0;\n                this.costTicker = 0;\n                this._stage = stage;\n                this.showFPS = showFPS;\n                this.showLog = showLog;\n                this.logFilter = logFilter;\n                this.styles = styles;\n                this.fpsDisplay = new egret.FPSDisplay(stage, showFPS, showLog, logFilter, styles);\n                var logFilterRegExp;\n                try {\n                    logFilterRegExp = logFilter ? new RegExp(logFilter) : null;\n                }\n                catch (e) {\n                    egret.log(e);\n                }\n                this.filter = function (message) {\n                    if (logFilterRegExp)\n                        return logFilterRegExp.test(message);\n                    return !logFilter || message.indexOf(logFilter) == 0;\n                };\n            }\n            FPSImpl.prototype.update = function (drawCalls, costRender, costTicker) {\n                var current = egret.getTimer();\n                this.totalTime += current - this.lastTime;\n                this.lastTime = current;\n                //todo 多Player\n                this.totalTick++;\n                this.drawCalls += drawCalls;\n                this.costRender += costRender;\n                this.costTicker += costTicker;\n                if (this.totalTime >= 1000) {\n                    var lastFPS = Math.min(Math.ceil(this.totalTick * 1000 / this.totalTime), egret.ticker.$frameRate);\n                    var lastDrawCalls = Math.round(this.drawCalls / this.totalTick);\n                    var lastCostRender = Math.round(this.costRender / this.totalTick);\n                    var lastCostTicker = Math.round(this.costTicker / this.totalTick);\n                    this.fpsDisplay.update({\n                        fps: lastFPS,\n                        draw: lastDrawCalls,\n                        costTicker: lastCostTicker,\n                        costRender: lastCostRender\n                    });\n                    this.totalTick = 0;\n                    this.totalTime = this.totalTime % 1000;\n                    this.drawCalls = 0;\n                    this.costRender = 0;\n                    this.costTicker = 0;\n                }\n            };\n            FPSImpl.prototype.updateInfo = function (info) {\n                if (!info) {\n                    return;\n                }\n                if (!this.showLog) {\n                    return;\n                }\n                if (!this.filter(info)) {\n                    return;\n                }\n                this.fpsDisplay.updateInfo(info);\n            };\n            FPSImpl.prototype.updateWarn = function (info) {\n                if (!info) {\n                    return;\n                }\n                if (!this.showLog) {\n                    return;\n                }\n                if (!this.filter(info)) {\n                    return;\n                }\n                if (this.fpsDisplay.updateWarn) {\n                    this.fpsDisplay.updateWarn(info);\n                }\n                else {\n                    this.fpsDisplay.updateInfo(\"[Warning]\" + info);\n                }\n            };\n            FPSImpl.prototype.updateError = function (info) {\n                if (!info) {\n                    return;\n                }\n                if (!this.showLog) {\n                    return;\n                }\n                if (!this.filter(info)) {\n                    return;\n                }\n                if (this.fpsDisplay.updateError) {\n                    this.fpsDisplay.updateError(info);\n                }\n                else {\n                    this.fpsDisplay.updateInfo(\"[Error]\" + info);\n                }\n            };\n            return FPSImpl;\n        }());\n        __reflect(FPSImpl.prototype, \"FPSImpl\");\n        __global.FPS = FPSImpl;\n        function toArray(argument) {\n            var args = [];\n            for (var i = 0; i < argument.length; i++) {\n                args.push(argument[i]);\n            }\n            return args;\n        }\n        egret.warn = function () {\n            console.warn.apply(console, toArray(arguments));\n        };\n        egret.error = function () {\n            console.error.apply(console, toArray(arguments));\n        };\n        egret.assert = function () {\n            console.assert.apply(console, toArray(arguments));\n        };\n        egret.log = function () {\n            console.log.apply(console, toArray(arguments));\n        };\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n/**\n * @private\n */\n(function (egret) {\n    /**\n     * @private\n     */\n    egret.nativeRender = __global.nativeRender;\n    //检测版本是否匹配，不匹配改用非原生加速渲染方式\n    if (egret.nativeRender) {\n        var nrABIVersion = egret_native.nrABIVersion;\n        var nrMinEgretVersion = egret_native.nrMinEgretVersion;\n        var requiredNrABIVersion = 5;\n        if (nrABIVersion < requiredNrABIVersion) {\n            egret.nativeRender = false;\n            var msg = \"需要升级微端版本到 0.1.14 才可以开启原生渲染加速\";\n            egret.sys.$warnToFPS(msg);\n            egret.warn(msg);\n        }\n        else if (nrABIVersion > requiredNrABIVersion) {\n            egret.nativeRender = false;\n            var msg = \"\\u9700\\u8981\\u5347\\u7EA7\\u5F15\\u64CE\\u7248\\u672C\\u5230 \" + nrMinEgretVersion + \" \\u624D\\u53EF\\u4EE5\\u5F00\\u542F\\u539F\\u751F\\u6E32\\u67D3\\u52A0\\u901F\";\n            egret.sys.$warnToFPS(msg);\n            egret.warn(msg);\n        }\n    }\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /** !!!!!!!!inspired by Babylon.js!!!!!!!!!!!!!\n     * for description see https://www.khronos.org/opengles/sdk/tools/KTX/\n     * for file layout see https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/\n     * Current families are astc, dxt, pvrtc, etc2, & etc1.\n     * @returns The extension selected.\n     */\n    var KTXContainer = (function () {\n        /**\n         * Creates a new KhronosTextureContainer\n         * @param arrayBuffer contents of the KTX container file\n         * @param facesExpected should be either 1 or 6, based whether a cube texture or or\n         * @param threeDExpected provision for indicating that data should be a 3D texture, not implemented\n         * @param textureArrayExpected provision for indicating that data should be a texture array, not implemented\n         */\n        function KTXContainer(/** contents of the KTX container file */ arrayBuffer, facesExpected, threeDExpected, textureArrayExpected) {\n            this.arrayBuffer = arrayBuffer;\n            /**\n             * If the container has been made invalid (eg. constructor failed to correctly load array buffer)\n             */\n            this.isInvalid = false;\n            // Test that it is a ktx formatted file, based on the first 12 bytes, character representation is:\n            // '�', 'K', 'T', 'X', ' ', '1', '1', '�', '\\r', '\\n', '\\x1A', '\\n'\n            // 0xAB, 0x4B, 0x54, 0x58, 0x20, 0x31, 0x31, 0xBB, 0x0D, 0x0A, 0x1A, 0x0A\n            var identifier = new Uint8Array(this.arrayBuffer, 0, 12);\n            if (identifier[0] !== 0xAB || identifier[1] !== 0x4B || identifier[2] !== 0x54 || identifier[3] !== 0x58 || identifier[4] !== 0x20 || identifier[5] !== 0x31 ||\n                identifier[6] !== 0x31 || identifier[7] !== 0xBB || identifier[8] !== 0x0D || identifier[9] !== 0x0A || identifier[10] !== 0x1A || identifier[11] !== 0x0A) {\n                this.isInvalid = true;\n                //Logger.Error(\"texture missing KTX identifier\");\n                console.error(\"texture missing KTX identifier\");\n                return;\n            }\n            // load the reset of the header in native 32 bit uint\n            var dataSize = Uint32Array.BYTES_PER_ELEMENT;\n            var headerDataView = new DataView(this.arrayBuffer, 12, 13 * dataSize);\n            var endianness = headerDataView.getUint32(0, true);\n            var littleEndian = endianness === 0x04030201;\n            this.glType = headerDataView.getUint32(1 * dataSize, littleEndian); // must be 0 for compressed textures\n            this.glTypeSize = headerDataView.getUint32(2 * dataSize, littleEndian); // must be 1 for compressed textures\n            this.glFormat = headerDataView.getUint32(3 * dataSize, littleEndian); // must be 0 for compressed textures\n            this.glInternalFormat = headerDataView.getUint32(4 * dataSize, littleEndian); // the value of arg passed to gl.compressedTexImage2D(,,x,,,,)\n            this.glBaseInternalFormat = headerDataView.getUint32(5 * dataSize, littleEndian); // specify GL_RGB, GL_RGBA, GL_ALPHA, etc (un-compressed only)\n            this.pixelWidth = headerDataView.getUint32(6 * dataSize, littleEndian); // level 0 value of arg passed to gl.compressedTexImage2D(,,,x,,,)\n            this.pixelHeight = headerDataView.getUint32(7 * dataSize, littleEndian); // level 0 value of arg passed to gl.compressedTexImage2D(,,,,x,,)\n            this.pixelDepth = headerDataView.getUint32(8 * dataSize, littleEndian); // level 0 value of arg passed to gl.compressedTexImage3D(,,,,,x,,)\n            this.numberOfArrayElements = headerDataView.getUint32(9 * dataSize, littleEndian); // used for texture arrays\n            this.numberOfFaces = headerDataView.getUint32(10 * dataSize, littleEndian); // used for cubemap textures, should either be 1 or 6\n            this.numberOfMipmapLevels = headerDataView.getUint32(11 * dataSize, littleEndian); // number of levels; disregard possibility of 0 for compressed textures\n            this.bytesOfKeyValueData = headerDataView.getUint32(12 * dataSize, littleEndian); // the amount of space after the header for meta-data\n            // Make sure we have a compressed type.  Not only reduces work, but probably better to let dev know they are not compressing.\n            if (this.glType !== 0) {\n                console.error(\"only compressed formats currently supported\");\n                return;\n            }\n            else {\n                // value of zero is an indication to generate mipmaps @ runtime.  Not usually allowed for compressed, so disregard.\n                this.numberOfMipmapLevels = Math.max(1, this.numberOfMipmapLevels);\n            }\n            if (this.pixelHeight === 0 || this.pixelDepth !== 0) {\n                console.error(\"only 2D textures currently supported\");\n                return;\n            }\n            if (this.numberOfArrayElements !== 0) {\n                console.error(\"texture arrays not currently supported\");\n                return;\n            }\n            if (this.numberOfFaces !== facesExpected) {\n                console.error(\"number of faces expected\" + facesExpected + \", but found \" + this.numberOfFaces);\n                return;\n            }\n            // we now have a completely validated file, so could use existence of loadType as success\n            // would need to make this more elaborate & adjust checks above to support more than one load type\n            this.loadType = KTXContainer.COMPRESSED_2D;\n        }\n        /**\n         * Uploads KTX content to a Babylon Texture.\n         * It is assumed that the texture has already been created & is currently bound\n         * @hidden\n         */\n        KTXContainer.prototype.uploadLevels = function (bitmapData, loadMipmaps) {\n            if (this.loadType === KTXContainer.COMPRESSED_2D) {\n                this._upload2DCompressedLevels(bitmapData, loadMipmaps);\n            }\n        };\n        KTXContainer.prototype._upload2DCompressedLevels = function (bitmapData, loadMipmaps) {\n            bitmapData.clearCompressedTextureData();\n            var compressedTextureData = bitmapData.compressedTextureData;\n            // initialize width & height for level 1\n            var dataOffset = KTXContainer.HEADER_LEN + this.bytesOfKeyValueData;\n            var width = this.pixelWidth;\n            var height = this.pixelHeight;\n            var mipmapCount = loadMipmaps ? this.numberOfMipmapLevels : 1;\n            for (var level = 0; level < mipmapCount; level++) {\n                var imageSize = new Int32Array(this.arrayBuffer, dataOffset, 1)[0]; // size per face, since not supporting array cubemaps\n                dataOffset += 4; //image data starts from next multiple of 4 offset. Each face refers to same imagesize field above.\n                var levelData = [];\n                for (var face = 0; face < this.numberOfFaces; face++) {\n                    var byteArray = new Uint8Array(this.arrayBuffer, dataOffset, imageSize);\n                    var compressedData = new egret.CompressedTextureData;\n                    compressedData.glInternalFormat = this.glInternalFormat;\n                    compressedData.width = width;\n                    compressedData.height = height;\n                    compressedData.byteArray = byteArray;\n                    compressedData.face = face;\n                    compressedData.level = level;\n                    levelData.push(compressedData);\n                    dataOffset += imageSize; // add size of the image for the next face/mipmap\n                    dataOffset += 3 - ((imageSize + 3) % 4); // add padding for odd sized image\n                }\n                compressedTextureData.push(levelData);\n                width = Math.max(1.0, width * 0.5);\n                height = Math.max(1.0, height * 0.5);\n            }\n            var compressed2d = bitmapData.getCompressed2dTextureData();\n            if (compressed2d) {\n                bitmapData.width = compressed2d.width;\n                bitmapData.height = compressed2d.height;\n            }\n        };\n        KTXContainer.HEADER_LEN = 12 + (13 * 4); // identifier + header elements (not including key value meta-data pairs)\n        // load types\n        KTXContainer.COMPRESSED_2D = 0; // uses a gl.compressedTexImage2D()\n        KTXContainer.COMPRESSED_3D = 1; // uses a gl.compressedTexImage3D()\n        KTXContainer.TEX_2D = 2; // uses a gl.texImage2D()\n        KTXContainer.TEX_3D = 3; // uses a gl.texImage3D()\n        return KTXContainer;\n    }());\n    egret.KTXContainer = KTXContainer;\n    __reflect(KTXContainer.prototype, \"egret.KTXContainer\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         * 屏幕适配器默认实现，开发者可以实现自定义规则的屏幕适配器。并在初始化加载时将适配器的实例赋值给egret.sys.screenAdapter上，从而替换掉默认适配器。\n         */\n        var DefaultScreenAdapter = (function (_super) {\n            __extends(DefaultScreenAdapter, _super);\n            /**\n             * @private\n             */\n            function DefaultScreenAdapter() {\n                return _super.call(this) || this;\n            }\n            /**\n             * @private\n             * 计算舞台显示尺寸\n             * @param scaleMode 当前的缩放模式\n             * @param screenWidth 播放器视口宽度\n             * @param screenHeight 播放器视口高度\n             * @param contentWidth 初始化内容宽度\n             * @param contentHeight 初始化内容高度\n             */\n            DefaultScreenAdapter.prototype.calculateStageSize = function (scaleMode, screenWidth, screenHeight, contentWidth, contentHeight) {\n                var displayWidth = screenWidth;\n                var displayHeight = screenHeight;\n                var stageWidth = contentWidth;\n                var stageHeight = contentHeight;\n                var scaleX = (screenWidth / stageWidth) || 0;\n                var scaleY = (screenHeight / stageHeight) || 0;\n                switch (scaleMode) {\n                    case egret.StageScaleMode.EXACT_FIT:\n                        break;\n                    case egret.StageScaleMode.FIXED_HEIGHT:\n                        stageWidth = Math.round(screenWidth / scaleY);\n                        break;\n                    case egret.StageScaleMode.FIXED_WIDTH:\n                        stageHeight = Math.round(screenHeight / scaleX);\n                        break;\n                    case egret.StageScaleMode.NO_BORDER:\n                        if (scaleX > scaleY) {\n                            displayHeight = Math.round(stageHeight * scaleX);\n                        }\n                        else {\n                            displayWidth = Math.round(stageWidth * scaleY);\n                        }\n                        break;\n                    case egret.StageScaleMode.SHOW_ALL:\n                        if (scaleX > scaleY) {\n                            displayWidth = Math.round(stageWidth * scaleY);\n                        }\n                        else {\n                            displayHeight = Math.round(stageHeight * scaleX);\n                        }\n                        break;\n                    case egret.StageScaleMode.FIXED_NARROW:\n                        if (scaleX > scaleY) {\n                            stageWidth = Math.round(screenWidth / scaleY);\n                        }\n                        else {\n                            stageHeight = Math.round(screenHeight / scaleX);\n                        }\n                        break;\n                    case egret.StageScaleMode.FIXED_WIDE:\n                        if (scaleX > scaleY) {\n                            stageHeight = Math.round(screenHeight / scaleX);\n                        }\n                        else {\n                            stageWidth = Math.round(screenWidth / scaleY);\n                        }\n                        break;\n                    default:\n                        stageWidth = screenWidth;\n                        stageHeight = screenHeight;\n                        break;\n                }\n                if (egret.Capabilities.runtimeType != egret.RuntimeType.WXGAME) {\n                    //宽高不是2的整数倍会导致图片绘制出现问题\n                    if (stageWidth % 2 != 0) {\n                        stageWidth += 1;\n                    }\n                    if (stageHeight % 2 != 0) {\n                        stageHeight += 1;\n                    }\n                    if (displayWidth % 2 != 0) {\n                        displayWidth += 1;\n                    }\n                    if (displayHeight % 2 != 0) {\n                        displayHeight += 1;\n                    }\n                }\n                return {\n                    stageWidth: stageWidth,\n                    stageHeight: stageHeight,\n                    displayWidth: displayWidth,\n                    displayHeight: displayHeight\n                };\n            };\n            return DefaultScreenAdapter;\n        }(egret.HashObject));\n        sys.DefaultScreenAdapter = DefaultScreenAdapter;\n        __reflect(DefaultScreenAdapter.prototype, \"egret.sys.DefaultScreenAdapter\", [\"egret.sys.IScreenAdapter\"]);\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * StageScaleMode class provides values for the stage zoom mode.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/player/StageScaleMode.ts\n     * @language en_US\n     */\n    /**\n     * StageScaleMode 类为舞台缩放模式提供值。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/player/StageScaleMode.ts\n     * @language zh_CN\n     */\n    var StageScaleMode = (function () {\n        function StageScaleMode() {\n        }\n        /**\n         * Do not scale application content. Even when you change the player viewport size, it remains unchanged. If the player is smaller than the viewport content, possibly with some cropping.<br/>\n         * In this mode, the stage size (Stage.stageWidth, Stage.stageHeight) always with the player viewport size consistent.\n         * @language en_US\n         */\n        /**\n         * 不缩放应用程序内容。即使在更改播放器视口大小时，它仍然保持不变。如果播放器视口比内容小，则可能进行一些裁切。<br/>\n         * 在此模式下，舞台尺寸（Stage.stageWidth,Stage.stageHeight）始终跟播放器视口大小保持一致。\n         * @language zh_CN\n         */\n        StageScaleMode.NO_SCALE = \"noScale\";\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling a wide directions application content to fill the viewport players on both sides in the other direction may not be wide enough and left black bars.<br/>\n         * In this mode, the stage size (Stage.stageWidth, Stage.stageHeight) is always equal to the initialization incoming external application content size.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容的较宽方向填满播放器视口，另一个方向的两侧可能会不够宽而留有黑边。<br/>\n         * 在此模式下，舞台尺寸(Stage.stageWidth,Stage.stageHeight)始终等于初始化时外部传入的应用程序内容尺寸。\n         * @language zh_CN\n         */\n        StageScaleMode.SHOW_ALL = \"showAll\";\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling a narrow direction of application content to fill the viewport players on both sides in the other direction may exceed the viewport and the player is cut.<br/>\n         * In this mode, the stage size (Stage.stageWidth, Stage.stageHeight) is always equal to the initialization incoming external application content size.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容的较窄方向填满播放器视口，另一个方向的两侧可能会超出播放器视口而被裁切。<br/>\n         * 在此模式下，舞台尺寸(Stage.stageWidth,Stage.stageHeight)始终等于初始化时外部传入的应用程序内容尺寸。\n         * @language zh_CN\n         */\n        StageScaleMode.NO_BORDER = \"noBorder\";\n        /**\n         * Do not keep the original aspect ratio scaling application content, after scaling application content just fill the player viewport.<br/>\n         * In this mode, the stage size (Stage.stageWidth, Stage.stageHeight) is always equal to the initialization incoming external application content size.\n         * @language en_US\n         */\n        /**\n         * 不保持原始宽高比缩放应用程序内容，缩放后应用程序内容正好填满播放器视口。<br/>\n         * 在此模式下，舞台尺寸(Stage.stageWidth,Stage.stageHeight)始终等于初始化时外部传入的应用程序内容尺寸。\n         * @language zh_CN\n         */\n        StageScaleMode.EXACT_FIT = \"exactFit\";\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, but only to keep the contents of the original application constant width, height may change.<br/>\n         * In this mode, the stage width (Stage.stageWidth) is always equal to initialize external incoming application content width. Stage height (Stage.stageHeight) by the current scale with the player viewport height decision.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，但只保持应用程序内容的原始宽度不变，高度可能会改变。<br/>\n         * 在此模式下，舞台宽度(Stage.stageWidth)始终等于初始化时外部传入的应用程序内容宽度。舞台高度(Stage.stageHeight)由当前的缩放比例与播放器视口高度决定。\n         * @language zh_CN\n         */\n        StageScaleMode.FIXED_WIDTH = \"fixedWidth\";\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, but only to keep the contents of the original application constant height, width may change.<br/>\n         * In this mode, the stage height (Stage.stageHeight) is always equal to initialize external incoming application content height. Stage width (Stage.stageWidth) by the current scale with the player viewport width decision.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，但只保持应用程序内容的原始高度不变，宽度可能会改变。<br/>\n         * 在此模式下，舞台高度(Stage.stageHeight)始终等于初始化时外部传入的应用程序内容高度。舞台宽度(Stage.stageWidth)由当前的缩放比例与播放器视口宽度决定。\n         * @language zh_CN\n         */\n        StageScaleMode.FIXED_HEIGHT = \"fixedHeight\";\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player,a narrow direction may not be wide enough and fill.<br/>\n         * In this mode, the stage height (Stage.stageHeight) and the stage width (Stage.stageWidth) by the current scale with the player viewport size.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，应用程序内容的较窄方向可能会不够宽而填充。<br/>\n         * 在此模式下，舞台高度(Stage.stageHeight)和舞台宽度(Stage.stageWidth)由当前的缩放比例与播放器视口宽高决定。\n         * @language zh_CN\n         */\n        StageScaleMode.FIXED_NARROW = \"fixedNarrow\";\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, a wide direction may exceed the viewport and the player is cut.<br/>\n         * In this mode, the stage height (Stage.stageHeight) and the stage width (Stage.stageWidth) by the current scale with the player viewport size.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，应用程序内容的较宽方向的两侧可能会超出播放器视口而被裁切。<br/>\n         * 在此模式下，舞台高度(Stage.stageHeight)和舞台宽度(Stage.stageWidth)由当前的缩放比例与播放器视口宽高决定。\n         * @language zh_CN\n         */\n        StageScaleMode.FIXED_WIDE = \"fixedWide\";\n        return StageScaleMode;\n    }());\n    egret.StageScaleMode = StageScaleMode;\n    __reflect(StageScaleMode.prototype, \"egret.StageScaleMode\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * 创建一个canvas。\n         */\n        function mainCanvas(width, height) {\n            console.error(\"empty sys.mainCanvas = \" + width + \", \" + height);\n            return null;\n        }\n        sys.mainCanvas = mainCanvas;\n        function createCanvas(width, height) {\n            console.error(\"empty sys.createCanvas = \" + width + \", \" + height);\n            return null;\n        }\n        sys.createCanvas = createCanvas;\n        /**\n        * 重新设置主canvas的大小\n        */\n        function resizeContext(renderContext, width, height, useMaxSize) {\n            console.error(\"empty sys.resizeContext = \" + renderContext + \", \" + width + \", \" + height + \", \" + useMaxSize);\n        }\n        sys.resizeContext = resizeContext;\n        /**\n        * 获得系统的渲染运行时\n        */\n        function getContextWebGL(surface) {\n            console.error(\"empty sys.getContextWebGL = \" + surface);\n            return null;\n        }\n        sys.getContextWebGL = getContextWebGL;\n        function getContext2d(surface) {\n            console.error(\"empty sys.getContext2d = \" + surface);\n            return null;\n        }\n        sys.getContext2d = getContext2d;\n        /**\n        * 仅通过bitmapData创建纹理\n        */\n        function createTexture(renderContext, bitmapData) {\n            console.error(\"empty sys.createTexture = \" + bitmapData);\n            return null;\n        }\n        sys.createTexture = createTexture;\n        /**\n        * 通过 width, height, data创建纹理\n        */\n        function _createTexture(renderContext, width, height, data) {\n            console.error(\"empty sys._createTexture = \" + width + \", \" + height + \", \" + data);\n            return null;\n        }\n        sys._createTexture = _createTexture;\n        /**\n         * 画texture\n         **/\n        function drawTextureElements(renderContext, data, offset) {\n            console.error(\"empty sys.drawTextureElements = \" + renderContext + \", \" + data + \", \" + offset);\n            return 0;\n        }\n        sys.drawTextureElements = drawTextureElements;\n        /**\n         * 测量文本的宽度\n         * @param context\n         * @param text\n         */\n        function measureTextWith(context, text) {\n            console.error(\"empty sys.measureTextWith = \" + context + \", \" + text);\n            return 0;\n        }\n        sys.measureTextWith = measureTextWith;\n        /**\n         * 为CanvasRenderBuffer创建一个canvas\n         * @param defaultFunc\n         * @param width\n         * @param height\n         * @param root\n         */\n        function createCanvasRenderBufferSurface(defaultFunc, width, height, root) {\n            console.error(\"empty sys.createCanvasRenderBufferSurface = \" + width + \", \" + height);\n            return null;\n        }\n        sys.createCanvasRenderBufferSurface = createCanvasRenderBufferSurface;\n        /**\n         * 改变渲染缓冲的大小并清空缓冲区\n         * @param renderContext\n         * @param width\n         * @param height\n         * @param useMaxSize\n         */\n        function resizeCanvasRenderBuffer(renderContext, width, height, useMaxSize) {\n            console.error(\"empty sys.resizeContext = \" + renderContext + \", \" + width + \", \" + height + \", \" + useMaxSize);\n        }\n        sys.resizeCanvasRenderBuffer = resizeCanvasRenderBuffer;\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         */\n        sys.$START_TIME = 0;\n        /**\n         * @private\n         * 是否要广播Event.RENDER事件的标志。\n         */\n        sys.$invalidateRenderFlag = false;\n        /**\n         * @private\n         * 需要立即刷新屏幕的标志\n         */\n        sys.$requestRenderingFlag = false;\n        /**\n         * Egret心跳计时器\n         */\n        var SystemTicker = (function () {\n            /**\n             * @private\n             */\n            function SystemTicker() {\n                /**\n                 * @private\n                 */\n                this.playerList = [];\n                /**\n                 * @private\n                 */\n                this.callBackList = [];\n                /**\n                 * @private\n                 */\n                this.thisObjectList = [];\n                /**\n                 * @private\n                 * 全局帧率\n                 */\n                this.$frameRate = 30;\n                /**\n                 * @private\n                 */\n                this.lastTimeStamp = 0;\n                /**\n                 * @private\n                 * ticker 花销的时间\n                 */\n                this.costEnterFrame = 0;\n                /**\n                 * @private\n                 * 是否被暂停\n                 */\n                this.isPaused = false;\n                if (true && egret.ticker) {\n                    egret.$error(1008, \"egret.sys.SystemTicker\");\n                }\n                sys.$START_TIME = Date.now();\n                this.frameDeltaTime = 1000 / this.$frameRate;\n                this.lastCount = this.frameInterval = Math.round(60000 / this.$frameRate);\n            }\n            /**\n             * @private\n             * 注册一个播放器实例并运行\n             */\n            SystemTicker.prototype.$addPlayer = function (player) {\n                if (this.playerList.indexOf(player) != -1) {\n                    return;\n                }\n                if (true) {\n                    egret_stages.push(player.stage);\n                }\n                this.playerList = this.playerList.concat();\n                this.playerList.push(player);\n            };\n            /**\n             * @private\n             * 停止一个播放器实例的运行。\n             */\n            SystemTicker.prototype.$removePlayer = function (player) {\n                var index = this.playerList.indexOf(player);\n                if (index !== -1) {\n                    if (true) {\n                        var i = egret_stages.indexOf(player.stage);\n                        egret_stages.splice(i, 1);\n                    }\n                    this.playerList = this.playerList.concat();\n                    this.playerList.splice(index, 1);\n                }\n            };\n            /**\n             * @private\n             */\n            SystemTicker.prototype.$startTick = function (callBack, thisObject) {\n                var index = this.getTickIndex(callBack, thisObject);\n                if (index != -1) {\n                    return;\n                }\n                this.concatTick();\n                this.callBackList.push(callBack);\n                this.thisObjectList.push(thisObject);\n            };\n            /**\n             * @private\n             */\n            SystemTicker.prototype.$stopTick = function (callBack, thisObject) {\n                var index = this.getTickIndex(callBack, thisObject);\n                if (index == -1) {\n                    return;\n                }\n                this.concatTick();\n                this.callBackList.splice(index, 1);\n                this.thisObjectList.splice(index, 1);\n            };\n            /**\n             * @private\n             */\n            SystemTicker.prototype.getTickIndex = function (callBack, thisObject) {\n                var callBackList = this.callBackList;\n                var thisObjectList = this.thisObjectList;\n                for (var i = callBackList.length - 1; i >= 0; i--) {\n                    if (callBackList[i] == callBack &&\n                        thisObjectList[i] == thisObject) {\n                        return i;\n                    }\n                }\n                return -1;\n            };\n            /**\n             * @private\n             *\n             */\n            SystemTicker.prototype.concatTick = function () {\n                this.callBackList = this.callBackList.concat();\n                this.thisObjectList = this.thisObjectList.concat();\n            };\n            /**\n             * @private\n             * 设置全局帧率\n             */\n            SystemTicker.prototype.$setFrameRate = function (value) {\n                if (value <= 0) {\n                    return false;\n                }\n                if (this.$frameRate == value) {\n                    return false;\n                }\n                this.$frameRate = value;\n                if (value > 60) {\n                    value = 60;\n                }\n                this.frameDeltaTime = 1000 / value;\n                //这里用60*1000来避免浮点数计算不准确的问题。\n                this.lastCount = this.frameInterval = Math.round(60000 / value);\n                return true;\n            };\n            /**\n             * Pause the ticker.\n             * @version Egret 5.0.2\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 暂停心跳\n             * @version Egret 5.0.2\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            SystemTicker.prototype.pause = function () {\n                this.isPaused = true;\n            };\n            /**\n             * Resume the ticker.\n             * @version Egret 5.0.2\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 恢复心跳\n             * @version Egret 5.0.2\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            SystemTicker.prototype.resume = function () {\n                this.isPaused = false;\n            };\n            /**\n             * @private\n             * 执行一次刷新\n             */\n            SystemTicker.prototype.update = function (forceUpdate) {\n                var t1 = egret.getTimer();\n                var callBackList = this.callBackList;\n                var thisObjectList = this.thisObjectList;\n                var length = callBackList.length;\n                var requestRenderingFlag = sys.$requestRenderingFlag;\n                var timeStamp = egret.getTimer();\n                var contexts = egret.lifecycle.contexts;\n                for (var _i = 0, contexts_1 = contexts; _i < contexts_1.length; _i++) {\n                    var c = contexts_1[_i];\n                    if (c.onUpdate) {\n                        c.onUpdate();\n                    }\n                }\n                if (this.isPaused) {\n                    this.lastTimeStamp = timeStamp;\n                    return;\n                }\n                this.callLaterAsyncs();\n                for (var i = 0; i < length; i++) {\n                    if (callBackList[i].call(thisObjectList[i], timeStamp)) {\n                        requestRenderingFlag = true;\n                    }\n                }\n                var t2 = egret.getTimer();\n                var deltaTime = timeStamp - this.lastTimeStamp;\n                this.lastTimeStamp = timeStamp;\n                if (deltaTime >= this.frameDeltaTime || forceUpdate) {\n                    this.lastCount = this.frameInterval;\n                }\n                else {\n                    this.lastCount -= 1000;\n                    if (this.lastCount > 0) {\n                        if (requestRenderingFlag) {\n                            this.render(false, this.costEnterFrame + t2 - t1);\n                        }\n                        return;\n                    }\n                    this.lastCount += this.frameInterval;\n                }\n                this.render(true, this.costEnterFrame + t2 - t1);\n                var t3 = egret.getTimer();\n                this.broadcastEnterFrame();\n                var t4 = egret.getTimer();\n                this.costEnterFrame = t4 - t3;\n            };\n            /**\n             * @private\n             * 执行一次屏幕渲染\n             */\n            SystemTicker.prototype.render = function (triggerByFrame, costTicker) {\n                var playerList = this.playerList;\n                var length = playerList.length;\n                if (length == 0) {\n                    return;\n                }\n                this.callLaters();\n                if (sys.$invalidateRenderFlag) {\n                    this.broadcastRender();\n                    sys.$invalidateRenderFlag = false;\n                }\n                for (var i = 0; i < length; i++) {\n                    playerList[i].$render(triggerByFrame, costTicker);\n                }\n                sys.$requestRenderingFlag = false;\n            };\n            /**\n             * @private\n             * 广播EnterFrame事件。\n             */\n            SystemTicker.prototype.broadcastEnterFrame = function () {\n                var list = egret.DisplayObject.$enterFrameCallBackList;\n                var length = list.length;\n                if (length == 0) {\n                    return;\n                }\n                list = list.concat();\n                for (var i = 0; i < length; i++) {\n                    list[i].dispatchEventWith(egret.Event.ENTER_FRAME);\n                }\n            };\n            /**\n             * @private\n             * 广播Render事件。\n             */\n            SystemTicker.prototype.broadcastRender = function () {\n                var list = egret.DisplayObject.$renderCallBackList;\n                var length = list.length;\n                if (length == 0) {\n                    return;\n                }\n                list = list.concat();\n                for (var i = 0; i < length; i++) {\n                    list[i].dispatchEventWith(egret.Event.RENDER);\n                }\n            };\n            /**\n             * @private\n             */\n            SystemTicker.prototype.callLaters = function () {\n                var functionList;\n                var thisList;\n                var argsList;\n                if (egret.$callLaterFunctionList.length > 0) {\n                    functionList = egret.$callLaterFunctionList;\n                    egret.$callLaterFunctionList = [];\n                    thisList = egret.$callLaterThisList;\n                    egret.$callLaterThisList = [];\n                    argsList = egret.$callLaterArgsList;\n                    egret.$callLaterArgsList = [];\n                }\n                if (functionList) {\n                    var length_2 = functionList.length;\n                    for (var i = 0; i < length_2; i++) {\n                        var func = functionList[i];\n                        if (func != null) {\n                            func.apply(thisList[i], argsList[i]);\n                        }\n                    }\n                }\n            };\n            /**\n             * @private\n             */\n            SystemTicker.prototype.callLaterAsyncs = function () {\n                if (egret.$callAsyncFunctionList.length > 0) {\n                    var locCallAsyncFunctionList = egret.$callAsyncFunctionList;\n                    var locCallAsyncThisList = egret.$callAsyncThisList;\n                    var locCallAsyncArgsList = egret.$callAsyncArgsList;\n                    egret.$callAsyncFunctionList = [];\n                    egret.$callAsyncThisList = [];\n                    egret.$callAsyncArgsList = [];\n                    for (var i = 0; i < locCallAsyncFunctionList.length; i++) {\n                        var func = locCallAsyncFunctionList[i];\n                        if (func != null) {\n                            func.apply(locCallAsyncThisList[i], locCallAsyncArgsList[i]);\n                        }\n                    }\n                }\n            };\n            return SystemTicker;\n        }());\n        sys.SystemTicker = SystemTicker;\n        __reflect(SystemTicker.prototype, \"egret.sys.SystemTicker\");\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n(function (egret) {\n    var lifecycle;\n    (function (lifecycle) {\n        /**\n         * @private\n         */\n        lifecycle.contexts = [];\n        var isActivate = true;\n        var LifecycleContext = (function () {\n            function LifecycleContext() {\n            }\n            LifecycleContext.prototype.pause = function () {\n                if (isActivate) {\n                    isActivate = false;\n                    lifecycle.stage.dispatchEvent(new egret.Event(egret.Event.DEACTIVATE));\n                    if (lifecycle.onPause) {\n                        lifecycle.onPause();\n                    }\n                }\n            };\n            LifecycleContext.prototype.resume = function () {\n                if (!isActivate) {\n                    isActivate = true;\n                    lifecycle.stage.dispatchEvent(new egret.Event(egret.Event.ACTIVATE));\n                    if (lifecycle.onResume) {\n                        lifecycle.onResume();\n                    }\n                }\n            };\n            return LifecycleContext;\n        }());\n        lifecycle.LifecycleContext = LifecycleContext;\n        __reflect(LifecycleContext.prototype, \"egret.lifecycle.LifecycleContext\");\n        function addLifecycleListener(plugin) {\n            var context = new LifecycleContext();\n            lifecycle.contexts.push(context);\n            plugin(context);\n        }\n        lifecycle.addLifecycleListener = addLifecycleListener;\n    })(lifecycle = egret.lifecycle || (egret.lifecycle = {}));\n    /**\n     * 心跳计时器单例\n     */\n    egret.ticker = new egret.sys.SystemTicker();\n})(egret || (egret = {}));\nif (true) {\n    global.egret_stages = [];\n}\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         * 用户交互操作管理器\n         */\n        var TouchHandler = (function (_super) {\n            __extends(TouchHandler, _super);\n            /**\n             * @private\n             */\n            function TouchHandler(stage) {\n                var _this = _super.call(this) || this;\n                _this.maxTouches = 0;\n                _this.useTouchesCount = 0;\n                /**\n                 * @private\n                 */\n                _this.touchDownTarget = {};\n                /**\n                 * @private\n                 */\n                _this.lastTouchX = -1;\n                /**\n                 * @private\n                 */\n                _this.lastTouchY = -1;\n                _this.stage = stage;\n                return _this;\n            }\n            /**\n             * @private\n             * 设置同时触摸数量\n             */\n            TouchHandler.prototype.$initMaxTouches = function () {\n                this.maxTouches = this.stage.$maxTouches;\n            };\n            /**\n             * @private\n             * 触摸开始（按下）\n             * @param x 事件发生处相对于舞台的坐标x\n             * @param y 事件发生处相对于舞台的坐标y\n             * @param touchPointID 分配给触摸点的唯一标识号\n             */\n            TouchHandler.prototype.onTouchBegin = function (x, y, touchPointID) {\n                if (this.useTouchesCount >= this.maxTouches) {\n                    return;\n                }\n                this.lastTouchX = x;\n                this.lastTouchY = y;\n                var target = this.findTarget(x, y);\n                if (this.touchDownTarget[touchPointID] == null) {\n                    this.touchDownTarget[touchPointID] = target;\n                    this.useTouchesCount++;\n                }\n                egret.TouchEvent.dispatchTouchEvent(target, egret.TouchEvent.TOUCH_BEGIN, true, true, x, y, touchPointID, true);\n            };\n            /**\n             * @private\n             * 触摸移动\n             * @param x 事件发生处相对于舞台的坐标x\n             * @param y 事件发生处相对于舞台的坐标y\n             * @param touchPointID 分配给触摸点的唯一标识号\n             */\n            TouchHandler.prototype.onTouchMove = function (x, y, touchPointID) {\n                if (this.touchDownTarget[touchPointID] == null) {\n                    return;\n                }\n                if (this.lastTouchX == x && this.lastTouchY == y) {\n                    return;\n                }\n                this.lastTouchX = x;\n                this.lastTouchY = y;\n                var target = this.findTarget(x, y);\n                egret.TouchEvent.dispatchTouchEvent(target, egret.TouchEvent.TOUCH_MOVE, true, true, x, y, touchPointID, true);\n            };\n            /**\n             * @private\n             * 触摸结束（弹起）\n             * @param x 事件发生处相对于舞台的坐标x\n             * @param y 事件发生处相对于舞台的坐标y\n             * @param touchPointID 分配给触摸点的唯一标识号\n             */\n            TouchHandler.prototype.onTouchEnd = function (x, y, touchPointID) {\n                if (this.touchDownTarget[touchPointID] == null) {\n                    return;\n                }\n                var target = this.findTarget(x, y);\n                var oldTarget = this.touchDownTarget[touchPointID];\n                delete this.touchDownTarget[touchPointID];\n                this.useTouchesCount--;\n                egret.TouchEvent.dispatchTouchEvent(target, egret.TouchEvent.TOUCH_END, true, true, x, y, touchPointID, false);\n                if (oldTarget == target) {\n                    egret.TouchEvent.dispatchTouchEvent(target, egret.TouchEvent.TOUCH_TAP, true, true, x, y, touchPointID, false);\n                }\n                else {\n                    egret.TouchEvent.dispatchTouchEvent(oldTarget, egret.TouchEvent.TOUCH_RELEASE_OUTSIDE, true, true, x, y, touchPointID, false);\n                }\n            };\n            /**\n             * @private\n             * 获取舞台坐标下的触摸对象\n             */\n            TouchHandler.prototype.findTarget = function (stageX, stageY) {\n                var target = this.stage.$hitTest(stageX, stageY);\n                if (!target) {\n                    target = this.stage;\n                }\n                return target;\n            };\n            return TouchHandler;\n        }(egret.HashObject));\n        sys.TouchHandler = TouchHandler;\n        __reflect(TouchHandler.prototype, \"egret.sys.TouchHandler\");\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         * 位图渲染节点\n         */\n        var BitmapNode = (function (_super) {\n            __extends(BitmapNode, _super);\n            function BitmapNode() {\n                var _this = _super.call(this) || this;\n                /**\n                 * 要绘制的位图\n                 */\n                _this.image = null;\n                /**\n                 * 控制在缩放时是否对位图进行平滑处理。\n                 */\n                _this.smoothing = true;\n                /**\n                 * 使用的混合模式\n                 */\n                _this.blendMode = null;\n                /**\n                 * 相对透明度\n                 */\n                _this.alpha = NaN;\n                /**\n                 * 颜色变换滤镜\n                 */\n                _this.filter = null;\n                /**\n                 * 翻转\n                 */\n                _this.rotated = false;\n                _this.type = 1 /* BitmapNode */;\n                return _this;\n            }\n            /**\n             * 绘制一次位图\n             */\n            BitmapNode.prototype.drawImage = function (sourceX, sourceY, sourceW, sourceH, drawX, drawY, drawW, drawH) {\n                this.drawData.push(sourceX, sourceY, sourceW, sourceH, drawX, drawY, drawW, drawH);\n                this.renderCount++;\n            };\n            /**\n             * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n             */\n            BitmapNode.prototype.cleanBeforeRender = function () {\n                _super.prototype.cleanBeforeRender.call(this);\n                this.image = null;\n                this.matrix = null;\n                this.blendMode = null;\n                this.alpha = NaN;\n                this.filter = null;\n            };\n            BitmapNode.$updateTextureData = function (node, image, bitmapX, bitmapY, bitmapWidth, bitmapHeight, offsetX, offsetY, textureWidth, textureHeight, destW, destH, sourceWidth, sourceHeight, fillMode, smoothing) {\n                if (!image) {\n                    return;\n                }\n                var scale = egret.$TextureScaleFactor;\n                node.smoothing = smoothing;\n                node.image = image;\n                node.imageWidth = sourceWidth;\n                node.imageHeight = sourceHeight;\n                if (fillMode == egret.BitmapFillMode.SCALE) {\n                    var tsX = destW / textureWidth * scale;\n                    var tsY = destH / textureHeight * scale;\n                    node.drawImage(bitmapX, bitmapY, bitmapWidth, bitmapHeight, tsX * offsetX, tsY * offsetY, tsX * bitmapWidth, tsY * bitmapHeight);\n                }\n                else if (fillMode == egret.BitmapFillMode.CLIP) {\n                    var displayW = Math.min(textureWidth, destW);\n                    var displayH = Math.min(textureHeight, destH);\n                    var scaledBitmapW = bitmapWidth * scale;\n                    var scaledBitmapH = bitmapHeight * scale;\n                    BitmapNode.drawClipImage(node, scale, bitmapX, bitmapY, scaledBitmapW, scaledBitmapH, offsetX, offsetY, displayW, displayH);\n                }\n                else {\n                    var scaledBitmapW = bitmapWidth * scale;\n                    var scaledBitmapH = bitmapHeight * scale;\n                    for (var startX = 0; startX < destW; startX += textureWidth) {\n                        for (var startY = 0; startY < destH; startY += textureHeight) {\n                            var displayW = Math.min(destW - startX, textureWidth);\n                            var displayH = Math.min(destH - startY, textureHeight);\n                            BitmapNode.drawClipImage(node, scale, bitmapX, bitmapY, scaledBitmapW, scaledBitmapH, offsetX, offsetY, displayW, displayH, startX, startY);\n                        }\n                    }\n                }\n            };\n            /**\n             * @private\n             * 绘制九宫格位图\n             */\n            BitmapNode.$updateTextureDataWithScale9Grid = function (node, image, scale9Grid, bitmapX, bitmapY, bitmapWidth, bitmapHeight, offsetX, offsetY, textureWidth, textureHeight, destW, destH, sourceWidth, sourceHeight, smoothing) {\n                node.smoothing = smoothing;\n                node.image = image;\n                node.imageWidth = sourceWidth;\n                node.imageHeight = sourceHeight;\n                var imageWidth = bitmapWidth;\n                var imageHeight = bitmapHeight;\n                destW = destW - (textureWidth - bitmapWidth * egret.$TextureScaleFactor);\n                destH = destH - (textureHeight - bitmapHeight * egret.$TextureScaleFactor);\n                var targetW0 = scale9Grid.x - offsetX;\n                var targetH0 = scale9Grid.y - offsetY;\n                var sourceW0 = targetW0 / egret.$TextureScaleFactor;\n                var sourceH0 = targetH0 / egret.$TextureScaleFactor;\n                var sourceW1 = scale9Grid.width / egret.$TextureScaleFactor;\n                var sourceH1 = scale9Grid.height / egret.$TextureScaleFactor;\n                //防止空心的情况出现。\n                if (sourceH1 == 0) {\n                    sourceH1 = 1;\n                    if (sourceH0 >= imageHeight) {\n                        sourceH0--;\n                    }\n                }\n                if (sourceW1 == 0) {\n                    sourceW1 = 1;\n                    if (sourceW0 >= imageWidth) {\n                        sourceW0--;\n                    }\n                }\n                var sourceX0 = bitmapX;\n                var sourceX1 = sourceX0 + sourceW0;\n                var sourceX2 = sourceX1 + sourceW1;\n                var sourceW2 = imageWidth - sourceW0 - sourceW1;\n                var sourceY0 = bitmapY;\n                var sourceY1 = sourceY0 + sourceH0;\n                var sourceY2 = sourceY1 + sourceH1;\n                var sourceH2 = imageHeight - sourceH0 - sourceH1;\n                var targetW2 = sourceW2 * egret.$TextureScaleFactor;\n                var targetH2 = sourceH2 * egret.$TextureScaleFactor;\n                if ((sourceW0 + sourceW2) * egret.$TextureScaleFactor > destW || (sourceH0 + sourceH2) * egret.$TextureScaleFactor > destH) {\n                    node.drawImage(bitmapX, bitmapY, bitmapWidth, bitmapHeight, offsetX, offsetY, destW, destH);\n                    return;\n                }\n                var targetX0 = offsetX;\n                var targetX1 = targetX0 + targetW0;\n                var targetX2 = targetX0 + (destW - targetW2);\n                var targetW1 = destW - targetW0 - targetW2;\n                var targetY0 = offsetY;\n                var targetY1 = targetY0 + targetH0;\n                var targetY2 = targetY0 + destH - targetH2;\n                var targetH1 = destH - targetH0 - targetH2;\n                //\n                //             x0     x1     x2\n                //          y0 +------+------+------+\n                //             |      |      |      | h0\n                //             |      |      |      |\n                //          y1 +------+------+------+\n                //             |      |      |      | h1\n                //             |      |      |      |\n                //          y2 +------+------+------+\n                //             |      |      |      | h2\n                //             |      |      |      |\n                //             +------+------+------+\n                //                w0     w1     w2\n                //\n                if (sourceH0 > 0) {\n                    if (sourceW0 > 0)\n                        node.drawImage(sourceX0, sourceY0, sourceW0, sourceH0, targetX0, targetY0, targetW0, targetH0);\n                    if (sourceW1 > 0)\n                        node.drawImage(sourceX1, sourceY0, sourceW1, sourceH0, targetX1, targetY0, targetW1, targetH0);\n                    if (sourceW2 > 0)\n                        node.drawImage(sourceX2, sourceY0, sourceW2, sourceH0, targetX2, targetY0, targetW2, targetH0);\n                }\n                if (sourceH1 > 0) {\n                    if (sourceW0 > 0)\n                        node.drawImage(sourceX0, sourceY1, sourceW0, sourceH1, targetX0, targetY1, targetW0, targetH1);\n                    if (sourceW1 > 0)\n                        node.drawImage(sourceX1, sourceY1, sourceW1, sourceH1, targetX1, targetY1, targetW1, targetH1);\n                    if (sourceW2 > 0)\n                        node.drawImage(sourceX2, sourceY1, sourceW2, sourceH1, targetX2, targetY1, targetW2, targetH1);\n                }\n                if (sourceH2 > 0) {\n                    if (sourceW0 > 0)\n                        node.drawImage(sourceX0, sourceY2, sourceW0, sourceH2, targetX0, targetY2, targetW0, targetH2);\n                    if (sourceW1 > 0)\n                        node.drawImage(sourceX1, sourceY2, sourceW1, sourceH2, targetX1, targetY2, targetW1, targetH2);\n                    if (sourceW2 > 0)\n                        node.drawImage(sourceX2, sourceY2, sourceW2, sourceH2, targetX2, targetY2, targetW2, targetH2);\n                }\n            };\n            /**\n             * @private\n             */\n            BitmapNode.drawClipImage = function (node, scale, bitmapX, bitmapY, scaledBitmapW, scaledBitmapH, offsetX, offsetY, destW, destH, startX, startY) {\n                if (startX === void 0) { startX = 0; }\n                if (startY === void 0) { startY = 0; }\n                var offset = offsetX + scaledBitmapW - destW;\n                if (offset > 0) {\n                    scaledBitmapW -= offset;\n                }\n                offset = offsetY + scaledBitmapH - destH;\n                if (offset > 0) {\n                    scaledBitmapH -= offset;\n                }\n                node.drawImage(bitmapX, bitmapY, scaledBitmapW / scale, scaledBitmapH / scale, startX + offsetX, startY + offsetY, scaledBitmapW, scaledBitmapH);\n            };\n            return BitmapNode;\n        }(sys.RenderNode));\n        sys.BitmapNode = BitmapNode;\n        __reflect(BitmapNode.prototype, \"egret.sys.BitmapNode\");\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        var CAPS_STYLES = [\"none\", \"round\", \"square\"];\n        var JOINT_STYLES = [\"bevel\", \"miter\", \"round\"];\n        /**\n         * @private\n         * 矢量渲染节点\n         */\n        var GraphicsNode = (function (_super) {\n            __extends(GraphicsNode, _super);\n            function GraphicsNode() {\n                var _this = _super.call(this) || this;\n                /**\n                 * 脏渲染标记\n                 * 暂时调用lineStyle,beginFill,beginGradientFill标记,实际应该draw时候标记在Path2D\n                 */\n                _this.dirtyRender = true;\n                _this.type = 3 /* GraphicsNode */;\n                return _this;\n            }\n            /**\n             * 指定一种简单的单一颜色填充，在绘制时该填充将在随后对其他 Graphics 方法（如 lineTo() 或 drawCircle()）的调用中使用。\n             * @param color 填充的颜色\n             * @param alpha 填充的 Alpha 值\n             * @param beforePath 插入在指定的路径命令之前绘制，通常是插入到当前正在绘制的线条路径之前，以确保线条总在填充的上方。\n             */\n            GraphicsNode.prototype.beginFill = function (color, alpha, beforePath) {\n                if (alpha === void 0) { alpha = 1; }\n                var path = new sys.FillPath();\n                path.fillColor = color;\n                path.fillAlpha = alpha;\n                if (beforePath) {\n                    var index = this.drawData.lastIndexOf(beforePath);\n                    this.drawData.splice(index, 0, path);\n                }\n                else {\n                    this.drawData.push(path);\n                }\n                this.renderCount++;\n                return path;\n            };\n            /**\n             * 指定一种简单的单一颜色填充，在绘制时该填充将在随后对其他 Graphics 方法（如 lineTo() 或 drawCircle()）的调用中使用。\n             * 调用 clear() 方法会清除填充。\n             * @param type 用于指定要使用哪种渐变类型的 GradientType 类的值：GradientType.LINEAR 或 GradientType.RADIAL。\n             * @param colors 渐变中使用的 RGB 十六进制颜色值的数组（例如，红色为 0xFF0000，蓝色为 0x0000FF，等等）。对于每种颜色，请在 alphas 和 ratios 参数中指定对应值。\n             * @param alphas colors 数组中对应颜色的 alpha 值数组。\n             * @param ratios 颜色分布比率的数组。有效值为 0 到 255。\n             * @param matrix 一个由 egret.Matrix 类定义的转换矩阵。egret.Matrix 类包括 createGradientBox() 方法，通过该方法可以方便地设置矩阵，以便与 beginGradientFill() 方法一起使用\n             * @param beforePath 插入在指定的路径命令之前绘制，通常是插入到当前正在绘制的线条路径之前，以确保线条总在填充的上方。\n             */\n            GraphicsNode.prototype.beginGradientFill = function (type, colors, alphas, ratios, matrix, beforePath) {\n                var m = new egret.Matrix();\n                if (matrix) {\n                    m.a = matrix.a * 819.2;\n                    m.b = matrix.b * 819.2;\n                    m.c = matrix.c * 819.2;\n                    m.d = matrix.d * 819.2;\n                    m.tx = matrix.tx;\n                    m.ty = matrix.ty;\n                }\n                else {\n                    //默认值\n                    m.a = 100;\n                    m.d = 100;\n                }\n                var path = new sys.GradientFillPath();\n                path.gradientType = type;\n                path.colors = colors;\n                path.alphas = alphas;\n                path.ratios = ratios;\n                path.matrix = m;\n                if (beforePath) {\n                    var index = this.drawData.lastIndexOf(beforePath);\n                    this.drawData.splice(index, 0, path);\n                }\n                else {\n                    this.drawData.push(path);\n                }\n                this.renderCount++;\n                return path;\n            };\n            /**\n             * 指定一种线条样式以用于随后对 lineTo() 或 drawCircle() 等 Graphics 方法的调用。\n             * @param thickness 一个整数，以点为单位表示线条的粗细，有效值为 0 到 255。如果未指定数字，或者未定义该参数，则不绘制线条。如果传递的值小于 0，则默认值为 0。值 0 表示极细的粗细；最大粗细为 255。如果传递的值大于 255，则默认值为 255。\n             * @param color 线条的十六进制颜色值（例如，红色为 0xFF0000，蓝色为 0x0000FF 等）。如果未指明值，则默认值为 0x000000（黑色）。可选。\n             * @param alpha 表示线条颜色的 Alpha 值的数字；有效值为 0 到 1。如果未指明值，则默认值为 1（纯色）。如果值小于 0，则默认值为 0。如果值大于 1，则默认值为 1。\n             * @param caps 用于指定线条末端处端点类型的 CapsStyle 类的值。默认值：CapsStyle.ROUND\n             * @param joints 指定用于拐角的连接外观的类型。默认值：JointStyle.ROUND\n             * @param miterLimit 用于表示剪切斜接的极限值的数字。\n             */\n            GraphicsNode.prototype.lineStyle = function (thickness, color, alpha, caps, joints, miterLimit, lineDash) {\n                if (alpha === void 0) { alpha = 1; }\n                if (miterLimit === void 0) { miterLimit = 3; }\n                if (lineDash === void 0) { lineDash = []; }\n                if (CAPS_STYLES.indexOf(caps) == -1) {\n                    caps = \"round\";\n                }\n                if (JOINT_STYLES.indexOf(joints) == -1) {\n                    joints = \"round\";\n                }\n                var path = new sys.StrokePath();\n                path.lineWidth = thickness;\n                path.lineColor = color;\n                path.lineAlpha = alpha;\n                path.caps = caps || egret.CapsStyle.ROUND;\n                path.joints = joints;\n                path.miterLimit = miterLimit;\n                path.lineDash = lineDash;\n                this.drawData.push(path);\n                this.renderCount++;\n                return path;\n            };\n            /**\n             * 清空所有缓存的绘制数据\n             */\n            GraphicsNode.prototype.clear = function () {\n                this.drawData.length = 0;\n                this.dirtyRender = true;\n                this.renderCount = 0;\n            };\n            /**\n             * 覆盖父类方法，不自动清空缓存的绘图数据，改为手动调用clear()方法清空。\n             */\n            GraphicsNode.prototype.cleanBeforeRender = function () {\n            };\n            /**\n             * 清除非绘制的缓存数据\n             */\n            GraphicsNode.prototype.clean = function () {\n                if (this.$texture) {\n                    egret.WebGLUtils.deleteWebGLTexture(this.$texture);\n                    this.$texture = null;\n                    this.dirtyRender = true;\n                }\n            };\n            return GraphicsNode;\n        }(sys.RenderNode));\n        sys.GraphicsNode = GraphicsNode;\n        __reflect(GraphicsNode.prototype, \"egret.sys.GraphicsNode\");\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         * 组渲染节点,用于组合多个渲染节点\n         */\n        var GroupNode = (function (_super) {\n            __extends(GroupNode, _super);\n            function GroupNode() {\n                var _this = _super.call(this) || this;\n                _this.type = 4 /* GroupNode */;\n                return _this;\n            }\n            GroupNode.prototype.addNode = function (node) {\n                this.drawData.push(node);\n            };\n            /**\n             * 覆盖父类方法，不自动清空缓存的绘图数据，改为手动调用clear()方法清空。\n             * 这里只是想清空绘制命令，因此不调用super\n             */\n            GroupNode.prototype.cleanBeforeRender = function () {\n                var data = this.drawData;\n                for (var i = data.length - 1; i >= 0; i--) {\n                    data[i].cleanBeforeRender();\n                }\n            };\n            GroupNode.prototype.$getRenderCount = function () {\n                var result = 0;\n                var data = this.drawData;\n                for (var i = data.length - 1; i >= 0; i--) {\n                    result += data[i].$getRenderCount();\n                }\n                return result;\n            };\n            return GroupNode;\n        }(sys.RenderNode));\n        sys.GroupNode = GroupNode;\n        __reflect(GroupNode.prototype, \"egret.sys.GroupNode\");\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         * Mesh 渲染节点\n         */\n        var MeshNode = (function (_super) {\n            __extends(MeshNode, _super);\n            function MeshNode() {\n                var _this = _super.call(this) || this;\n                /**\n                 * 要绘制的位图\n                 */\n                _this.image = null;\n                /**\n                 * 控制在缩放时是否对位图进行平滑处理。\n                 */\n                _this.smoothing = true;\n                /**\n                 * 顶点索引。\n                 */\n                _this.bounds = new egret.Rectangle();\n                /**\n                 * 使用的混合模式\n                 */\n                _this.blendMode = null;\n                /**\n                 * 相对透明度\n                 */\n                _this.alpha = NaN;\n                /**\n                 * 颜色变换滤镜\n                 */\n                _this.filter = null;\n                /**\n                 * 翻转\n                 */\n                _this.rotated = false;\n                _this.type = 5 /* MeshNode */;\n                _this.vertices = [];\n                _this.uvs = [];\n                _this.indices = [];\n                return _this;\n            }\n            /**\n             * 绘制一次位图\n             */\n            MeshNode.prototype.drawMesh = function (sourceX, sourceY, sourceW, sourceH, drawX, drawY, drawW, drawH) {\n                this.drawData.push(sourceX, sourceY, sourceW, sourceH, drawX, drawY, drawW, drawH);\n                this.renderCount++;\n            };\n            /**\n             * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n             */\n            MeshNode.prototype.cleanBeforeRender = function () {\n                _super.prototype.cleanBeforeRender.call(this);\n                this.image = null;\n                this.matrix = null;\n            };\n            return MeshNode;\n        }(sys.RenderNode));\n        sys.MeshNode = MeshNode;\n        __reflect(MeshNode.prototype, \"egret.sys.MeshNode\");\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         * 位图渲染节点\n         */\n        var NormalBitmapNode = (function (_super) {\n            __extends(NormalBitmapNode, _super);\n            function NormalBitmapNode() {\n                var _this = _super.call(this) || this;\n                /**\n                 * 要绘制的位图\n                 */\n                _this.image = null;\n                /**\n                 * 控制在缩放时是否对位图进行平滑处理。\n                 */\n                _this.smoothing = true;\n                /**\n                 * 翻转\n                 */\n                _this.rotated = false;\n                _this.type = 6 /* NormalBitmapNode */;\n                return _this;\n            }\n            /**\n             * 绘制一次位图\n             */\n            NormalBitmapNode.prototype.drawImage = function (sourceX, sourceY, sourceW, sourceH, drawX, drawY, drawW, drawH) {\n                var self = this;\n                self.sourceX = sourceX;\n                self.sourceY = sourceY;\n                self.sourceW = sourceW;\n                self.sourceH = sourceH;\n                self.drawX = drawX;\n                self.drawY = drawY;\n                self.drawW = drawW;\n                self.drawH = drawH;\n                self.renderCount = 1;\n            };\n            /**\n             * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n             */\n            NormalBitmapNode.prototype.cleanBeforeRender = function () {\n                _super.prototype.cleanBeforeRender.call(this);\n                this.image = null;\n            };\n            return NormalBitmapNode;\n        }(sys.RenderNode));\n        sys.NormalBitmapNode = NormalBitmapNode;\n        __reflect(NormalBitmapNode.prototype, \"egret.sys.NormalBitmapNode\");\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @private\n     */\n    var Mesh = (function (_super) {\n        __extends(Mesh, _super);\n        function Mesh(value) {\n            var _this = _super.call(this, value) || this;\n            /**\n             * @private\n             */\n            _this._verticesDirty = true;\n            _this._bounds = new egret.Rectangle();\n            _this.$renderNode = new egret.sys.MeshNode();\n            return _this;\n        }\n        Mesh.prototype.createNativeDisplayObject = function () {\n            this.$nativeDisplayObject = new egret_native.NativeDisplayObject(12 /* MESH */);\n        };\n        /**\n         * @private\n         */\n        Mesh.prototype.setBitmapDataToWasm = function (data) {\n            this.$nativeDisplayObject.setBitmapDataToMesh(data);\n        };\n        /**\n         * @private\n         */\n        Mesh.prototype.$updateRenderNode = function () {\n            var image = this.$bitmapData;\n            if (!image) {\n                return;\n            }\n            var scale = egret.$TextureScaleFactor;\n            var node = this.$renderNode;\n            node.smoothing = this.$smoothing;\n            node.image = image;\n            node.imageWidth = this.$sourceWidth;\n            node.imageHeight = this.$sourceHeight;\n            var destW = !isNaN(this.$explicitBitmapWidth) ? this.$explicitBitmapWidth : this.$textureWidth;\n            var destH = !isNaN(this.$explicitBitmapHeight) ? this.$explicitBitmapHeight : this.$textureHeight;\n            var tsX = destW / this.$textureWidth;\n            var tsY = destH / this.$textureHeight;\n            var bitmapWidth = this.$bitmapWidth;\n            var bitmapHeight = this.$bitmapHeight;\n            node.drawMesh(this.$bitmapX, this.$bitmapY, bitmapWidth, bitmapHeight, this.$offsetX * tsX, this.$offsetY * tsY, tsX * bitmapWidth, tsY * bitmapHeight);\n        };\n        /**\n         * @private\n         */\n        Mesh.prototype.$updateVertices = function () {\n            var self = this;\n            self._verticesDirty = true;\n            self.$renderDirty = true;\n            if (egret.nativeRender) {\n                var renderNode = (this.$renderNode);\n                this.$nativeDisplayObject.setDataToMesh(renderNode.vertices, renderNode.indices, renderNode.uvs);\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        /**\n         * @private\n         */\n        Mesh.prototype.$measureContentBounds = function (bounds) {\n            if (this._verticesDirty) {\n                this._verticesDirty = false;\n                var node = this.$renderNode;\n                var vertices = node.vertices;\n                if (vertices.length) {\n                    this._bounds.setTo(Number.MAX_VALUE, Number.MAX_VALUE, -Number.MAX_VALUE, -Number.MAX_VALUE);\n                    for (var i = 0, l = vertices.length; i < l; i += 2) {\n                        var x = vertices[i];\n                        var y = vertices[i + 1];\n                        if (this._bounds.x > x)\n                            this._bounds.x = x;\n                        if (this._bounds.width < x)\n                            this._bounds.width = x;\n                        if (this._bounds.y > y)\n                            this._bounds.y = y;\n                        if (this._bounds.height < y)\n                            this._bounds.height = y;\n                    }\n                    this._bounds.width -= this._bounds.x;\n                    this._bounds.height -= this._bounds.y;\n                }\n                else {\n                    this._bounds.setTo(0, 0, 0, 0);\n                }\n                node.bounds.copyFrom(this._bounds);\n            }\n            bounds.copyFrom(this._bounds);\n        };\n        return Mesh;\n    }(egret.Bitmap));\n    egret.Mesh = Mesh;\n    __reflect(Mesh.prototype, \"egret.Mesh\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         * 文本渲染节点\n         */\n        var TextNode = (function (_super) {\n            __extends(TextNode, _super);\n            function TextNode() {\n                var _this = _super.call(this) || this;\n                /**\n                 * 颜色值\n                 */\n                _this.textColor = 0xFFFFFF;\n                /**\n                 * 描边颜色值\n                 */\n                _this.strokeColor = 0x000000;\n                /**\n                 * 字号\n                 */\n                _this.size = 30;\n                /**\n                 * 描边大小\n                 */\n                _this.stroke = 0;\n                /**\n                 * 是否加粗\n                 */\n                _this.bold = false;\n                /**\n                 * 是否倾斜\n                 */\n                _this.italic = false;\n                /**\n                 * 字体名称\n                 */\n                _this.fontFamily = \"Arial\";\n                /**\n                 * 脏渲染标记\n                 */\n                _this.dirtyRender = true;\n                _this.type = 2 /* TextNode */;\n                return _this;\n            }\n            /**\n             * 绘制一行文本\n             */\n            TextNode.prototype.drawText = function (x, y, text, format) {\n                this.drawData.push(x, y, text, format);\n                this.renderCount++;\n                this.dirtyRender = true;\n            };\n            /**\n             * 清除非绘制的缓存数据\n             */\n            TextNode.prototype.clean = function () {\n                if (this.$texture) {\n                    egret.WebGLUtils.deleteWebGLTexture(this.$texture);\n                    this.$texture = null;\n                    this.dirtyRender = true;\n                }\n            };\n            /**\n             * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n             */\n            TextNode.prototype.cleanBeforeRender = function () {\n                _super.prototype.cleanBeforeRender.call(this);\n                this.dirtyRender = true;\n            };\n            return TextNode;\n        }(sys.RenderNode));\n        sys.TextNode = TextNode;\n        __reflect(TextNode.prototype, \"egret.sys.TextNode\");\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         * 填充路径\n         */\n        var FillPath = (function (_super) {\n            __extends(FillPath, _super);\n            function FillPath() {\n                var _this = _super.call(this) || this;\n                _this.type = 1 /* Fill */;\n                return _this;\n            }\n            return FillPath;\n        }(sys.Path2D));\n        sys.FillPath = FillPath;\n        __reflect(FillPath.prototype, \"egret.sys.FillPath\");\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         * 渐变填充路径\n         */\n        var GradientFillPath = (function (_super) {\n            __extends(GradientFillPath, _super);\n            function GradientFillPath() {\n                var _this = _super.call(this) || this;\n                _this.type = 2 /* GradientFill */;\n                return _this;\n            }\n            return GradientFillPath;\n        }(sys.Path2D));\n        sys.GradientFillPath = GradientFillPath;\n        __reflect(GradientFillPath.prototype, \"egret.sys.GradientFillPath\");\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * OrientationMode 类为舞台初始旋转模式提供值。\n     */\n    egret.OrientationMode = {\n        /**\n         * 适配屏幕\n         */\n        AUTO: \"auto\",\n        /**\n         * 默认竖屏\n         */\n        PORTRAIT: \"portrait\",\n        /**\n         * 默认横屏，舞台顺时针旋转90度\n         */\n        LANDSCAPE: \"landscape\",\n        /**\n         * 默认横屏，舞台逆时针旋转90度\n         */\n        LANDSCAPE_FLIPPED: \"landscapeFlipped\"\n    };\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n        /**\n         * @private\n         * 线条路径。\n         * 注意：当线条宽度（lineWidth）为1或3像素时，需要特殊处理，往右下角偏移0.5像素，以显示清晰锐利的线条。\n         */\n        var StrokePath = (function (_super) {\n            __extends(StrokePath, _super);\n            function StrokePath() {\n                var _this = _super.call(this) || this;\n                _this.type = 3 /* Stroke */;\n                return _this;\n            }\n            return StrokePath;\n        }(sys.Path2D));\n        sys.StrokePath = StrokePath;\n        __reflect(StrokePath.prototype, \"egret.sys.StrokePath\");\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var blendModes = [\"source-over\", \"lighter\", \"destination-out\"];\n    var defaultCompositeOp = \"source-over\";\n    var BLACK_COLOR = \"#000000\";\n    var CAPS_STYLES = { none: 'butt', square: 'square', round: 'round' };\n    var renderBufferPool = []; //渲染缓冲区对象池\n    var renderBufferPool_Filters = []; //滤镜缓冲区对象池\n    var CanvasRenderer = (function () {\n        function CanvasRenderer() {\n            this.nestLevel = 0; //渲染的嵌套层次，0表示在调用堆栈的最外层。\n            this.renderingMask = false;\n        }\n        CanvasRenderer.prototype.render = function (displayObject, buffer, matrix, forRenderTexture) {\n            this.nestLevel++;\n            var context = buffer.context;\n            var root = forRenderTexture ? displayObject : null;\n            //绘制显示对象\n            context.transform(matrix.a, matrix.b, matrix.c, matrix.d, 0, 0);\n            var drawCall = this.drawDisplayObject(displayObject, context, matrix.tx, matrix.ty, true);\n            var invert = egret.Matrix.create();\n            matrix.$invertInto(invert);\n            context.transform(invert.a, invert.b, invert.c, invert.d, 0, 0);\n            egret.Matrix.release(invert);\n            this.nestLevel--;\n            if (this.nestLevel === 0) {\n                //最大缓存6个渲染缓冲\n                if (renderBufferPool.length > 6) {\n                    renderBufferPool.length = 6;\n                }\n                var length_3 = renderBufferPool.length;\n                for (var i = 0; i < length_3; i++) {\n                    renderBufferPool[i].resize(0, 0);\n                }\n            }\n            return drawCall;\n        };\n        /**\n         * @private\n         * 绘制一个显示对象\n         */\n        CanvasRenderer.prototype.drawDisplayObject = function (displayObject, context, offsetX, offsetY, isStage) {\n            var drawCalls = 0;\n            var node;\n            var displayList = displayObject.$displayList;\n            if (displayList && !isStage) {\n                if (displayObject.$cacheDirty || displayObject.$renderDirty ||\n                    displayList.$canvasScaleX != egret.sys.DisplayList.$canvasScaleX ||\n                    displayList.$canvasScaleY != egret.sys.DisplayList.$canvasScaleY) {\n                    drawCalls += displayList.drawToSurface();\n                }\n                node = displayList.$renderNode;\n            }\n            else {\n                if (displayObject.$renderDirty) {\n                    node = displayObject.$getRenderNode();\n                }\n                else {\n                    node = displayObject.$renderNode;\n                }\n            }\n            displayObject.$cacheDirty = false;\n            if (node) {\n                drawCalls++;\n                context.$offsetX = offsetX;\n                context.$offsetY = offsetY;\n                switch (node.type) {\n                    case 1 /* BitmapNode */:\n                        this.renderBitmap(node, context);\n                        break;\n                    case 2 /* TextNode */:\n                        this.renderText(node, context);\n                        break;\n                    case 3 /* GraphicsNode */:\n                        this.renderGraphics(node, context);\n                        break;\n                    case 4 /* GroupNode */:\n                        this.renderGroup(node, context);\n                        break;\n                    case 5 /* MeshNode */:\n                        this.renderMesh(node, context);\n                        break;\n                    case 6 /* NormalBitmapNode */:\n                        this.renderNormalBitmap(node, context);\n                        break;\n                }\n                context.$offsetX = 0;\n                context.$offsetY = 0;\n            }\n            if (displayList && !isStage) {\n                return drawCalls;\n            }\n            var children = displayObject.$children;\n            if (children) {\n                var length_4 = children.length;\n                for (var i = 0; i < length_4; i++) {\n                    var child = children[i];\n                    var offsetX2 = void 0;\n                    var offsetY2 = void 0;\n                    if (child.$useTranslate) {\n                        var m = child.$getMatrix();\n                        offsetX2 = offsetX + child.$x;\n                        offsetY2 = offsetY + child.$y;\n                        context.save();\n                        context.transform(m.a, m.b, m.c, m.d, offsetX2, offsetY2);\n                        offsetX2 = -child.$anchorOffsetX;\n                        offsetY2 = -child.$anchorOffsetY;\n                    }\n                    else {\n                        offsetX2 = offsetX + child.$x - child.$anchorOffsetX;\n                        offsetY2 = offsetY + child.$y - child.$anchorOffsetY;\n                    }\n                    var tempAlpha = void 0;\n                    if (child.$alpha != 1) {\n                        tempAlpha = context.globalAlpha;\n                        context.globalAlpha *= child.$alpha;\n                    }\n                    switch (child.$renderMode) {\n                        case 1 /* NONE */:\n                            break;\n                        case 2 /* FILTER */:\n                            drawCalls += this.drawWithFilter(child, context, offsetX2, offsetY2);\n                            break;\n                        case 3 /* CLIP */:\n                            drawCalls += this.drawWithClip(child, context, offsetX2, offsetY2);\n                            break;\n                        case 4 /* SCROLLRECT */:\n                            drawCalls += this.drawWithScrollRect(child, context, offsetX2, offsetY2);\n                            break;\n                        default:\n                            drawCalls += this.drawDisplayObject(child, context, offsetX2, offsetY2);\n                            break;\n                    }\n                    if (child.$useTranslate) {\n                        context.restore();\n                    }\n                    else if (tempAlpha) {\n                        context.globalAlpha = tempAlpha;\n                    }\n                }\n            }\n            return drawCalls;\n        };\n        CanvasRenderer.prototype.drawWithFilter = function (displayObject, context, offsetX, offsetY) {\n            if (displayObject.$children && displayObject.$children.length == 0 && (!displayObject.$renderNode || displayObject.$renderNode.$getRenderCount() == 0)) {\n                return 0;\n            }\n            var drawCalls = 0;\n            var filters = displayObject.$filters;\n            var filtersLen = filters.length;\n            var hasBlendMode = (displayObject.$blendMode !== 0);\n            var compositeOp;\n            if (hasBlendMode) {\n                compositeOp = blendModes[displayObject.$blendMode];\n                if (!compositeOp) {\n                    compositeOp = defaultCompositeOp;\n                }\n            }\n            var displayBounds = displayObject.$getOriginalBounds();\n            var displayBoundsX = displayBounds.x;\n            var displayBoundsY = displayBounds.y;\n            var displayBoundsWidth = displayBounds.width;\n            var displayBoundsHeight = displayBounds.height;\n            if (displayBoundsWidth <= 0 || displayBoundsHeight <= 0) {\n                return drawCalls;\n            }\n            // 为显示对象创建一个新的buffer\n            var displayBuffer = this.createRenderBuffer(displayBoundsWidth - displayBoundsX, displayBoundsHeight - displayBoundsY, true);\n            var displayContext = displayBuffer.context;\n            if (displayObject.$mask) {\n                drawCalls += this.drawWithClip(displayObject, displayContext, -displayBoundsX, -displayBoundsY);\n            }\n            else if (displayObject.$scrollRect || displayObject.$maskRect) {\n                drawCalls += this.drawWithScrollRect(displayObject, displayContext, -displayBoundsX, -displayBoundsY);\n            }\n            else {\n                drawCalls += this.drawDisplayObject(displayObject, displayContext, -displayBoundsX, -displayBoundsY);\n            }\n            //绘制结果到屏幕\n            if (drawCalls > 0) {\n                if (hasBlendMode) {\n                    context.globalCompositeOperation = compositeOp;\n                }\n                drawCalls++;\n                // 应用滤镜\n                var imageData = displayContext.getImageData(0, 0, displayBuffer.surface.width, displayBuffer.surface.height);\n                for (var i = 0; i < filtersLen; i++) {\n                    var filter = filters[i];\n                    if (filter.type == \"colorTransform\") {\n                        colorFilter(imageData.data, displayBuffer.surface.width, displayBuffer.surface.height, filter.$matrix);\n                    }\n                    else if (filter.type == \"blur\") {\n                        blurFilter(imageData.data, displayBuffer.surface.width, displayBuffer.surface.height, filter.$blurX, filter.$blurY);\n                    }\n                    else if (filter.type == \"glow\") {\n                        var r = filter.$red;\n                        var g = filter.$green;\n                        var b = filter.$blue;\n                        var a = filter.$alpha;\n                        if (filter.$inner || filter.$knockout || filter.$hideObject) {\n                            dropShadowFilter2(imageData.data, displayBuffer.surface.width, displayBuffer.surface.height, [r / 255, g / 255, b / 255, a], filter.$blurX, filter.$blurY, filter.$angle ? (filter.$angle / 180 * Math.PI) : 0, filter.$distance || 0, filter.$strength, filter.$inner ? 1 : 0, filter.$knockout ? 0 : 1, filter.$hideObject ? 1 : 0);\n                        }\n                        else {\n                            // 如果没有高级效果，使用性能比较高的方式\n                            dropShadowFilter(imageData.data, displayBuffer.surface.width, displayBuffer.surface.height, [r / 255, g / 255, b / 255, a], filter.$blurX, filter.$blurY, filter.$angle ? (filter.$angle / 180 * Math.PI) : 0, filter.$distance || 0, filter.$strength);\n                        }\n                    }\n                    else if (filter.type == \"custom\") {\n                        // 目前canvas渲染不支持自定义滤镜\n                    }\n                }\n                displayContext.putImageData(imageData, 0, 0);\n                // 绘制结果的时候，应用滤镜\n                context.drawImage(displayBuffer.surface, offsetX + displayBoundsX, offsetY + displayBoundsY);\n                if (hasBlendMode) {\n                    context.globalCompositeOperation = defaultCompositeOp;\n                }\n            }\n            renderBufferPool_Filters.push(displayBuffer);\n            return drawCalls;\n        };\n        CanvasRenderer.prototype.drawWithClip = function (displayObject, context, offsetX, offsetY) {\n            var drawCalls = 0;\n            var hasBlendMode = (displayObject.$blendMode !== 0);\n            var compositeOp;\n            if (hasBlendMode) {\n                compositeOp = blendModes[displayObject.$blendMode];\n                if (!compositeOp) {\n                    compositeOp = defaultCompositeOp;\n                }\n            }\n            var scrollRect = displayObject.$scrollRect ? displayObject.$scrollRect : displayObject.$maskRect;\n            var mask = displayObject.$mask;\n            if (mask) {\n                var maskRenderMatrix = mask.$getMatrix();\n                //遮罩scaleX或scaleY为0，放弃绘制\n                if ((maskRenderMatrix.a == 0 && maskRenderMatrix.b == 0) || (maskRenderMatrix.c == 0 && maskRenderMatrix.d == 0)) {\n                    return drawCalls;\n                }\n            }\n            //没有遮罩,同时显示对象没有子项\n            if (!mask && (!displayObject.$children || displayObject.$children.length == 0)) {\n                if (scrollRect) {\n                    context.save();\n                    context.beginPath();\n                    context.rect(scrollRect.x + offsetX, scrollRect.y + offsetY, scrollRect.width, scrollRect.height);\n                    context.clip();\n                }\n                if (hasBlendMode) {\n                    context.globalCompositeOperation = compositeOp;\n                }\n                drawCalls += this.drawDisplayObject(displayObject, context, offsetX, offsetY);\n                if (hasBlendMode) {\n                    context.globalCompositeOperation = defaultCompositeOp;\n                }\n                if (scrollRect) {\n                    context.restore();\n                }\n                return drawCalls;\n            }\n            //遮罩是单纯的填充图形,且alpha为1,性能优化\n            if (mask) {\n                var maskRenderNode = mask.$getRenderNode();\n                if ((!mask.$children || mask.$children.length == 0) &&\n                    maskRenderNode && maskRenderNode.type == 3 /* GraphicsNode */ &&\n                    maskRenderNode.drawData.length == 1 &&\n                    maskRenderNode.drawData[0].type == 1 /* Fill */ &&\n                    maskRenderNode.drawData[0].fillAlpha == 1) {\n                    this.renderingMask = true;\n                    context.save();\n                    var maskMatrix = egret.Matrix.create();\n                    maskMatrix.copyFrom(mask.$getConcatenatedMatrix());\n                    mask.$getConcatenatedMatrixAt(displayObject, maskMatrix);\n                    maskMatrix.prepend(1, 0, 0, 1, offsetX, offsetY);\n                    context.transform(maskMatrix.a, maskMatrix.b, maskMatrix.c, maskMatrix.d, maskMatrix.tx, maskMatrix.ty);\n                    var calls = this.drawDisplayObject(mask, context, 0, 0);\n                    this.renderingMask = false;\n                    maskMatrix.$invertInto(maskMatrix);\n                    context.transform(maskMatrix.a, maskMatrix.b, maskMatrix.c, maskMatrix.d, maskMatrix.tx, maskMatrix.ty);\n                    egret.Matrix.release(maskMatrix);\n                    if (scrollRect) {\n                        context.beginPath();\n                        context.rect(scrollRect.x + offsetX, scrollRect.y + offsetY, scrollRect.width, scrollRect.height);\n                        context.clip();\n                    }\n                    calls += this.drawDisplayObject(displayObject, context, offsetX, offsetY);\n                    context.restore();\n                    return calls;\n                }\n            }\n            //todo 若显示对象是容器，同时子项有混合模式，则需要先绘制背景到displayBuffer并清除背景区域\n            //绘制显示对象自身，若有scrollRect，应用clip\n            var displayBounds = displayObject.$getOriginalBounds();\n            var displayBoundsX = displayBounds.x;\n            var displayBoundsY = displayBounds.y;\n            var displayBoundsWidth = displayBounds.width;\n            var displayBoundsHeight = displayBounds.height;\n            if (displayBoundsWidth <= 0 || displayBoundsHeight <= 0) {\n                return drawCalls;\n            }\n            var displayBuffer = this.createRenderBuffer(displayBoundsWidth, displayBoundsHeight);\n            var displayContext = displayBuffer.context;\n            if (!displayContext) {\n                drawCalls += this.drawDisplayObject(displayObject, context, offsetX, offsetY);\n                return drawCalls;\n            }\n            drawCalls += this.drawDisplayObject(displayObject, displayContext, -displayBoundsX, -displayBoundsY);\n            //绘制遮罩\n            if (mask) {\n                var maskRenderNode = mask.$getRenderNode();\n                var maskMatrix = egret.Matrix.create();\n                maskMatrix.copyFrom(mask.$getConcatenatedMatrix());\n                mask.$getConcatenatedMatrixAt(displayObject, maskMatrix);\n                maskMatrix.translate(-displayBoundsX, -displayBoundsY);\n                //如果只有一次绘制或是已经被cache直接绘制到displayContext\n                if (maskRenderNode && maskRenderNode.$getRenderCount() == 1 || mask.$displayList) {\n                    displayContext.globalCompositeOperation = \"destination-in\";\n                    displayContext.save();\n                    displayContext.setTransform(maskMatrix.a, maskMatrix.b, maskMatrix.c, maskMatrix.d, maskMatrix.tx, maskMatrix.ty);\n                    drawCalls += this.drawDisplayObject(mask, displayContext, 0, 0);\n                    displayContext.restore();\n                }\n                else {\n                    var maskBuffer = this.createRenderBuffer(displayBoundsWidth, displayBoundsHeight);\n                    var maskContext = maskBuffer.context;\n                    maskContext.setTransform(maskMatrix.a, maskMatrix.b, maskMatrix.c, maskMatrix.d, maskMatrix.tx, maskMatrix.ty);\n                    drawCalls += this.drawDisplayObject(mask, maskContext, 0, 0);\n                    displayContext.globalCompositeOperation = \"destination-in\";\n                    displayContext.drawImage(maskBuffer.surface, 0, 0);\n                    renderBufferPool.push(maskBuffer);\n                }\n                egret.Matrix.release(maskMatrix);\n            }\n            //绘制结果到屏幕\n            if (drawCalls > 0) {\n                drawCalls++;\n                if (hasBlendMode) {\n                    context.globalCompositeOperation = compositeOp;\n                }\n                if (scrollRect) {\n                    context.save();\n                    context.beginPath();\n                    context.rect(scrollRect.x + offsetX, scrollRect.y + offsetY, scrollRect.width, scrollRect.height);\n                    context.clip();\n                }\n                context.drawImage(displayBuffer.surface, offsetX + displayBoundsX, offsetY + displayBoundsY);\n                if (scrollRect) {\n                    context.restore();\n                }\n                if (hasBlendMode) {\n                    context.globalCompositeOperation = defaultCompositeOp;\n                }\n            }\n            renderBufferPool.push(displayBuffer);\n            return drawCalls;\n        };\n        CanvasRenderer.prototype.drawWithScrollRect = function (displayObject, context, offsetX, offsetY) {\n            var drawCalls = 0;\n            var scrollRect = displayObject.$scrollRect ? displayObject.$scrollRect : displayObject.$maskRect;\n            if (scrollRect.isEmpty()) {\n                return drawCalls;\n            }\n            if (displayObject.$scrollRect) {\n                offsetX -= scrollRect.x;\n                offsetY -= scrollRect.y;\n            }\n            //绘制显示对象自身\n            context.save();\n            context.beginPath();\n            context.rect(scrollRect.x + offsetX, scrollRect.y + offsetY, scrollRect.width, scrollRect.height);\n            context.clip();\n            drawCalls += this.drawDisplayObject(displayObject, context, offsetX, offsetY);\n            context.restore();\n            return drawCalls;\n        };\n        CanvasRenderer.prototype.drawNodeToBuffer = function (node, buffer, matrix, forHitTest) {\n            var context = buffer.context;\n            context.setTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty);\n            this.renderNode(node, context, forHitTest);\n        };\n        /**\n         * 将一个DisplayObject绘制到渲染缓冲，用于RenderTexture绘制\n         * @param displayObject 要绘制的显示对象\n         * @param buffer 渲染缓冲\n         * @param matrix 要叠加的矩阵\n         */\n        CanvasRenderer.prototype.drawDisplayToBuffer = function (displayObject, buffer, matrix) {\n            var context = buffer.context;\n            if (matrix) {\n                context.setTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty);\n            }\n            var node;\n            if (displayObject.$renderDirty) {\n                node = displayObject.$getRenderNode();\n            }\n            else {\n                node = displayObject.$renderNode;\n            }\n            var drawCalls = 0;\n            if (node) {\n                drawCalls++;\n                switch (node.type) {\n                    case 1 /* BitmapNode */:\n                        this.renderBitmap(node, context);\n                        break;\n                    case 2 /* TextNode */:\n                        this.renderText(node, context);\n                        break;\n                    case 3 /* GraphicsNode */:\n                        this.renderGraphics(node, context);\n                        break;\n                    case 4 /* GroupNode */:\n                        this.renderGroup(node, context);\n                        break;\n                    case 5 /* MeshNode */:\n                        this.renderMesh(node, context);\n                        break;\n                    case 6 /* NormalBitmapNode */:\n                        this.renderNormalBitmap(node, context);\n                        break;\n                }\n            }\n            var children = displayObject.$children;\n            if (children) {\n                var length_5 = children.length;\n                for (var i = 0; i < length_5; i++) {\n                    var child = children[i];\n                    switch (child.$renderMode) {\n                        case 1 /* NONE */:\n                            break;\n                        case 2 /* FILTER */:\n                            drawCalls += this.drawWithFilter(child, context, 0, 0);\n                            break;\n                        case 3 /* CLIP */:\n                            drawCalls += this.drawWithClip(child, context, 0, 0);\n                            break;\n                        case 4 /* SCROLLRECT */:\n                            drawCalls += this.drawWithScrollRect(child, context, 0, 0);\n                            break;\n                        default:\n                            drawCalls += this.drawDisplayObject(child, context, 0, 0);\n                            break;\n                    }\n                }\n            }\n            return drawCalls;\n        };\n        CanvasRenderer.prototype.renderNode = function (node, context, forHitTest) {\n            var drawCalls = 0;\n            switch (node.type) {\n                case 1 /* BitmapNode */:\n                    drawCalls = this.renderBitmap(node, context);\n                    break;\n                case 2 /* TextNode */:\n                    drawCalls = 1;\n                    this.renderText(node, context);\n                    break;\n                case 3 /* GraphicsNode */:\n                    drawCalls = this.renderGraphics(node, context, forHitTest);\n                    break;\n                case 4 /* GroupNode */:\n                    drawCalls = this.renderGroup(node, context);\n                    break;\n                case 5 /* MeshNode */:\n                    drawCalls = this.renderMesh(node, context);\n                    break;\n                case 6 /* NormalBitmapNode */:\n                    drawCalls += this.renderNormalBitmap(node, context);\n                    break;\n            }\n            return drawCalls;\n        };\n        CanvasRenderer.prototype.renderNormalBitmap = function (node, context) {\n            var image = node.image;\n            if (!image || !image.source) {\n                return 0;\n            }\n            if (context.$imageSmoothingEnabled != node.smoothing) {\n                context.imageSmoothingEnabled = node.smoothing;\n                context.$imageSmoothingEnabled = node.smoothing;\n            }\n            if (node.rotated) {\n                var sourceX = node.sourceX;\n                var sourceY = node.sourceY;\n                var sourceHeight = node.sourceW;\n                var sourceWidth = node.sourceH;\n                var offsetX = node.drawX;\n                var offsetY = node.drawY;\n                var destHeight = node.drawW;\n                var destWidth = node.drawH;\n                context.save();\n                context.transform(0, -1, 1, 0, 0, destWidth);\n                context.drawImage(image.source, sourceX, sourceY, sourceWidth, sourceHeight, offsetX + context.$offsetX, offsetY + context.$offsetY, destWidth, destHeight);\n                context.restore();\n            }\n            else {\n                context.drawImage(image.source, node.sourceX, node.sourceY, node.sourceW, node.sourceH, node.drawX + context.$offsetX, node.drawY + context.$offsetY, node.drawW, node.drawH);\n            }\n            return 1;\n        };\n        CanvasRenderer.prototype.renderBitmap = function (node, context) {\n            var image = node.image;\n            if (!image || !image.source) {\n                return 0;\n            }\n            if (context.$imageSmoothingEnabled != node.smoothing) {\n                context.imageSmoothingEnabled = node.smoothing;\n                context.$imageSmoothingEnabled = node.smoothing;\n            }\n            var data = node.drawData;\n            var length = data.length;\n            var pos = 0;\n            var m = node.matrix;\n            var blendMode = node.blendMode;\n            var alpha = node.alpha;\n            var saved = false;\n            var offsetX;\n            var offsetY;\n            if (m) {\n                context.save();\n                saved = true;\n                if (context.$offsetX != 0 || context.$offsetY != 0) {\n                    context.translate(context.$offsetX, context.$offsetY);\n                    offsetX = context.$offsetX;\n                    offsetY = context.$offsetY;\n                    context.$offsetX = context.$offsetY = 0;\n                }\n                context.transform(m.a, m.b, m.c, m.d, m.tx, m.ty);\n            }\n            //这里不考虑嵌套\n            if (blendMode) {\n                context.globalCompositeOperation = blendModes[blendMode];\n            }\n            var originAlpha;\n            if (alpha == alpha) {\n                originAlpha = context.globalAlpha;\n                context.globalAlpha *= alpha;\n            }\n            var drawCalls = 0;\n            var filter = node.filter;\n            //todo 暂时只考虑绘制一次的情况\n            if (filter && length == 8) {\n                var sourceX = data[0];\n                var sourceY = data[1];\n                var sourceWidth = data[2];\n                var sourceHeight = data[3];\n                var offsetX_1 = data[4];\n                var offsetY_1 = data[5];\n                var destWidth = data[6];\n                var destHeight = data[7];\n                if (node.rotated) {\n                    sourceWidth = data[3];\n                    sourceHeight = data[2];\n                    destWidth = data[7];\n                    destHeight = data[6];\n                }\n                var displayBuffer = this.createRenderBuffer(destWidth, destHeight);\n                var displayContext = displayBuffer.context;\n                drawCalls++;\n                if (node.rotated) {\n                    context.transform(0, -1, 1, 0, 0, destWidth);\n                }\n                displayContext.drawImage(image.source, sourceX, sourceY, sourceWidth, sourceHeight, 0, 0, destWidth, destHeight);\n                //绘制结果到屏幕\n                drawCalls++;\n                // 应用滤镜\n                var imageData = displayContext.getImageData(0, 0, destWidth, destHeight);\n                colorFilter(imageData.data, destWidth, destHeight, filter.$matrix);\n                displayContext.putImageData(imageData, 0, 0);\n                // 绘制结果的时候，应用滤镜\n                context.drawImage(displayBuffer.surface, 0, 0, destWidth, destHeight, offsetX_1 + context.$offsetX, offsetY_1 + context.$offsetY, destWidth, destHeight);\n                renderBufferPool.push(displayBuffer);\n            }\n            else {\n                while (pos < length) {\n                    drawCalls++;\n                    if (node.rotated) {\n                        var sourceX = data[pos++];\n                        var sourceY = data[pos++];\n                        var sourceHeight = data[pos++];\n                        var sourceWidth = data[pos++];\n                        var offsetX_2 = data[pos++];\n                        var offsetY_2 = data[pos++];\n                        var destHeight = data[pos++];\n                        var destWidth = data[pos++];\n                        context.save();\n                        context.transform(0, -1, 1, 0, 0, destWidth);\n                        context.drawImage(image.source, sourceX, sourceY, sourceWidth, sourceHeight, offsetX_2 + context.$offsetX, offsetY_2 + context.$offsetY, destWidth, destHeight);\n                        context.restore();\n                    }\n                    else {\n                        context.drawImage(image.source, data[pos++], data[pos++], data[pos++], data[pos++], data[pos++] + context.$offsetX, data[pos++] + context.$offsetY, data[pos++], data[pos++]);\n                    }\n                }\n            }\n            if (saved) {\n                context.restore();\n            }\n            else {\n                if (blendMode) {\n                    context.globalCompositeOperation = defaultCompositeOp;\n                }\n                if (alpha == alpha) {\n                    context.globalAlpha = originAlpha;\n                }\n            }\n            if (offsetX) {\n                context.$offsetX = offsetX;\n            }\n            if (offsetY) {\n                context.$offsetY = offsetY;\n            }\n            return drawCalls;\n        };\n        CanvasRenderer.prototype.renderMesh = function (node, context) {\n            return 0;\n        };\n        CanvasRenderer.prototype.renderText = function (node, context) {\n            context.textAlign = \"left\";\n            context.textBaseline = \"middle\";\n            context.lineJoin = \"round\"; //确保描边样式是圆角\n            var drawData = node.drawData;\n            var length = drawData.length;\n            var pos = 0;\n            while (pos < length) {\n                var x = drawData[pos++];\n                var y = drawData[pos++];\n                var text = drawData[pos++];\n                var format = drawData[pos++];\n                context.font = getFontString(node, format);\n                var textColor = format.textColor == null ? node.textColor : format.textColor;\n                var strokeColor = format.strokeColor == null ? node.strokeColor : format.strokeColor;\n                var stroke = format.stroke == null ? node.stroke : format.stroke;\n                context.fillStyle = egret.toColorString(textColor);\n                context.strokeStyle = egret.toColorString(strokeColor);\n                if (stroke) {\n                    context.lineWidth = stroke * 2;\n                    context.strokeText(text, x + context.$offsetX, y + context.$offsetY);\n                }\n                context.fillText(text, x + context.$offsetX, y + context.$offsetY);\n            }\n        };\n        /**\n         * @private\n         */\n        CanvasRenderer.prototype.renderGraphics = function (node, context, forHitTest) {\n            var drawData = node.drawData;\n            var length = drawData.length;\n            forHitTest = !!forHitTest;\n            for (var i = 0; i < length; i++) {\n                var path = drawData[i];\n                switch (path.type) {\n                    case 1 /* Fill */:\n                        var fillPath = path;\n                        context.fillStyle = forHitTest ? BLACK_COLOR : getRGBAString(fillPath.fillColor, fillPath.fillAlpha);\n                        this.renderPath(path, context);\n                        if (this.renderingMask) {\n                            context.clip();\n                        }\n                        else {\n                            context.fill();\n                        }\n                        break;\n                    case 2 /* GradientFill */:\n                        var g = path;\n                        context.fillStyle = forHitTest ? BLACK_COLOR : getGradient(context, g.gradientType, g.colors, g.alphas, g.ratios, g.matrix);\n                        context.save();\n                        var m = g.matrix;\n                        this.renderPath(path, context);\n                        context.transform(m.a, m.b, m.c, m.d, m.tx, m.ty);\n                        context.fill();\n                        context.restore();\n                        break;\n                    case 3 /* Stroke */:\n                        var strokeFill = path;\n                        var lineWidth = strokeFill.lineWidth;\n                        context.lineWidth = lineWidth;\n                        context.strokeStyle = forHitTest ? BLACK_COLOR : getRGBAString(strokeFill.lineColor, strokeFill.lineAlpha);\n                        context.lineCap = CAPS_STYLES[strokeFill.caps];\n                        context.lineJoin = strokeFill.joints;\n                        context.miterLimit = strokeFill.miterLimit;\n                        if (context.setLineDash) {\n                            context.setLineDash(strokeFill.lineDash);\n                        }\n                        //对1像素和3像素特殊处理，向右下角偏移0.5像素，以显示清晰锐利的线条。\n                        var isSpecialCaseWidth = lineWidth === 1 || lineWidth === 3;\n                        if (isSpecialCaseWidth) {\n                            context.translate(0.5, 0.5);\n                        }\n                        this.renderPath(path, context);\n                        context.stroke();\n                        if (isSpecialCaseWidth) {\n                            context.translate(-0.5, -0.5);\n                        }\n                        break;\n                }\n            }\n            return length == 0 ? 0 : 1;\n        };\n        CanvasRenderer.prototype.renderPath = function (path, context) {\n            context.beginPath();\n            var data = path.$data;\n            var commands = path.$commands;\n            var commandCount = commands.length;\n            var pos = 0;\n            for (var commandIndex = 0; commandIndex < commandCount; commandIndex++) {\n                var command = commands[commandIndex];\n                switch (command) {\n                    case 4 /* CubicCurveTo */:\n                        context.bezierCurveTo(data[pos++] + context.$offsetX, data[pos++] + context.$offsetY, data[pos++] + context.$offsetX, data[pos++] + context.$offsetY, data[pos++] + context.$offsetX, data[pos++] + context.$offsetY);\n                        break;\n                    case 3 /* CurveTo */:\n                        context.quadraticCurveTo(data[pos++] + context.$offsetX, data[pos++] + context.$offsetY, data[pos++] + context.$offsetX, data[pos++] + context.$offsetY);\n                        break;\n                    case 2 /* LineTo */:\n                        context.lineTo(data[pos++] + context.$offsetX, data[pos++] + context.$offsetY);\n                        break;\n                    case 1 /* MoveTo */:\n                        context.moveTo(data[pos++] + context.$offsetX, data[pos++] + context.$offsetY);\n                        break;\n                }\n            }\n        };\n        CanvasRenderer.prototype.renderGroup = function (groupNode, context) {\n            var m = groupNode.matrix;\n            var saved = false;\n            var offsetX;\n            var offsetY;\n            if (m) {\n                context.save();\n                saved = true;\n                if (context.$offsetX != 0 || context.$offsetY != 0) {\n                    context.translate(context.$offsetX, context.$offsetY);\n                    offsetX = context.$offsetX;\n                    offsetY = context.$offsetY;\n                    context.$offsetX = context.$offsetY = 0;\n                }\n                context.transform(m.a, m.b, m.c, m.d, m.tx, m.ty);\n            }\n            var drawCalls = 0;\n            var children = groupNode.drawData;\n            var length = children.length;\n            for (var i = 0; i < length; i++) {\n                var node = children[i];\n                drawCalls += this.renderNode(node, context);\n            }\n            if (saved) {\n                context.restore();\n            }\n            if (offsetX) {\n                context.$offsetX = offsetX;\n            }\n            if (offsetY) {\n                context.$offsetY = offsetY;\n            }\n            return drawCalls;\n        };\n        CanvasRenderer.prototype.createRenderBuffer = function (width, height, useForFilters) {\n            var buffer = useForFilters ? renderBufferPool_Filters.pop() : renderBufferPool.pop();\n            if (buffer) {\n                buffer.resize(width, height, true);\n            }\n            else {\n                buffer = new egret.sys.CanvasRenderBuffer(width, height);\n            }\n            return buffer;\n        };\n        return CanvasRenderer;\n    }());\n    egret.CanvasRenderer = CanvasRenderer;\n    __reflect(CanvasRenderer.prototype, \"egret.CanvasRenderer\");\n    /**\n     * @private\n     * 获取字体字符串\n     */\n    function getFontString(node, format) {\n        var italic = format.italic == null ? node.italic : format.italic;\n        var bold = format.bold == null ? node.bold : format.bold;\n        var size = format.size == null ? node.size : format.size;\n        var fontFamily = format.fontFamily || node.fontFamily;\n        var font = italic ? \"italic \" : \"normal \";\n        font += bold ? \"bold \" : \"normal \";\n        font += size + \"px \" + fontFamily;\n        return font;\n    }\n    egret.getFontString = getFontString;\n    /**\n     * @private\n     * 获取RGBA字符串\n     */\n    function getRGBAString(color, alpha) {\n        var red = color >> 16;\n        var green = (color >> 8) & 0xFF;\n        var blue = color & 0xFF;\n        return \"rgba(\" + red + \",\" + green + \",\" + blue + \",\" + alpha + \")\";\n    }\n    egret.getRGBAString = getRGBAString;\n    /**\n     * @private\n     * 获取渐变填充样式对象\n     */\n    function getGradient(context, type, colors, alphas, ratios, matrix) {\n        var gradient;\n        if (type == egret.GradientType.LINEAR) {\n            gradient = context.createLinearGradient(-1, 0, 1, 0);\n        }\n        else {\n            gradient = context.createRadialGradient(0, 0, 0, 0, 0, 1);\n        }\n        //todo colors alphas ratios数量不一致情况处理\n        var l = colors.length;\n        for (var i = 0; i < l; i++) {\n            gradient.addColorStop(ratios[i] / 255, getRGBAString(colors[i], alphas[i]));\n        }\n        return gradient;\n    }\n    // 判断浏览器是否支持 Uint8ClampedArray\n    var use8Clamp = false;\n    try {\n        use8Clamp = (typeof Uint8ClampedArray !== undefined);\n    }\n    catch (e) { }\n    function setArray(a, b, index) {\n        if (index === void 0) { index = 0; }\n        for (var i = 0, l = b.length; i < l; i++) {\n            a[i + index] = b[i];\n        }\n    }\n    /**\n     * @private\n     */\n    function colorFilter(buffer, w, h, matrix) {\n        var r0 = matrix[0], r1 = matrix[1], r2 = matrix[2], r3 = matrix[3], r4 = matrix[4];\n        var g0 = matrix[5], g1 = matrix[6], g2 = matrix[7], g3 = matrix[8], g4 = matrix[9];\n        var b0 = matrix[10], b1 = matrix[11], b2 = matrix[12], b3 = matrix[13], b4 = matrix[14];\n        var a0 = matrix[15], a1 = matrix[16], a2 = matrix[17], a3 = matrix[18], a4 = matrix[19];\n        for (var p = 0, e = w * h * 4; p < e; p += 4) {\n            var r = buffer[p + 0];\n            var g = buffer[p + 1];\n            var b = buffer[p + 2];\n            var a = buffer[p + 3];\n            buffer[p + 0] = r0 * r + r1 * g + r2 * b + r3 * a + r4;\n            buffer[p + 1] = g0 * r + g1 * g + g2 * b + g3 * a + g4;\n            buffer[p + 2] = b0 * r + b1 * g + b2 * b + b3 * a + b4;\n            buffer[p + 3] = a0 * r + a1 * g + a2 * b + a3 * a + a4;\n        }\n    }\n    /**\n     * @private\n     */\n    function blurFilter(buffer, w, h, blurX, blurY) {\n        blurFilterH(buffer, w, h, blurX);\n        blurFilterV(buffer, w, h, blurY);\n    }\n    /**\n     * @private\n     */\n    function blurFilterH(buffer, w, h, blurX) {\n        var lineBuffer;\n        if (use8Clamp) {\n            lineBuffer = new Uint8ClampedArray(w * 4);\n        }\n        else {\n            lineBuffer = new Array(w * 4);\n        }\n        var lineSize = w * 4;\n        var windowLength = (blurX * 2) + 1;\n        var windowSize = windowLength * 4;\n        for (var y = 0; y < h; y++) {\n            var pLineStart = y * lineSize;\n            var rs = 0, gs = 0, bs = 0, _as = 0, alpha = 0, alpha2 = 0;\n            // Fill window\n            for (var ptr = -blurX * 4, end = blurX * 4 + 4; ptr < end; ptr += 4) {\n                var key = pLineStart + ptr;\n                if (key < pLineStart || key >= pLineStart + lineSize) {\n                    continue;\n                }\n                alpha = buffer[key + 3];\n                rs += buffer[key + 0] * alpha;\n                gs += buffer[key + 1] * alpha;\n                bs += buffer[key + 2] * alpha;\n                _as += alpha;\n            }\n            // Slide window\n            for (var ptr = pLineStart, end = pLineStart + lineSize, linePtr = 0, lastPtr = ptr - blurX * 4, nextPtr = ptr + (blurX + 1) * 4; ptr < end; ptr += 4, linePtr += 4, nextPtr += 4, lastPtr += 4) {\n                if (_as === 0) {\n                    lineBuffer[linePtr + 0] = 0;\n                    lineBuffer[linePtr + 1] = 0;\n                    lineBuffer[linePtr + 2] = 0;\n                    lineBuffer[linePtr + 3] = 0;\n                }\n                else {\n                    lineBuffer[linePtr + 0] = rs / _as;\n                    lineBuffer[linePtr + 1] = gs / _as;\n                    lineBuffer[linePtr + 2] = bs / _as;\n                    lineBuffer[linePtr + 3] = _as / windowLength;\n                }\n                alpha = buffer[nextPtr + 3];\n                alpha2 = buffer[lastPtr + 3];\n                if (alpha || alpha == 0) {\n                    if (alpha2 || alpha2 == 0) {\n                        rs += buffer[nextPtr + 0] * alpha - buffer[lastPtr + 0] * alpha2;\n                        gs += buffer[nextPtr + 1] * alpha - buffer[lastPtr + 1] * alpha2;\n                        bs += buffer[nextPtr + 2] * alpha - buffer[lastPtr + 2] * alpha2;\n                        _as += alpha - alpha2;\n                    }\n                    else {\n                        rs += buffer[nextPtr + 0] * alpha;\n                        gs += buffer[nextPtr + 1] * alpha;\n                        bs += buffer[nextPtr + 2] * alpha;\n                        _as += alpha;\n                    }\n                }\n                else {\n                    if (alpha2 || alpha2 == 0) {\n                        rs += -buffer[lastPtr + 0] * alpha2;\n                        gs += -buffer[lastPtr + 1] * alpha2;\n                        bs += -buffer[lastPtr + 2] * alpha2;\n                        _as += -alpha2;\n                    }\n                    else {\n                        // do nothing\n                    }\n                }\n            }\n            // Copy line\n            if (use8Clamp) {\n                buffer.set(lineBuffer, pLineStart);\n            }\n            else {\n                setArray(buffer, lineBuffer, pLineStart);\n            }\n        }\n    }\n    /**\n     * @private\n     */\n    function blurFilterV(buffer, w, h, blurY) {\n        var columnBuffer;\n        if (use8Clamp) {\n            columnBuffer = new Uint8ClampedArray(h * 4);\n        }\n        else {\n            columnBuffer = new Array(h * 4);\n        }\n        var stride = w * 4;\n        var windowLength = (blurY * 2) + 1;\n        for (var x = 0; x < w; x++) {\n            var pColumnStart = x * 4;\n            var rs = 0, gs = 0, bs = 0, _as = 0, alpha = 0, alpha2 = 0;\n            // Fill window\n            for (var ptr = -blurY * stride, end = blurY * stride + stride; ptr < end; ptr += stride) {\n                var key = pColumnStart + ptr;\n                if (key < pColumnStart || key >= pColumnStart + h * stride) {\n                    continue;\n                }\n                alpha = buffer[key + 3];\n                rs += buffer[key + 0] * alpha;\n                gs += buffer[key + 1] * alpha;\n                bs += buffer[key + 2] * alpha;\n                _as += alpha;\n            }\n            // Slide window\n            for (var ptr = pColumnStart, end = pColumnStart + h * stride, columnPtr = 0, lastPtr = pColumnStart - blurY * stride, nextPtr = pColumnStart + ((blurY + 1) * stride); ptr < end; ptr += stride, columnPtr += 4, nextPtr += stride, lastPtr += stride) {\n                if (_as === 0) {\n                    columnBuffer[columnPtr + 0] = 0;\n                    columnBuffer[columnPtr + 1] = 0;\n                    columnBuffer[columnPtr + 2] = 0;\n                    columnBuffer[columnPtr + 3] = 0;\n                }\n                else {\n                    columnBuffer[columnPtr + 0] = rs / _as;\n                    columnBuffer[columnPtr + 1] = gs / _as;\n                    columnBuffer[columnPtr + 2] = bs / _as;\n                    columnBuffer[columnPtr + 3] = _as / windowLength;\n                }\n                alpha = buffer[nextPtr + 3];\n                alpha2 = buffer[lastPtr + 3];\n                if (alpha || alpha == 0) {\n                    if (alpha2 || alpha2 == 0) {\n                        rs += buffer[nextPtr + 0] * alpha - buffer[lastPtr + 0] * alpha2;\n                        gs += buffer[nextPtr + 1] * alpha - buffer[lastPtr + 1] * alpha2;\n                        bs += buffer[nextPtr + 2] * alpha - buffer[lastPtr + 2] * alpha2;\n                        _as += alpha - alpha2;\n                    }\n                    else {\n                        rs += buffer[nextPtr + 0] * alpha;\n                        gs += buffer[nextPtr + 1] * alpha;\n                        bs += buffer[nextPtr + 2] * alpha;\n                        _as += alpha;\n                    }\n                }\n                else {\n                    if (alpha2 || alpha2 == 0) {\n                        rs += -buffer[lastPtr + 0] * alpha2;\n                        gs += -buffer[lastPtr + 1] * alpha2;\n                        bs += -buffer[lastPtr + 2] * alpha2;\n                        _as += -alpha2;\n                    }\n                    else {\n                        // do nothing\n                    }\n                }\n            }\n            // Copy column\n            for (var i = x * 4, end = i + h * stride, j = 0; i < end; i += stride, j += 4) {\n                buffer[i + 0] = columnBuffer[j + 0];\n                buffer[i + 1] = columnBuffer[j + 1];\n                buffer[i + 2] = columnBuffer[j + 2];\n                buffer[i + 3] = columnBuffer[j + 3];\n            }\n        }\n    }\n    // function glowFilter(buffer, w, h, color, blurX, blurY, strength) {\n    //     dropShadowFilter(buffer, w, h, color, blurX, blurY, 0, 0, strength)\n    // }\n    function dropShadowFilter(buffer, w, h, color, blurX, blurY, angle, distance, strength) {\n        var tmp = alphaFilter(buffer, color);\n        panFilter(tmp, w, h, angle, distance);\n        blurFilter(tmp, w, h, blurX, blurY);\n        scaleAlphaChannel(tmp, strength);\n        compositeSourceOver(tmp, buffer);\n        buffer.set(tmp);\n        if (use8Clamp) {\n            buffer.set(tmp);\n        }\n        else {\n            setArray(buffer, tmp);\n        }\n    }\n    function alphaFilter(buffer, color) {\n        if (!color) {\n            color = [0, 0, 0, 0];\n        }\n        var plane;\n        if (use8Clamp) {\n            plane = new Uint8ClampedArray(buffer);\n        }\n        else {\n            plane = new Array(buffer.length);\n            setArray(plane, buffer);\n        }\n        var colorR = color[0];\n        var colorG = color[1];\n        var colorB = color[2];\n        var colorA = color[3];\n        for (var ptr = 0, end = plane.length; ptr < end; ptr += 4) {\n            var alpha = plane[ptr + 3];\n            plane[ptr + 0] = colorR * alpha;\n            plane[ptr + 1] = colorG * alpha;\n            plane[ptr + 2] = colorB * alpha;\n            plane[ptr + 3] = colorA * alpha;\n        }\n        return plane;\n    }\n    function panFilter(buffer, w, h, angle, distance) {\n        var dy = (Math.sin(angle) * distance) | 0;\n        var dx = (Math.cos(angle) * distance) | 0;\n        var oldBuffer, newBuffer;\n        if (use8Clamp) {\n            oldBuffer = new Int32Array(buffer.buffer);\n            newBuffer = new Int32Array(oldBuffer.length);\n            for (var oy = 0; oy < h; oy++) {\n                var ny = oy + dy;\n                if (ny < 0 || ny > h) {\n                    continue;\n                }\n                for (var ox = 0; ox < w; ox++) {\n                    var nx = ox + dx;\n                    if (nx < 0 || nx > w) {\n                        continue;\n                    }\n                    newBuffer[ny * w + nx] = oldBuffer[oy * w + ox];\n                }\n            }\n            oldBuffer.set(newBuffer);\n        }\n        else {\n            oldBuffer = buffer;\n            newBuffer = new Array(oldBuffer.length);\n            for (var oy = 0; oy < h; oy++) {\n                var ny = oy + dy;\n                if (ny < 0 || ny > h) {\n                    continue;\n                }\n                for (var ox = 0; ox < w; ox++) {\n                    var nx = ox + dx;\n                    if (nx < 0 || nx > w) {\n                        continue;\n                    }\n                    newBuffer[(ny * w + nx) * 4 + 0] = oldBuffer[(oy * w + ox) * 4 + 0];\n                    newBuffer[(ny * w + nx) * 4 + 1] = oldBuffer[(oy * w + ox) * 4 + 1];\n                    newBuffer[(ny * w + nx) * 4 + 2] = oldBuffer[(oy * w + ox) * 4 + 2];\n                    newBuffer[(ny * w + nx) * 4 + 3] = oldBuffer[(oy * w + ox) * 4 + 3];\n                }\n            }\n            setArray(oldBuffer, newBuffer);\n        }\n    }\n    function scaleAlphaChannel(buffer, value) {\n        for (var ptr = 0, end = buffer.length; ptr < end; ptr += 4) {\n            buffer[ptr + 3] *= value;\n        }\n    }\n    function compositeSourceOver(dst, src) {\n        for (var ptr = 0, end = dst.length; ptr < end; ptr += 4) {\n            var Dr = dst[ptr + 0];\n            var Dg = dst[ptr + 1];\n            var Db = dst[ptr + 2];\n            var Da = dst[ptr + 3] / 255;\n            var Sr = src[ptr + 0];\n            var Sg = src[ptr + 1];\n            var Sb = src[ptr + 2];\n            var Sa = src[ptr + 3] / 255;\n            dst[ptr + 0] = Sr + Dr * (1 - Sa);\n            dst[ptr + 1] = Sg + Dg * (1 - Sa);\n            dst[ptr + 2] = Sb + Db * (1 - Sa);\n            dst[ptr + 3] = (Sa + Da * (1 - Sa)) * 255;\n        }\n    }\n    function getPixelKey(w, x, y) {\n        return y * w * 4 + x * 4;\n    }\n    function mix(v1, v2, rate) {\n        return v1 * (1 - rate) + v2 * rate;\n    }\n    // dropShadowFilter2\n    // 模拟shader中的算法，可以实现内发光，挖空等高级效果\n    function dropShadowFilter2(buffer, w, h, color, blurX, blurY, angle, distance, strength, inner, knockout, hideObject) {\n        var plane;\n        if (use8Clamp) {\n            plane = new Uint8ClampedArray(buffer.length);\n        }\n        else {\n            plane = new Array(buffer.length);\n        }\n        var alpha = color[3];\n        var curDistanceX = 0;\n        var curDistanceY = 0;\n        var offsetX = distance * Math.cos(angle);\n        var offsetY = distance * Math.sin(angle);\n        var linearSamplingTimes = 7.0;\n        var circleSamplingTimes = 12.0;\n        var PI = 3.14159265358979323846264;\n        var cosAngle;\n        var sinAngle;\n        var stepX = blurX / linearSamplingTimes;\n        var stepY = blurY / linearSamplingTimes;\n        // 遍历像素\n        for (var u = 0; u < w; u++) {\n            for (var v = 0; v < h; v++) {\n                // 此处为了避免毛刺可以添加一个随机值\n                var offset = 0;\n                // 处理单个像素\n                var key = v * w * 4 + u * 4;\n                var totalAlpha = 0;\n                var maxTotalAlpha = 0;\n                // 采样出来的色值\n                var _r = buffer[key + 0] / 255;\n                var _g = buffer[key + 1] / 255;\n                var _b = buffer[key + 2] / 255;\n                var _a = buffer[key + 3] / 255;\n                for (var a = 0; a <= PI * 2; a += PI * 2 / circleSamplingTimes) {\n                    cosAngle = Math.cos(a + offset);\n                    sinAngle = Math.sin(a + offset);\n                    for (var i = 0; i < linearSamplingTimes; i++) {\n                        curDistanceX = i * stepX * cosAngle;\n                        curDistanceY = i * stepY * sinAngle;\n                        var _u = Math.round(u + curDistanceX - offsetX);\n                        var _v = Math.round(v + curDistanceY - offsetY);\n                        var __a = 0;\n                        if (_u >= w || _u < 0 || _v < 0 || _v >= h) {\n                            __a = 0;\n                        }\n                        else {\n                            var _key = _v * w * 4 + _u * 4;\n                            __a = buffer[_key + 3] / 255;\n                        }\n                        totalAlpha += (linearSamplingTimes - i) * __a;\n                        maxTotalAlpha += (linearSamplingTimes - i);\n                    }\n                }\n                _a = Math.max(_a, 0.0001);\n                // 'ownColor.rgb = ownColor.rgb / ownColor.a;',\n                var outerGlowAlpha = (totalAlpha / maxTotalAlpha) * strength * alpha * (1. - inner) * Math.max(Math.min(hideObject, knockout), 1. - _a);\n                var innerGlowAlpha = ((maxTotalAlpha - totalAlpha) / maxTotalAlpha) * strength * alpha * inner * _a;\n                _a = Math.max(_a * knockout * (1 - hideObject), 0.0001);\n                var rate1 = innerGlowAlpha / (innerGlowAlpha + _a);\n                var r1 = mix(_r, color[0], rate1);\n                var g1 = mix(_g, color[1], rate1);\n                var b1 = mix(_b, color[2], rate1);\n                var rate2 = outerGlowAlpha / (innerGlowAlpha + _a + outerGlowAlpha);\n                var r2 = mix(r1, color[0], rate2);\n                var g2 = mix(g1, color[1], rate2);\n                var b2 = mix(b1, color[2], rate2);\n                var resultAlpha = Math.min(_a + outerGlowAlpha + innerGlowAlpha, 1);\n                // 赋值颜色\n                plane[key + 0] = r2 * 255;\n                plane[key + 1] = g2 * 255;\n                plane[key + 2] = b2 * 255;\n                plane[key + 3] = resultAlpha * 255;\n            }\n        }\n        if (use8Clamp) {\n            buffer.set(plane);\n        }\n        else {\n            setArray(buffer, plane);\n        }\n    }\n})(egret || (egret = {}));\nvar egret;\n(function (egret) {\n    /**\n     * @copy egret.Orientation\n     */\n    egret.DeviceOrientation = null;\n})(egret || (egret = {}));\nvar egret;\n(function (egret) {\n})(egret || (egret = {}));\nvar egret;\n(function (egret) {\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Type of operation.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 运行类型的类型。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var RuntimeType;\n    (function (RuntimeType) {\n        /**\n         * Running on Web\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 运行在Web上\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        RuntimeType.WEB = \"web\";\n        /**\n         * Running on NATIVE\n         * @version Egret 2.4\n         * @deprecated\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 运行在NATIVE上\n         * @version Egret 2.4\n         * @deprecated\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        RuntimeType.NATIVE = \"native\";\n        /**\n         * Running on Runtime2.0\n         * @version Egret 5.1.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 运行在Runtime2.0上\n         * @version Egret 5.1.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        RuntimeType.RUNTIME2 = \"runtime2\";\n        /**\n         * Running on Alipay\n         * @version Egret 5.2.23\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在支付宝小游戏上\n         * @version Egret 5.2.26\n         * @platform All\n         * @language zh_CN\n         */\n        RuntimeType.MYGAME = \"mygame\";\n        /**\n         * Running on WeChat mini game\n         * @version Egret 5.1.5\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在微信小游戏上\n         * @version Egret 5.1.5\n         * @platform All\n         * @language zh_CN\n         */\n        RuntimeType.WXGAME = \"wxgame\";\n        /**\n         * Running on Baidu mini game\n         * @version Egret 5.2.13\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在百度小游戏上\n         * @version Egret 5.2.13\n         * @platform All\n         * @language zh_CN\n         */\n        RuntimeType.BAIDUGAME = \"baidugame\";\n        /**\n         * Running on Xiaomi quick game\n         * @version Egret 5.2.14\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在小米快游戏上\n         * @version Egret 5.2.14\n         * @platform All\n         * @language zh_CN\n         */\n        RuntimeType.QGAME = \"qgame\";\n        /**\n         * Running on OPPO mini game\n         * @version Egret 5.2.14\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在 Oppo 小游戏上\n         * @version Egret 5.2.14\n         * @platform All\n         * @language zh_CN\n         */\n        RuntimeType.OPPOGAME = \"oppogame\";\n        /**\n        * Running on QQ mini game\n        * @version Egret 5.2.25\n        * @platform All\n        * @language en_US\n        */\n        /**\n        * 运行在 QQ 小游戏上\n        * @version Egret 5.2.25\n        * @platform All\n        * @language zh_CN\n        */\n        RuntimeType.QQGAME = \"qqgame\";\n        /**\n         * Running on vivo mini game\n         * @version Egret 5.2.23\n         * @platform All\n         * @language en_US\n         */\n        /**\n        * 运行在 vivo 小游戏上\n        * @version Egret 5.2.23\n        * @platform All\n        * @language zh_CN\n        */\n        RuntimeType.VIVOGAME = \"vivogame\";\n    })(RuntimeType = egret.RuntimeType || (egret.RuntimeType = {}));\n    /**\n     * The Capabilities class provides properties that describe the system and runtime that are hosting the application.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/system/Capabilities.ts\n     * @language en_US\n     */\n    /**\n     * Capabilities 类提供一些属性，这些属性描述了承载应用程序的系统和运行时。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/system/Capabilities.ts\n     * @language zh_CN\n     */\n    var Capabilities = (function () {\n        function Capabilities() {\n        }\n        /**\n         * Specifies the language code of the system on which the content is running. The language is specified as a lowercase\n         * two-letter language code from ISO 639-1. For Chinese, an additional uppercase two-letter country code from ISO 3166\n         * distinguishes between Simplified and Traditional Chinese.<br/>\n         * The following table lists the possible values,but not limited to them:\n         * <ul>\n         * <li>Simplified    Chinese  zh-CN</li>\n         * <li>Traditional   Chinese  zh-TW</li>\n         * <li>English       en</li>\n         * <li>Japanese      ja</li>\n         * <li>Korean        ko</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示运行内容的系统的语言代码。语言指定为 ISO 639-1 中的小写双字母语言代码。\n         * 对于中文，另外使用 ISO 3166 中的大写双字母国家/地区代码，以区分简体中文和繁体中文。<br/>\n         * 以下是可能但不限于的语言和值：\n         * <ul>\n         * <li>简体中文  zh-CN</li>\n         * <li>繁体中文  zh-TW</li>\n         * <li>英语      en</li>\n         * <li>日语      ja</li>\n         * <li>韩语      ko</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Capabilities.language = \"zh-CN\";\n        /**\n         * Specifies the current operating system. The os property can return the following strings:\n         * <ul>\n         * <li>iPhone            \"iOS\"</li>\n         * <li>Android Phone     \"Android\"</li>\n         * <li>Windows Phone     \"Windows Phone\"</li>\n         * <li>Windows Desktop   \"Windows PC\"</li>\n         * <li>Mac Desktop       \"Mac OS\"</li>\n         * <li>Unknown OS        \"Unknown\"</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指示当前的操作系统。os 属性返回下列字符串：\n         * <ul>\n         * <li>苹果手机操作系统     \"iOS\"</li>\n         * <li>安卓手机操作系统     \"Android\"</li>\n         * <li>微软手机操作系统     \"Windows Phone\"</li>\n         * <li>微软桌面操作系统     \"Windows PC\"</li>\n         * <li>苹果桌面操作系统     \"Mac OS\"</li>\n         * <li>未知操作系统        \"Unknown\"</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Capabilities.os = \"Unknown\";\n        /**\n         * It indicates the current type of operation. runtimeType property returns the following string:\n         * <ul>\n         * <li>Run on Web     egret.RuntimeType.WEB</li>\n         * <li>Run on Runtime2.0     egret.RuntimeType.RUNTIME2</li>\n         * <li>Run on WeChat mini game     egret.RuntimeType.WXGAME</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指示当前的运行类型。runtimeType 属性返回下列字符串：\n         * <ul>\n         * <li>运行在Web上     egret.RuntimeType.WEB</li>\n         * <li>运行在Runtime2.0上     egret.RuntimeType.RUNTIME2</li>\n         * <li>运行在微信小游戏上    egret.RuntimeType.WXGAME</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Capabilities.runtimeType = egret.RuntimeType.WEB;\n        /***\n         * version of Egret.\n         * @type {string}\n         * @version Egret 3.2.0\n         * @platform Web,Native\n         * @language en_US\n         */\n        /***\n         * Egret 的版本号。\n         * @type {string}\n         * @version Egret 3.2.0\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Capabilities.engineVersion = \"5.2.30\";\n        /***\n         * current render mode.\n         * @type {string}\n         * @version Egret 3.0.7\n         * @platform Web,Native\n         * @language en_US\n         */\n        /***\n         * 当前渲染模式。\n         * @type {string}\n         * @version Egret 3.0.7\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Capabilities.renderMode = \"Unknown\";\n        /***\n         * Clients border width.\n         * The value before the document class initialization is always 0.\n         * This value will change after the distribution Event.RESIZE and StageOrientationEvent.ORIENTATION_CHANGE.\n         * @version Egret 3.1.3\n         * @platform Web,Native\n         * @language en_US\n         */\n        /***\n         * 客户端边界宽度。\n         * 该值在文档类初始化之前始终是0。\n         * 该值在派发 Event.RESIZE 以及 StageOrientationEvent.ORIENTATION_CHANGE 之后会发生改变。\n         * @version Egret 3.1.3\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Capabilities.boundingClientWidth = 0;\n        /***\n         * Clients border height.\n         * The value before the document class initialization is always 0.\n         * This value will change after the distribution Event.RESIZE and StageOrientationEvent.ORIENTATION_CHANGE.\n         * @version Egret 3.1.3\n         * @platform Web,Native\n         * @language en_US\n         */\n        /***\n         * 客户端边界高度。\n         * 该值在文档类初始化之前始终是0。\n         * 该值在派发 Event.RESIZE 以及 StageOrientationEvent.ORIENTATION_CHANGE 之后会发生改变。\n         * @version Egret 3.1.3\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Capabilities.boundingClientHeight = 0;\n        return Capabilities;\n    }());\n    egret.Capabilities = Capabilities;\n    __reflect(Capabilities.prototype, \"egret.Capabilities\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * RenderTexture is a dynamic texture\n     * @extends egret.Texture\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/RenderTexture.ts\n     * @language en_US\n     */\n    /**\n     * RenderTexture 是动态纹理类，他实现了将显示对象及其子对象绘制成为一个纹理的功能\n     * @extends egret.Texture\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/RenderTexture.ts\n     * @language zh_CN\n     */\n    var RenderTexture = (function (_super) {\n        __extends(RenderTexture, _super);\n        function RenderTexture() {\n            var _this = _super.call(this) || this;\n            _this.$renderBuffer = new egret.sys.RenderBuffer();\n            var bitmapData = new egret.BitmapData(_this.$renderBuffer.surface);\n            bitmapData.$deleteSource = false;\n            _this._setBitmapData(bitmapData);\n            return _this;\n        }\n        /**\n         * The specified display object is drawn as a texture\n         * @param displayObject {egret.DisplayObject} the display to draw\n         * @param clipBounds {egret.Rectangle} clip rect\n         * @param scale {number} scale factor\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将指定显示对象绘制为一个纹理\n         * @param displayObject {egret.DisplayObject} 需要绘制的显示对象\n         * @param clipBounds {egret.Rectangle} 绘制矩形区域\n         * @param scale {number} 缩放比例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        RenderTexture.prototype.drawToTexture = function (displayObject, clipBounds, scale) {\n            if (scale === void 0) { scale = 1; }\n            if (clipBounds && (clipBounds.width == 0 || clipBounds.height == 0)) {\n                return false;\n            }\n            var bounds = clipBounds || displayObject.$getOriginalBounds();\n            if (bounds.width == 0 || bounds.height == 0) {\n                return false;\n            }\n            scale /= egret.$TextureScaleFactor;\n            var width = (bounds.x + bounds.width) * scale;\n            var height = (bounds.y + bounds.height) * scale;\n            if (clipBounds) {\n                width = bounds.width * scale;\n                height = bounds.height * scale;\n            }\n            var renderBuffer = this.$renderBuffer;\n            if (!renderBuffer) {\n                return false;\n            }\n            renderBuffer.resize(width, height);\n            this.$bitmapData.width = width;\n            this.$bitmapData.height = height;\n            if (egret.nativeRender) {\n                egret_native.activateBuffer(this.$renderBuffer);\n                var useClip = false;\n                var clipX = 0;\n                var clipY = 0;\n                var clipW = 0;\n                var clipH = 0;\n                if (clipBounds) {\n                    useClip = true;\n                    clipX = clipBounds.x;\n                    clipY = clipBounds.y;\n                    clipW = clipBounds.width;\n                    clipH = clipBounds.height;\n                }\n                egret_native.updateNativeRender();\n                egret_native.nrRenderDisplayObject(displayObject.$nativeDisplayObject.id, scale, useClip, clipX, clipY, clipW, clipH);\n                egret_native.activateBuffer(null);\n            }\n            else {\n                var matrix = egret.Matrix.create();\n                matrix.identity();\n                matrix.scale(scale, scale);\n                //应用裁切\n                if (clipBounds) {\n                    matrix.translate(-clipBounds.x, -clipBounds.y);\n                }\n                egret.sys.systemRenderer.render(displayObject, renderBuffer, matrix, true);\n                egret.Matrix.release(matrix);\n            }\n            //设置纹理参数\n            this.$initData(0, 0, width, height, 0, 0, width, height, width, height);\n            return true;\n        };\n        /**\n         * @inheritDoc\n         */\n        RenderTexture.prototype.getPixel32 = function (x, y) {\n            var data;\n            if (this.$renderBuffer) {\n                var scale = egret.$TextureScaleFactor;\n                x = Math.round(x / scale);\n                y = Math.round(y / scale);\n                data = this.$renderBuffer.getPixels(x, y, 1, 1);\n            }\n            return data;\n        };\n        /**\n         * @inheritDoc\n         */\n        RenderTexture.prototype.dispose = function () {\n            _super.prototype.dispose.call(this);\n            this.$renderBuffer = null;\n        };\n        return RenderTexture;\n    }(egret.Texture));\n    egret.RenderTexture = RenderTexture;\n    __reflect(RenderTexture.prototype, \"egret.RenderTexture\");\n})(egret || (egret = {}));\nvar egret;\n(function (egret) {\n    /**\n    * @private\n    */\n    var implMap = {};\n    /**\n     * Adds an interface-name-to-implementation-class mapping to the registry.\n     * @param interfaceName the interface name to register. For example：\"eui.IAssetAdapter\",\"eui.Theme\"\n     * @param instance the instance to register.\n     * @version Egret 3.2.1\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 注册一个接口实现。\n     * @param interfaceName 注入的接口名称。例如：\"eui.IAssetAdapter\",\"eui.Theme\"\n     * @param instance 实现此接口的实例。\n     * @version Egret 3.2.1\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function registerImplementation(interfaceName, instance) {\n        implMap[interfaceName] = instance;\n    }\n    egret.registerImplementation = registerImplementation;\n    /**\n     * Returns the singleton instance of the implementation class that was registered for the specified interface.\n     * This method is usually called by egret framework.\n     * @param interfaceName The interface name to identify. For example：\"eui.IAssetAdapter\",\"eui.Theme\"\n     * @returns the singleton instance of the implementation class\n     * @version Egret 3.2.1\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 获取一个接口实现。此方法通常由框架内部调用。获取项目注入的自定义实现实例。\n     * @param interfaceName 要获取的接口名称。例如：\"eui.IAssetAdapter\",\"eui.Theme\"\n     * @returns 返回实现此接口的实例。\n     * @version Egret 3.2.1\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getImplementation(interfaceName) {\n        return implMap[interfaceName];\n    }\n    egret.getImplementation = getImplementation;\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * This class is used to create lightweight shapes using the drawing application program interface (API). The Shape\n     * class includes a graphics property, which lets you access methods from the Graphics class.\n     * @see egret.Graphics\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Shape.ts\n     * @language en_US\n     */\n    /**\n     * 此类用于使用绘图应用程序编程接口 (API) 创建简单形状。Shape 类含有 graphics 属性，通过该属性您可以访问各种矢量绘图方法。\n     * @see egret.Graphics\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Shape.ts\n     * @language zh_CN\n     */\n    var Shape = (function (_super) {\n        __extends(Shape, _super);\n        /**\n         * Creates a new Shape object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 Shape 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function Shape() {\n            var _this = _super.call(this) || this;\n            _this.$graphics = new egret.Graphics();\n            _this.$graphics.$setTarget(_this);\n            return _this;\n        }\n        Shape.prototype.createNativeDisplayObject = function () {\n            this.$nativeDisplayObject = new egret_native.NativeDisplayObject(8 /* GRAPHICS */);\n        };\n        Object.defineProperty(Shape.prototype, \"graphics\", {\n            /**\n             * Specifies the Graphics object belonging to this Shape object, where vector drawing commands can occur.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 获取 Shape 中的 Graphics 对象。可通过此对象执行矢量绘图命令。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$graphics;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         */\n        Shape.prototype.$measureContentBounds = function (bounds) {\n            this.$graphics.$measureContentBounds(bounds);\n        };\n        Shape.prototype.$hitTest = function (stageX, stageY) {\n            var target = _super.prototype.$hitTest.call(this, stageX, stageY);\n            if (target == this) {\n                target = this.$graphics.$hitTest(stageX, stageY);\n            }\n            return target;\n        };\n        /**\n         * @private\n         */\n        Shape.prototype.$onRemoveFromStage = function () {\n            _super.prototype.$onRemoveFromStage.call(this);\n            if (this.$graphics) {\n                this.$graphics.$onRemoveFromStage();\n            }\n        };\n        return Shape;\n    }(egret.DisplayObject));\n    egret.Shape = Shape;\n    __reflect(Shape.prototype, \"egret.Shape\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Bitmap font, texture set of a font. It is generally used as the value of the BitmapText.font attribute.\n     * @see http://bbs.egret-labs.org/thread-918-1-1.html TextureMerger\n     * @see http://bbs.egret-labs.org/forum.php?mod=viewthread&tid=251 Text(Containing the specific usage of the bitmap font )\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/BitmapFont.ts\n     * @language en_US\n     */\n    /**\n     * 位图字体,是一个字体的纹理集，通常作为BitmapText.font属性的值。\n     * @see http://bbs.egret-labs.org/thread-918-1-1.html TextureMerger\n     * @see http://bbs.egret-labs.org/forum.php?mod=viewthread&tid=251 文本(含位图字体具体用法)\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/BitmapFont.ts\n     * @language zh_CN\n     */\n    var BitmapFont = (function (_super) {\n        __extends(BitmapFont, _super);\n        /**\n         * Create an egret.BitmapFont object\n         * @param texture {egret.Texture} Texture set that use TextureMerger create\n         * @param config {any} Configure data that use TextureMerger create\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.BitmapFont 对象\n         * @param texture {egret.Texture} 使用TextureMerger生成的纹理集\n         * @param config {any} 使用TextureMerger生成的配置数据\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function BitmapFont(texture, config) {\n            var _this = _super.call(this, texture) || this;\n            /**\n             * @private\n             */\n            _this.firstCharHeight = 0;\n            if (typeof (config) == \"string\") {\n                _this.charList = _this.parseConfig(config);\n            }\n            else if (config && config.hasOwnProperty(\"frames\")) {\n                _this.charList = config.frames;\n            }\n            else {\n                _this.charList = {};\n            }\n            return _this;\n        }\n        /**\n         * Obtain corresponding texture through the name attribute\n         * @param name {string} name Attribute\n         * @returns {egret.Texture}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 通过 name 属性获取对应纹理\n         * @param name {string} name属性\n         * @returns {egret.Texture}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        BitmapFont.prototype.getTexture = function (name) {\n            var texture = this._textureMap[name];\n            if (!texture) {\n                var c = this.charList[name];\n                if (!c) {\n                    return null;\n                }\n                texture = this.createTexture(name, c.x, c.y, c.w, c.h, c.offX, c.offY, c.sourceW, c.sourceH);\n                this._textureMap[name] = texture;\n            }\n            return texture;\n        };\n        /**\n         * @private\n         */\n        BitmapFont.prototype.getConfig = function (name, key) {\n            if (!this.charList[name]) {\n                return 0;\n            }\n            return this.charList[name][key];\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        BitmapFont.prototype._getFirstCharHeight = function () {\n            if (this.firstCharHeight == 0) {\n                for (var str in this.charList) {\n                    var c = this.charList[str];\n                    if (c) {\n                        var sourceH = c.sourceH;\n                        if (sourceH === undefined) {\n                            var h = c.h;\n                            if (h === undefined) {\n                                h = 0;\n                            }\n                            var offY = c.offY;\n                            if (offY === undefined) {\n                                offY = 0;\n                            }\n                            sourceH = h + offY;\n                        }\n                        if (sourceH <= 0) {\n                            continue;\n                        }\n                        this.firstCharHeight = sourceH;\n                        break;\n                    }\n                }\n            }\n            return this.firstCharHeight;\n        };\n        /**\n         * @private\n         *\n         * @param fntText\n         * @returns\n         */\n        BitmapFont.prototype.parseConfig = function (fntText) {\n            fntText = fntText.split(\"\\r\\n\").join(\"\\n\");\n            var lines = fntText.split(\"\\n\");\n            var charsCount = this.getConfigByKey(lines[3], \"count\");\n            var chars = {};\n            for (var i = 4; i < 4 + charsCount; i++) {\n                var charText = lines[i];\n                var letter = String.fromCharCode(this.getConfigByKey(charText, \"id\"));\n                var c = {};\n                chars[letter] = c;\n                c[\"x\"] = this.getConfigByKey(charText, \"x\");\n                c[\"y\"] = this.getConfigByKey(charText, \"y\");\n                c[\"w\"] = this.getConfigByKey(charText, \"width\");\n                c[\"h\"] = this.getConfigByKey(charText, \"height\");\n                c[\"offX\"] = this.getConfigByKey(charText, \"xoffset\");\n                c[\"offY\"] = this.getConfigByKey(charText, \"yoffset\");\n                c[\"xadvance\"] = this.getConfigByKey(charText, \"xadvance\");\n            }\n            return chars;\n        };\n        /**\n         * @private\n         *\n         * @param configText\n         * @param key\n         * @returns\n         */\n        BitmapFont.prototype.getConfigByKey = function (configText, key) {\n            var itemConfigTextList = configText.split(\" \");\n            for (var i = 0, length_6 = itemConfigTextList.length; i < length_6; i++) {\n                var itemConfigText = itemConfigTextList[i];\n                if (key == itemConfigText.substring(0, key.length)) {\n                    var value = itemConfigText.substring(key.length + 1);\n                    return parseInt(value);\n                }\n            }\n            return 0;\n        };\n        return BitmapFont;\n    }(egret.SpriteSheet));\n    egret.BitmapFont = BitmapFont;\n    __reflect(BitmapFont.prototype, \"egret.BitmapFont\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Bitmap font adopts the Bitmap+SpriteSheet mode to render text.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/BitmapText.ts\n     * @language en_US\n     */\n    /**\n     * 位图字体采用了Bitmap+SpriteSheet的方式来渲染文字。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/BitmapText.ts\n     * @language zh_CN\n     */\n    var BitmapText = (function (_super) {\n        __extends(BitmapText, _super);\n        /**\n         * Create an egret.BitmapText object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.BitmapText 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function BitmapText() {\n            var _this = _super.call(this) || this;\n            _this.$smoothing = egret.Bitmap.defaultSmoothing;\n            _this.$text = \"\";\n            _this.$textFieldWidth = NaN;\n            _this.$textLinesChanged = false;\n            _this.$textFieldHeight = NaN;\n            _this.$font = null;\n            _this.$fontStringChanged = false;\n            _this.$lineSpacing = 0;\n            _this.$letterSpacing = 0;\n            _this.$textAlign = egret.HorizontalAlign.LEFT;\n            _this.$verticalAlign = egret.VerticalAlign.TOP;\n            _this.$textWidth = NaN;\n            _this.$textHeight = NaN;\n            /**\n             * @private\n             */\n            _this.$textOffsetX = 0;\n            /**\n             * @private\n             */\n            _this.$textOffsetY = 0;\n            /**\n             * @private\n             */\n            _this.$textStartX = 0;\n            /**\n             * @private\n             */\n            _this.$textStartY = 0;\n            /**\n             * @private\n             */\n            _this.textLines = [];\n            /**\n             * @private\n             */\n            _this.$lineHeights = [];\n            if (!egret.nativeRender) {\n                _this.$renderNode = new egret.sys.BitmapNode();\n            }\n            return _this;\n        }\n        BitmapText.prototype.createNativeDisplayObject = function () {\n            this.$nativeDisplayObject = new egret_native.NativeDisplayObject(11 /* BITMAP_TEXT */);\n        };\n        Object.defineProperty(BitmapText.prototype, \"smoothing\", {\n            /**\n             * Whether or not is smoothed when scaled.\n             * @default true。\n             * @version Egret 3.0\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 控制在缩放时是否进行平滑处理。\n             * @default true。\n             * @version Egret 3.0\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$smoothing;\n            },\n            set: function (value) {\n                var self = this;\n                if (value == self.$smoothing) {\n                    return;\n                }\n                self.$smoothing = value;\n                if (!egret.nativeRender) {\n                    var p = self.$parent;\n                    if (p && !p.$cacheDirty) {\n                        p.$cacheDirty = true;\n                        p.$cacheDirtyUp();\n                    }\n                    var maskedObject = self.$maskedObject;\n                    if (maskedObject && !maskedObject.$cacheDirty) {\n                        maskedObject.$cacheDirty = true;\n                        maskedObject.$cacheDirtyUp();\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(BitmapText.prototype, \"text\", {\n            /**\n             * A string to display in the text field.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 要显示的文本内容\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$text;\n            },\n            set: function (value) {\n                this.$setText(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         */\n        BitmapText.prototype.$setText = function (value) {\n            if (value == null) {\n                value = \"\";\n            }\n            else {\n                value = String(value);\n            }\n            var self = this;\n            if (value == self.$text)\n                return false;\n            self.$text = value;\n            self.$invalidateContentBounds();\n            return true;\n        };\n        /**\n         * @private\n         */\n        BitmapText.prototype.$getWidth = function () {\n            var self = this;\n            var w = self.$textFieldWidth;\n            return isNaN(w) ? self.$getContentBounds().width : w;\n        };\n        /**\n         * @private\n         */\n        BitmapText.prototype.$setWidth = function (value) {\n            var self = this;\n            if (value < 0 || value == self.$textFieldWidth) {\n                return false;\n            }\n            self.$textFieldWidth = value;\n            self.$invalidateContentBounds();\n            return true;\n        };\n        /**\n         * @private\n         */\n        BitmapText.prototype.$invalidateContentBounds = function () {\n            this.$renderDirty = true;\n            this.$textLinesChanged = true;\n            //todo lcj\n            this.$updateRenderNode();\n        };\n        /**\n         * @private\n         */\n        BitmapText.prototype.$getHeight = function () {\n            var self = this;\n            var h = self.$textFieldHeight;\n            return isNaN(h) ? self.$getContentBounds().height : h;\n        };\n        /**\n         * @private\n         */\n        BitmapText.prototype.$setHeight = function (value) {\n            var self = this;\n            if (value < 0 || value == self.$textFieldHeight) {\n                return false;\n            }\n            self.$textFieldHeight = value;\n            self.$invalidateContentBounds();\n            return true;\n        };\n        Object.defineProperty(BitmapText.prototype, \"font\", {\n            /**\n             * The name of the font to use, or a comma-separated list of font names, the type of value must be BitmapFont.\n             * @default null\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 要使用的字体的名称或用逗号分隔的字体名称列表，类型必须是 BitmapFont。\n             * @default null\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$font;\n            },\n            set: function (value) {\n                this.$setFont(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        BitmapText.prototype.$setFont = function (value) {\n            var self = this;\n            if (self.$font == value) {\n                return false;\n            }\n            self.$font = value;\n            self.$fontStringChanged = true;\n            this.$invalidateContentBounds();\n            return true;\n        };\n        Object.defineProperty(BitmapText.prototype, \"lineSpacing\", {\n            /**\n             /**\n             * An integer representing the amount of vertical space between lines.\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 一个整数，表示行与行之间的垂直间距量\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$lineSpacing;\n            },\n            set: function (value) {\n                this.$setLineSpacing(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        BitmapText.prototype.$setLineSpacing = function (value) {\n            var self = this;\n            if (self.$lineSpacing == value)\n                return false;\n            self.$lineSpacing = value;\n            self.$invalidateContentBounds();\n            return true;\n        };\n        Object.defineProperty(BitmapText.prototype, \"letterSpacing\", {\n            /**\n             * An integer representing the amount of distance between characters.\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 一个整数，表示字符之间的距离。\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$letterSpacing;\n            },\n            set: function (value) {\n                this.$setLetterSpacing(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        BitmapText.prototype.$setLetterSpacing = function (value) {\n            var self = this;\n            if (self.$letterSpacing == value) {\n                return false;\n            }\n            self.$letterSpacing = value;\n            self.$invalidateContentBounds();\n            return true;\n        };\n        Object.defineProperty(BitmapText.prototype, \"textAlign\", {\n            /**\n             * Horizontal alignment of text.\n             * @default：egret.HorizontalAlign.LEFT\n             * @version Egret 2.5.6\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 文本的水平对齐方式。\n             * @default：egret.HorizontalAlign.LEFT\n             * @version Egret 2.5.6\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$textAlign;\n            },\n            set: function (value) {\n                this.$setTextAlign(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        BitmapText.prototype.$setTextAlign = function (value) {\n            var self = this;\n            if (self.$textAlign == value) {\n                return false;\n            }\n            self.$textAlign = value;\n            self.$invalidateContentBounds();\n            return true;\n        };\n        Object.defineProperty(BitmapText.prototype, \"verticalAlign\", {\n            /**\n             * Vertical alignment of text.\n             * @default：egret.VerticalAlign.TOP\n             * @version Egret 2.5.6\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 文字的垂直对齐方式。\n             * @default：egret.VerticalAlign.TOP\n             * @version Egret 2.5.6\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$verticalAlign;\n            },\n            set: function (value) {\n                this.$setVerticalAlign(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        BitmapText.prototype.$setVerticalAlign = function (value) {\n            var self = this;\n            if (self.$verticalAlign == value) {\n                return false;\n            }\n            self.$verticalAlign = value;\n            self.$invalidateContentBounds();\n            return true;\n        };\n        /**\n         * @private\n         */\n        BitmapText.prototype.$updateRenderNode = function () {\n            var self = this;\n            var textLines = this.$getTextLines();\n            var length = textLines.length;\n            if (length == 0) {\n                if (egret.nativeRender && self.$font) {\n                    self.$nativeDisplayObject.setDataToBitmapNode(self.$nativeDisplayObject.id, self.$font.$texture, []);\n                    self.$nativeDisplayObject.setWidth(0);\n                    self.$nativeDisplayObject.setHeight(0);\n                }\n                return;\n            }\n            var drawArr = [];\n            var textLinesWidth = this.$textLinesWidth;\n            var bitmapFont = self.$font;\n            var node;\n            if (!egret.nativeRender) {\n                node = this.$renderNode;\n                if (bitmapFont.$texture) {\n                    node.image = bitmapFont.$texture.$bitmapData;\n                }\n                node.smoothing = self.$smoothing;\n            }\n            var emptyHeight = bitmapFont._getFirstCharHeight();\n            var emptyWidth = Math.ceil(emptyHeight * BitmapText.EMPTY_FACTOR);\n            var hasSetHeight = !isNaN(self.$textFieldHeight);\n            var textWidth = self.$textWidth;\n            var textFieldWidth = self.$textFieldWidth;\n            var textFieldHeight = self.$textFieldHeight;\n            var align = self.$textAlign;\n            var yPos = this.$textOffsetY + this.$textStartY;\n            var lineHeights = this.$lineHeights;\n            for (var i = 0; i < length; i++) {\n                var lineHeight = lineHeights[i];\n                if (hasSetHeight && i > 0 && yPos + lineHeight > textFieldHeight) {\n                    break;\n                }\n                var line = textLines[i];\n                var len = line.length;\n                var xPos = this.$textOffsetX;\n                if (align != egret.HorizontalAlign.LEFT) {\n                    var countWidth = textFieldWidth > textWidth ? textFieldWidth : textWidth;\n                    if (align == egret.HorizontalAlign.RIGHT) {\n                        xPos += countWidth - textLinesWidth[i];\n                    }\n                    else if (align == egret.HorizontalAlign.CENTER) {\n                        xPos += Math.floor((countWidth - textLinesWidth[i]) / 2);\n                    }\n                }\n                for (var j = 0; j < len; j++) {\n                    var character = line.charAt(j);\n                    var texture = bitmapFont.getTexture(character);\n                    if (!texture) {\n                        if (character == \" \") {\n                            xPos += emptyWidth;\n                        }\n                        else {\n                            egret.$warn(1046, character);\n                        }\n                        continue;\n                    }\n                    var bitmapWidth = texture.$bitmapWidth;\n                    var bitmapHeight = texture.$bitmapHeight;\n                    if (egret.nativeRender) {\n                        drawArr.push(texture.$bitmapX, texture.$bitmapY, bitmapWidth, bitmapHeight, xPos + texture.$offsetX, yPos + texture.$offsetY, texture.$getScaleBitmapWidth(), texture.$getScaleBitmapHeight(), texture.$sourceWidth, texture.$sourceHeight);\n                    }\n                    else {\n                        node.imageWidth = texture.$sourceWidth;\n                        node.imageHeight = texture.$sourceHeight;\n                        node.drawImage(texture.$bitmapX, texture.$bitmapY, bitmapWidth, bitmapHeight, xPos + texture.$offsetX, yPos + texture.$offsetY, texture.$getScaleBitmapWidth(), texture.$getScaleBitmapHeight());\n                    }\n                    xPos += (bitmapFont.getConfig(character, \"xadvance\") || texture.$getTextureWidth()) + self.$letterSpacing;\n                }\n                yPos += lineHeight + self.$lineSpacing;\n            }\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setDataToBitmapNode(self.$nativeDisplayObject.id, bitmapFont.$texture, drawArr);\n                var bounds = self.$getContentBounds();\n                self.$nativeDisplayObject.setWidth(bounds.width);\n                self.$nativeDisplayObject.setHeight(bounds.height);\n            }\n        };\n        /**\n         * @private\n         */\n        BitmapText.prototype.$measureContentBounds = function (bounds) {\n            var lines = this.$getTextLines();\n            if (lines.length == 0) {\n                bounds.setEmpty();\n            }\n            else {\n                bounds.setTo(this.$textOffsetX + this.$textStartX, this.$textOffsetY + this.$textStartY, this.$textWidth - this.$textOffsetX, this.$textHeight - this.$textOffsetY);\n            }\n        };\n        Object.defineProperty(BitmapText.prototype, \"textWidth\", {\n            /**\n             * Get the BitmapText measured width\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 获取位图文本测量宽度\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                this.$getTextLines();\n                return this.$textWidth;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(BitmapText.prototype, \"textHeight\", {\n            /**\n             * Get Text BitmapText height\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 获取位图文本测量高度\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                this.$getTextLines();\n                return this.$textHeight;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @returns\n         */\n        BitmapText.prototype.$getTextLines = function () {\n            var self = this;\n            if (!self.$textLinesChanged) {\n                return self.textLines;\n            }\n            var textLines = [];\n            self.textLines = textLines;\n            var textLinesWidth = [];\n            self.$textLinesWidth = textLinesWidth;\n            self.$textLinesChanged = false;\n            var lineHeights = [];\n            self.$lineHeights = lineHeights;\n            if (!self.$text || !self.$font) {\n                self.$textWidth = 0;\n                self.$textHeight = 0;\n                return textLines;\n            }\n            var lineSpacing = self.$lineSpacing;\n            var letterSpacing = self.$letterSpacing;\n            var textWidth = 0;\n            var textHeight = 0;\n            var textOffsetX = 0;\n            var textOffsetY = 0;\n            var hasWidthSet = !isNaN(self.$textFieldWidth);\n            var textFieldWidth = self.$textFieldWidth;\n            var textFieldHeight = self.$textFieldHeight;\n            var bitmapFont = self.$font;\n            var emptyHeight = bitmapFont._getFirstCharHeight();\n            var emptyWidth = Math.ceil(emptyHeight * BitmapText.EMPTY_FACTOR);\n            var text = self.$text;\n            var textArr = text.split(/(?:\\r\\n|\\r|\\n)/);\n            var length = textArr.length;\n            var isFirstLine = true;\n            var isFirstChar;\n            var isLastChar;\n            var lineHeight;\n            var xPos;\n            for (var i = 0; i < length; i++) {\n                var line = textArr[i];\n                var len = line.length;\n                lineHeight = 0;\n                xPos = 0;\n                isFirstChar = true;\n                isLastChar = false;\n                for (var j = 0; j < len; j++) {\n                    if (!isFirstChar) {\n                        xPos += letterSpacing;\n                    }\n                    var character = line.charAt(j);\n                    var texureWidth = void 0;\n                    var textureHeight = void 0;\n                    var offsetX = 0;\n                    var offsetY = 0;\n                    var texture = bitmapFont.getTexture(character);\n                    if (!texture) {\n                        if (character == \" \") {\n                            texureWidth = emptyWidth;\n                            textureHeight = emptyHeight;\n                        }\n                        else {\n                            egret.$warn(1046, character);\n                            if (isFirstChar) {\n                                isFirstChar = false;\n                            }\n                            continue;\n                        }\n                    }\n                    else {\n                        texureWidth = texture.$getTextureWidth();\n                        textureHeight = texture.$getTextureHeight();\n                        offsetX = texture.$offsetX;\n                        offsetY = texture.$offsetY;\n                    }\n                    if (isFirstChar) {\n                        isFirstChar = false;\n                        // textOffsetX = Math.min(offsetX, textOffsetX);\n                    }\n                    if (isFirstLine) {\n                        isFirstLine = false;\n                        // textOffsetY = Math.min(offsetY, textOffsetY);\n                    }\n                    if (hasWidthSet && j > 0 && xPos + texureWidth > textFieldWidth) {\n                        if (!setLineData(line.substring(0, j)))\n                            break;\n                        line = line.substring(j);\n                        len = line.length;\n                        j = 0;\n                        //最后一个字符要计算纹理宽度，而不是xadvance\n                        if (j == len - 1) {\n                            xPos = texureWidth;\n                        }\n                        else {\n                            xPos = bitmapFont.getConfig(character, \"xadvance\") || texureWidth;\n                        }\n                        lineHeight = textureHeight;\n                        continue;\n                    }\n                    //最后一个字符要计算纹理宽度，而不是xadvance\n                    if (j == len - 1) {\n                        xPos += texureWidth;\n                    }\n                    else {\n                        xPos += bitmapFont.getConfig(character, \"xadvance\") || texureWidth;\n                    }\n                    lineHeight = Math.max(textureHeight, lineHeight);\n                }\n                if (textFieldHeight && i > 0 && textHeight > textFieldHeight) {\n                    break;\n                }\n                isLastChar = true;\n                if (!setLineData(line))\n                    break;\n            }\n            function setLineData(str) {\n                if (textFieldHeight && textLines.length > 0 && textHeight > textFieldHeight) {\n                    return false;\n                }\n                textHeight += lineHeight + lineSpacing;\n                if (!isFirstChar && !isLastChar) {\n                    xPos -= letterSpacing;\n                }\n                textLines.push(str);\n                lineHeights.push(lineHeight);\n                textLinesWidth.push(xPos);\n                textWidth = Math.max(xPos, textWidth);\n                return true;\n            }\n            textHeight -= lineSpacing;\n            self.$textWidth = textWidth;\n            self.$textHeight = textHeight;\n            this.$textOffsetX = textOffsetX;\n            this.$textOffsetY = textOffsetY;\n            this.$textStartX = 0;\n            this.$textStartY = 0;\n            var alignType;\n            if (textFieldWidth > textWidth) {\n                alignType = self.$textAlign;\n                if (alignType == egret.HorizontalAlign.RIGHT) {\n                    this.$textStartX = textFieldWidth - textWidth;\n                }\n                else if (alignType == egret.HorizontalAlign.CENTER) {\n                    this.$textStartX = Math.floor((textFieldWidth - textWidth) / 2);\n                }\n            }\n            if (textFieldHeight > textHeight) {\n                alignType = self.$verticalAlign;\n                if (alignType == egret.VerticalAlign.BOTTOM) {\n                    this.$textStartY = textFieldHeight - textHeight;\n                }\n                else if (alignType == egret.VerticalAlign.MIDDLE) {\n                    this.$textStartY = Math.floor((textFieldHeight - textHeight) / 2);\n                }\n            }\n            return textLines;\n        };\n        /**\n         * A ratio of the width of the space character. This value is multiplied by the height of the first character is the space character width.\n         * @default 0.33\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个空格字符的宽度比例。这个数值乘以第一个字符的高度即为空格字符的宽。\n         * @default 0.33\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        BitmapText.EMPTY_FACTOR = 0.33;\n        return BitmapText;\n    }(egret.DisplayObject));\n    egret.BitmapText = BitmapText;\n    __reflect(BitmapText.prototype, \"egret.BitmapText\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The HorizontalAlign class defines the possible values for the horizontal alignment.\n     * @see egret.TextField#textAlign\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * HorizontalAlign 类为水平对齐方式定义可能的值。\n     * @see egret.TextField#textAlign\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var HorizontalAlign = (function () {\n        function HorizontalAlign() {\n        }\n        /**\n         * Horizontally align content to the left of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将内容与容器的左侧对齐。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        HorizontalAlign.LEFT = \"left\";\n        /**\n         * Horizontally align content to the right of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将内容与容器的右侧对齐。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        HorizontalAlign.RIGHT = \"right\";\n        /**\n         * Horizontally align content in the center of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在容器的水平中心对齐内容。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        HorizontalAlign.CENTER = \"center\";\n        /**\n         * Horizontal alignment with both edges.\n         * Note: TextFiled does not support this alignment method.\n         * @constant egret.HorizontalAlign.JUSTIFY\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 水平两端对齐。\n         * 注意：TextFiled不支持此对齐方式。\n         * @constant egret.HorizontalAlign.JUSTIFY\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        HorizontalAlign.JUSTIFY = \"justify\";\n        /**\n         * Align the content of the child items, relative to the container. This operation will adjust uniformly the size of all the child items to be the Content Width \\\" of the container \\\".\n         * The Content Width \\\" of the container \\\" is the size of the max. child item. If the size of all child items are less than the width of the container, they will be adjusted to the width of the container.\n         * Note: TextFiled does not support this alignment method.\n         * @constant egret.HorizontalAlign.CONTENT_JUSTIFY\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 相对于容器对子项进行内容对齐。这会将所有子项的大小统一调整为容器的\"内容宽度\"。\n         * 容器的\"内容宽度\"是最大子项的大小,如果所有子项都小于容器的宽度，则会将所有子项的大小调整为容器的宽度。\n         * 注意：TextFiled不支持此对齐方式。\n         * @constant egret.HorizontalAlign.CONTENT_JUSTIFY\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        HorizontalAlign.CONTENT_JUSTIFY = \"contentJustify\";\n        return HorizontalAlign;\n    }());\n    egret.HorizontalAlign = HorizontalAlign;\n    __reflect(HorizontalAlign.prototype, \"egret.HorizontalAlign\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Convert the text in html format to the object that can be assigned to the egret.TextField#textFlow property\n     * @see http://edn.egret.com/cn/docs/page/146 Text mixed in a variety of style\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/HtmlTextParser.ts\n     * @language en_US\n     */\n    /**\n     * 将html格式文本转换为可赋值给 egret.TextField#textFlow 属性的对象\n     * @see http://edn.egret.com/cn/docs/page/146 多种样式文本混合\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/HtmlTextParser.ts\n     * @language zh_CN\n     */\n    var HtmlTextParser = (function () {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function HtmlTextParser() {\n            this.replaceArr = [];\n            /**\n             * @private\n             */\n            this.resutlArr = [];\n            this.initReplaceArr();\n        }\n        HtmlTextParser.prototype.initReplaceArr = function () {\n            this.replaceArr = [];\n            this.replaceArr.push([/&lt;/g, \"<\"]);\n            this.replaceArr.push([/&gt;/g, \">\"]);\n            this.replaceArr.push([/&amp;/g, \"&\"]);\n            this.replaceArr.push([/&quot;/g, \"\\\"\"]);\n            this.replaceArr.push([/&apos;/g, \"\\'\"]);\n        };\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        HtmlTextParser.prototype.replaceSpecial = function (value) {\n            for (var i = 0; i < this.replaceArr.length; i++) {\n                var k = this.replaceArr[i][0];\n                var v = this.replaceArr[i][1];\n                value = value.replace(k, v);\n            }\n            return value;\n        };\n        /**\n         * Convert the text in html format to the object that can be assigned to the egret.TextField#textFlow property\n         * @param htmltext {string} Text in html\n         * @returns {Array<egret.ITextElement>} 可赋值给 egret.TextField#textFlow Object that can be assigned to the egret.TextField#textFlow property\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将html格式文本转换为可赋值给 egret.TextField#textFlow 属性的对象\n         * @param htmltext {string} html文本\n         * @returns {Array<egret.ITextElement>} 可赋值给 egret.TextField#textFlow 属性的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        HtmlTextParser.prototype.parse = function (htmltext) {\n            this.stackArray = [];\n            this.resutlArr = [];\n            var firstIdx = 0; //文本段开始位置\n            var length = htmltext.length;\n            while (firstIdx < length) {\n                var starIdx = htmltext.indexOf(\"<\", firstIdx);\n                if (starIdx < 0) {\n                    this.addToResultArr(htmltext.substring(firstIdx));\n                    firstIdx = length;\n                }\n                else {\n                    this.addToResultArr(htmltext.substring(firstIdx, starIdx));\n                    var fontEnd = htmltext.indexOf(\">\", starIdx);\n                    if (fontEnd == -1) {\n                        egret.$error(1038);\n                        fontEnd = starIdx;\n                    }\n                    else if (htmltext.charAt(starIdx + 1) == \"\\/\") {\n                        this.stackArray.pop();\n                    }\n                    else {\n                        this.addToArray(htmltext.substring(starIdx + 1, fontEnd));\n                    }\n                    firstIdx = fontEnd + 1;\n                }\n            }\n            return this.resutlArr;\n        };\n        HtmlTextParser.prototype.parser = function (htmltext) {\n            return this.parse(htmltext);\n        };\n        /**\n         * @private\n         *\n         * @param value\n         */\n        HtmlTextParser.prototype.addToResultArr = function (value) {\n            if (value == \"\") {\n                return;\n            }\n            value = this.replaceSpecial(value);\n            if (this.stackArray.length > 0) {\n                this.resutlArr.push({ text: value, style: this.stackArray[this.stackArray.length - 1] });\n            }\n            else {\n                this.resutlArr.push({ text: value });\n            }\n        };\n        //将字符数据转成Json数据\n        HtmlTextParser.prototype.changeStringToObject = function (str) {\n            str = str.trim();\n            var info = {};\n            var header = [];\n            if (str.charAt(0) == \"i\" || str.charAt(0) == \"b\" || str.charAt(0) == \"u\") {\n                this.addProperty(info, str, \"true\");\n            }\n            else if (header = str.match(/^(font|a)\\s/)) {\n                str = str.substring(header[0].length).trim();\n                var next = 0;\n                var titles = void 0;\n                while (titles = str.match(this.getHeadReg())) {\n                    var title = titles[0];\n                    var value = \"\";\n                    str = str.substring(title.length).trim();\n                    if (str.charAt(0) == \"\\\"\") {\n                        next = str.indexOf(\"\\\"\", 1);\n                        value = str.substring(1, next);\n                        next += 1;\n                    }\n                    else if (str.charAt(0) == \"\\'\") {\n                        next = str.indexOf(\"\\'\", 1);\n                        value = str.substring(1, next);\n                        next += 1;\n                    }\n                    else {\n                        value = str.match(/(\\S)+/)[0];\n                        next = value.length;\n                    }\n                    this.addProperty(info, title.substring(0, title.length - 1).trim(), value.trim());\n                    str = str.substring(next).trim();\n                }\n            }\n            return info;\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        HtmlTextParser.prototype.getHeadReg = function () {\n            return /^(color|textcolor|strokecolor|stroke|b|bold|i|italic|u|size|fontfamily|href|target)(\\s)*=/;\n        };\n        /**\n         * @private\n         *\n         * @param info\n         * @param head\n         * @param value\n         */\n        HtmlTextParser.prototype.addProperty = function (info, head, value) {\n            switch (head.toLowerCase()) {\n                case \"color\":\n                case \"textcolor\":\n                    value = value.replace(/#/, \"0x\");\n                    info.textColor = parseInt(value);\n                    break;\n                case \"strokecolor\":\n                    value = value.replace(/#/, \"0x\");\n                    info.strokeColor = parseInt(value);\n                    break;\n                case \"stroke\":\n                    info.stroke = parseInt(value);\n                    break;\n                case \"b\":\n                case \"bold\":\n                    info.bold = value == \"true\";\n                    break;\n                case \"u\":\n                    info.underline = value == \"true\";\n                    break;\n                case \"i\":\n                case \"italic\":\n                    info.italic = value == \"true\";\n                    break;\n                case \"size\":\n                    info.size = parseInt(value);\n                    break;\n                case \"fontfamily\":\n                    info.fontFamily = value;\n                    break;\n                case \"href\":\n                    info.href = this.replaceSpecial(value);\n                    break;\n                case \"target\":\n                    info.target = this.replaceSpecial(value);\n                    break;\n            }\n        };\n        /**\n         * @private\n         *\n         * @param infoStr\n         */\n        HtmlTextParser.prototype.addToArray = function (infoStr) {\n            var info = this.changeStringToObject(infoStr);\n            if (this.stackArray.length == 0) {\n                this.stackArray.push(info);\n            }\n            else {\n                var lastInfo = this.stackArray[this.stackArray.length - 1];\n                for (var key in lastInfo) {\n                    if (info[key] == null) {\n                        info[key] = lastInfo[key];\n                    }\n                }\n                this.stackArray.push(info);\n            }\n        };\n        return HtmlTextParser;\n    }());\n    egret.HtmlTextParser = HtmlTextParser;\n    __reflect(HtmlTextParser.prototype, \"egret.HtmlTextParser\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    var InputController = (function (_super) {\n        __extends(InputController, _super);\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function InputController() {\n            var _this = _super.call(this) || this;\n            /**\n             * @private\n             */\n            _this.stageTextAdded = false;\n            /**\n             * @private\n             */\n            _this._text = null;\n            /**\n             * @private\n             */\n            _this._isFocus = false;\n            return _this;\n        }\n        /**\n         *\n         * @param text\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        InputController.prototype.init = function (text) {\n            this._text = text;\n            this.stageText = new egret.StageText();\n            this.stageText.$setTextField(this._text);\n        };\n        /**\n         * @private\n         *\n         */\n        InputController.prototype._addStageText = function () {\n            if (this.stageTextAdded) {\n                return;\n            }\n            if (!this._text.$inputEnabled) {\n                this._text.$touchEnabled = true;\n            }\n            this.tempStage = this._text.stage;\n            this.stageText.$addToStage();\n            this.stageText.addEventListener(\"updateText\", this.updateTextHandler, this);\n            this._text.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this);\n            this.stageText.addEventListener(\"blur\", this.blurHandler, this);\n            this.stageText.addEventListener(\"focus\", this.focusHandler, this);\n            this.stageTextAdded = true;\n        };\n        /**\n         * @private\n         *\n         */\n        InputController.prototype._removeStageText = function () {\n            if (!this.stageTextAdded) {\n                return;\n            }\n            if (!this._text.$inputEnabled) {\n                this._text.$touchEnabled = false;\n            }\n            this.stageText.$removeFromStage();\n            this.stageText.removeEventListener(\"updateText\", this.updateTextHandler, this);\n            this._text.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onMouseDownHandler, this);\n            this.tempStage.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onStageDownHandler, this);\n            this.stageText.removeEventListener(\"blur\", this.blurHandler, this);\n            this.stageText.removeEventListener(\"focus\", this.focusHandler, this);\n            this.stageTextAdded = false;\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        InputController.prototype._getText = function () {\n            return this.stageText.$getText();\n        };\n        /**\n         * @private\n         *\n         * @param value\n         */\n        InputController.prototype._setText = function (value) {\n            this.stageText.$setText(value);\n        };\n        /**\n         * @private\n         */\n        InputController.prototype._setColor = function (value) {\n            this.stageText.$setColor(value);\n        };\n        /**\n         * @private\n         *\n         * @param event\n         */\n        InputController.prototype.focusHandler = function (event) {\n            //不再显示竖线，并且输入框显示最开始\n            if (!this._isFocus) {\n                this._isFocus = true;\n                if (!event[\"showing\"]) {\n                    this._text.$setIsTyping(true);\n                }\n                this._text.dispatchEvent(new egret.FocusEvent(egret.FocusEvent.FOCUS_IN, true));\n            }\n        };\n        /**\n         * @private\n         *\n         * @param event\n         */\n        InputController.prototype.blurHandler = function (event) {\n            if (this._isFocus) {\n                //不再显示竖线，并且输入框显示最开始\n                this._isFocus = false;\n                this.tempStage.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onStageDownHandler, this);\n                this._text.$setIsTyping(false);\n                //失去焦点后调用\n                this.stageText.$onBlur();\n                this._text.dispatchEvent(new egret.FocusEvent(egret.FocusEvent.FOCUS_OUT, true));\n            }\n        };\n        //点中文本\n        InputController.prototype.onMouseDownHandler = function (event) {\n            this.$onFocus();\n        };\n        InputController.prototype.$onFocus = function () {\n            var _this = this;\n            var self = this;\n            if (!this._text.visible) {\n                return;\n            }\n            if (this._isFocus) {\n                return;\n            }\n            this.tempStage.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onStageDownHandler, this);\n            egret.callLater(function () {\n                _this.tempStage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, _this.onStageDownHandler, _this);\n            }, this);\n            if (egret.nativeRender) {\n                this.stageText.$setText(this._text.$TextField[13 /* text */]);\n            }\n            //强制更新输入框位置\n            this.stageText.$show();\n        };\n        //未点中文本\n        InputController.prototype.onStageDownHandler = function (event) {\n            if (event.$target != this._text) {\n                this.stageText.$hide();\n            }\n        };\n        /**\n         * @private\n         *\n         * @param event\n         */\n        InputController.prototype.updateTextHandler = function (event) {\n            var values = this._text.$TextField;\n            var textValue = this.stageText.$getText();\n            var isChanged = false;\n            var reg;\n            var result;\n            if (values[35 /* restrictAnd */] != null) {\n                reg = new RegExp(\"[\" + values[35 /* restrictAnd */] + \"]\", \"g\");\n                result = textValue.match(reg);\n                if (result) {\n                    textValue = result.join(\"\");\n                }\n                else {\n                    textValue = \"\";\n                }\n                isChanged = true;\n            }\n            if (values[36 /* restrictNot */] != null) {\n                reg = new RegExp(\"[^\" + values[36 /* restrictNot */] + \"]\", \"g\");\n                result = textValue.match(reg);\n                if (result) {\n                    textValue = result.join(\"\");\n                }\n                else {\n                    textValue = \"\";\n                }\n                isChanged = true;\n            }\n            if (isChanged && this.stageText.$getText() != textValue) {\n                this.stageText.$setText(textValue);\n            }\n            this.resetText();\n            //抛出change事件\n            this._text.dispatchEvent(new egret.Event(egret.Event.CHANGE, true));\n        };\n        /**\n         * @private\n         *\n         */\n        InputController.prototype.resetText = function () {\n            this._text.$setBaseText(this.stageText.$getText());\n        };\n        /**\n         * @private\n         *\n         */\n        InputController.prototype._hideInput = function () {\n            this.stageText.$removeFromStage();\n        };\n        /**\n         * @private\n         *\n         */\n        InputController.prototype.updateInput = function () {\n            if (!this._text.$visible && this.stageText) {\n                this._hideInput();\n            }\n        };\n        /**\n         * @private\n         *\n         */\n        InputController.prototype._updateProperties = function () {\n            if (this._isFocus) {\n                //整体修改\n                this.stageText.$resetStageText();\n                this.updateInput();\n                return;\n            }\n            this.stageText.$setText(this._text.$TextField[13 /* text */]);\n            //整体修改\n            this.stageText.$resetStageText();\n            this.updateInput();\n        };\n        return InputController;\n    }(egret.HashObject));\n    egret.InputController = InputController;\n    __reflect(InputController.prototype, \"egret.InputController\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var SplitRegex = new RegExp(\"(?=[\\\\u00BF-\\\\u1FFF\\\\u2C00-\\\\uD7FF]|\\\\b|\\\\s)(?![。，！、》…）)}”】\\\\.\\\\,\\\\!\\\\?\\\\]\\\\:])\");\n    /**\n     * @private\n     * 根据样式测量文本宽度\n     */\n    function measureTextWidth(text, values, style) {\n        style = style || {};\n        var italic = style.italic == null ? values[16 /* italic */] : style.italic;\n        var bold = style.bold == null ? values[15 /* bold */] : style.bold;\n        var size = style.size == null ? values[0 /* fontSize */] : style.size;\n        var fontFamily = style.fontFamily || values[8 /* fontFamily */] || TextField.default_fontFamily;\n        return egret.sys.measureText(text, fontFamily, size, bold, italic);\n    }\n    /**\n     * TextField is the text rendering class of egret. It conducts rendering by using the browser / device API. Due to different ways of font rendering in different browsers / devices, there may be differences in the rendering\n     * If developers expect  no differences among all platforms, please use BitmapText\n     * @see http://edn.egret.com/cn/docs/page/141 Create Text\n     *\n     * @event egret.Event.CHANGE Dispatched when entering text user input。\n     * @event egret.FocusEvent.FOCUS_IN Dispatched after the focus to enter text.\n     * @event egret.FocusEvent.FOCUS_OUT Enter the text loses focus after dispatch.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/TextField.ts\n     * @language en_US\n     */\n    /**\n     * TextField是egret的文本渲染类，采用浏览器/设备的API进行渲染，在不同的浏览器/设备中由于字体渲染方式不一，可能会有渲染差异\n     * 如果开发者希望所有平台完全无差异，请使用BitmapText\n     * @see http://edn.egret.com/cn/docs/page/141 创建文本\n     *\n     * @event egret.Event.CHANGE 输入文本有用户输入时调度。\n     * @event egret.FocusEvent.FOCUS_IN 聚焦输入文本后调度。\n     * @event egret.FocusEvent.FOCUS_OUT 输入文本失去焦点后调度。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/TextField.ts\n     * @language zh_CN\n     */\n    var TextField = (function (_super) {\n        __extends(TextField, _super);\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function TextField() {\n            var _this = _super.call(this) || this;\n            _this.$inputEnabled = false;\n            _this.inputUtils = null;\n            /**\n             * @private\n             */\n            _this.$graphicsNode = null;\n            /**\n             * @private\n             */\n            _this.isFlow = false;\n            /**\n             * @private\n             */\n            _this.textArr = [];\n            /**\n             * @private\n             */\n            _this.linesArr = [];\n            /**\n             * @private\n             */\n            _this.$isTyping = false;\n            var textNode = new egret.sys.TextNode();\n            textNode.fontFamily = TextField.default_fontFamily;\n            _this.textNode = textNode;\n            _this.$renderNode = textNode;\n            _this.$TextField = {\n                0: TextField.default_size,\n                1: 0,\n                2: TextField.default_textColor,\n                3: NaN,\n                4: NaN,\n                5: 0,\n                6: 0,\n                7: 0,\n                8: TextField.default_fontFamily,\n                9: \"left\",\n                10: \"top\",\n                11: \"#ffffff\",\n                12: \"\",\n                13: \"\",\n                14: [],\n                15: false,\n                16: false,\n                17: true,\n                18: false,\n                19: false,\n                20: false,\n                21: 0,\n                22: 0,\n                23: 0,\n                24: egret.TextFieldType.DYNAMIC,\n                25: 0x000000,\n                26: \"#000000\",\n                27: 0,\n                28: -1,\n                29: 0,\n                30: false,\n                31: false,\n                32: 0x000000,\n                33: false,\n                34: 0xffffff,\n                35: null,\n                36: null,\n                37: egret.TextFieldInputType.TEXT,\n                38: false //textLinesChangedForNativeRender\n            };\n            return _this;\n        }\n        TextField.prototype.createNativeDisplayObject = function () {\n            this.$nativeDisplayObject = new egret_native.NativeDisplayObject(7 /* TEXT */);\n        };\n        /**\n         * @private\n         */\n        TextField.prototype.isInput = function () {\n            return this.$TextField[24 /* type */] == egret.TextFieldType.INPUT;\n        };\n        TextField.prototype.$setTouchEnabled = function (value) {\n            _super.prototype.$setTouchEnabled.call(this, value);\n            if (this.isInput()) {\n                this.$inputEnabled = true;\n            }\n        };\n        Object.defineProperty(TextField.prototype, \"fontFamily\", {\n            /**\n             * The name of the font to use, or a comma-separated list of font names.\n             * @default \"Arial\"\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 要使用的字体的名称或用逗号分隔的字体名称列表。\n             * @default \"Arial\"\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$TextField[8 /* fontFamily */];\n            },\n            set: function (value) {\n                this.$setFontFamily(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        TextField.prototype.$setFontFamily = function (value) {\n            var values = this.$TextField;\n            if (values[8 /* fontFamily */] == value) {\n                return false;\n            }\n            values[8 /* fontFamily */] = value;\n            this.invalidateFontString();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setFontFamily(value);\n            }\n            return true;\n        };\n        Object.defineProperty(TextField.prototype, \"size\", {\n            /**\n             * The size in pixels of text\n             * @default 30\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 文本的字号大小。\n             * @default 30\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$TextField[0 /* fontSize */];\n            },\n            set: function (value) {\n                this.$setSize(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        TextField.prototype.$setSize = function (value) {\n            var values = this.$TextField;\n            if (values[0 /* fontSize */] == value) {\n                return false;\n            }\n            values[0 /* fontSize */] = value;\n            this.invalidateFontString();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setFontSize(value);\n            }\n            return true;\n        };\n        Object.defineProperty(TextField.prototype, \"bold\", {\n            /**\n             * Specifies whether the text is boldface.\n             * @default false\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 是否显示为粗体。\n             * @default false\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$TextField[15 /* bold */];\n            },\n            set: function (value) {\n                this.$setBold(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        TextField.prototype.$setBold = function (value) {\n            var values = this.$TextField;\n            if (value == values[15 /* bold */]) {\n                return false;\n            }\n            values[15 /* bold */] = value;\n            this.invalidateFontString();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setBold(value);\n            }\n            return true;\n        };\n        Object.defineProperty(TextField.prototype, \"italic\", {\n            /**\n             * Determines whether the text is italic font.\n             * @default false\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 是否显示为斜体。\n             * @default false\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$TextField[16 /* italic */];\n            },\n            set: function (value) {\n                this.$setItalic(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        TextField.prototype.$setItalic = function (value) {\n            var values = this.$TextField;\n            if (value == values[16 /* italic */]) {\n                return false;\n            }\n            values[16 /* italic */] = value;\n            this.invalidateFontString();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setItalic(value);\n            }\n            return true;\n        };\n        /**\n         * @private\n         *\n         */\n        TextField.prototype.invalidateFontString = function () {\n            this.$TextField[17 /* fontStringChanged */] = true;\n            this.$invalidateTextField();\n        };\n        Object.defineProperty(TextField.prototype, \"textAlign\", {\n            /**\n             * Horizontal alignment of text.\n             * @default：egret.HorizontalAlign.LEFT\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 文本的水平对齐方式。\n             * @default：egret.HorizontalAlign.LEFT\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$TextField[9 /* textAlign */];\n            },\n            set: function (value) {\n                this.$setTextAlign(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        TextField.prototype.$setTextAlign = function (value) {\n            var values = this.$TextField;\n            if (values[9 /* textAlign */] == value) {\n                return false;\n            }\n            values[9 /* textAlign */] = value;\n            this.$invalidateTextField();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setTextAlign(value);\n            }\n            return true;\n        };\n        Object.defineProperty(TextField.prototype, \"verticalAlign\", {\n            /**\n             * Vertical alignment of text.\n             * @default：egret.VerticalAlign.TOP\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 文字的垂直对齐方式。\n             * @default：egret.VerticalAlign.TOP\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$TextField[10 /* verticalAlign */];\n            },\n            set: function (value) {\n                this.$setVerticalAlign(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        TextField.prototype.$setVerticalAlign = function (value) {\n            var values = this.$TextField;\n            if (values[10 /* verticalAlign */] == value) {\n                return false;\n            }\n            values[10 /* verticalAlign */] = value;\n            this.$invalidateTextField();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setVerticalAlign(value);\n            }\n            return true;\n        };\n        Object.defineProperty(TextField.prototype, \"lineSpacing\", {\n            /**\n             * An integer representing the amount of vertical space between lines.\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 一个整数，表示行与行之间的垂直间距量\n             * @default 0\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$TextField[1 /* lineSpacing */];\n            },\n            set: function (value) {\n                this.$setLineSpacing(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        TextField.prototype.$setLineSpacing = function (value) {\n            var values = this.$TextField;\n            if (values[1 /* lineSpacing */] == value) {\n                return false;\n            }\n            values[1 /* lineSpacing */] = value;\n            this.$invalidateTextField();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setLineSpacing(value);\n            }\n            return true;\n        };\n        Object.defineProperty(TextField.prototype, \"textColor\", {\n            /**\n             * Color of the text.\n             * @default 0x000000\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 文本颜色\n             * @default 0x000000\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$TextField[2 /* textColor */];\n            },\n            set: function (value) {\n                this.$setTextColor(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        TextField.prototype.$setTextColor = function (value) {\n            var values = this.$TextField;\n            if (values[2 /* textColor */] == value) {\n                return false;\n            }\n            values[2 /* textColor */] = value;\n            if (this.inputUtils) {\n                this.inputUtils._setColor(this.$TextField[2 /* textColor */]);\n            }\n            this.$invalidateTextField();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setTextColor(value);\n            }\n            return true;\n        };\n        Object.defineProperty(TextField.prototype, \"wordWrap\", {\n            /**\n             * A Boolean value that indicates whether the text field word wrap. If the value is true, then the text field by word wrap;\n             * if the value is false, the text field by newline characters.\n             * @default false\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 一个布尔值，表示文本字段是否按单词换行。如果值为 true，则该文本字段按单词换行；\n             * 如果值为 false，则该文本字段按字符换行。\n             * @default false\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$TextField[19 /* wordWrap */];\n            },\n            set: function (value) {\n                this.$setWordWrap(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        TextField.prototype.$setWordWrap = function (value) {\n            var values = this.$TextField;\n            if (value == values[19 /* wordWrap */]) {\n                return;\n            }\n            if (values[20 /* displayAsPassword */]) {\n                return;\n            }\n            values[19 /* wordWrap */] = value;\n            this.$invalidateTextField();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setWordWrap(value);\n            }\n        };\n        Object.defineProperty(TextField.prototype, \"type\", {\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$TextField[24 /* type */];\n            },\n            /**\n             * Type of the text field.\n             * Any one of the following TextFieldType constants: TextFieldType.DYNAMIC (specifies the dynamic text field that users can not edit), or TextFieldType.INPUT (specifies the dynamic text field that users can edit).\n             * @default egret.TextFieldType.DYNAMIC\n             * @language en_US\n             */\n            /**\n             * 文本字段的类型。\n             * 以下 TextFieldType 常量中的任一个：TextFieldType.DYNAMIC（指定用户无法编辑的动态文本字段），或 TextFieldType.INPUT（指定用户可以编辑的输入文本字段）。\n             * @default egret.TextFieldType.DYNAMIC\n             * @language zh_CN\n             */\n            set: function (value) {\n                this.$setType(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        TextField.prototype.$setType = function (value) {\n            var values = this.$TextField;\n            if (values[24 /* type */] != value) {\n                values[24 /* type */] = value;\n                if (egret.nativeRender) {\n                    this.$nativeDisplayObject.setType(value);\n                }\n                if (value == egret.TextFieldType.INPUT) {\n                    if (isNaN(values[3 /* textFieldWidth */])) {\n                        this.$setWidth(100);\n                    }\n                    if (isNaN(values[4 /* textFieldHeight */])) {\n                        this.$setHeight(30);\n                    }\n                    this.$setTouchEnabled(true);\n                    //创建stageText\n                    if (this.inputUtils == null) {\n                        this.inputUtils = new egret.InputController();\n                    }\n                    this.inputUtils.init(this);\n                    this.$invalidateTextField();\n                    if (this.$stage) {\n                        this.inputUtils._addStageText();\n                    }\n                }\n                else {\n                    if (this.inputUtils) {\n                        this.inputUtils._removeStageText();\n                        this.inputUtils = null;\n                    }\n                    this.$setTouchEnabled(false);\n                }\n                return true;\n            }\n            return false;\n        };\n        Object.defineProperty(TextField.prototype, \"inputType\", {\n            /**\n             * @version Egret 3.1.2\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$TextField[37 /* inputType */];\n            },\n            /**\n             * Pop-up keyboard type.\n             * Any of a TextFieldInputType constants.\n             * @language en_US\n             */\n            /**\n             * 弹出键盘的类型。\n             * TextFieldInputType 常量中的任一个。\n             * @language zh_CN\n             */\n            set: function (value) {\n                if (this.$TextField[37 /* inputType */] == value) {\n                    return;\n                }\n                this.$TextField[37 /* inputType */] = value;\n                if (egret.nativeRender) {\n                    this.$nativeDisplayObject.setInputType(value);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(TextField.prototype, \"text\", {\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$getText();\n            },\n            /**\n             * Serve as a string of the current text field in the text\n             * @language en_US\n             */\n            /**\n             * 作为文本字段中当前文本的字符串\n             * @language zh_CN\n             */\n            set: function (value) {\n                this.$setText(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @returns\n         */\n        TextField.prototype.$getText = function () {\n            if (this.$TextField[24 /* type */] == egret.TextFieldType.INPUT) {\n                return this.inputUtils._getText();\n            }\n            return this.$TextField[13 /* text */];\n        };\n        /**\n         * @private\n         *\n         * @param value\n         */\n        TextField.prototype.$setBaseText = function (value) {\n            if (value == null) {\n                value = \"\";\n            }\n            else {\n                value = value.toString();\n            }\n            this.isFlow = false;\n            var values = this.$TextField;\n            if (values[13 /* text */] != value) {\n                this.$invalidateTextField();\n                values[13 /* text */] = value;\n                var text = \"\";\n                if (values[20 /* displayAsPassword */]) {\n                    text = this.changeToPassText(value);\n                }\n                else {\n                    text = value;\n                }\n                if (egret.nativeRender) {\n                    this.$nativeDisplayObject.setText(text);\n                }\n                this.setMiddleStyle([{ text: text }]);\n                return true;\n            }\n            return false;\n        };\n        /**\n         * @private\n         *\n         * @param value\n         */\n        TextField.prototype.$setText = function (value) {\n            if (value == null) {\n                value = \"\";\n            }\n            var result = this.$setBaseText(value);\n            if (this.inputUtils) {\n                this.inputUtils._setText(this.$TextField[13 /* text */]);\n            }\n            return result;\n        };\n        Object.defineProperty(TextField.prototype, \"displayAsPassword\", {\n            /**\n             * Specify whether the text field is a password text field.\n             * If the value of this property is true, the text field is treated as a password text field and hides the input characters using asterisks instead of the actual characters. If false, the text field is not treated as a password text field.\n             * @default false\n             * @language en_US\n             */\n            /**\n             * 指定文本字段是否是密码文本字段。\n             * 如果此属性的值为 true，则文本字段被视为密码文本字段，并使用星号而不是实际字符来隐藏输入的字符。如果为 false，则不会将文本字段视为密码文本字段。\n             * @default false\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$TextField[20 /* displayAsPassword */];\n            },\n            set: function (value) {\n                this.$setDisplayAsPassword(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        TextField.prototype.$setDisplayAsPassword = function (value) {\n            var values = this.$TextField;\n            if (values[20 /* displayAsPassword */] != value) {\n                values[20 /* displayAsPassword */] = value;\n                this.$invalidateTextField();\n                var text = \"\";\n                if (value) {\n                    text = this.changeToPassText(values[13 /* text */]);\n                }\n                else {\n                    text = values[13 /* text */];\n                }\n                if (egret.nativeRender) {\n                    this.$nativeDisplayObject.setText(text);\n                }\n                this.setMiddleStyle([{ text: text }]);\n                return true;\n            }\n            return false;\n        };\n        Object.defineProperty(TextField.prototype, \"strokeColor\", {\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$TextField[25 /* strokeColor */];\n            },\n            /**\n             * Represent the stroke color of the text.\n             * Contain three 8-bit numbers with RGB color components; for example, 0xFF0000 is red, 0x00FF00 is green.\n             * @default 0x000000\n             * @language en_US\n             */\n            /**\n             * 表示文本的描边颜色。\n             * 包含三个 8 位 RGB 颜色成分的数字；例如，0xFF0000 为红色，0x00FF00 为绿色。\n             * @default 0x000000\n             * @language zh_CN\n             */\n            set: function (value) {\n                this.$setStrokeColor(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        TextField.prototype.$setStrokeColor = function (value) {\n            var values = this.$TextField;\n            if (values[25 /* strokeColor */] != value) {\n                this.$invalidateTextField();\n                values[25 /* strokeColor */] = value;\n                if (egret.nativeRender) {\n                    this.$nativeDisplayObject.setStrokeColor(value);\n                }\n                values[26 /* strokeColorString */] = egret.toColorString(value);\n                return true;\n            }\n            return false;\n        };\n        Object.defineProperty(TextField.prototype, \"stroke\", {\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$TextField[27 /* stroke */];\n            },\n            /**\n             * Indicate the stroke width.\n             * 0 means no stroke.\n             * @default 0\n             * @language en_US\n             */\n            /**\n             * 表示描边宽度。\n             * 0为没有描边。\n             * @default 0\n             * @language zh_CN\n             */\n            set: function (value) {\n                this.$setStroke(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        TextField.prototype.$setStroke = function (value) {\n            if (this.$TextField[27 /* stroke */] != value) {\n                this.$invalidateTextField();\n                this.$TextField[27 /* stroke */] = value;\n                if (egret.nativeRender) {\n                    this.$nativeDisplayObject.setStroke(value);\n                }\n                return true;\n            }\n            return false;\n        };\n        Object.defineProperty(TextField.prototype, \"maxChars\", {\n            /**\n             * The maximum number of characters that the text field can contain, as entered by a user. \\n A script can insert more text than maxChars allows; the maxChars property indicates only how much text a user can enter. If the value of this property is 0, a user can enter an unlimited amount of text.\n             * The default value is 0.\n             * @default 0\n             * @language en_US\n             */\n            /**\n             * 文本字段中最多可包含的字符数（即用户输入的字符数）。\n             * 脚本可以插入比 maxChars 允许的字符数更多的文本；maxChars 属性仅表示用户可以输入多少文本。如果此属性的值为 0，则用户可以输入无限数量的文本。\n             * @default 0\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$TextField[21 /* maxChars */];\n            },\n            set: function (value) {\n                this.$setMaxChars(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        TextField.prototype.$setMaxChars = function (value) {\n            if (this.$TextField[21 /* maxChars */] != value) {\n                this.$TextField[21 /* maxChars */] = value;\n                if (egret.nativeRender) {\n                    this.$nativeDisplayObject.setMaxChars(value);\n                }\n                return true;\n            }\n            return false;\n        };\n        Object.defineProperty(TextField.prototype, \"scrollV\", {\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return Math.min(Math.max(this.$TextField[28 /* scrollV */], 1), this.maxScrollV);\n            },\n            /**\n             * Vertical position of text in a text field. scrollV property helps users locate specific passages in a long article, and create scrolling text fields.\n             * Vertically scrolling units are lines, and horizontal scrolling unit is pixels.\n             * If the first displayed line is the first line in the text field, scrollV is set to 1 (instead of 0).\n             * @language en_US\n             */\n            /**\n             * 文本在文本字段中的垂直位置。scrollV 属性可帮助用户定位到长篇文章的特定段落，还可用于创建滚动文本字段。\n             * 垂直滚动的单位是行，而水平滚动的单位是像素。\n             * 如果显示的第一行是文本字段中的第一行，则 scrollV 设置为 1（而非 0）。\n             * @language zh_CN\n             */\n            set: function (value) {\n                value = Math.max(value, 1);\n                if (value == this.$TextField[28 /* scrollV */]) {\n                    return;\n                }\n                this.$TextField[28 /* scrollV */] = value;\n                if (egret.nativeRender) {\n                    this.$nativeDisplayObject.setScrollV(value);\n                }\n                this.$invalidateTextField();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(TextField.prototype, \"maxScrollV\", {\n            /**\n             * The maximum value of scrollV\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * scrollV 的最大值\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                this.$getLinesArr();\n                return Math.max(this.$TextField[29 /* numLines */] - egret.TextFieldUtils.$getScrollNum(this) + 1, 1);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(TextField.prototype, \"selectionBeginIndex\", {\n            /**\n             * @private\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(TextField.prototype, \"selectionEndIndex\", {\n            /**\n             * @private\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(TextField.prototype, \"caretIndex\", {\n            /**\n             * @private\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param beginIndex\n         * @param endIndex\n         */\n        TextField.prototype.$setSelection = function (beginIndex, endIndex) {\n            return false;\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        TextField.prototype.$getLineHeight = function () {\n            return this.$TextField[1 /* lineSpacing */] + this.$TextField[0 /* fontSize */];\n        };\n        Object.defineProperty(TextField.prototype, \"numLines\", {\n            /**\n             * Number of lines of text.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 文本行数。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                this.$getLinesArr();\n                return this.$TextField[29 /* numLines */];\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(TextField.prototype, \"multiline\", {\n            get: function () {\n                return this.$TextField[30 /* multiline */];\n            },\n            /**\n             * Indicate whether field is a multiline text field. Note that this property is valid only when the type is TextFieldType.INPUT.\n             * If the value is true, the text field is multiline; if the value is false, the text field is a single-line text field. In a field of type TextFieldType.INPUT, the multiline value determines whether the Enter key creates a new line (a value of false, and the Enter key is ignored).\n             * @default false\n             * @language en_US\n             */\n            /**\n             * 表示字段是否为多行文本字段。注意，此属性仅在type为TextFieldType.INPUT时才有效。\n             * 如果值为 true，则文本字段为多行文本字段；如果值为 false，则文本字段为单行文本字段。在类型为 TextFieldType.INPUT 的字段中，multiline 值将确定 Enter 键是否创建新行（如果值为 false，则将忽略 Enter 键）。\n             * @default false\n             * @language zh_CN\n             */\n            set: function (value) {\n                this.$setMultiline(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        TextField.prototype.$setMultiline = function (value) {\n            if (this.$TextField[30 /* multiline */] == value) {\n                return false;\n            }\n            this.$TextField[30 /* multiline */] = value;\n            this.$invalidateTextField();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setMultiline(value);\n            }\n            return true;\n        };\n        Object.defineProperty(TextField.prototype, \"restrict\", {\n            get: function () {\n                var values = this.$TextField;\n                var str = null;\n                if (values[35 /* restrictAnd */] != null) {\n                    str = values[35 /* restrictAnd */];\n                }\n                if (values[36 /* restrictNot */] != null) {\n                    if (str == null) {\n                        str = \"\";\n                    }\n                    str += \"^\" + values[36 /* restrictNot */];\n                }\n                return str;\n            },\n            /**\n             * Indicates a user can enter into the text field character set. If you restrict property is null, you can enter any character. If you restrict property is an empty string, you can not enter any character. If you restrict property is a string of characters, you can enter only characters in the string in the text field. The string is scanned from left to right. You can use a hyphen (-) to specify a range. Only restricts user interaction; a script may put any text into the text field. <br/>\n                      * If the string of characters caret (^) at the beginning, all characters are initially accepted, then the string are excluded from receiving ^ character. If the string does not begin with a caret (^) to, any characters are initially accepted and then a string of characters included in the set of accepted characters. <br/>\n                      * The following example allows only uppercase characters, spaces, and numbers in the text field: <br/>\n                      * My_txt.restrict = \"A-Z 0-9\"; <br/>\n                      * The following example includes all characters except lowercase letters: <br/>\n                      * My_txt.restrict = \"^ a-z\"; <br/>\n                      * If you need to enter characters \\ ^, use two backslash \"\\\\ -\" \"\\\\ ^\": <br/>\n                      * Can be used anywhere in the string ^ to rule out including characters and switch between characters, but can only be used to exclude a ^. The following code includes only uppercase letters except uppercase Q: <br/>\n                      * My_txt.restrict = \"A-Z ^ Q\"; <br/>\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @default null\n             * @language en_US\n             */\n            /**\n             * 表示用户可输入到文本字段中的字符集。如果 restrict 属性的值为 null，则可以输入任何字符。如果 restrict 属性的值为空字符串，则不能输入任何字符。如果 restrict 属性的值为一串字符，则只能在文本字段中输入该字符串中的字符。从左向右扫描该字符串。可以使用连字符 (-) 指定一个范围。只限制用户交互；脚本可将任何文本放入文本字段中。<br/>\n             * 如果字符串以尖号 (^) 开头，则先接受所有字符，然后从接受字符集中排除字符串中 ^ 之后的字符。如果字符串不以尖号 (^) 开头，则最初不接受任何字符，然后将字符串中的字符包括在接受字符集中。<br/>\n             * 下例仅允许在文本字段中输入大写字符、空格和数字：<br/>\n             * my_txt.restrict = \"A-Z 0-9\";<br/>\n             * 下例包含除小写字母之外的所有字符：<br/>\n             * my_txt.restrict = \"^a-z\";<br/>\n             * 如果需要输入字符 \\ ^，请使用2个反斜杠 \"\\\\-\" \"\\\\^\" ：<br/>\n             * 可在字符串中的任何位置使用 ^，以在包含字符与排除字符之间进行切换，但是最多只能有一个 ^ 用来排除。下面的代码只包含除大写字母 Q 之外的大写字母：<br/>\n             * my_txt.restrict = \"A-Z^Q\";<br/>\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @default null\n             * @language zh_CN\n             */\n            set: function (value) {\n                var values = this.$TextField;\n                if (value == null) {\n                    values[35 /* restrictAnd */] = null;\n                    values[36 /* restrictNot */] = null;\n                }\n                else {\n                    var index = -1;\n                    while (index < value.length) {\n                        index = value.indexOf(\"^\", index);\n                        if (index == 0) {\n                            break;\n                        }\n                        else if (index > 0) {\n                            if (value.charAt(index - 1) != \"\\\\\") {\n                                break;\n                            }\n                            index++;\n                        }\n                        else {\n                            break;\n                        }\n                    }\n                    if (index == 0) {\n                        values[35 /* restrictAnd */] = null;\n                        values[36 /* restrictNot */] = value.substring(index + 1);\n                    }\n                    else if (index > 0) {\n                        values[35 /* restrictAnd */] = value.substring(0, index);\n                        values[36 /* restrictNot */] = value.substring(index + 1);\n                    }\n                    else {\n                        values[35 /* restrictAnd */] = value;\n                        values[36 /* restrictNot */] = null;\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        TextField.prototype.$setWidth = function (value) {\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setTextFieldWidth(value);\n            }\n            var values = this.$TextField;\n            if (isNaN(value)) {\n                if (isNaN(values[3 /* textFieldWidth */])) {\n                    return false;\n                }\n                values[3 /* textFieldWidth */] = NaN;\n            }\n            else {\n                if (values[3 /* textFieldWidth */] == value) {\n                    return false;\n                }\n                values[3 /* textFieldWidth */] = value;\n            }\n            value = +value;\n            if (value < 0) {\n                return false;\n            }\n            this.$invalidateTextField();\n            return true;\n        };\n        /**\n         * @private\n         *\n         * @param value\n         */\n        TextField.prototype.$setHeight = function (value) {\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setTextFieldHeight(value);\n            }\n            var values = this.$TextField;\n            if (isNaN(value)) {\n                if (isNaN(values[4 /* textFieldHeight */])) {\n                    return false;\n                }\n                values[4 /* textFieldHeight */] = NaN;\n            }\n            else {\n                if (values[4 /* textFieldHeight */] == value) {\n                    return false;\n                }\n                values[4 /* textFieldHeight */] = value;\n            }\n            value = +value;\n            if (value < 0) {\n                return false;\n            }\n            this.$invalidateTextField();\n            return true;\n        };\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        TextField.prototype.$getWidth = function () {\n            var values = this.$TextField;\n            return isNaN(values[3 /* textFieldWidth */]) ? this.$getContentBounds().width : values[3 /* textFieldWidth */];\n        };\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        TextField.prototype.$getHeight = function () {\n            var values = this.$TextField;\n            return isNaN(values[4 /* textFieldHeight */]) ? this.$getContentBounds().height : values[4 /* textFieldHeight */];\n        };\n        Object.defineProperty(TextField.prototype, \"border\", {\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$TextField[31 /* border */];\n            },\n            /**\n             * Specifies whether the text field has a border.\n             * If true, the text field has a border. If false, the text field has no border.\n             * Use borderColor property to set the border color.\n             * @default false\n             * @language en_US\n             */\n            /**\n             * 指定文本字段是否具有边框。\n             * 如果为 true，则文本字段具有边框。如果为 false，则文本字段没有边框。\n             * 使用 borderColor 属性来设置边框颜色。\n             * @default false\n             * @language zh_CN\n             */\n            set: function (value) {\n                this.$setBorder(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         */\n        TextField.prototype.$setBorder = function (value) {\n            value = !!value;\n            if (this.$TextField[31 /* border */] == value) {\n                return;\n            }\n            this.$TextField[31 /* border */] = value;\n            this.$invalidateTextField();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setBorder(value);\n            }\n        };\n        Object.defineProperty(TextField.prototype, \"borderColor\", {\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$TextField[32 /* borderColor */];\n            },\n            /**\n             * The color of the text field border.\n             * Even currently is no border can be retrieved or set this property, but only if the text field has the border property is set to true, the color is visible.\n             * @default 0x000000\n             * @language en_US\n             */\n            /**\n             * 文本字段边框的颜色。\n             * 即使当前没有边框，也可检索或设置此属性，但只有当文本字段已将 border 属性设置为 true 时，才可以看到颜色。\n             * @default 0x000000\n             * @language zh_CN\n             */\n            set: function (value) {\n                this.$setBorderColor(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         */\n        TextField.prototype.$setBorderColor = function (value) {\n            value = +value || 0;\n            if (this.$TextField[32 /* borderColor */] == value) {\n                return;\n            }\n            this.$TextField[32 /* borderColor */] = value;\n            this.$invalidateTextField();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setBorderColor(value);\n            }\n        };\n        Object.defineProperty(TextField.prototype, \"background\", {\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$TextField[33 /* background */];\n            },\n            /**\n             * Specifies whether the text field has a background fill.\n             * If true, the text field has a background fill. If false, the text field has no background fill.\n             * Use the backgroundColor property to set the background color of the text field.\n             * @default false\n             * @language en_US\n             */\n            /**\n             * 指定文本字段是否具有背景填充。\n             * 如果为 true，则文本字段具有背景填充。如果为 false，则文本字段没有背景填充。\n             * 使用 backgroundColor 属性来设置文本字段的背景颜色。\n             * @default false\n             * @language zh_CN\n             */\n            set: function (value) {\n                this.$setBackground(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         */\n        TextField.prototype.$setBackground = function (value) {\n            if (this.$TextField[33 /* background */] == value) {\n                return;\n            }\n            this.$TextField[33 /* background */] = value;\n            this.$invalidateTextField();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setBackground(value);\n            }\n        };\n        Object.defineProperty(TextField.prototype, \"backgroundColor\", {\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$TextField[34 /* backgroundColor */];\n            },\n            /**\n             * Color of the text field background.\n             * Even currently is no background, can be retrieved or set this property, but only if the text field has the background property set to true, the color is visible.\n             * @default 0xFFFFFF\n             * @language en_US\n             */\n            /**\n             * 文本字段背景的颜色。\n             * 即使当前没有背景，也可检索或设置此属性，但只有当文本字段已将 background 属性设置为 true 时，才可以看到颜色。\n             * @default 0xFFFFFF\n             * @language zh_CN\n             */\n            set: function (value) {\n                this.$setBackgroundColor(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         */\n        TextField.prototype.$setBackgroundColor = function (value) {\n            if (this.$TextField[34 /* backgroundColor */] == value) {\n                return;\n            }\n            this.$TextField[34 /* backgroundColor */] = value;\n            this.$invalidateTextField();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setBackgroundColor(value);\n            }\n        };\n        /**\n         * @private\n         *\n         */\n        TextField.prototype.fillBackground = function (lines) {\n            var graphics = this.$graphicsNode;\n            if (graphics) {\n                graphics.clear();\n            }\n            var values = this.$TextField;\n            if (values[33 /* background */] || values[31 /* border */] || (lines && lines.length > 0)) {\n                if (!graphics) {\n                    graphics = this.$graphicsNode = new egret.sys.GraphicsNode();\n                    if (!egret.nativeRender) {\n                        var groupNode = new egret.sys.GroupNode();\n                        groupNode.addNode(graphics);\n                        groupNode.addNode(this.textNode);\n                        this.$renderNode = groupNode;\n                    }\n                    else {\n                        this.$renderNode = this.textNode;\n                    }\n                }\n                var fillPath = void 0;\n                var strokePath = void 0;\n                //渲染背景\n                if (values[33 /* background */]) {\n                    fillPath = graphics.beginFill(values[34 /* backgroundColor */]);\n                    fillPath.drawRect(0, 0, this.$getWidth(), this.$getHeight());\n                }\n                //渲染边框\n                if (values[31 /* border */]) {\n                    strokePath = graphics.lineStyle(1, values[32 /* borderColor */]);\n                    //1像素和3像素线条宽度的情况，会向右下角偏移0.5像素绘制。少画一像素宽度，正好能不超出文本测量边界。\n                    strokePath.drawRect(0, 0, this.$getWidth() - 1, this.$getHeight() - 1);\n                }\n                //渲染下划线\n                if (lines && lines.length > 0) {\n                    var textColor = values[2 /* textColor */];\n                    var lastColor = -1;\n                    var length_7 = lines.length;\n                    for (var i = 0; i < length_7; i += 4) {\n                        var x = lines[i];\n                        var y = lines[i + 1];\n                        var w = lines[i + 2];\n                        var color = lines[i + 3] || textColor;\n                        if (lastColor < 0 || lastColor != color) {\n                            lastColor = color;\n                            strokePath = graphics.lineStyle(2, color, 1, egret.CapsStyle.NONE);\n                        }\n                        strokePath.moveTo(x, y);\n                        strokePath.lineTo(x + w, y);\n                    }\n                }\n            }\n            if (graphics) {\n                var bounds = this.$getRenderBounds();\n                graphics.x = bounds.x;\n                graphics.y = bounds.y;\n                graphics.width = bounds.width;\n                graphics.height = bounds.height;\n                egret.Rectangle.release(bounds);\n            }\n        };\n        /**\n         * Enter the text automatically entered into the input state, the input type is text only and may only be invoked in the user interaction.\n         * @version Egret 3.0.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 输入文本自动进入到输入状态，仅在类型是输入文本并且是在用户交互下才可以调用。\n         * @version Egret 3.0.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TextField.prototype.setFocus = function () {\n            if (this.type == egret.TextFieldType.INPUT && this.$stage) {\n                this.inputUtils.$onFocus();\n            }\n        };\n        /**\n         * @private\n         *\n         */\n        TextField.prototype.$onRemoveFromStage = function () {\n            _super.prototype.$onRemoveFromStage.call(this);\n            this.removeEvent();\n            if (this.$TextField[24 /* type */] == egret.TextFieldType.INPUT) {\n                this.inputUtils._removeStageText();\n            }\n            if (this.textNode) {\n                this.textNode.clean();\n                if (egret.nativeRender) {\n                    egret_native.NativeDisplayObject.disposeTextData(this);\n                }\n            }\n        };\n        /**\n         * @private\n         *\n         * @param stage\n         * @param nestLevel\n         */\n        TextField.prototype.$onAddToStage = function (stage, nestLevel) {\n            _super.prototype.$onAddToStage.call(this, stage, nestLevel);\n            this.addEvent();\n            if (this.$TextField[24 /* type */] == egret.TextFieldType.INPUT) {\n                this.inputUtils._addStageText();\n            }\n        };\n        TextField.prototype.$invalidateTextField = function () {\n            var self = this;\n            self.$renderDirty = true;\n            self.$TextField[18 /* textLinesChanged */] = true;\n            self.$TextField[38 /* textLinesChangedForNativeRender */] = true;\n            if (egret.nativeRender) {\n                // egret_native.dirtyTextField(this);\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        TextField.prototype.$getRenderBounds = function () {\n            var bounds = this.$getContentBounds();\n            var tmpBounds = egret.Rectangle.create();\n            tmpBounds.copyFrom(bounds);\n            if (this.$TextField[31 /* border */]) {\n                tmpBounds.width += 2;\n                tmpBounds.height += 2;\n            }\n            var _strokeDouble = this.$TextField[27 /* stroke */] * 2;\n            if (_strokeDouble > 0) {\n                tmpBounds.width += _strokeDouble * 2;\n                tmpBounds.height += _strokeDouble * 2;\n            }\n            tmpBounds.x -= _strokeDouble + 2; //+2和+4 是为了webgl纹理太小导致裁切问题\n            tmpBounds.y -= _strokeDouble + 2;\n            tmpBounds.width = Math.ceil(tmpBounds.width) + 4;\n            tmpBounds.height = Math.ceil(tmpBounds.height) + 4;\n            return tmpBounds;\n        };\n        /**\n         * @private\n         */\n        TextField.prototype.$measureContentBounds = function (bounds) {\n            this.$getLinesArr();\n            var w = 0;\n            var h = 0;\n            if (egret.nativeRender) {\n                w = egret_native.nrGetTextFieldWidth(this.$nativeDisplayObject.id);\n                h = egret_native.nrGetTextFieldHeight(this.$nativeDisplayObject.id);\n            }\n            else {\n                w = !isNaN(this.$TextField[3 /* textFieldWidth */]) ? this.$TextField[3 /* textFieldWidth */] : this.$TextField[5 /* textWidth */];\n                h = !isNaN(this.$TextField[4 /* textFieldHeight */]) ? this.$TextField[4 /* textFieldHeight */] : egret.TextFieldUtils.$getTextHeight(this);\n            }\n            bounds.setTo(0, 0, w, h);\n        };\n        TextField.prototype.$updateRenderNode = function () {\n            if (this.$TextField[24 /* type */] == egret.TextFieldType.INPUT) {\n                this.inputUtils._updateProperties();\n                if (this.$isTyping) {\n                    this.fillBackground();\n                    return;\n                }\n            }\n            else if (this.$TextField[3 /* textFieldWidth */] == 0) {\n                var graphics = this.$graphicsNode;\n                if (graphics) {\n                    graphics.clear();\n                }\n                return;\n            }\n            var underLines = this.drawText();\n            this.fillBackground(underLines);\n            //tudo 宽高很小的情况下webgl模式绘制异常\n            var bounds = this.$getRenderBounds();\n            var node = this.textNode;\n            node.x = bounds.x;\n            node.y = bounds.y;\n            node.width = Math.ceil(bounds.width);\n            node.height = Math.ceil(bounds.height);\n            egret.Rectangle.release(bounds);\n        };\n        Object.defineProperty(TextField.prototype, \"textFlow\", {\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.textArr;\n            },\n            /**\n             * Set rich text\n             * @language en_US\n             */\n            /**\n             * 设置富文本\n             * @see http://edn.egret.com/cn/index.php/article/index/id/146\n             * @language zh_CN\n             */\n            set: function (textArr) {\n                this.isFlow = true;\n                var text = \"\";\n                if (textArr == null)\n                    textArr = [];\n                for (var i = 0; i < textArr.length; i++) {\n                    var element = textArr[i];\n                    text += element.text;\n                }\n                if (this.$TextField[20 /* displayAsPassword */]) {\n                    this.$setBaseText(text);\n                }\n                else {\n                    this.$TextField[13 /* text */] = text;\n                    this.setMiddleStyle(textArr);\n                    if (egret.nativeRender) {\n                        this.$nativeDisplayObject.setTextFlow(textArr);\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param text\n         * @returns\n         */\n        TextField.prototype.changeToPassText = function (text) {\n            if (this.$TextField[20 /* displayAsPassword */]) {\n                var passText = \"\";\n                for (var i = 0, num = text.length; i < num; i++) {\n                    switch (text.charAt(i)) {\n                        case '\\n':\n                            passText += \"\\n\";\n                            break;\n                        case '\\r':\n                            break;\n                        default:\n                            passText += '*';\n                    }\n                }\n                return passText;\n            }\n            return text;\n        };\n        /**\n         * @private\n         *\n         * @param textArr\n         */\n        TextField.prototype.setMiddleStyle = function (textArr) {\n            this.$TextField[18 /* textLinesChanged */] = true;\n            this.$TextField[38 /* textLinesChangedForNativeRender */] = true;\n            this.textArr = textArr;\n            this.$invalidateTextField();\n        };\n        Object.defineProperty(TextField.prototype, \"textWidth\", {\n            /**\n             * Get the text measured width\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 获取文本测量宽度\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                this.$getLinesArr();\n                if (egret.nativeRender) {\n                    return egret_native.nrGetTextWidth(this.$nativeDisplayObject.id);\n                }\n                return this.$TextField[5 /* textWidth */];\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(TextField.prototype, \"textHeight\", {\n            /**\n             * Get Text measuring height\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 获取文本测量高度\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                this.$getLinesArr();\n                if (egret.nativeRender) {\n                    return egret_native.nrGetTextHeight(this.$nativeDisplayObject.id);\n                }\n                return egret.TextFieldUtils.$getTextHeight(this);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         * @param text\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        TextField.prototype.appendText = function (text) {\n            this.appendElement({ text: text });\n        };\n        /**\n         * @private\n         * @param element\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        TextField.prototype.appendElement = function (element) {\n            var text = this.$TextField[13 /* text */] + element.text;\n            if (egret.nativeRender) {\n                this.textArr.push(element);\n                this.$TextField[13 /* text */] = text;\n                this.$TextField[18 /* textLinesChanged */] = true;\n                this.$TextField[38 /* textLinesChangedForNativeRender */] = true;\n                this.$nativeDisplayObject.setTextFlow(this.textArr);\n                return;\n            }\n            if (this.$TextField[20 /* displayAsPassword */]) {\n                this.$setBaseText(text);\n            }\n            else {\n                this.$TextField[13 /* text */] = text;\n                this.textArr.push(element);\n                this.setMiddleStyle(this.textArr);\n            }\n        };\n        TextField.prototype.$getLinesArr = function () {\n            var values = this.$TextField;\n            if (egret.nativeRender && values[38 /* textLinesChangedForNativeRender */]) {\n                egret_native.updateNativeRender();\n                values[38 /* textLinesChangedForNativeRender */] = false;\n                return;\n            }\n            else {\n                return this.$getLinesArr2();\n            }\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        TextField.prototype.$getLinesArr2 = function () {\n            var values = this.$TextField;\n            if (!values[18 /* textLinesChanged */]) {\n                return this.linesArr;\n            }\n            values[18 /* textLinesChanged */] = false;\n            var text2Arr = this.textArr;\n            this.linesArr.length = 0;\n            values[6 /* textHeight */] = 0;\n            values[5 /* textWidth */] = 0;\n            var textFieldWidth = values[3 /* textFieldWidth */];\n            //宽度被设置为0\n            if (!isNaN(textFieldWidth) && textFieldWidth == 0) {\n                values[29 /* numLines */] = 0;\n                return [{ width: 0, height: 0, charNum: 0, elements: [], hasNextLine: false }];\n            }\n            var linesArr = this.linesArr;\n            var lineW = 0;\n            var lineCharNum = 0;\n            var lineH = 0;\n            var lineCount = 0;\n            var lineElement;\n            for (var i = 0, text2ArrLength = text2Arr.length; i < text2ArrLength; i++) {\n                var element = text2Arr[i];\n                //可能设置为没有文本，忽略绘制\n                if (!element.text) {\n                    if (lineElement) {\n                        lineElement.width = lineW;\n                        lineElement.height = lineH;\n                        lineElement.charNum = lineCharNum;\n                        values[5 /* textWidth */] = Math.max(values[5 /* textWidth */], lineW);\n                        values[6 /* textHeight */] += lineH;\n                    }\n                    continue;\n                }\n                element.style = element.style || {};\n                var text = element.text.toString();\n                var textArr = text.split(/(?:\\r\\n|\\r|\\n)/);\n                for (var j = 0, textArrLength = textArr.length; j < textArrLength; j++) {\n                    if (linesArr[lineCount] == null) {\n                        lineElement = { width: 0, height: 0, elements: [], charNum: 0, hasNextLine: false };\n                        linesArr[lineCount] = lineElement;\n                        lineW = 0;\n                        lineH = 0;\n                        lineCharNum = 0;\n                    }\n                    if (values[24 /* type */] == egret.TextFieldType.INPUT) {\n                        lineH = values[0 /* fontSize */];\n                    }\n                    else {\n                        lineH = Math.max(lineH, element.style.size || values[0 /* fontSize */]);\n                    }\n                    var isNextLine = true;\n                    if (textArr[j] == \"\") {\n                        if (j == textArrLength - 1) {\n                            isNextLine = false;\n                        }\n                    }\n                    else {\n                        var w = measureTextWidth(textArr[j], values, element.style);\n                        if (isNaN(textFieldWidth)) {\n                            lineW += w;\n                            lineCharNum += textArr[j].length;\n                            lineElement.elements.push({\n                                width: w,\n                                text: textArr[j],\n                                style: element.style\n                            });\n                            if (j == textArrLength - 1) {\n                                isNextLine = false;\n                            }\n                        }\n                        else {\n                            if (lineW + w <= textFieldWidth) {\n                                lineElement.elements.push({\n                                    width: w,\n                                    text: textArr[j],\n                                    style: element.style\n                                });\n                                lineW += w;\n                                lineCharNum += textArr[j].length;\n                                if (j == textArrLength - 1) {\n                                    isNextLine = false;\n                                }\n                            }\n                            else {\n                                var k = 0;\n                                var ww = 0;\n                                var word = textArr[j];\n                                var words = void 0;\n                                if (values[19 /* wordWrap */]) {\n                                    words = word.split(SplitRegex);\n                                }\n                                else {\n                                    words = word.match(/./g);\n                                }\n                                var wl = words.length;\n                                var charNum = 0;\n                                for (; k < wl; k++) {\n                                    // detect 4 bytes unicode, refer https://mths.be/punycode\n                                    var codeLen = words[k].length;\n                                    var has4BytesUnicode = false;\n                                    if (codeLen == 1 && k < wl - 1) {\n                                        var charCodeHigh = words[k].charCodeAt(0);\n                                        var charCodeLow = words[k + 1].charCodeAt(0);\n                                        if (charCodeHigh >= 0xD800 && charCodeHigh <= 0xDBFF && (charCodeLow & 0xFC00) == 0xDC00) {\n                                            var realWord = words[k] + words[k + 1];\n                                            codeLen = 2;\n                                            has4BytesUnicode = true;\n                                            w = measureTextWidth(realWord, values, element.style);\n                                        }\n                                        else {\n                                            w = measureTextWidth(words[k], values, element.style);\n                                        }\n                                    }\n                                    else {\n                                        w = measureTextWidth(words[k], values, element.style);\n                                    }\n                                    // w = measureTextWidth(words[k], values, element.style);\n                                    if (lineW != 0 && lineW + w > textFieldWidth && lineW + k != 0) {\n                                        break;\n                                    }\n                                    if (ww + w > textFieldWidth) {\n                                        var words2 = words[k].match(/./g);\n                                        for (var k2 = 0, wl2 = words2.length; k2 < wl2; k2++) {\n                                            // detect 4 bytes unicode, refer https://mths.be/punycode\n                                            var codeLen = words2[k2].length;\n                                            var has4BytesUnicode2 = false;\n                                            if (codeLen == 1 && k2 < wl2 - 1) {\n                                                var charCodeHigh = words2[k2].charCodeAt(0);\n                                                var charCodeLow = words2[k2 + 1].charCodeAt(0);\n                                                if (charCodeHigh >= 0xD800 && charCodeHigh <= 0xDBFF && (charCodeLow & 0xFC00) == 0xDC00) {\n                                                    var realWord = words2[k2] + words2[k2 + 1];\n                                                    codeLen = 2;\n                                                    has4BytesUnicode2 = true;\n                                                    w = measureTextWidth(realWord, values, element.style);\n                                                }\n                                                else {\n                                                    w = measureTextWidth(words2[k2], values, element.style);\n                                                }\n                                            }\n                                            else {\n                                                w = measureTextWidth(words2[k2], values, element.style);\n                                            }\n                                            // w = measureTextWidth(words2[k2], values, element.style);\n                                            if (k2 > 0 && lineW + w > textFieldWidth) {\n                                                break;\n                                            }\n                                            // charNum += words2[k2].length;\n                                            charNum += codeLen;\n                                            ww += w;\n                                            lineW += w;\n                                            lineCharNum += charNum;\n                                            if (has4BytesUnicode2) {\n                                                k2++;\n                                            }\n                                        }\n                                    }\n                                    else {\n                                        // charNum += words[k].length;\n                                        charNum += codeLen;\n                                        ww += w;\n                                        lineW += w;\n                                        lineCharNum += charNum;\n                                    }\n                                    if (has4BytesUnicode) {\n                                        k++;\n                                    }\n                                }\n                                if (k > 0) {\n                                    lineElement.elements.push({\n                                        width: ww,\n                                        text: word.substring(0, charNum),\n                                        style: element.style\n                                    });\n                                    var leftWord = word.substring(charNum);\n                                    var m = void 0;\n                                    var lwleng = leftWord.length;\n                                    for (m = 0; m < lwleng; m++) {\n                                        if (leftWord.charAt(m) != \" \") {\n                                            break;\n                                        }\n                                    }\n                                    textArr[j] = leftWord.substring(m);\n                                }\n                                if (textArr[j] != \"\") {\n                                    j--;\n                                    isNextLine = false;\n                                }\n                            }\n                        }\n                    }\n                    if (isNextLine) {\n                        lineCharNum++;\n                        lineElement.hasNextLine = true;\n                    }\n                    if (j < textArr.length - 1) {\n                        lineElement.width = lineW;\n                        lineElement.height = lineH;\n                        lineElement.charNum = lineCharNum;\n                        values[5 /* textWidth */] = Math.max(values[5 /* textWidth */], lineW);\n                        values[6 /* textHeight */] += lineH;\n                        //if (this._type == TextFieldType.INPUT && !this._multiline) {\n                        //    this._numLines = linesArr.length;\n                        //    return linesArr;\n                        //}\n                        lineCount++;\n                    }\n                }\n                if (i == text2Arr.length - 1 && lineElement) {\n                    lineElement.width = lineW;\n                    lineElement.height = lineH;\n                    lineElement.charNum = lineCharNum;\n                    values[5 /* textWidth */] = Math.max(values[5 /* textWidth */], lineW);\n                    values[6 /* textHeight */] += lineH;\n                }\n            }\n            values[29 /* numLines */] = linesArr.length;\n            return linesArr;\n        };\n        /**\n         * @private\n         */\n        TextField.prototype.$setIsTyping = function (value) {\n            this.$isTyping = value;\n            this.$invalidateTextField();\n            if (egret.nativeRender) {\n                this.$nativeDisplayObject.setIsTyping(value);\n            }\n        };\n        /**\n         * @private\n         * 返回要绘制的下划线列表\n         */\n        TextField.prototype.drawText = function () {\n            var node = this.textNode;\n            var values = this.$TextField;\n            //更新文本样式\n            node.bold = values[15 /* bold */];\n            node.fontFamily = values[8 /* fontFamily */] || TextField.default_fontFamily;\n            node.italic = values[16 /* italic */];\n            node.size = values[0 /* fontSize */];\n            node.stroke = values[27 /* stroke */];\n            node.strokeColor = values[25 /* strokeColor */];\n            node.textColor = values[2 /* textColor */];\n            //先算出需要的数值\n            var lines = this.$getLinesArr();\n            if (values[5 /* textWidth */] == 0) {\n                return [];\n            }\n            var maxWidth = !isNaN(values[3 /* textFieldWidth */]) ? values[3 /* textFieldWidth */] : values[5 /* textWidth */];\n            var textHeight = egret.TextFieldUtils.$getTextHeight(this);\n            var drawY = 0;\n            var startLine = egret.TextFieldUtils.$getStartLine(this);\n            var textFieldHeight = values[4 /* textFieldHeight */];\n            if (!isNaN(textFieldHeight) && textFieldHeight > textHeight) {\n                var vAlign = egret.TextFieldUtils.$getValign(this);\n                drawY += vAlign * (textFieldHeight - textHeight);\n            }\n            drawY = Math.round(drawY);\n            var hAlign = egret.TextFieldUtils.$getHalign(this);\n            var drawX = 0;\n            var underLineData = [];\n            for (var i = startLine, numLinesLength = values[29 /* numLines */]; i < numLinesLength; i++) {\n                var line = lines[i];\n                var h = line.height;\n                drawY += h / 2;\n                if (i != startLine) {\n                    if (values[24 /* type */] == egret.TextFieldType.INPUT && !values[30 /* multiline */]) {\n                        break;\n                    }\n                    if (!isNaN(textFieldHeight) && drawY > textFieldHeight) {\n                        break;\n                    }\n                }\n                drawX = Math.round((maxWidth - line.width) * hAlign);\n                for (var j = 0, elementsLength = line.elements.length; j < elementsLength; j++) {\n                    var element = line.elements[j];\n                    var size = element.style.size || values[0 /* fontSize */];\n                    node.drawText(drawX, drawY + (h - size) / 2, element.text, element.style);\n                    if (element.style.underline) {\n                        underLineData.push(drawX, drawY + (h) / 2, element.width, element.style.textColor);\n                    }\n                    drawX += element.width;\n                }\n                drawY += h / 2 + values[1 /* lineSpacing */];\n            }\n            return underLineData;\n        };\n        //增加点击事件\n        TextField.prototype.addEvent = function () {\n            this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapHandler, this);\n        };\n        //释放点击事件\n        TextField.prototype.removeEvent = function () {\n            this.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.onTapHandler, this);\n        };\n        //处理富文本中有href的\n        TextField.prototype.onTapHandler = function (e) {\n            if (this.$TextField[24 /* type */] == egret.TextFieldType.INPUT) {\n                return;\n            }\n            var ele = egret.TextFieldUtils.$getTextElement(this, e.localX, e.localY);\n            if (ele == null) {\n                return;\n            }\n            var style = ele.style;\n            if (style && style.href) {\n                if (style.href.match(/^event:/)) {\n                    var type = style.href.match(/^event:/)[0];\n                    egret.TextEvent.dispatchTextEvent(this, egret.TextEvent.LINK, style.href.substring(type.length));\n                }\n                else {\n                    open(style.href, style.target || \"_blank\");\n                }\n            }\n        };\n        /**\n         * default fontFamily\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 默认文本字体\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TextField.default_fontFamily = \"Arial\";\n        /**\n         * default size in pixels of text\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 默认文本字号大小\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TextField.default_size = 30;\n        /**\n         * default color of the text.\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 默认文本颜色\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TextField.default_textColor = 0xffffff;\n        return TextField;\n    }(egret.DisplayObject));\n    egret.TextField = TextField;\n    __reflect(TextField.prototype, \"egret.TextField\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * TextFieldInputType class is an enumeration of constant value used in setting the inputType property of the TextField class.\n     * @version Egret 3.1.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * TextFieldInputType 类是在设置 TextField 类的 inputType 属性时使用的常数值的枚举。\n     * @version Egret 3.1.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var TextFieldInputType = (function () {\n        function TextFieldInputType() {\n        }\n        /**\n         * The default\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 默认 input 类型\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TextFieldInputType.TEXT = \"text\";\n        /**\n         * Telephone Number Inputs\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 电话号码 input 类型\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TextFieldInputType.TEL = \"tel\";\n        /**\n         * Password Inputs\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * password 类型\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TextFieldInputType.PASSWORD = \"password\";\n        return TextFieldInputType;\n    }());\n    egret.TextFieldInputType = TextFieldInputType;\n    __reflect(TextFieldInputType.prototype, \"egret.TextFieldInputType\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * TextFieldType class is an enumeration of constant value used in setting the type property of the TextField class.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * TextFieldType 类是在设置 TextField 类的 type 属性时使用的常数值的枚举。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var TextFieldType = (function () {\n        function TextFieldType() {\n        }\n        /**\n         * Used to specify dynamic text\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于指定动态文本\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TextFieldType.DYNAMIC = \"dynamic\";\n        /**\n         * Used to specify the input text\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于指定输入文本\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        TextFieldType.INPUT = \"input\";\n        return TextFieldType;\n    }());\n    egret.TextFieldType = TextFieldType;\n    __reflect(TextFieldType.prototype, \"egret.TextFieldType\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    var TextFieldUtils = (function () {\n        function TextFieldUtils() {\n        }\n        /**\n         * 获取第一个绘制的行数\n         * @param textfield 文本\n         * @returns {number} 行数，从0开始\n         * @private\n         */\n        TextFieldUtils.$getStartLine = function (textfield) {\n            var values = textfield.$TextField;\n            var textHeight = TextFieldUtils.$getTextHeight(textfield);\n            var startLine = 0;\n            var textFieldHeight = values[4 /* textFieldHeight */];\n            if (!isNaN(textFieldHeight)) {\n                if (textHeight < textFieldHeight) {\n                }\n                else if (textHeight > textFieldHeight) {\n                    startLine = Math.max(values[28 /* scrollV */] - 1, 0);\n                    startLine = Math.min(values[29 /* numLines */] - 1, startLine);\n                }\n                if (!values[30 /* multiline */]) {\n                    startLine = Math.max(values[28 /* scrollV */] - 1, 0);\n                    if (values[29 /* numLines */] > 0) {\n                        startLine = Math.min(values[29 /* numLines */] - 1, startLine);\n                    }\n                }\n            }\n            return startLine;\n        };\n        /**\n         * 获取水平比例\n         * @param textfield 文本\n         * @returns {number} 水平比例\n         * @private\n         */\n        TextFieldUtils.$getHalign = function (textfield) {\n            var lineArr = textfield.$getLinesArr2();\n            var halign = 0;\n            if (textfield.$TextField[9 /* textAlign */] == egret.HorizontalAlign.CENTER) {\n                halign = 0.5;\n            }\n            else if (textfield.$TextField[9 /* textAlign */] == egret.HorizontalAlign.RIGHT) {\n                halign = 1;\n            }\n            if (textfield.$TextField[24 /* type */] == egret.TextFieldType.INPUT && !textfield.$TextField[30 /* multiline */] && lineArr.length > 1) {\n                halign = 0;\n            }\n            return halign;\n        };\n        /**\n         * @private\n         *\n         * @param textfield\n         * @returns\n         */\n        TextFieldUtils.$getTextHeight = function (textfield) {\n            var textHeight = (egret.TextFieldType.INPUT == textfield.$TextField[24 /* type */]\n                && !textfield.$TextField[30 /* multiline */]) ? textfield.$TextField[0 /* fontSize */] : (textfield.$TextField[6 /* textHeight */] + (textfield.$TextField[29 /* numLines */] - 1) * textfield.$TextField[1 /* lineSpacing */]);\n            return textHeight;\n        };\n        /**\n         * 获取垂直比例\n         * @param textfield 文本\n         * @returns {number} 垂直比例\n         * @private\n         */\n        TextFieldUtils.$getValign = function (textfield) {\n            var textHeight = TextFieldUtils.$getTextHeight(textfield);\n            //if (textfield.$TextField[sys.TextKeys.type] == egret.TextFieldType.INPUT) {\n            //    if (textfield.$TextField[sys.TextKeys.multiline]) {\n            //return 0;\n            //}\n            //return 0.5;\n            //}\n            var textFieldHeight = textfield.$TextField[4 /* textFieldHeight */];\n            if (!isNaN(textFieldHeight)) {\n                if (textHeight < textFieldHeight) {\n                    var valign = 0;\n                    if (textfield.$TextField[10 /* verticalAlign */] == egret.VerticalAlign.MIDDLE)\n                        valign = 0.5;\n                    else if (textfield.$TextField[10 /* verticalAlign */] == egret.VerticalAlign.BOTTOM)\n                        valign = 1;\n                    return valign;\n                }\n            }\n            return 0;\n        };\n        /**\n         * 根据x、y获取文本项\n         * @param textfield 文本\n         * @param x x坐标值\n         * @param y y坐标值\n         * @returns 文本单项\n         * @private\n         */\n        TextFieldUtils.$getTextElement = function (textfield, x, y) {\n            var hitTextEle = TextFieldUtils.$getHit(textfield, x, y);\n            var lineArr = textfield.$getLinesArr2();\n            if (hitTextEle && lineArr[hitTextEle.lineIndex] && lineArr[hitTextEle.lineIndex].elements[hitTextEle.textElementIndex]) {\n                return lineArr[hitTextEle.lineIndex].elements[hitTextEle.textElementIndex];\n            }\n            return null;\n        };\n        /**\n         * 获取文本点击块\n         * @param textfield 文本\n         * @param x x坐标值\n         * @param y y坐标值\n         * @returns 文本点击块\n         * @private\n         */\n        TextFieldUtils.$getHit = function (textfield, x, y) {\n            var lineArr = textfield.$getLinesArr2();\n            if (textfield.$TextField[3 /* textFieldWidth */] == 0) {\n                return null;\n            }\n            var line = 0;\n            var textHeight = TextFieldUtils.$getTextHeight(textfield);\n            var startY = 0;\n            var textFieldHeight = textfield.$TextField[4 /* textFieldHeight */];\n            if (!isNaN(textFieldHeight) && textFieldHeight > textHeight) {\n                var valign = TextFieldUtils.$getValign(textfield);\n                startY = valign * (textFieldHeight - textHeight);\n                if (startY != 0) {\n                    y -= startY;\n                }\n            }\n            var startLine = TextFieldUtils.$getStartLine(textfield);\n            var lineH = 0;\n            for (var i = startLine; i < lineArr.length; i++) {\n                var lineEle = lineArr[i];\n                if (lineH + lineEle.height >= y) {\n                    if (lineH < y) {\n                        line = i + 1;\n                    }\n                    break;\n                }\n                else {\n                    lineH += lineEle.height;\n                }\n                if (lineH + textfield.$TextField[1 /* lineSpacing */] > y) {\n                    return null;\n                }\n                lineH += textfield.$TextField[1 /* lineSpacing */];\n            }\n            if (line == 0) {\n                return null;\n            }\n            var lineElement = lineArr[line - 1];\n            var textFieldWidth = textfield.$TextField[3 /* textFieldWidth */];\n            if (isNaN(textFieldWidth)) {\n                textFieldWidth = textfield.textWidth;\n            }\n            var halign = TextFieldUtils.$getHalign(textfield);\n            x -= halign * (textFieldWidth - lineElement.width);\n            var lineW = 0;\n            for (var i = 0; i < lineElement.elements.length; i++) {\n                var iwTE = lineElement.elements[i];\n                if (lineW + iwTE.width <= x) {\n                    lineW += iwTE.width;\n                }\n                else if (lineW < x) {\n                    return { \"lineIndex\": line - 1, \"textElementIndex\": i };\n                }\n            }\n            return null;\n        };\n        /**\n         * 获取当前显示多少行\n         * @param textfield 文本\n         * @returns {number} 显示的行数\n         * @private\n         */\n        TextFieldUtils.$getScrollNum = function (textfield) {\n            var scrollNum = 1;\n            if (textfield.$TextField[30 /* multiline */]) {\n                var height = textfield.height;\n                var size = textfield.size;\n                var lineSpacing = textfield.lineSpacing;\n                scrollNum = Math.floor(height / (size + lineSpacing));\n                var leftH = height - (size + lineSpacing) * scrollNum;\n                if (leftH > size / 2) {\n                    scrollNum++;\n                }\n            }\n            return scrollNum;\n        };\n        return TextFieldUtils;\n    }());\n    egret.TextFieldUtils = TextFieldUtils;\n    __reflect(TextFieldUtils.prototype, \"egret.TextFieldUtils\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n/**\n * @private\n */\nvar egret;\n(function (egret) {\n    var sys;\n    (function (sys) {\n    })(sys = egret.sys || (egret.sys = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The VerticalAlign class defines the possible values for the vertical alignment.\n     * @see egret.TextField#verticalAlign\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * VerticalAlign 类为垂直对齐方式定义可能的值。\n     * @see egret.TextField#verticalAlign\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var VerticalAlign = (function () {\n        function VerticalAlign() {\n        }\n        /**\n         * Vertically align content to the top of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将内容与容器的顶部对齐。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        VerticalAlign.TOP = \"top\";\n        /**\n         * Vertically align content to the bottom of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将内容与容器的底部对齐。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        VerticalAlign.BOTTOM = \"bottom\";\n        /**\n         * Vertically align content in the middle of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在容器的垂直中心对齐内容。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        VerticalAlign.MIDDLE = \"middle\";\n        /**\n         * Vertical alignment with both edges\n         * Note: TextFiled does not support this alignment method.\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 垂直两端对齐\n         * 注意：TextFiled不支持此对齐方式。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        VerticalAlign.JUSTIFY = \"justify\";\n        /**\n         * Align the content of the child items, relative to the container. This operation will adjust uniformly the size of all the child items to be the Content Height \\\" of the container \\\".\n         * The Content Height \\\" of the container \\\" is the size of the max. child item. If the size of all child items are less than the height of the container, they will be adjusted to the height of the container.\n         * Note: TextFiled does not support this alignment method.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 相对于容器对子项进行内容对齐。这会将所有子项的大小统一调整为容器的\"内容高度\"。\n         * 容器的\"内容高度\"是最大子项的大小,如果所有子项都小于容器的高度，则会将所有子项的大小调整为容器的高度。\n         * 注意：TextFiled不支持此对齐方式。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        VerticalAlign.CONTENT_JUSTIFY = \"contentJustify\";\n        return VerticalAlign;\n    }());\n    egret.VerticalAlign = VerticalAlign;\n    __reflect(VerticalAlign.prototype, \"egret.VerticalAlign\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n    * @language en_US\n    * The Base64Util class provides methods for encoding and decoding base64.\n    * @version Egret 2.4\n    * @platform Web,Native\n    * @includeExample egret/utils/Base64Util.ts\n    */\n    /**\n     * @language zh_CN\n     * Base64Util 类提供用于编解码base64的方法。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/Base64Util.ts\n     */\n    var Base64Util = (function () {\n        function Base64Util() {\n        }\n        /**\n         * @language en_US\n         * encode base64.\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * @language zh_CN\n         * 编码base64。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        Base64Util.encode = function (arraybuffer) {\n            var bytes = new Uint8Array(arraybuffer);\n            var len = bytes.length;\n            var base64 = '';\n            for (var i = 0; i < len; i += 3) {\n                base64 += chars[bytes[i] >> 2];\n                base64 += chars[((bytes[i] & 3) << 4) | (bytes[i + 1] >> 4)];\n                base64 += chars[((bytes[i + 1] & 15) << 2) | (bytes[i + 2] >> 6)];\n                base64 += chars[bytes[i + 2] & 63];\n            }\n            if ((len % 3) === 2) {\n                base64 = base64.substring(0, base64.length - 1) + '=';\n            }\n            else if (len % 3 === 1) {\n                base64 = base64.substring(0, base64.length - 2) + '==';\n            }\n            return base64;\n        };\n        /**\n         * @language en_US\n         * decode base64.\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * @language zh_CN\n         * 解码base64。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        Base64Util.decode = function (base64) {\n            var bufferLength = base64.length * 0.75;\n            var len = base64.length;\n            var p = 0;\n            var encoded1 = 0;\n            var encoded2 = 0;\n            var encoded3 = 0;\n            var encoded4 = 0;\n            if (base64[base64.length - 1] === '=') {\n                bufferLength--;\n                if (base64[base64.length - 2] === '=') {\n                    bufferLength--;\n                }\n            }\n            var arraybuffer = new ArrayBuffer(bufferLength), bytes = new Uint8Array(arraybuffer);\n            for (var i = 0; i < len; i += 4) {\n                encoded1 = lookup[base64.charCodeAt(i)];\n                encoded2 = lookup[base64.charCodeAt(i + 1)];\n                encoded3 = lookup[base64.charCodeAt(i + 2)];\n                encoded4 = lookup[base64.charCodeAt(i + 3)];\n                bytes[p++] = (encoded1 << 2) | (encoded2 >> 4);\n                bytes[p++] = ((encoded2 & 15) << 4) | (encoded3 >> 2);\n                bytes[p++] = ((encoded3 & 3) << 6) | (encoded4 & 63);\n            }\n            return arraybuffer;\n        };\n        return Base64Util;\n    }());\n    egret.Base64Util = Base64Util;\n    __reflect(Base64Util.prototype, \"egret.Base64Util\");\n})(egret || (egret = {}));\n/**\n * @private\n */\nvar chars = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\n/**\n * @private\n */\nvar lookup = new Uint8Array(256);\nfor (var i = 0; i < chars.length; i++) {\n    lookup[chars.charCodeAt(i)] = i;\n}\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The Endian class contains values that denote the byte order used to represent multibyte numbers.\n     * The byte order is either bigEndian (most significant byte first) or littleEndian (least significant byte first).\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * Endian 类中包含一些值，它们表示用于表示多字节数字的字节顺序。\n     * 字节顺序为 bigEndian（最高有效字节位于最前）或 littleEndian（最低有效字节位于最前）。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var Endian = (function () {\n        function Endian() {\n        }\n        /**\n         * Indicates the least significant byte of the multibyte number appears first in the sequence of bytes.\n         * The hexadecimal number 0x12345678 has 4 bytes (2 hexadecimal digits per byte). The most significant byte is 0x12. The least significant byte is 0x78. (For the equivalent decimal number, 305419896, the most significant digit is 3, and the least significant digit is 6).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示多字节数字的最低有效字节位于字节序列的最前面。\n         * 十六进制数字 0x12345678 包含 4 个字节（每个字节包含 2 个十六进制数字）。最高有效字节为 0x12。最低有效字节为 0x78。（对于等效的十进制数字 305419896，最高有效数字是 3，最低有效数字是 6）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Endian.LITTLE_ENDIAN = \"littleEndian\";\n        /**\n         * Indicates the most significant byte of the multibyte number appears first in the sequence of bytes.\n         * The hexadecimal number 0x12345678 has 4 bytes (2 hexadecimal digits per byte).  The most significant byte is 0x12. The least significant byte is 0x78. (For the equivalent decimal number, 305419896, the most significant digit is 3, and the least significant digit is 6).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示多字节数字的最高有效字节位于字节序列的最前面。\n         * 十六进制数字 0x12345678 包含 4 个字节（每个字节包含 2 个十六进制数字）。最高有效字节为 0x12。最低有效字节为 0x78。（对于等效的十进制数字 305419896，最高有效数字是 3，最低有效数字是 6）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Endian.BIG_ENDIAN = \"bigEndian\";\n        return Endian;\n    }());\n    egret.Endian = Endian;\n    __reflect(Endian.prototype, \"egret.Endian\");\n    /**\n     * The ByteArray class provides methods and attributes for optimized reading and writing as well as dealing with binary data.\n     * Note: The ByteArray class is applied to the advanced developers who need to access data at the byte layer.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/ByteArray.ts\n     * @language en_US\n     */\n    /**\n     * ByteArray 类提供用于优化读取、写入以及处理二进制数据的方法和属性。\n     * 注意：ByteArray 类适用于需要在字节层访问数据的高级开发人员。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/ByteArray.ts\n     * @language zh_CN\n     */\n    var ByteArray = (function () {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function ByteArray(buffer, bufferExtSize) {\n            if (bufferExtSize === void 0) { bufferExtSize = 0; }\n            /**\n             * @private\n             */\n            this.bufferExtSize = 0; //Buffer expansion size\n            /**\n             * @private\n             */\n            this.EOF_byte = -1;\n            /**\n             * @private\n             */\n            this.EOF_code_point = -1;\n            if (bufferExtSize < 0) {\n                bufferExtSize = 0;\n            }\n            this.bufferExtSize = bufferExtSize;\n            var bytes, wpos = 0;\n            if (buffer) {\n                var uint8 = void 0;\n                if (buffer instanceof Uint8Array) {\n                    uint8 = buffer;\n                    wpos = buffer.length;\n                }\n                else {\n                    wpos = buffer.byteLength;\n                    uint8 = new Uint8Array(buffer);\n                }\n                if (bufferExtSize == 0) {\n                    bytes = new Uint8Array(wpos);\n                }\n                else {\n                    var multi = (wpos / bufferExtSize | 0) + 1;\n                    bytes = new Uint8Array(multi * bufferExtSize);\n                }\n                bytes.set(uint8);\n            }\n            else {\n                bytes = new Uint8Array(bufferExtSize);\n            }\n            this.write_position = wpos;\n            this._position = 0;\n            this._bytes = bytes;\n            this.data = new DataView(bytes.buffer);\n            this.endian = Endian.BIG_ENDIAN;\n        }\n        Object.defineProperty(ByteArray.prototype, \"endian\", {\n            /**\n             * Changes or reads the byte order; egret.EndianConst.BIG_ENDIAN or egret.EndianConst.LITTLE_EndianConst.\n             * @default egret.EndianConst.BIG_ENDIAN\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 更改或读取数据的字节顺序；egret.EndianConst.BIG_ENDIAN 或 egret.EndianConst.LITTLE_ENDIAN。\n             * @default egret.EndianConst.BIG_ENDIAN\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$endian == 0 /* LITTLE_ENDIAN */ ? Endian.LITTLE_ENDIAN : Endian.BIG_ENDIAN;\n            },\n            set: function (value) {\n                this.$endian = value == Endian.LITTLE_ENDIAN ? 0 /* LITTLE_ENDIAN */ : 1 /* BIG_ENDIAN */;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @deprecated\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        ByteArray.prototype.setArrayBuffer = function (buffer) {\n        };\n        Object.defineProperty(ByteArray.prototype, \"readAvailable\", {\n            /**\n             * 可读的剩余字节数\n             *\n             * @returns\n             *\n             * @memberOf ByteArray\n             */\n            get: function () {\n                return this.write_position - this._position;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ByteArray.prototype, \"buffer\", {\n            get: function () {\n                return this.data.buffer.slice(0, this.write_position);\n            },\n            /**\n             * @private\n             */\n            set: function (value) {\n                var wpos = value.byteLength;\n                var uint8 = new Uint8Array(value);\n                var bufferExtSize = this.bufferExtSize;\n                var bytes;\n                if (bufferExtSize == 0) {\n                    bytes = new Uint8Array(wpos);\n                }\n                else {\n                    var multi = (wpos / bufferExtSize | 0) + 1;\n                    bytes = new Uint8Array(multi * bufferExtSize);\n                }\n                bytes.set(uint8);\n                this.write_position = wpos;\n                this._bytes = bytes;\n                this.data = new DataView(bytes.buffer);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ByteArray.prototype, \"rawBuffer\", {\n            get: function () {\n                return this.data.buffer;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ByteArray.prototype, \"bytes\", {\n            get: function () {\n                return this._bytes;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ByteArray.prototype, \"dataView\", {\n            /**\n             * @private\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.data;\n            },\n            /**\n             * @private\n             */\n            set: function (value) {\n                this.buffer = value.buffer;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ByteArray.prototype, \"bufferOffset\", {\n            /**\n             * @private\n             */\n            get: function () {\n                return this.data.byteOffset;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ByteArray.prototype, \"position\", {\n            /**\n             * The current position of the file pointer (in bytes) to move or return to the ByteArray object. The next time you start reading reading method call in this position, or will start writing in this position next time call a write method.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 将文件指针的当前位置（以字节为单位）移动或返回到 ByteArray 对象中。下一次调用读取方法时将在此位置开始读取，或者下一次调用写入方法时将在此位置开始写入。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._position;\n            },\n            set: function (value) {\n                this._position = value;\n                if (value > this.write_position) {\n                    this.write_position = value;\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ByteArray.prototype, \"length\", {\n            /**\n             * The length of the ByteArray object (in bytes).\n                      * If the length is set to be larger than the current length, the right-side zero padding byte array.\n                      * If the length is set smaller than the current length, the byte array is truncated.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * ByteArray 对象的长度（以字节为单位）。\n             * 如果将长度设置为大于当前长度的值，则用零填充字节数组的右侧。\n             * 如果将长度设置为小于当前长度的值，将会截断该字节数组。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.write_position;\n            },\n            set: function (value) {\n                this.write_position = value;\n                if (this.data.byteLength > value) {\n                    this._position = value;\n                }\n                this._validateBuffer(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ByteArray.prototype._validateBuffer = function (value) {\n            if (this.data.byteLength < value) {\n                var be = this.bufferExtSize;\n                var tmp = void 0;\n                if (be == 0) {\n                    tmp = new Uint8Array(value);\n                }\n                else {\n                    var nLen = ((value / be >> 0) + 1) * be;\n                    tmp = new Uint8Array(nLen);\n                }\n                tmp.set(this._bytes);\n                this._bytes = tmp;\n                this.data = new DataView(tmp.buffer);\n            }\n        };\n        Object.defineProperty(ByteArray.prototype, \"bytesAvailable\", {\n            /**\n             * The number of bytes that can be read from the current position of the byte array to the end of the array data.\n             * When you access a ByteArray object, the bytesAvailable property in conjunction with the read methods each use to make sure you are reading valid data.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 可从字节数组的当前位置到数组末尾读取的数据的字节数。\n             * 每次访问 ByteArray 对象时，将 bytesAvailable 属性与读取方法结合使用，以确保读取有效的数据。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.data.byteLength - this._position;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * Clears the contents of the byte array and resets the length and position properties to 0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 清除字节数组的内容，并将 length 和 position 属性重置为 0。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.clear = function () {\n            var buffer = new ArrayBuffer(this.bufferExtSize);\n            this.data = new DataView(buffer);\n            this._bytes = new Uint8Array(buffer);\n            this._position = 0;\n            this.write_position = 0;\n        };\n        /**\n         * Read a Boolean value from the byte stream. Read a simple byte. If the byte is non-zero, it returns true; otherwise, it returns false.\n         * @return If the byte is non-zero, it returns true; otherwise, it returns false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取布尔值。读取单个字节，如果字节非零，则返回 true，否则返回 false\n         * @return 如果字节不为零，则返回 true，否则返回 false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.readBoolean = function () {\n            if (this.validate(1 /* SIZE_OF_BOOLEAN */))\n                return !!this._bytes[this.position++];\n        };\n        /**\n         * Read signed bytes from the byte stream.\n         * @return An integer ranging from -128 to 127\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取带符号的字节\n         * @return 介于 -128 和 127 之间的整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.readByte = function () {\n            if (this.validate(1 /* SIZE_OF_INT8 */))\n                return this.data.getInt8(this.position++);\n        };\n        /**\n         * Read data byte number specified by the length parameter from the byte stream. Starting from the position specified by offset, read bytes into the ByteArray object specified by the bytes parameter, and write bytes into the target ByteArray\n         * @param bytes ByteArray object that data is read into\n         * @param offset Offset (position) in bytes. Read data should be written from this position\n         * @param length Byte number to be read Default value 0 indicates reading all available data\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取 length 参数指定的数据字节数。从 offset 指定的位置开始，将字节读入 bytes 参数指定的 ByteArray 对象中，并将字节写入目标 ByteArray 中\n         * @param bytes 要将数据读入的 ByteArray 对象\n         * @param offset bytes 中的偏移（位置），应从该位置写入读取的数据\n         * @param length 要读取的字节数。默认值 0 导致读取所有可用的数据\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.readBytes = function (bytes, offset, length) {\n            if (offset === void 0) { offset = 0; }\n            if (length === void 0) { length = 0; }\n            if (!bytes) {\n                return;\n            }\n            var pos = this._position;\n            var available = this.write_position - pos;\n            if (available < 0) {\n                egret.$error(1025);\n                return;\n            }\n            if (length == 0) {\n                length = available;\n            }\n            else if (length > available) {\n                egret.$error(1025);\n                return;\n            }\n            var position = bytes._position;\n            bytes._position = 0;\n            bytes.validateBuffer(offset + length);\n            bytes._position = position;\n            bytes._bytes.set(this._bytes.subarray(pos, pos + length), offset);\n            this.position += length;\n        };\n        /**\n         * Read an IEEE 754 double-precision (64 bit) floating point number from the byte stream\n         * @return Double-precision (64 bit) floating point number\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个 IEEE 754 双精度（64 位）浮点数\n         * @return 双精度（64 位）浮点数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.readDouble = function () {\n            if (this.validate(8 /* SIZE_OF_FLOAT64 */)) {\n                var value = this.data.getFloat64(this._position, this.$endian == 0 /* LITTLE_ENDIAN */);\n                this.position += 8 /* SIZE_OF_FLOAT64 */;\n                return value;\n            }\n        };\n        /**\n         * Read an IEEE 754 single-precision (32 bit) floating point number from the byte stream\n         * @return Single-precision (32 bit) floating point number\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个 IEEE 754 单精度（32 位）浮点数\n         * @return 单精度（32 位）浮点数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.readFloat = function () {\n            if (this.validate(4 /* SIZE_OF_FLOAT32 */)) {\n                var value = this.data.getFloat32(this._position, this.$endian == 0 /* LITTLE_ENDIAN */);\n                this.position += 4 /* SIZE_OF_FLOAT32 */;\n                return value;\n            }\n        };\n        /**\n         * Read a 32-bit signed integer from the byte stream.\n         * @return A 32-bit signed integer ranging from -2147483648 to 2147483647\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个带符号的 32 位整数\n         * @return 介于 -2147483648 和 2147483647 之间的 32 位带符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.readInt = function () {\n            if (this.validate(4 /* SIZE_OF_INT32 */)) {\n                var value = this.data.getInt32(this._position, this.$endian == 0 /* LITTLE_ENDIAN */);\n                this.position += 4 /* SIZE_OF_INT32 */;\n                return value;\n            }\n        };\n        /**\n         * Read a 16-bit signed integer from the byte stream.\n         * @return A 16-bit signed integer ranging from -32768 to 32767\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个带符号的 16 位整数\n         * @return 介于 -32768 和 32767 之间的 16 位带符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.readShort = function () {\n            if (this.validate(2 /* SIZE_OF_INT16 */)) {\n                var value = this.data.getInt16(this._position, this.$endian == 0 /* LITTLE_ENDIAN */);\n                this.position += 2 /* SIZE_OF_INT16 */;\n                return value;\n            }\n        };\n        /**\n         * Read unsigned bytes from the byte stream.\n         * @return A unsigned integer ranging from 0 to 255\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取无符号的字节\n         * @return 介于 0 和 255 之间的无符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.readUnsignedByte = function () {\n            if (this.validate(1 /* SIZE_OF_UINT8 */))\n                return this._bytes[this.position++];\n        };\n        /**\n         * Read a 32-bit unsigned integer from the byte stream.\n         * @return A 32-bit unsigned integer ranging from 0 to 4294967295\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个无符号的 32 位整数\n         * @return 介于 0 和 4294967295 之间的 32 位无符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.readUnsignedInt = function () {\n            if (this.validate(4 /* SIZE_OF_UINT32 */)) {\n                var value = this.data.getUint32(this._position, this.$endian == 0 /* LITTLE_ENDIAN */);\n                this.position += 4 /* SIZE_OF_UINT32 */;\n                return value;\n            }\n        };\n        /**\n         * Read a 16-bit unsigned integer from the byte stream.\n         * @return A 16-bit unsigned integer ranging from 0 to 65535\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个无符号的 16 位整数\n         * @return 介于 0 和 65535 之间的 16 位无符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.readUnsignedShort = function () {\n            if (this.validate(2 /* SIZE_OF_UINT16 */)) {\n                var value = this.data.getUint16(this._position, this.$endian == 0 /* LITTLE_ENDIAN */);\n                this.position += 2 /* SIZE_OF_UINT16 */;\n                return value;\n            }\n        };\n        /**\n         * Read a UTF-8 character string from the byte stream Assume that the prefix of the character string is a short unsigned integer (use byte to express length)\n         * @return UTF-8 character string\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个 UTF-8 字符串。假定字符串的前缀是无符号的短整型（以字节表示长度）\n         * @return UTF-8 编码的字符串\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.readUTF = function () {\n            var length = this.readUnsignedShort();\n            if (length > 0) {\n                return this.readUTFBytes(length);\n            }\n            else {\n                return \"\";\n            }\n        };\n        /**\n         * Read a UTF-8 byte sequence specified by the length parameter from the byte stream, and then return a character string\n         * @param Specify a short unsigned integer of the UTF-8 byte length\n         * @return A character string consists of UTF-8 bytes of the specified length\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个由 length 参数指定的 UTF-8 字节序列，并返回一个字符串\n         * @param length 指明 UTF-8 字节长度的无符号短整型数\n         * @return 由指定长度的 UTF-8 字节组成的字符串\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.readUTFBytes = function (length) {\n            if (!this.validate(length)) {\n                return;\n            }\n            var data = this.data;\n            var bytes = new Uint8Array(data.buffer, data.byteOffset + this._position, length);\n            this.position += length;\n            return this.decodeUTF8(bytes);\n        };\n        /**\n         * Write a Boolean value. A single byte is written according to the value parameter. If the value is true, write 1; if the value is false, write 0.\n         * @param value A Boolean value determining which byte is written. If the value is true, write 1; if the value is false, write 0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 写入布尔值。根据 value 参数写入单个字节。如果为 true，则写入 1，如果为 false，则写入 0\n         * @param value 确定写入哪个字节的布尔值。如果该参数为 true，则该方法写入 1；如果该参数为 false，则该方法写入 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.writeBoolean = function (value) {\n            this.validateBuffer(1 /* SIZE_OF_BOOLEAN */);\n            this._bytes[this.position++] = +value;\n        };\n        /**\n         * Write a byte into the byte stream\n         * The low 8 bits of the parameter are used. The high 24 bits are ignored.\n         * @param value A 32-bit integer. The low 8 bits will be written into the byte stream\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个字节\n         * 使用参数的低 8 位。忽略高 24 位\n         * @param value 一个 32 位整数。低 8 位将被写入字节流\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.writeByte = function (value) {\n            this.validateBuffer(1 /* SIZE_OF_INT8 */);\n            this._bytes[this.position++] = value & 0xff;\n        };\n        /**\n         * Write the byte sequence that includes length bytes in the specified byte array, bytes, (starting at the byte specified by offset, using a zero-based index), into the byte stream\n         * If the length parameter is omitted, the default length value 0 is used and the entire buffer starting at offset is written. If the offset parameter is also omitted, the entire buffer is written\n         * If the offset or length parameter is out of range, they are clamped to the beginning and end of the bytes array.\n         * @param bytes ByteArray Object\n         * @param offset A zero-based index specifying the position into the array to begin writing\n         * @param length An unsigned integer specifying how far into the buffer to write\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将指定字节数组 bytes（起始偏移量为 offset，从零开始的索引）中包含 length 个字节的字节序列写入字节流\n         * 如果省略 length 参数，则使用默认长度 0；该方法将从 offset 开始写入整个缓冲区。如果还省略了 offset 参数，则写入整个缓冲区\n         * 如果 offset 或 length 超出范围，它们将被锁定到 bytes 数组的开头和结尾\n         * @param bytes ByteArray 对象\n         * @param offset 从 0 开始的索引，表示在数组中开始写入的位置\n         * @param length 一个无符号整数，表示在缓冲区中的写入范围\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.writeBytes = function (bytes, offset, length) {\n            if (offset === void 0) { offset = 0; }\n            if (length === void 0) { length = 0; }\n            var writeLength;\n            if (offset < 0) {\n                return;\n            }\n            if (length < 0) {\n                return;\n            }\n            else if (length == 0) {\n                writeLength = bytes.length - offset;\n            }\n            else {\n                writeLength = Math.min(bytes.length - offset, length);\n            }\n            if (writeLength > 0) {\n                this.validateBuffer(writeLength);\n                this._bytes.set(bytes._bytes.subarray(offset, offset + writeLength), this._position);\n                this.position = this._position + writeLength;\n            }\n        };\n        /**\n         * Write an IEEE 754 double-precision (64 bit) floating point number into the byte stream\n         * @param value Double-precision (64 bit) floating point number\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个 IEEE 754 双精度（64 位）浮点数\n         * @param value 双精度（64 位）浮点数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.writeDouble = function (value) {\n            this.validateBuffer(8 /* SIZE_OF_FLOAT64 */);\n            this.data.setFloat64(this._position, value, this.$endian == 0 /* LITTLE_ENDIAN */);\n            this.position += 8 /* SIZE_OF_FLOAT64 */;\n        };\n        /**\n         * Write an IEEE 754 single-precision (32 bit) floating point number into the byte stream\n         * @param value Single-precision (32 bit) floating point number\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个 IEEE 754 单精度（32 位）浮点数\n         * @param value 单精度（32 位）浮点数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.writeFloat = function (value) {\n            this.validateBuffer(4 /* SIZE_OF_FLOAT32 */);\n            this.data.setFloat32(this._position, value, this.$endian == 0 /* LITTLE_ENDIAN */);\n            this.position += 4 /* SIZE_OF_FLOAT32 */;\n        };\n        /**\n         * Write a 32-bit signed integer into the byte stream\n         * @param value An integer to be written into the byte stream\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个带符号的 32 位整数\n         * @param value 要写入字节流的整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.writeInt = function (value) {\n            this.validateBuffer(4 /* SIZE_OF_INT32 */);\n            this.data.setInt32(this._position, value, this.$endian == 0 /* LITTLE_ENDIAN */);\n            this.position += 4 /* SIZE_OF_INT32 */;\n        };\n        /**\n         * Write a 16-bit integer into the byte stream. The low 16 bits of the parameter are used. The high 16 bits are ignored.\n         * @param value A 32-bit integer. Its low 16 bits will be written into the byte stream\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个 16 位整数。使用参数的低 16 位。忽略高 16 位\n         * @param value 32 位整数，该整数的低 16 位将被写入字节流\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.writeShort = function (value) {\n            this.validateBuffer(2 /* SIZE_OF_INT16 */);\n            this.data.setInt16(this._position, value, this.$endian == 0 /* LITTLE_ENDIAN */);\n            this.position += 2 /* SIZE_OF_INT16 */;\n        };\n        /**\n         * Write a 32-bit unsigned integer into the byte stream\n         * @param value An unsigned integer to be written into the byte stream\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个无符号的 32 位整数\n         * @param value 要写入字节流的无符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.writeUnsignedInt = function (value) {\n            this.validateBuffer(4 /* SIZE_OF_UINT32 */);\n            this.data.setUint32(this._position, value, this.$endian == 0 /* LITTLE_ENDIAN */);\n            this.position += 4 /* SIZE_OF_UINT32 */;\n        };\n        /**\n         * Write a 16-bit unsigned integer into the byte stream\n         * @param value An unsigned integer to be written into the byte stream\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个无符号的 16 位整数\n         * @param value 要写入字节流的无符号整数\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.writeUnsignedShort = function (value) {\n            this.validateBuffer(2 /* SIZE_OF_UINT16 */);\n            this.data.setUint16(this._position, value, this.$endian == 0 /* LITTLE_ENDIAN */);\n            this.position += 2 /* SIZE_OF_UINT16 */;\n        };\n        /**\n         * Write a UTF-8 string into the byte stream. The length of the UTF-8 string in bytes is written first, as a 16-bit integer, followed by the bytes representing the characters of the string\n         * @param value Character string value to be written\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 UTF-8 字符串写入字节流。先写入以字节表示的 UTF-8 字符串长度（作为 16 位整数），然后写入表示字符串字符的字节\n         * @param value 要写入的字符串值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.writeUTF = function (value) {\n            var utf8bytes = this.encodeUTF8(value);\n            var length = utf8bytes.length;\n            this.validateBuffer(2 /* SIZE_OF_UINT16 */ + length);\n            this.data.setUint16(this._position, length, this.$endian == 0 /* LITTLE_ENDIAN */);\n            this.position += 2 /* SIZE_OF_UINT16 */;\n            this._writeUint8Array(utf8bytes, false);\n        };\n        /**\n         * Write a UTF-8 string into the byte stream. Similar to the writeUTF() method, but the writeUTFBytes() method does not prefix the string with a 16-bit length word\n         * @param value Character string value to be written\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 UTF-8 字符串写入字节流。类似于 writeUTF() 方法，但 writeUTFBytes() 不使用 16 位长度的词为字符串添加前缀\n         * @param value 要写入的字符串值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ByteArray.prototype.writeUTFBytes = function (value) {\n            this._writeUint8Array(this.encodeUTF8(value));\n        };\n        /**\n         *\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        ByteArray.prototype.toString = function () {\n            return \"[ByteArray] length:\" + this.length + \", bytesAvailable:\" + this.bytesAvailable;\n        };\n        /**\n         * @private\n         * 将 Uint8Array 写入字节流\n         * @param bytes 要写入的Uint8Array\n         * @param validateBuffer\n         */\n        ByteArray.prototype._writeUint8Array = function (bytes, validateBuffer) {\n            if (validateBuffer === void 0) { validateBuffer = true; }\n            var pos = this._position;\n            var npos = pos + bytes.length;\n            if (validateBuffer) {\n                this.validateBuffer(npos);\n            }\n            this.bytes.set(bytes, pos);\n            this.position = npos;\n        };\n        /**\n         * @param len\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @private\n         */\n        ByteArray.prototype.validate = function (len) {\n            var bl = this._bytes.length;\n            if (bl > 0 && this._position + len <= bl) {\n                return true;\n            }\n            else {\n                egret.$error(1025);\n            }\n        };\n        /**********************/\n        /*  PRIVATE METHODS   */\n        /**********************/\n        /**\n         * @private\n         * @param len\n         * @param needReplace\n         */\n        ByteArray.prototype.validateBuffer = function (len) {\n            this.write_position = len > this.write_position ? len : this.write_position;\n            len += this._position;\n            this._validateBuffer(len);\n        };\n        /**\n         * @private\n         * UTF-8 Encoding/Decoding\n         */\n        ByteArray.prototype.encodeUTF8 = function (str) {\n            var pos = 0;\n            var codePoints = this.stringToCodePoints(str);\n            var outputBytes = [];\n            while (codePoints.length > pos) {\n                var code_point = codePoints[pos++];\n                if (this.inRange(code_point, 0xD800, 0xDFFF)) {\n                    this.encoderError(code_point);\n                }\n                else if (this.inRange(code_point, 0x0000, 0x007f)) {\n                    outputBytes.push(code_point);\n                }\n                else {\n                    var count = void 0, offset = void 0;\n                    if (this.inRange(code_point, 0x0080, 0x07FF)) {\n                        count = 1;\n                        offset = 0xC0;\n                    }\n                    else if (this.inRange(code_point, 0x0800, 0xFFFF)) {\n                        count = 2;\n                        offset = 0xE0;\n                    }\n                    else if (this.inRange(code_point, 0x10000, 0x10FFFF)) {\n                        count = 3;\n                        offset = 0xF0;\n                    }\n                    outputBytes.push(this.div(code_point, Math.pow(64, count)) + offset);\n                    while (count > 0) {\n                        var temp = this.div(code_point, Math.pow(64, count - 1));\n                        outputBytes.push(0x80 + (temp % 64));\n                        count -= 1;\n                    }\n                }\n            }\n            return new Uint8Array(outputBytes);\n        };\n        /**\n         * @private\n         *\n         * @param data\n         * @returns\n         */\n        ByteArray.prototype.decodeUTF8 = function (data) {\n            var fatal = false;\n            var pos = 0;\n            var result = \"\";\n            var code_point;\n            var utf8_code_point = 0;\n            var utf8_bytes_needed = 0;\n            var utf8_bytes_seen = 0;\n            var utf8_lower_boundary = 0;\n            while (data.length > pos) {\n                var _byte = data[pos++];\n                if (_byte == this.EOF_byte) {\n                    if (utf8_bytes_needed != 0) {\n                        code_point = this.decoderError(fatal);\n                    }\n                    else {\n                        code_point = this.EOF_code_point;\n                    }\n                }\n                else {\n                    if (utf8_bytes_needed == 0) {\n                        if (this.inRange(_byte, 0x00, 0x7F)) {\n                            code_point = _byte;\n                        }\n                        else {\n                            if (this.inRange(_byte, 0xC2, 0xDF)) {\n                                utf8_bytes_needed = 1;\n                                utf8_lower_boundary = 0x80;\n                                utf8_code_point = _byte - 0xC0;\n                            }\n                            else if (this.inRange(_byte, 0xE0, 0xEF)) {\n                                utf8_bytes_needed = 2;\n                                utf8_lower_boundary = 0x800;\n                                utf8_code_point = _byte - 0xE0;\n                            }\n                            else if (this.inRange(_byte, 0xF0, 0xF4)) {\n                                utf8_bytes_needed = 3;\n                                utf8_lower_boundary = 0x10000;\n                                utf8_code_point = _byte - 0xF0;\n                            }\n                            else {\n                                this.decoderError(fatal);\n                            }\n                            utf8_code_point = utf8_code_point * Math.pow(64, utf8_bytes_needed);\n                            code_point = null;\n                        }\n                    }\n                    else if (!this.inRange(_byte, 0x80, 0xBF)) {\n                        utf8_code_point = 0;\n                        utf8_bytes_needed = 0;\n                        utf8_bytes_seen = 0;\n                        utf8_lower_boundary = 0;\n                        pos--;\n                        code_point = this.decoderError(fatal, _byte);\n                    }\n                    else {\n                        utf8_bytes_seen += 1;\n                        utf8_code_point = utf8_code_point + (_byte - 0x80) * Math.pow(64, utf8_bytes_needed - utf8_bytes_seen);\n                        if (utf8_bytes_seen !== utf8_bytes_needed) {\n                            code_point = null;\n                        }\n                        else {\n                            var cp = utf8_code_point;\n                            var lower_boundary = utf8_lower_boundary;\n                            utf8_code_point = 0;\n                            utf8_bytes_needed = 0;\n                            utf8_bytes_seen = 0;\n                            utf8_lower_boundary = 0;\n                            if (this.inRange(cp, lower_boundary, 0x10FFFF) && !this.inRange(cp, 0xD800, 0xDFFF)) {\n                                code_point = cp;\n                            }\n                            else {\n                                code_point = this.decoderError(fatal, _byte);\n                            }\n                        }\n                    }\n                }\n                //Decode string\n                if (code_point !== null && code_point !== this.EOF_code_point) {\n                    if (code_point <= 0xFFFF) {\n                        if (code_point > 0)\n                            result += String.fromCharCode(code_point);\n                    }\n                    else {\n                        code_point -= 0x10000;\n                        result += String.fromCharCode(0xD800 + ((code_point >> 10) & 0x3ff));\n                        result += String.fromCharCode(0xDC00 + (code_point & 0x3ff));\n                    }\n                }\n            }\n            return result;\n        };\n        /**\n         * @private\n         *\n         * @param code_point\n         */\n        ByteArray.prototype.encoderError = function (code_point) {\n            egret.$error(1026, code_point);\n        };\n        /**\n         * @private\n         *\n         * @param fatal\n         * @param opt_code_point\n         * @returns\n         */\n        ByteArray.prototype.decoderError = function (fatal, opt_code_point) {\n            if (fatal) {\n                egret.$error(1027);\n            }\n            return opt_code_point || 0xFFFD;\n        };\n        /**\n         * @private\n         *\n         * @param a\n         * @param min\n         * @param max\n         */\n        ByteArray.prototype.inRange = function (a, min, max) {\n            return min <= a && a <= max;\n        };\n        /**\n         * @private\n         *\n         * @param n\n         * @param d\n         */\n        ByteArray.prototype.div = function (n, d) {\n            return Math.floor(n / d);\n        };\n        /**\n         * @private\n         *\n         * @param string\n         */\n        ByteArray.prototype.stringToCodePoints = function (string) {\n            /** @type {Array.<number>} */\n            var cps = [];\n            // Based on http://www.w3.org/TR/WebIDL/#idl-DOMString\n            var i = 0, n = string.length;\n            while (i < string.length) {\n                var c = string.charCodeAt(i);\n                if (!this.inRange(c, 0xD800, 0xDFFF)) {\n                    cps.push(c);\n                }\n                else if (this.inRange(c, 0xDC00, 0xDFFF)) {\n                    cps.push(0xFFFD);\n                }\n                else {\n                    if (i == n - 1) {\n                        cps.push(0xFFFD);\n                    }\n                    else {\n                        var d = string.charCodeAt(i + 1);\n                        if (this.inRange(d, 0xDC00, 0xDFFF)) {\n                            var a = c & 0x3FF;\n                            var b = d & 0x3FF;\n                            i += 1;\n                            cps.push(0x10000 + (a << 10) + b);\n                        }\n                        else {\n                            cps.push(0xFFFD);\n                        }\n                    }\n                }\n                i += 1;\n            }\n            return cps;\n        };\n        return ByteArray;\n    }());\n    egret.ByteArray = ByteArray;\n    __reflect(ByteArray.prototype, \"egret.ByteArray\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The Sprite class is a basic display list building block: a display list node that can contain children.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Sprite.ts\n     * @language en_US\n     */\n    /**\n     * Sprite 类是基本显示列表构造块：一个可包含子项的显示列表节点。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Sprite.ts\n     * @language zh_CN\n     */\n    var Sprite = (function (_super) {\n        __extends(Sprite, _super);\n        /**\n         * Creates a new Sprite instance.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 实例化一个容器\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function Sprite() {\n            var _this = _super.call(this) || this;\n            _this.$graphics = new egret.Graphics();\n            _this.$graphics.$setTarget(_this);\n            return _this;\n        }\n        Sprite.prototype.createNativeDisplayObject = function () {\n            this.$nativeDisplayObject = new egret_native.NativeDisplayObject(9 /* SPRITE */);\n        };\n        Object.defineProperty(Sprite.prototype, \"graphics\", {\n            /**\n             * Specifies the Graphics object belonging to this Shape object, where vector drawing commands can occur.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 获取 Shape 中的 Graphics 对象。可通过此对象执行矢量绘图命令。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$graphics;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Sprite.prototype.$hitTest = function (stageX, stageY) {\n            if (!this.$visible) {\n                return null;\n            }\n            var m = this.$getInvertedConcatenatedMatrix();\n            var localX = m.a * stageX + m.c * stageY + m.tx;\n            var localY = m.b * stageX + m.d * stageY + m.ty;\n            var rect = this.$scrollRect ? this.$scrollRect : this.$maskRect;\n            if (rect && !rect.contains(localX, localY)) {\n                return null;\n            }\n            if (this.$mask && !this.$mask.$hitTest(stageX, stageY)) {\n                return null;\n            }\n            var children = this.$children;\n            var found = false;\n            var target = null;\n            for (var i = children.length - 1; i >= 0; i--) {\n                var child = children[i];\n                if (child.$maskedObject) {\n                    continue;\n                }\n                target = child.$hitTest(stageX, stageY);\n                if (target) {\n                    found = true;\n                    if (target.$touchEnabled) {\n                        break;\n                    }\n                    else {\n                        target = null;\n                    }\n                }\n            }\n            if (target) {\n                if (this.$touchChildren) {\n                    return target;\n                }\n                return this;\n            }\n            if (found) {\n                return this;\n            }\n            target = egret.DisplayObject.prototype.$hitTest.call(this, stageX, stageY);\n            if (target) {\n                target = this.$graphics.$hitTest(stageX, stageY);\n            }\n            return target;\n        };\n        /**\n         * @private\n         */\n        Sprite.prototype.$measureContentBounds = function (bounds) {\n            this.$graphics.$measureContentBounds(bounds);\n        };\n        /**\n         * @private\n         */\n        Sprite.prototype.$onRemoveFromStage = function () {\n            _super.prototype.$onRemoveFromStage.call(this);\n            if (this.$graphics) {\n                this.$graphics.$onRemoveFromStage();\n            }\n        };\n        return Sprite;\n    }(egret.DisplayObjectContainer));\n    egret.Sprite = Sprite;\n    __reflect(Sprite.prototype, \"egret.Sprite\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Registers the runtime class information for a class.This method adds some strings which represent the class name or\n     * some interface names to the class definition. After the registration,you can use egret.is() method to do the type checking\n     * for the instance of this class.<br/>\n     * Note:If you use the TypeScript programming language, the egret command line tool will automatically generate the registration code line.\n     * You don't need to manually call this method.\n     *\n     * @example the following code shows how to register the runtime class information for the EventDispatcher class and do the type checking:\n     * <pre>\n     *      egret.registerClass(egret.EventDispatcher,\"egret.EventDispatcher\",[\"egret.IEventDispatcher\"]);\n     *      let dispatcher = new egret.EventDispatcher();\n     *      egret.log(egret.is(dispatcher, \"egret.IEventDispatcher\"));  //true。\n     *      egret.log(egret.is(dispatcher, \"egret.EventDispatcher\"));   //true。\n     *      egret.log(egret.is(dispatcher, \"egret.Bitmap\"));   //false。\n     * </pre>\n     * @param classDefinition the class definition to be registered.\n     * @param className  a unique identification string of the specific class\n     * @param interfaceNames a list of unique identification string of the specific interfaces.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 为一个类定义注册运行时类信息,用此方法往类定义上注册它自身以及所有接口对应的字符串。\n     * 在运行时，这个类的实例将可以使用 egret.is() 方法传入一个字符串来判断实例类型。\n     * @example 以下代码演示了如何为EventDispatcher类注册运行时类信息并判断类型：\n     * <pre>\n     *      //为egret.EventDispatcher类注册运行时类信息，由于它实现了IEventDispatcher接口，这里应同时传入接口名对应的字符串。\n     *      egret.registerClass(egret.EventDispatcher,\"egret.EventDispatcher\",[\"egret.IEventDispatcher\"]);\n     *      let dispatcher = new egret.EventDispatcher();\n     *      egret.log(egret.is(dispatcher, \"egret.IEventDispatcher\"));  //true。\n     *      egret.log(egret.is(dispatcher, \"egret.EventDispatcher\"));   //true。\n     *      egret.log(egret.is(dispatcher, \"egret.Bitmap\"));   //false。\n     * </pre>\n     * 注意：若您使用 TypeScript 来编写程序，egret 命令行会自动帮您生成类信息注册代码行到最终的 Javascript 文件中。因此您不需要手动调用此方法。\n     *\n     * @param classDefinition 要注册的类定义。\n     * @param className 要注册的类名。\n     * @param interfaceNames 要注册的类所实现的接口名列表。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function registerClass(classDefinition, className, interfaceNames) {\n        if (true) {\n            if (!classDefinition) {\n                egret.$error(1003, \"classDefinition\");\n            }\n            if (!classDefinition.prototype) {\n                egret.$error(1012, \"classDefinition\");\n            }\n            if (className === void 0) {\n                egret.$error(1003, \"className\");\n            }\n        }\n        var prototype = classDefinition.prototype;\n        Object.defineProperty(prototype, '__class__', {\n            value: className,\n            enumerable: false,\n            writable: true\n        });\n        var types = [className];\n        if (interfaceNames) {\n            types = types.concat(interfaceNames);\n        }\n        var superTypes = prototype.__types__;\n        if (prototype.__types__) {\n            var length_8 = superTypes.length;\n            for (var i = 0; i < length_8; i++) {\n                var name_1 = superTypes[i];\n                if (types.indexOf(name_1) == -1) {\n                    types.push(name_1);\n                }\n            }\n        }\n        Object.defineProperty(prototype, '__types__', {\n            value: types,\n            enumerable: false,\n            writable: true\n        });\n    }\n    egret.registerClass = registerClass;\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The BitmapFillMode class defines the image fill mode of Bitmap.\n     * The BitmapFillMode class defines a pattern enumeration for adjusting size. These patterns determine how Bitmap fill the size designated by the layout system.\n     * @see http://edn.egret.com/cn/docs/page/134 Texture filling way\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/BitmapFillMode.ts\n     * @language en_US\n     */\n    /**\n     * BitmapFillMode 类定义Bitmap的图像填充方式。\n     * BitmapFillMode 类定义了调整大小模式的一个枚举，这些模式确定 Bitmap 如何填充由布局系统指定的尺寸。\n     * @see http://edn.egret.com/cn/docs/page/134 纹理的填充方式\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/BitmapFillMode.ts\n     * @language zh_CN\n     */\n    egret.BitmapFillMode = {\n        /**\n         * Repeat the bitmap to fill area.\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 重复位图以填充区域。\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        REPEAT: \"repeat\",\n        /**\n         * Scale bitmap fill to fill area.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 位图填充拉伸以填充区域。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        SCALE: \"scale\",\n        /**\n         * The bitmap ends at the edge of the region.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在区域的边缘处截断不显示位图。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        CLIP: \"clip\"\n    };\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Logger is an entrance for the log processing namespace of the engine\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * Logger是引擎的日志处理模块入口\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var Logger = (function () {\n        function Logger() {\n        }\n        Object.defineProperty(Logger, \"logLevel\", {\n            /**\n             * Set the current need to open the log level. Grade level are: ALL <DEBUG <INFO <WARN <ERROR <OFF<br/>\n             * This feature is only in DEBUG mode to take effect. <br/>\n             * <Ul>\n             * <Li> Logger.ALL - all levels of log can be printed out. </ li>\n             * <Li> Logger.DEBUG - print debug, info, log, warn, error. </ li>\n             * <Li> Logger.INFO - print info, log, warn, error. </ li>\n             * <Li> Logger.WARN - can print warn, error. </ li>\n             * <Li> Logger.ERROR - You can print error. </ li>\n             * <Li> Logger.OFF - all closed. </ li>\n             * </ Ul>\n             *param LogType from this level to start printing.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 设置当前需要开启的log级别。级别等级分别为：ALL < DEBUG < INFO < WARN < ERROR < OFF<br/>\n             * 此功能只在 DEBUG 模式下才生效。<br/>\n             * <ul>\n             * <li>Logger.ALL -- 所有等级的log都可以打印出来。</li>\n             * <li>Logger.DEBUG -- 可以打印debug、info、log、warn、error。</li>\n             * <li>Logger.INFO -- 可以打印info、log、warn、error。</li>\n             * <li>Logger.WARN -- 可以打印warn、error。</li>\n             * <li>Logger.ERROR -- 可以打印error。</li>\n             * <li>Logger.OFF -- 全部关闭。</li>\n             * </ul>\n             * @param logType 从这个等级开始打印。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            set: function (logType) {\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * open all\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 全开\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Logger.ALL = \"all\";\n        /**\n         * level: DEBUG\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等级为 DEBUG\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Logger.DEBUG = \"debug\";\n        /**\n         * level: INFO\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等级为 INFO\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Logger.INFO = \"info\";\n        /**\n         * level: WARN\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等级为 WARN\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Logger.WARN = \"warn\";\n        /**\n         * level: ERROR\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等级为 ERROR\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Logger.ERROR = \"error\";\n        /**\n         * close all\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 全关\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Logger.OFF = \"off\";\n        return Logger;\n    }());\n    egret.Logger = Logger;\n    __reflect(Logger.prototype, \"egret.Logger\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    var NumberUtils = (function () {\n        function NumberUtils() {\n        }\n        /**\n         * Judge whether it is a numerical value\n         * @param value Parameter that needs to be judged\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 判断是否是数值\n         * @param value 需要判断的参数\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        NumberUtils.isNumber = function (value) {\n            return typeof (value) === \"number\" && !isNaN(value);\n        };\n        /**\n         * Obtain the approximate sin value of the corresponding angle value\n         * @param value {number} Angle value\n         * @returns {number} sin value\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 得到对应角度值的sin近似值\n         * @param value {number} 角度值\n         * @returns {number} sin值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        NumberUtils.sin = function (value) {\n            var valueFloor = Math.floor(value);\n            var valueCeil = valueFloor + 1;\n            var resultFloor = NumberUtils.sinInt(valueFloor);\n            if (valueFloor == value) {\n                return resultFloor;\n            }\n            var resultCeil = NumberUtils.sinInt(valueCeil);\n            return (value - valueFloor) * resultCeil + (valueCeil - value) * resultFloor;\n        };\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        NumberUtils.sinInt = function (value) {\n            value = value % 360;\n            if (value < 0) {\n                value += 360;\n            }\n            return egret_sin_map[value];\n        };\n        /**\n         * Obtain the approximate cos value of the corresponding angle value\n         * @param value {number} Angle value\n         * @returns {number} cos value\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 得到对应角度值的cos近似值\n         * @param value {number} 角度值\n         * @returns {number} cos值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        NumberUtils.cos = function (value) {\n            var valueFloor = Math.floor(value);\n            var valueCeil = valueFloor + 1;\n            var resultFloor = NumberUtils.cosInt(valueFloor);\n            if (valueFloor == value) {\n                return resultFloor;\n            }\n            var resultCeil = NumberUtils.cosInt(valueCeil);\n            return (value - valueFloor) * resultCeil + (valueCeil - value) * resultFloor;\n        };\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        NumberUtils.cosInt = function (value) {\n            value = value % 360;\n            if (value < 0) {\n                value += 360;\n            }\n            return egret_cos_map[value];\n        };\n        NumberUtils.convertStringToHashCode = function (str) {\n            if (str.length === 0) {\n                return 0;\n            }\n            var hash = 0;\n            for (var i = 0, length_9 = str.length; i < length_9; ++i) {\n                var chr = str.charCodeAt(i);\n                hash = ((hash << 5) - hash) + chr;\n                hash |= 0; // Convert to 32bit integer\n            }\n            return hash;\n        };\n        return NumberUtils;\n    }());\n    egret.NumberUtils = NumberUtils;\n    __reflect(NumberUtils.prototype, \"egret.NumberUtils\");\n})(egret || (egret = {}));\n/**\n * @private\n */\nvar egret_sin_map = {};\n/**\n * @private\n */\nvar egret_cos_map = {};\n/**\n * @private\n */\nvar DEG_TO_RAD = Math.PI / 180;\nfor (var NumberUtils_i = 0; NumberUtils_i < 360; NumberUtils_i++) {\n    egret_sin_map[NumberUtils_i] = Math.sin(NumberUtils_i * DEG_TO_RAD);\n    egret_cos_map[NumberUtils_i] = Math.cos(NumberUtils_i * DEG_TO_RAD);\n}\negret_sin_map[90] = 1;\negret_cos_map[90] = 0;\negret_sin_map[180] = 0;\negret_cos_map[180] = -1;\negret_sin_map[270] = -1;\negret_cos_map[270] = 0;\n//对未提供bind的浏览器实现bind机制\nif (!Function.prototype.bind) {\n    Function.prototype.bind = function (oThis) {\n        if (typeof this !== \"function\") {\n            // closest thing possible to the ECMAScript 5 internal IsCallable function\n            egret.$error(1029);\n        }\n        var aArgs = Array.prototype.slice.call(arguments, 1), fToBind = this, fNOP = function () {\n        }, fBound = function () {\n            return fToBind.apply(this instanceof fNOP && oThis\n                ? this\n                : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));\n        };\n        fNOP.prototype = this.prototype;\n        fBound.prototype = new fNOP();\n        return fBound;\n    };\n}\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The Timer class is the interface to timers, which let you run code on a specified time sequence. Use the start()\n     * method to start a timer. Add an event listener for the timer event to set up code to be run on the timer interval.<br/>\n     * You can create Timer objects to run once or repeat at specified intervals to execute code on a schedule. Depending\n     * on the framerate or the runtime environment (available memory and other factors), the runtime may dispatchEvent events at\n     * slightly offset intervals.\n     * @see egret.TimerEvent\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/Timer.ts\n     * @language en_US\n     */\n    /**\n     * Timer 类是计时器的接口，它使您能按指定的时间序列运行代码。\n     * 使用 start() 方法来启动计时器。为 timer 事件添加事件侦听器，以便将代码设置为按计时器间隔运行。\n     * 可以创建 Timer 对象以运行一次或按指定间隔重复运行，从而按计划执行代码。\n     * 根据 Egret 的帧速率或运行时环境（可用内存和其他因素），运行时调度事件的间隔可能稍有不同。\n     * @see egret.TimerEvent\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/Timer.ts\n     * @language zh_CN\n     */\n    var Timer = (function (_super) {\n        __extends(Timer, _super);\n        /**\n         * Constructs a new Timer object with the specified delay and repeatCount states.\n         * @param delay The delay between timer events, in milliseconds. A delay lower than 20 milliseconds is not recommended.\n         * Timer frequency is limited to 60 frames per second, meaning a delay lower than 16.6 milliseconds causes runtime problems.\n         * @param repeatCount Specifies the number of repetitions. If zero, the timer repeats indefinitely.If nonzero,\n         * the timer runs the specified number of times and then stops.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的 delay 和 repeatCount 状态构造新的 Timer 对象。\n         * @param delay 计时器事件间的延迟（以毫秒为单位）。建议 delay 不要低于 20 毫秒。计时器频率不得超过 60 帧/秒，这意味着低于 16.6 毫秒的延迟可导致出现运行时问题。\n         * @param repeatCount 指定重复次数。如果为零，则计时器将持续不断重复运行。如果不为 0，则将运行计时器，运行次数为指定的次数，然后停止。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function Timer(delay, repeatCount) {\n            if (repeatCount === void 0) { repeatCount = 0; }\n            var _this = _super.call(this) || this;\n            /**\n             * @private\n             */\n            _this._delay = 0;\n            /**\n             * @private\n             */\n            _this._currentCount = 0;\n            /**\n             * @private\n             */\n            _this._running = false;\n            /**\n             * @private\n             */\n            _this.updateInterval = 1000;\n            /**\n             * @private\n             */\n            _this.lastCount = 1000;\n            /**\n             * @private\n             */\n            _this.lastTimeStamp = 0;\n            _this.delay = delay;\n            _this.repeatCount = +repeatCount | 0;\n            return _this;\n        }\n        Object.defineProperty(Timer.prototype, \"delay\", {\n            /**\n             * The delay between timer events, in milliseconds. A delay lower than 20 milliseconds is not recommended.<br/>\n             * Note: Timer frequency is limited to 60 frames per second, meaning a delay lower than 16.6 milliseconds causes runtime problems.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 计时器事件间的延迟（以毫秒为单位）。如果在计时器正在运行时设置延迟间隔，则计时器将按相同的 repeatCount 迭代重新启动。<br/>\n             * 注意：建议 delay 不要低于 20 毫秒。计时器频率不得超过 60 帧/秒，这意味着低于 16.6 毫秒的延迟可导致出现运行时问题。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._delay;\n            },\n            set: function (value) {\n                if (value < 1) {\n                    value = 1;\n                }\n                if (this._delay == value) {\n                    return;\n                }\n                this._delay = value;\n                this.lastCount = this.updateInterval = Math.round(60 * value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Timer.prototype, \"currentCount\", {\n            /**\n             * The total number of times the timer has fired since it started at zero. If the timer has been reset, only the fires since the reset are counted.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 计时器从 0 开始后触发的总次数。如果已重置了计时器，则只会计入重置后的触发次数。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._currentCount;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Timer.prototype, \"running\", {\n            /**\n             * The timer's current state; true if the timer is running, otherwise false.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 计时器的当前状态；如果计时器正在运行，则为 true，否则为 false。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._running;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * Stops the timer, if it is running, and sets the currentCount property back to 0, like the reset button of a stopwatch.\n         * Then, when start() is called, the timer instance runs for the specified number of repetitions, as set by the repeatCount value.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果计时器正在运行，则停止计时器，并将 currentCount 属性设回为 0，这类似于秒表的重置按钮。然后，在调用 start() 后，将运行计时器实例，运行次数为指定的重复次数（由 repeatCount 值设置）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Timer.prototype.reset = function () {\n            this.stop();\n            this._currentCount = 0;\n        };\n        /**\n         * Starts the timer, if it is not already running.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果计时器尚未运行，则启动计时器。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Timer.prototype.start = function () {\n            if (this._running)\n                return;\n            this.lastCount = this.updateInterval;\n            this.lastTimeStamp = egret.getTimer();\n            egret.ticker.$startTick(this.$update, this);\n            this._running = true;\n        };\n        /**\n         * Stops the timer. When start() is called after stop(), the timer instance runs for the remaining number of\n         * repetitions, as set by the repeatCount property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 停止计时器。如果在调用 stop() 后调用 start()，则将继续运行计时器实例，运行次数为剩余的 重复次数（由 repeatCount 属性设置）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Timer.prototype.stop = function () {\n            if (!this._running)\n                return;\n            egret.stopTick(this.$update, this);\n            this._running = false;\n        };\n        /**\n         * @private\n         * Ticker以60FPS频率刷新此方法\n         */\n        Timer.prototype.$update = function (timeStamp) {\n            var deltaTime = timeStamp - this.lastTimeStamp;\n            if (deltaTime >= this._delay) {\n                this.lastCount = this.updateInterval;\n            }\n            else {\n                this.lastCount -= 1000;\n                if (this.lastCount > 0) {\n                    return false;\n                }\n                this.lastCount += this.updateInterval;\n            }\n            this.lastTimeStamp = timeStamp;\n            this._currentCount++;\n            var complete = (this.repeatCount > 0 && this._currentCount >= this.repeatCount);\n            if (this.repeatCount == 0 || this._currentCount <= this.repeatCount) {\n                egret.TimerEvent.dispatchTimerEvent(this, egret.TimerEvent.TIMER);\n            }\n            if (complete) {\n                this.stop();\n                egret.TimerEvent.dispatchTimerEvent(this, egret.TimerEvent.TIMER_COMPLETE);\n            }\n            return false;\n        };\n        return Timer;\n    }(egret.EventDispatcher));\n    egret.Timer = Timer;\n    __reflect(Timer.prototype, \"egret.Timer\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @private\n     */\n    egret.$callLaterFunctionList = [];\n    /**\n     * @private\n     */\n    egret.$callLaterThisList = [];\n    /**\n     * @private\n     */\n    egret.$callLaterArgsList = [];\n    /**\n     * Delay the function to run unless screen is redrawn.\n     * @param method {Function} The function to be delayed to run\n     * @param thisObject {any} this reference of callback function\n     * @param ...args {any} Function parameter list\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/callLater.ts\n     * @language en_US\n     */\n    /**\n     * 延迟函数到屏幕重绘前执行。\n     * @param method {Function} 要延迟执行的函数\n     * @param thisObject {any} 回调函数的this引用\n     * @param ...args {any} 函数参数列表\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/callLater.ts\n     * @language zh_CN\n     */\n    function callLater(method, thisObject) {\n        var args = [];\n        for (var _i = 2; _i < arguments.length; _i++) {\n            args[_i - 2] = arguments[_i];\n        }\n        egret.$callLaterFunctionList.push(method);\n        egret.$callLaterThisList.push(thisObject);\n        egret.$callLaterArgsList.push(args);\n    }\n    egret.callLater = callLater;\n    /**\n     * @private\n     */\n    egret.$callAsyncFunctionList = [];\n    /**\n     * @private\n     */\n    egret.$callAsyncThisList = [];\n    /**\n     * @private\n     */\n    egret.$callAsyncArgsList = [];\n    /**\n     * 异步调用函数\n     * @param method {Function} 要异步调用的函数\n     * @param thisObject {any} 函数的this引用\n     * @param ...args {any} 函数参数列表\n     * @private\n     */\n    function $callAsync(method, thisObject) {\n        var args = [];\n        for (var _i = 2; _i < arguments.length; _i++) {\n            args[_i - 2] = arguments[_i];\n        }\n        egret.$callAsyncFunctionList.push(method);\n        egret.$callAsyncThisList.push(thisObject);\n        egret.$callAsyncArgsList.push(args);\n    }\n    egret.$callAsync = $callAsync;\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n//function __extends(d, b) {\n//    for (let p in b) if (b.hasOwnProperty(p)) d[p] = b[p];\n//    function __() {\n//        this.constructor = d;\n//    }\n//\n//    __.prototype = b.prototype;\n//    d.prototype = new __();\n//}\nvar egret;\n(function (egret) {\n    /**\n     * Call setter properties of the parent class, instead of the other writing languages, such as super.alpha = 1;\n     * @param currentClass The current class class name, non-string\n     * @param thisObj The current object. Always this\n     * @param type Setter property names need to call\n     * @param values Value passed to the parent class\n     *\n     * @exmaple egret.superSetter(egret.Sprite, this, \"alpha\", 1);\n     * @language en_US\n     */\n    /**\n     * 调用父类的setter属性，代替其他语言的写法，如 super.alpha = 1;\n     * @param currentClass 当前 class 类名，非字符串\n     * @param thisObj 当前对象。永远都this\n     * @param type 需要调用的setter属性名称\n     * @param values 传给父类的值\n     *\n     * @exmaple egret.superSetter(egret.Sprite, this, \"alpha\", 1);\n     * @language zh_CN\n     */\n    function superSetter(currentClass, thisObj, type) {\n        var values = [];\n        for (var _i = 3; _i < arguments.length; _i++) {\n            values[_i - 3] = arguments[_i];\n        }\n        var cla = currentClass.prototype;\n        var seters;\n        if (!currentClass.hasOwnProperty(\"__sets__\")) {\n            Object.defineProperty(currentClass, \"__sets__\", { \"value\": {} });\n        }\n        seters = currentClass[\"__sets__\"];\n        var setF = seters[type];\n        if (setF) {\n            return setF.apply(thisObj, values);\n        }\n        var d = Object.getPrototypeOf(cla);\n        if (d == null) {\n            return;\n        }\n        while (!d.hasOwnProperty(type)) {\n            d = Object.getPrototypeOf(d);\n            if (d == null) {\n                return;\n            }\n        }\n        setF = Object.getOwnPropertyDescriptor(d, type).set;\n        seters[type] = setF;\n        setF.apply(thisObj, values);\n    }\n    egret.superSetter = superSetter;\n    /**\n     * Get getter property value of the parent class. Instead of writing in other languages, such as super.alpha;\n     * @param currentClass The current class class name, non-string\n     * @param thisObj The current object. Always this\n     * @param type Setter property names need to call\n     * @returns {any} The value returned by the parent\n     *\n     * @exmaple egret.superGetter(egret.Sprite, this, \"alpha\");\n     * @language en_US\n     */\n    /**\n     * 获取父类的getter属性值。代替其他语言的写法，如 super.alpha;\n     * @param currentClass 当前 class 类名，非字符串\n     * @param thisObj 当前对象。永远都this\n     * @param type 需要调用的getter属性名称\n     * @returns {any} 父类返回的值\n     *\n     * @exmaple egret.superGetter(egret.Sprite, this, \"alpha\");\n     * @language zh_CN\n     */\n    function superGetter(currentClass, thisObj, type) {\n        var cla = currentClass.prototype;\n        var geters;\n        if (!currentClass.hasOwnProperty(\"__gets__\")) {\n            Object.defineProperty(currentClass, \"__gets__\", { \"value\": {} });\n        }\n        geters = currentClass[\"__gets__\"];\n        var getF = geters[type];\n        if (getF) {\n            return getF.call(thisObj);\n        }\n        var d = Object.getPrototypeOf(cla);\n        if (d == null) {\n            return;\n        }\n        while (!d.hasOwnProperty(type)) {\n            d = Object.getPrototypeOf(d);\n            if (d == null) {\n                return;\n            }\n        }\n        getF = Object.getOwnPropertyDescriptor(d, type).get;\n        geters[type] = getF;\n        return getF.call(thisObj);\n    }\n    egret.superGetter = superGetter;\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @private\n     */\n    var getDefinitionByNameCache = {};\n    /**\n     * Returns a reference to the class object of the class specified by the name parameter.\n     * @param name The name of a class.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getDefinitionByName.ts\n     * @language en_US\n     */\n    /**\n     * 返回 name 参数指定的类的类对象引用。\n     * @param name 类的名称。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getDefinitionByName.ts\n     * @language zh_CN\n     */\n    function getDefinitionByName(name) {\n        if (!name)\n            return null;\n        var definition = getDefinitionByNameCache[name];\n        if (definition) {\n            return definition;\n        }\n        var paths = name.split(\".\");\n        var length = paths.length;\n        definition = global;\n        for (var i = 0; i < length; i++) {\n            var path = paths[i];\n            definition = definition[path];\n            if (!definition) {\n                return null;\n            }\n        }\n        getDefinitionByNameCache[name] = definition;\n        return definition;\n    }\n    egret.getDefinitionByName = getDefinitionByName;\n    if (true) {\n        egret[\"cleanCache\"] = function () {\n            getDefinitionByNameCache = {};\n        };\n    }\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Return the fully qualified class name of an object\n     * @param value The object for which a fully qualified class name is desired. Any JavaScript value may be passed to\n     * this method including all available JavaScript types, object instances, primitive types such as number, and class objects.\n     * @returns A string containing the fully qualified class name.\n     * @example\n     * <pre>\n     *  egret.getQualifiedClassName(egret.DisplayObject) //return \"egret.DisplayObject\"\n     * </pre>\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getQualifiedClassName.ts\n     * @language en_US\n     */\n    /**\n     * 返回对象的完全限定类名。\n     * @param value 需要完全限定类名称的对象，可以将任何 JavaScript 值传递给此方法，包括所有可用的 JavaScript 类型、对象实例、原始类型\n     * （如number)和类对象\n     * @returns 包含完全限定类名称的字符串。\n     * @example\n     * <pre>\n     *  egret.getQualifiedClassName(egret.DisplayObject) //返回 \"egret.DisplayObject\"\n     * </pre>\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getQualifiedClassName.ts\n     * @language zh_CN\n     */\n    function getQualifiedClassName(value) {\n        var type = typeof value;\n        if (!value || (type != \"object\" && !value.prototype)) {\n            return type;\n        }\n        var prototype = value.prototype ? value.prototype : Object.getPrototypeOf(value);\n        if (prototype.hasOwnProperty(\"__class__\")) {\n            return prototype[\"__class__\"];\n        }\n        var constructorString = prototype.constructor.toString().trim();\n        var index = constructorString.indexOf(\"(\");\n        var className = constructorString.substring(9, index);\n        Object.defineProperty(prototype, \"__class__\", {\n            value: className,\n            enumerable: false,\n            writable: true\n        });\n        return className;\n    }\n    egret.getQualifiedClassName = getQualifiedClassName;\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Returns the fully qualified class name of the base class of the object specified by the value parameter.\n     * @param value The object for which a parent class is desired. Any JavaScript value may be passed to this method including\n     * all available JavaScript types, object instances, primitive types such as number, and class objects.\n     * @returns  A fully qualified base class name, or null if none exists.\n     * @example\n     * <pre>\n     *  egret.getQualifiedSuperclassName(egret.Bitmap) //return \"egret.DisplayObject\"\n     * </pre>\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getQualifiedSuperclassName.ts\n     * @language en_US\n     */\n    /**\n     * 返回 value 参数指定的对象的基类的完全限定类名。\n     * @param value 需要取得父类的对象，可以将任何 JavaScript 值传递给此方法，包括所有可用的 JavaScript 类型、对象实例、原始类型（如number）和类对象\n     * @returns 完全限定的基类名称，或 null（如果不存在基类名称）。\n     * @example\n     * <pre>\n     *  egret.getQualifiedSuperclassName(egret.Sprite) //返回 \"egret.DisplayObject\"\n     * </pre>\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getQualifiedSuperclassName.ts\n     * @language zh_CN\n     */\n    function getQualifiedSuperclassName(value) {\n        if (!value || (typeof value != \"object\" && !value.prototype)) {\n            return null;\n        }\n        var prototype = value.prototype ? value.prototype : Object.getPrototypeOf(value);\n        var superProto = Object.getPrototypeOf(prototype);\n        if (!superProto) {\n            return null;\n        }\n        var superClass = egret.getQualifiedClassName(superProto.constructor);\n        if (!superClass) {\n            return null;\n        }\n        return superClass;\n    }\n    egret.getQualifiedSuperclassName = getQualifiedSuperclassName;\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Used to compute relative time.this method returns the number of milliseconds since the Egret framework was initialized\n     * @returns The number of milliseconds since the Egret framework was initialized\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getTimer.ts\n     * @language en_US\n     */\n    /**\n     * 用于计算相对时间。此方法返回自启动 Egret 框架以来经过的毫秒数。\n     * @returns 启动 Egret 框架以来经过的毫秒数。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getTimer.ts\n     * @language zh_CN\n     */\n    function getTimer() {\n        return Date.now() - egret.sys.$START_TIME;\n    }\n    egret.getTimer = getTimer;\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Check whether a public definition exists in the specified application domain. The definition can be that of a class, a naming space or a function.\n     * @param name {string} Name of the definition.\n     * @returns {boolean} Whether the public definition exists\n     * @example\n     * egret.hasDefinition(\"egret.DisplayObject\") //return true\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/hasDefinition.ts\n     * @language en_US\n     */\n    /**\n     * 检查指定的应用程序域之内是否存在一个公共定义。该定义可以是一个类、一个命名空间或一个函数的定义。\n     * @param name {string} 定义的名称。\n     * @returns {boolean} 公共定义是否存在\n     * @example\n     * egret.hasDefinition(\"egret.DisplayObject\") //返回 true\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/hasDefinition.ts\n     * @language zh_CN\n     */\n    function hasDefinition(name) {\n        var definition = egret.getDefinitionByName(name);\n        return definition ? true : false;\n    }\n    egret.hasDefinition = hasDefinition;\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Indicates whether an object is a instance of the class or interface specified as the parameter.This method has better performance\n     * compared width the instanceOf operator,and it can indicate whether an object is a instance of the specific interface.\n     * @param instance the instance to be checked.\n     * @param typeName the string value representing a specific class or interface.\n     * @returns A value of true if the object is a instance of the class or interface specified as the parameter.\n     * @example\n     * <pre>\n     *     let instance = new egret.Sprite();\n     *     egret.log(egret.is(instance,\"egret.Sprite\"))  //true\n     *     egret.log(egret.is(instance,\"egret.DisplayObjectContainer\"))  //true\n     *     egret.log(egret.is(instance,\"egret.Bitmap\"))  //false\n     * </pre>\n     * @see egret.registerClass()\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 检查指定对象是否为 Egret 框架内指定接口或类或其子类的实例。此方法与使用 instanceOf 关键字相比具有更高的性能，并且能判断接口的实现。\n     * @param instance 要判断的实例。\n     * @param typeName 类或接口的完全名称.\n     * @returns 返回true表示当前对象是指定类或接口的实例。\n     * @example\n     * <pre>\n     *     let instance = new egret.Sprite();\n     *     egret.log(egret.is(instance,\"egret.Sprite\"))  //true\n     *     egret.log(egret.is(instance,\"egret.DisplayObjectContainer\"))  //true\n     *     egret.log(egret.is(instance,\"egret.Bitmap\"))  //false\n     * </pre>\n     * @see egret.registerClass()\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function is(instance, typeName) {\n        if (!instance || typeof instance != \"object\") {\n            return false;\n        }\n        var prototype = Object.getPrototypeOf(instance);\n        var types = prototype ? prototype.__types__ : null;\n        if (!types) {\n            return false;\n        }\n        return (types.indexOf(typeName) !== -1);\n    }\n    egret.is = is;\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Register and start a timer,which will notify the callback method at a rate of 60 FPS ,and pass the current time stamp as parameters.<br/>\n     * Note: After the registration,it will notify the callback method continuously,you can call the stopTick () method to stop it.\n     * @param callBack the call back method. the timeStamp parameter of this method represents the number of milliseconds\n     * since the Egret framework was initialized. If the return value of this method is true, it will force Egret runtime\n     * to render after processing of this method completes.\n     * @param thisObject the call back method's \"this\"\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 注册并启动一个计时器，通常会以60FPS的速率触发回调方法，并传入当前时间戳。注意：注册后将会持续触发回调方法，若要停止回调，需要手动调用stopTick()方法。\n     * @param callBack 要执行的回调方法。参数 timeStamp 表示从启动Egret框架开始经过的时间(毫秒)。\n     * 若回调方法返回值为true，其作用与TimerEvent.updateAfterEvent()类似，将会忽略帧频限制，在此方法处理完成后立即重绘屏幕。\n     * @param thisObject 回调方法的this对象引用。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function startTick(callBack, thisObject) {\n        if (true && !callBack) {\n            egret.$error(1003, \"callBack\");\n        }\n        egret.ticker.$startTick(callBack, thisObject);\n    }\n    egret.startTick = startTick;\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Stops the timer started by the egret.startTick() method.\n     * @param callBack the call back method. the timeStamp parameter of this method represents the number of milliseconds\n     * since the Egret framework was initialized. If the return value of this method is true, it will force Egret runtime\n     * to render after processing of this method completes.\n     * @param thisObject the call back method's \"this\"\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 停止之前用 startTick() 方法启动的计时器。\n     * @param callBack 要执行的回调方法。参数 timeStamp 表示从启动Egret框架开始经过的时间(毫秒)。\n     * 若回调方法返回值为true，其作用与TimerEvent.updateAfterEvent()类似，将会忽略帧频限制，在此方法处理完成后立即重绘屏幕。\n     * @param thisObject 回调方法的this对象引用。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function stopTick(callBack, thisObject) {\n        if (true && !callBack) {\n            egret.$error(1003, \"callBack\");\n        }\n        egret.ticker.$stopTick(callBack, thisObject);\n    }\n    egret.stopTick = stopTick;\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Transfer number to color character string\n     * @param value {number} color value ,such as 0xffffff\n     * @returns {string} Color character string, for example, #ffffff.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/toColorString.ts\n     * @language en_US\n     */\n    /**\n     * 转换数字为颜色字符串\n     * @param value {number} 颜色值，例如 0xffffff\n     * @returns {string} 颜色字符串，例如\"#ffffff\"。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/toColorString.ts\n     * @language zh_CN\n     */\n    function toColorString(value) {\n        if (value < 0)\n            value = 0;\n        if (value > 16777215)\n            value = 16777215;\n        var color = value.toString(16).toUpperCase();\n        while (color.length > 6) {\n            color = color.slice(1, color.length);\n        }\n        while (color.length < 6) {\n            color = \"0\" + color;\n        }\n        return \"#\" + color;\n    }\n    egret.toColorString = toColorString;\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n"
  },
  {
    "path": "demo/libs/modules/egret/egret.web.js",
    "content": "var __reflect = (this && this.__reflect) || function (p, c, t) {\n    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;\n};\nvar __extends = this && this.__extends || function __extends(t, e) { \n function r() { \n this.constructor = t;\n}\nfor (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);\nr.prototype = e.prototype, t.prototype = new r();\n};\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var WebGeolocation = (function (_super) {\n            __extends(WebGeolocation, _super);\n            /**\n             * @private\n             */\n            function WebGeolocation(option) {\n                var _this = _super.call(this) || this;\n                /**\n                 * @private\n                 */\n                _this.onUpdate = function (position) {\n                    var event = new egret.GeolocationEvent(egret.Event.CHANGE);\n                    var coords = position.coords;\n                    event.altitude = coords.altitude;\n                    event.heading = coords.heading;\n                    event.accuracy = coords.accuracy;\n                    event.latitude = coords.latitude;\n                    event.longitude = coords.longitude;\n                    event.speed = coords.speed;\n                    event.altitudeAccuracy = coords.altitudeAccuracy;\n                    _this.dispatchEvent(event);\n                };\n                /**\n                 * @private\n                 */\n                _this.onError = function (error) {\n                    var errorType = egret.GeolocationEvent.UNAVAILABLE;\n                    if (error.code == error.PERMISSION_DENIED)\n                        errorType = egret.GeolocationEvent.PERMISSION_DENIED;\n                    var event = new egret.GeolocationEvent(egret.IOErrorEvent.IO_ERROR);\n                    event.errorType = errorType;\n                    event.errorMessage = error.message;\n                    _this.dispatchEvent(event);\n                };\n                _this.geolocation = navigator.geolocation;\n                return _this;\n            }\n            /**\n             * @private\n             *\n             */\n            WebGeolocation.prototype.start = function () {\n                var geo = this.geolocation;\n                if (geo)\n                    this.watchId = geo.watchPosition(this.onUpdate, this.onError);\n                else\n                    this.onError({\n                        code: 2,\n                        message: egret.sys.tr(3004),\n                        PERMISSION_DENIED: 1,\n                        POSITION_UNAVAILABLE: 2\n                    });\n            };\n            /**\n             * @private\n             *\n             */\n            WebGeolocation.prototype.stop = function () {\n                var geo = this.geolocation;\n                geo.clearWatch(this.watchId);\n            };\n            return WebGeolocation;\n        }(egret.EventDispatcher));\n        web.WebGeolocation = WebGeolocation;\n        __reflect(WebGeolocation.prototype, \"egret.web.WebGeolocation\", [\"egret.Geolocation\"]);\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var WebMotion = (function (_super) {\n            __extends(WebMotion, _super);\n            function WebMotion() {\n                var _this = _super !== null && _super.apply(this, arguments) || this;\n                /**\n                 * @private\n                 */\n                _this.onChange = function (e) {\n                    var event = new egret.MotionEvent(egret.Event.CHANGE);\n                    var acceleration = {\n                        x: e.acceleration.x,\n                        y: e.acceleration.y,\n                        z: e.acceleration.z\n                    };\n                    var accelerationIncludingGravity = {\n                        x: e.accelerationIncludingGravity.x,\n                        y: e.accelerationIncludingGravity.y,\n                        z: e.accelerationIncludingGravity.z\n                    };\n                    var rotation = {\n                        alpha: e.rotationRate.alpha,\n                        beta: e.rotationRate.beta,\n                        gamma: e.rotationRate.gamma\n                    };\n                    event.acceleration = acceleration;\n                    event.accelerationIncludingGravity = accelerationIncludingGravity;\n                    event.rotationRate = rotation;\n                    _this.dispatchEvent(event);\n                };\n                return _this;\n            }\n            /**\n             * @private\n             *\n             */\n            WebMotion.prototype.start = function () {\n                window.addEventListener(\"devicemotion\", this.onChange);\n            };\n            /**\n             * @private\n             *\n             */\n            WebMotion.prototype.stop = function () {\n                window.removeEventListener(\"devicemotion\", this.onChange);\n            };\n            return WebMotion;\n        }(egret.EventDispatcher));\n        web.WebMotion = WebMotion;\n        __reflect(WebMotion.prototype, \"egret.web.WebMotion\", [\"egret.Motion\"]);\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        function getOption(key) {\n            if (window.location) {\n                var search = location.search;\n                if (search == \"\") {\n                    return \"\";\n                }\n                search = search.slice(1);\n                var searchArr = search.split(\"&\");\n                var length_1 = searchArr.length;\n                for (var i = 0; i < length_1; i++) {\n                    var str = searchArr[i];\n                    var arr = str.split(\"=\");\n                    if (arr[0] == key) {\n                        return arr[1];\n                    }\n                }\n            }\n            return \"\";\n        }\n        web.getOption = getOption;\n        egret.getOption = getOption;\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         * @inheritDoc\n         */\n        var HtmlSoundChannel = (function (_super) {\n            __extends(HtmlSoundChannel, _super);\n            /**\n             * @private\n             */\n            function HtmlSoundChannel(audio) {\n                var _this = _super.call(this) || this;\n                /**\n                 * @private\n                 */\n                _this.$startTime = 0;\n                /**\n                 * @private\n                 */\n                _this.audio = null;\n                //声音是否已经播放完成\n                _this.isStopped = false;\n                _this.canPlay = function () {\n                    _this.audio.removeEventListener(\"canplay\", _this.canPlay);\n                    try {\n                        _this.audio.currentTime = _this.$startTime;\n                    }\n                    catch (e) {\n                    }\n                    finally {\n                        _this.audio.play();\n                    }\n                };\n                /**\n                 * @private\n                 */\n                _this.onPlayEnd = function () {\n                    if (_this.$loops == 1) {\n                        _this.stop();\n                        _this.dispatchEventWith(egret.Event.SOUND_COMPLETE);\n                        return;\n                    }\n                    if (_this.$loops > 0) {\n                        _this.$loops--;\n                    }\n                    /////////////\n                    //this.audio.load();\n                    _this.$play();\n                };\n                /**\n                 * @private\n                 */\n                _this._volume = 1;\n                audio.addEventListener(\"ended\", _this.onPlayEnd);\n                _this.audio = audio;\n                return _this;\n            }\n            HtmlSoundChannel.prototype.$play = function () {\n                if (this.isStopped) {\n                    egret.$error(1036);\n                    return;\n                }\n                try {\n                    //this.audio.pause();\n                    this.audio.volume = this._volume;\n                    this.audio.currentTime = this.$startTime;\n                }\n                catch (e) {\n                    this.audio.addEventListener(\"canplay\", this.canPlay);\n                    return;\n                }\n                this.audio.play();\n            };\n            /**\n             * @private\n             * @inheritDoc\n             */\n            HtmlSoundChannel.prototype.stop = function () {\n                if (!this.audio)\n                    return;\n                if (!this.isStopped) {\n                    egret.sys.$popSoundChannel(this);\n                }\n                this.isStopped = true;\n                var audio = this.audio;\n                audio.removeEventListener(\"ended\", this.onPlayEnd);\n                audio.removeEventListener(\"canplay\", this.canPlay);\n                audio.volume = 0;\n                this._volume = 0;\n                this.audio = null;\n                var url = this.$url;\n                //延迟一定时间再停止，规避chrome报错\n                window.setTimeout(function () {\n                    audio.pause();\n                    web.HtmlSound.$recycle(url, audio);\n                }, 200);\n            };\n            Object.defineProperty(HtmlSoundChannel.prototype, \"volume\", {\n                /**\n                 * @private\n                 * @inheritDoc\n                 */\n                get: function () {\n                    return this._volume;\n                },\n                /**\n                 * @inheritDoc\n                 */\n                set: function (value) {\n                    if (this.isStopped) {\n                        egret.$error(1036);\n                        return;\n                    }\n                    this._volume = value;\n                    if (!this.audio)\n                        return;\n                    this.audio.volume = value;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(HtmlSoundChannel.prototype, \"position\", {\n                /**\n                 * @private\n                 * @inheritDoc\n                 */\n                get: function () {\n                    if (!this.audio)\n                        return 0;\n                    return this.audio.currentTime;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            return HtmlSoundChannel;\n        }(egret.EventDispatcher));\n        web.HtmlSoundChannel = HtmlSoundChannel;\n        __reflect(HtmlSoundChannel.prototype, \"egret.web.HtmlSoundChannel\", [\"egret.SoundChannel\", \"egret.IEventDispatcher\"]);\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var WebAudioDecode = (function () {\n            function WebAudioDecode() {\n            }\n            /**\n             * @private\n             *\n             */\n            WebAudioDecode.decodeAudios = function () {\n                if (WebAudioDecode.decodeArr.length <= 0) {\n                    return;\n                }\n                if (WebAudioDecode.isDecoding) {\n                    return;\n                }\n                WebAudioDecode.isDecoding = true;\n                var decodeInfo = WebAudioDecode.decodeArr.shift();\n                WebAudioDecode.ctx.decodeAudioData(decodeInfo[\"buffer\"], function (audioBuffer) {\n                    decodeInfo[\"self\"].audioBuffer = audioBuffer;\n                    if (decodeInfo[\"success\"]) {\n                        decodeInfo[\"success\"]();\n                    }\n                    WebAudioDecode.isDecoding = false;\n                    WebAudioDecode.decodeAudios();\n                }, function () {\n                    egret.log('sound decode error');\n                    if (decodeInfo[\"fail\"]) {\n                        decodeInfo[\"fail\"]();\n                    }\n                    WebAudioDecode.isDecoding = false;\n                    WebAudioDecode.decodeAudios();\n                });\n            };\n            /**\n             * @private\n             */\n            WebAudioDecode.decodeArr = [];\n            /**\n             * @private\n             */\n            WebAudioDecode.isDecoding = false;\n            return WebAudioDecode;\n        }());\n        web.WebAudioDecode = WebAudioDecode;\n        __reflect(WebAudioDecode.prototype, \"egret.web.WebAudioDecode\");\n        /**\n         * @private\n         * @inheritDoc\n         */\n        var WebAudioSound = (function (_super) {\n            __extends(WebAudioSound, _super);\n            /**\n             * @private\n             * @inheritDoc\n             */\n            function WebAudioSound() {\n                var _this = _super.call(this) || this;\n                /**\n                 * @private\n                 */\n                _this.loaded = false;\n                return _this;\n            }\n            Object.defineProperty(WebAudioSound.prototype, \"length\", {\n                get: function () {\n                    if (this.audioBuffer) {\n                        return this.audioBuffer.duration;\n                    }\n                    throw new Error(\"sound not loaded!\");\n                    //return 0;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            /**\n             * @inheritDoc\n             */\n            WebAudioSound.prototype.load = function (url) {\n                var self = this;\n                this.url = url;\n                if (true && !url) {\n                    egret.$error(3002);\n                }\n                var request = new XMLHttpRequest();\n                request.open(\"GET\", url, true);\n                request.responseType = \"arraybuffer\";\n                request.addEventListener(\"load\", function () {\n                    var ioError = (request.status >= 400);\n                    if (ioError) {\n                        self.dispatchEventWith(egret.IOErrorEvent.IO_ERROR);\n                    }\n                    else {\n                        WebAudioDecode.decodeArr.push({\n                            \"buffer\": request.response,\n                            \"success\": onAudioLoaded,\n                            \"fail\": onAudioError,\n                            \"self\": self,\n                            \"url\": self.url\n                        });\n                        WebAudioDecode.decodeAudios();\n                    }\n                });\n                request.addEventListener(\"error\", function () {\n                    self.dispatchEventWith(egret.IOErrorEvent.IO_ERROR);\n                });\n                request.send();\n                function onAudioLoaded() {\n                    self.loaded = true;\n                    self.dispatchEventWith(egret.Event.COMPLETE);\n                }\n                function onAudioError() {\n                    self.dispatchEventWith(egret.IOErrorEvent.IO_ERROR);\n                }\n            };\n            /**\n             * @inheritDoc\n             */\n            WebAudioSound.prototype.play = function (startTime, loops) {\n                startTime = +startTime || 0;\n                loops = +loops || 0;\n                if (true && this.loaded == false) {\n                    egret.$error(1049);\n                }\n                var channel = new web.WebAudioSoundChannel();\n                channel.$url = this.url;\n                channel.$loops = loops;\n                channel.$audioBuffer = this.audioBuffer;\n                channel.$startTime = startTime;\n                channel.$play();\n                egret.sys.$pushSoundChannel(channel);\n                return channel;\n            };\n            /**\n             * @inheritDoc\n             */\n            WebAudioSound.prototype.close = function () {\n            };\n            /**\n             * Background music\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 背景音乐\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            WebAudioSound.MUSIC = \"music\";\n            /**\n             * EFFECT\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 音效\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            WebAudioSound.EFFECT = \"effect\";\n            return WebAudioSound;\n        }(egret.EventDispatcher));\n        web.WebAudioSound = WebAudioSound;\n        __reflect(WebAudioSound.prototype, \"egret.web.WebAudioSound\", [\"egret.Sound\"]);\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         * @inheritDoc\n         */\n        var WebAudioSoundChannel = (function (_super) {\n            __extends(WebAudioSoundChannel, _super);\n            /**\n             * @private\n             */\n            function WebAudioSoundChannel() {\n                var _this = _super.call(this) || this;\n                /**\n                 * @private\n                 */\n                _this.$startTime = 0;\n                /**\n                 * @private\n                 */\n                _this.bufferSource = null;\n                /**\n                 * @private\n                 */\n                _this.context = web.WebAudioDecode.ctx;\n                //声音是否已经播放完成\n                _this.isStopped = false;\n                /**\n                 * @private\n                 */\n                _this._currentTime = 0;\n                /**\n                 * @private\n                 */\n                _this._volume = 1;\n                /**\n                 * @private\n                 */\n                _this.onPlayEnd = function () {\n                    if (_this.$loops == 1) {\n                        _this.stop();\n                        _this.dispatchEventWith(egret.Event.SOUND_COMPLETE);\n                        return;\n                    }\n                    if (_this.$loops > 0) {\n                        _this.$loops--;\n                    }\n                    /////////////\n                    _this.$play();\n                };\n                /**\n                 * @private\n                 */\n                _this._startTime = 0;\n                if (_this.context[\"createGain\"]) {\n                    _this.gain = _this.context[\"createGain\"]();\n                }\n                else {\n                    _this.gain = _this.context[\"createGainNode\"]();\n                }\n                return _this;\n            }\n            WebAudioSoundChannel.prototype.$play = function () {\n                if (this.isStopped) {\n                    egret.$error(1036);\n                    return;\n                }\n                if (this.bufferSource) {\n                    this.bufferSource.onended = null;\n                    this.bufferSource = null;\n                }\n                var context = this.context;\n                var gain = this.gain;\n                var bufferSource = context.createBufferSource();\n                this.bufferSource = bufferSource;\n                bufferSource.buffer = this.$audioBuffer;\n                bufferSource.connect(gain);\n                gain.connect(context.destination);\n                bufferSource.onended = this.onPlayEnd;\n                this._startTime = Date.now();\n                this.gain.gain.value = this._volume;\n                bufferSource.start(0, this.$startTime);\n                this._currentTime = 0;\n            };\n            WebAudioSoundChannel.prototype.stop = function () {\n                if (this.bufferSource) {\n                    var sourceNode = this.bufferSource;\n                    if (sourceNode.stop) {\n                        sourceNode.stop(0);\n                    }\n                    else {\n                        sourceNode.noteOff(0);\n                    }\n                    sourceNode.onended = null;\n                    sourceNode.disconnect();\n                    this.bufferSource = null;\n                    this.$audioBuffer = null;\n                }\n                if (!this.isStopped) {\n                    egret.sys.$popSoundChannel(this);\n                }\n                this.isStopped = true;\n            };\n            Object.defineProperty(WebAudioSoundChannel.prototype, \"volume\", {\n                /**\n                 * @private\n                 * @inheritDoc\n                 */\n                get: function () {\n                    return this._volume;\n                },\n                /**\n                 * @inheritDoc\n                 */\n                set: function (value) {\n                    if (this.isStopped) {\n                        egret.$error(1036);\n                        return;\n                    }\n                    this._volume = value;\n                    this.gain.gain.value = value;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(WebAudioSoundChannel.prototype, \"position\", {\n                /**\n                 * @private\n                 * @inheritDoc\n                 */\n                get: function () {\n                    if (this.bufferSource) {\n                        return (Date.now() - this._startTime) / 1000 + this.$startTime;\n                    }\n                    return 0;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            return WebAudioSoundChannel;\n        }(egret.EventDispatcher));\n        web.WebAudioSoundChannel = WebAudioSoundChannel;\n        __reflect(WebAudioSoundChannel.prototype, \"egret.web.WebAudioSoundChannel\", [\"egret.SoundChannel\", \"egret.IEventDispatcher\"]);\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         * @inheritDoc\n         */\n        var WebVideo = (function (_super) {\n            __extends(WebVideo, _super);\n            /**\n             * @inheritDoc\n             */\n            function WebVideo(url, cache) {\n                if (cache === void 0) { cache = true; }\n                var _this = _super.call(this) || this;\n                /**\n                 * @private\n                 */\n                _this.loaded = false;\n                /**\n                 * @private\n                 */\n                _this.closed = false;\n                /**\n                 * @private\n                 */\n                _this.heightSet = NaN;\n                /**\n                 * @private\n                 */\n                _this.widthSet = NaN;\n                /**\n                 * @private\n                 * pc上视频卡住的时候不能暂停\n                 */\n                _this.waiting = false;\n                /**\n                 * @private\n                 * 用户是否设置了 pause\n                 */\n                _this.userPause = false;\n                /**\n                 * @private\n                 * 用户是否设置了 play\n                 */\n                _this.userPlay = false;\n                _this.isPlayed = false;\n                _this.screenChanged = function (e) {\n                    var isfullscreen = document.fullscreenEnabled || document.webkitIsFullScreen;\n                    if (!isfullscreen) {\n                        _this.checkFullScreen(false);\n                        if (!egret.Capabilities.isMobile) {\n                            _this._fullscreen = isfullscreen;\n                        }\n                    }\n                };\n                _this._fullscreen = true;\n                /**\n                 * @private\n                 *\n                 */\n                _this.onVideoLoaded = function () {\n                    _this.video.removeEventListener(\"canplay\", _this.onVideoLoaded);\n                    var video = _this.video;\n                    _this.loaded = true;\n                    //video.pause();\n                    if (_this.posterData) {\n                        _this.posterData.width = _this.getPlayWidth();\n                        _this.posterData.height = _this.getPlayHeight();\n                    }\n                    video.width = video.videoWidth;\n                    video.height = video.videoHeight;\n                    window.setTimeout(function () {\n                        _this.dispatchEventWith(egret.Event.COMPLETE);\n                    }, 200);\n                };\n                _this.$renderNode = new egret.sys.BitmapNode();\n                _this.src = url;\n                _this.once(egret.Event.ADDED_TO_STAGE, _this.loadPoster, _this);\n                if (url) {\n                    _this.load();\n                }\n                return _this;\n            }\n            WebVideo.prototype.createNativeDisplayObject = function () {\n                this.$nativeDisplayObject = new egret_native.NativeDisplayObject(1 /* BITMAP */);\n            };\n            /**\n             * @inheritDoc\n             */\n            WebVideo.prototype.load = function (url, cache) {\n                var _this = this;\n                if (cache === void 0) { cache = true; }\n                url = url || this.src;\n                this.src = url;\n                if (true && !url) {\n                    egret.$error(3002);\n                }\n                if (this.video && this.video.src == url) {\n                    return;\n                }\n                var video;\n                if (!this.video || egret.Capabilities.isMobile) {\n                    video = document.createElement(\"video\");\n                    this.video = video;\n                    video.controls = null;\n                }\n                else {\n                    video = this.video;\n                }\n                video.src = url;\n                video.setAttribute(\"autoplay\", \"autoplay\");\n                video.setAttribute(\"webkit-playsinline\", \"true\");\n                video.addEventListener(\"canplay\", this.onVideoLoaded);\n                video.addEventListener(\"error\", function () { return _this.onVideoError(); });\n                video.addEventListener(\"ended\", function () { return _this.onVideoEnded(); });\n                var firstPause = false;\n                video.addEventListener(\"canplay\", function () {\n                    _this.waiting = false;\n                    if (!firstPause) {\n                        firstPause = true;\n                        video.pause();\n                    }\n                    else {\n                        if (_this.userPause) {\n                            _this.pause();\n                        }\n                        else if (_this.userPlay) {\n                            _this.play();\n                        }\n                    }\n                });\n                video.addEventListener(\"waiting\", function () {\n                    _this.waiting = true;\n                });\n                video.load();\n                this.videoPlay();\n                video.style.position = \"absolute\";\n                video.style.top = \"0px\";\n                video.style.zIndex = \"-88888\";\n                video.style.left = \"0px\";\n                video.height = 1;\n                video.width = 1;\n            };\n            /**\n             * @inheritDoc\n             */\n            WebVideo.prototype.play = function (startTime, loop) {\n                var _this = this;\n                if (loop === void 0) { loop = false; }\n                if (this.loaded == false) {\n                    this.load(this.src);\n                    this.once(egret.Event.COMPLETE, function (e) { return _this.play(startTime, loop); }, this);\n                    return;\n                }\n                this.isPlayed = true;\n                var video = this.video;\n                if (startTime != undefined) {\n                    video.currentTime = +startTime || 0;\n                }\n                video.loop = !!loop;\n                if (egret.Capabilities.isMobile) {\n                    video.style.zIndex = \"-88888\"; //移动端，就算设置成最小，只要全屏，都会在最上层，而且在自动退出去后，不担心挡住canvas\n                }\n                else {\n                    video.style.zIndex = \"9999\";\n                }\n                video.style.position = \"absolute\";\n                video.style.top = \"0px\";\n                video.style.left = \"0px\";\n                video.height = video.videoHeight;\n                video.width = video.videoWidth;\n                if (egret.Capabilities.os != \"Windows PC\" && egret.Capabilities.os != \"Mac OS\") {\n                    window.setTimeout(function () {\n                        video.width = 0;\n                    }, 1000);\n                }\n                this.checkFullScreen(this._fullscreen);\n            };\n            WebVideo.prototype.videoPlay = function () {\n                this.userPause = false;\n                if (this.waiting) {\n                    this.userPlay = true;\n                    return;\n                }\n                this.userPlay = false;\n                this.video.play();\n            };\n            WebVideo.prototype.checkFullScreen = function (playFullScreen) {\n                var video = this.video;\n                if (playFullScreen) {\n                    if (video.parentElement == null) {\n                        video.removeAttribute(\"webkit-playsinline\");\n                        document.body.appendChild(video);\n                    }\n                    egret.stopTick(this.markDirty, this);\n                    this.goFullscreen();\n                }\n                else {\n                    if (video.parentElement != null) {\n                        video.parentElement.removeChild(video);\n                    }\n                    video.setAttribute(\"webkit-playsinline\", \"true\");\n                    this.setFullScreenMonitor(false);\n                    egret.startTick(this.markDirty, this);\n                    if (egret.Capabilities.isMobile) {\n                        this.video.currentTime = 0;\n                        this.onVideoEnded();\n                        return;\n                    }\n                }\n                this.videoPlay();\n            };\n            WebVideo.prototype.goFullscreen = function () {\n                var video = this.video;\n                var fullscreenType;\n                fullscreenType = egret.web.getPrefixStyleName('requestFullscreen', video);\n                if (!video[fullscreenType]) {\n                    fullscreenType = egret.web.getPrefixStyleName('requestFullScreen', video);\n                    if (!video[fullscreenType]) {\n                        return true;\n                    }\n                }\n                video.removeAttribute(\"webkit-playsinline\");\n                video[fullscreenType]();\n                this.setFullScreenMonitor(true);\n                return true;\n            };\n            WebVideo.prototype.setFullScreenMonitor = function (use) {\n                var video = this.video;\n                if (use) {\n                    video.addEventListener(\"mozfullscreenchange\", this.screenChanged);\n                    video.addEventListener(\"webkitfullscreenchange\", this.screenChanged);\n                    video.addEventListener(\"mozfullscreenerror\", this.screenError);\n                    video.addEventListener(\"webkitfullscreenerror\", this.screenError);\n                }\n                else {\n                    video.removeEventListener(\"mozfullscreenchange\", this.screenChanged);\n                    video.removeEventListener(\"webkitfullscreenchange\", this.screenChanged);\n                    video.removeEventListener(\"mozfullscreenerror\", this.screenError);\n                    video.removeEventListener(\"webkitfullscreenerror\", this.screenError);\n                }\n            };\n            WebVideo.prototype.screenError = function () {\n                egret.$error(3014);\n            };\n            WebVideo.prototype.exitFullscreen = function () {\n                //退出全屏\n                if (document['exitFullscreen']) {\n                    document['exitFullscreen']();\n                }\n                else if (document['msExitFullscreen']) {\n                    document['msExitFullscreen']();\n                }\n                else if (document['mozCancelFullScreen']) {\n                    document['mozCancelFullScreen']();\n                }\n                else if (document['oCancelFullScreen']) {\n                    document['oCancelFullScreen']();\n                }\n                else if (document['webkitExitFullscreen']) {\n                    document['webkitExitFullscreen']();\n                }\n                else {\n                }\n            };\n            /**\n             * @private\n             *\n             */\n            WebVideo.prototype.onVideoEnded = function () {\n                this.pause();\n                this.isPlayed = false;\n                this.dispatchEventWith(egret.Event.ENDED);\n            };\n            /**\n             * @private\n             *\n             */\n            WebVideo.prototype.onVideoError = function () {\n                this.dispatchEventWith(egret.IOErrorEvent.IO_ERROR);\n            };\n            /**\n             * @inheritDoc\n             */\n            WebVideo.prototype.close = function () {\n                var _this = this;\n                this.closed = true;\n                this.video.removeEventListener(\"canplay\", this.onVideoLoaded);\n                this.video.removeEventListener(\"error\", function () { return _this.onVideoError(); });\n                this.video.removeEventListener(\"ended\", function () { return _this.onVideoEnded(); });\n                this.pause();\n                if (this.loaded == false && this.video)\n                    this.video.src = \"\";\n                if (this.video && this.video.parentElement) {\n                    this.video.parentElement.removeChild(this.video);\n                    this.video = null;\n                }\n                this.loaded = false;\n            };\n            /**\n             * @inheritDoc\n             */\n            WebVideo.prototype.pause = function () {\n                this.userPlay = false;\n                if (this.waiting) {\n                    this.userPause = true;\n                    return;\n                }\n                this.userPause = false;\n                this.video.pause();\n                egret.stopTick(this.markDirty, this);\n            };\n            Object.defineProperty(WebVideo.prototype, \"volume\", {\n                /**\n                 * @inheritDoc\n                 */\n                get: function () {\n                    if (!this.video)\n                        return 1;\n                    return this.video.volume;\n                },\n                /**\n                 * @inheritDoc\n                 */\n                set: function (value) {\n                    if (!this.video)\n                        return;\n                    this.video.volume = value;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(WebVideo.prototype, \"position\", {\n                /**\n                 * @inheritDoc\n                 */\n                get: function () {\n                    if (!this.video)\n                        return 0;\n                    return this.video.currentTime;\n                },\n                /**\n                 * @inheritDoc\n                 */\n                set: function (value) {\n                    if (!this.video)\n                        return;\n                    this.video.currentTime = value;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(WebVideo.prototype, \"fullscreen\", {\n                /**\n                 * @inheritDoc\n                 */\n                get: function () {\n                    return this._fullscreen;\n                },\n                /**\n                 * @inheritDoc\n                 */\n                set: function (value) {\n                    if (egret.Capabilities.isMobile) {\n                        return;\n                    }\n                    this._fullscreen = !!value;\n                    if (this.video && this.video.paused == false) {\n                        this.checkFullScreen(this._fullscreen);\n                    }\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(WebVideo.prototype, \"bitmapData\", {\n                /**\n                 * @inheritDoc\n                 */\n                get: function () {\n                    if (!this.video || !this.loaded)\n                        return null;\n                    if (!this._bitmapData) {\n                        this.video.width = this.video.videoWidth;\n                        this.video.height = this.video.videoHeight;\n                        this._bitmapData = new egret.BitmapData(this.video);\n                        this._bitmapData.$deleteSource = false;\n                    }\n                    return this._bitmapData;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            WebVideo.prototype.loadPoster = function () {\n                var _this = this;\n                var poster = this.poster;\n                if (!poster)\n                    return;\n                var imageLoader = new egret.ImageLoader();\n                imageLoader.once(egret.Event.COMPLETE, function (e) {\n                    var posterData = imageLoader.data;\n                    _this.posterData = imageLoader.data;\n                    _this.$renderDirty = true;\n                    _this.posterData.width = _this.getPlayWidth();\n                    _this.posterData.height = _this.getPlayHeight();\n                    if (egret.nativeRender) {\n                        var texture = new egret.Texture();\n                        texture._setBitmapData(_this.posterData);\n                        _this.$nativeDisplayObject.setTexture(texture);\n                    }\n                }, this);\n                imageLoader.load(poster);\n            };\n            /**\n             * @private\n             */\n            WebVideo.prototype.$measureContentBounds = function (bounds) {\n                var bitmapData = this.bitmapData;\n                var posterData = this.posterData;\n                if (bitmapData) {\n                    bounds.setTo(0, 0, this.getPlayWidth(), this.getPlayHeight());\n                }\n                else if (posterData) {\n                    bounds.setTo(0, 0, this.getPlayWidth(), this.getPlayHeight());\n                }\n                else {\n                    bounds.setEmpty();\n                }\n            };\n            WebVideo.prototype.getPlayWidth = function () {\n                if (!isNaN(this.widthSet)) {\n                    return this.widthSet;\n                }\n                if (this.bitmapData) {\n                    return this.bitmapData.width;\n                }\n                if (this.posterData) {\n                    return this.posterData.width;\n                }\n                return NaN;\n            };\n            WebVideo.prototype.getPlayHeight = function () {\n                if (!isNaN(this.heightSet)) {\n                    return this.heightSet;\n                }\n                if (this.bitmapData) {\n                    return this.bitmapData.height;\n                }\n                if (this.posterData) {\n                    return this.posterData.height;\n                }\n                return NaN;\n            };\n            /**\n             * @private\n             */\n            WebVideo.prototype.$updateRenderNode = function () {\n                var node = this.$renderNode;\n                var bitmapData = this.bitmapData;\n                var posterData = this.posterData;\n                var width = this.getPlayWidth();\n                var height = this.getPlayHeight();\n                if ((!this.isPlayed || egret.Capabilities.isMobile) && posterData) {\n                    node.image = posterData;\n                    node.imageWidth = width;\n                    node.imageHeight = height;\n                    node.drawImage(0, 0, posterData.width, posterData.height, 0, 0, width, height);\n                }\n                else if (this.isPlayed && bitmapData) {\n                    node.image = bitmapData;\n                    node.imageWidth = bitmapData.width;\n                    node.imageHeight = bitmapData.height;\n                    egret.WebGLUtils.deleteWebGLTexture(bitmapData.webGLTexture);\n                    bitmapData.webGLTexture = null;\n                    node.drawImage(0, 0, bitmapData.width, bitmapData.height, 0, 0, width, height);\n                }\n            };\n            WebVideo.prototype.markDirty = function () {\n                this.$renderDirty = true;\n                return true;\n            };\n            /**\n             * @private\n             * 设置显示高度\n             */\n            WebVideo.prototype.$setHeight = function (value) {\n                this.heightSet = value;\n                if (this.paused) {\n                    var self_1 = this;\n                    this.$renderDirty = true;\n                    window.setTimeout(function () {\n                        self_1.$renderDirty = false;\n                    }, 200);\n                }\n                _super.prototype.$setHeight.call(this, value);\n            };\n            /**\n             * @private\n             * 设置显示宽度\n             */\n            WebVideo.prototype.$setWidth = function (value) {\n                this.widthSet = value;\n                if (this.paused) {\n                    var self_2 = this;\n                    this.$renderDirty = true;\n                    window.setTimeout(function () {\n                        self_2.$renderDirty = false;\n                    }, 200);\n                }\n                _super.prototype.$setWidth.call(this, value);\n            };\n            Object.defineProperty(WebVideo.prototype, \"paused\", {\n                get: function () {\n                    if (this.video) {\n                        return this.video.paused;\n                    }\n                    return true;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(WebVideo.prototype, \"length\", {\n                /**\n                 * @inheritDoc\n                 */\n                get: function () {\n                    if (this.video) {\n                        return this.video.duration;\n                    }\n                    throw new Error(\"Video not loaded!\");\n                },\n                enumerable: true,\n                configurable: true\n            });\n            return WebVideo;\n        }(egret.DisplayObject));\n        web.WebVideo = WebVideo;\n        __reflect(WebVideo.prototype, \"egret.web.WebVideo\", [\"egret.Video\", \"egret.DisplayObject\"]);\n        egret.Video = WebVideo;\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var WebHttpRequest = (function (_super) {\n            __extends(WebHttpRequest, _super);\n            /**\n             * @private\n             */\n            function WebHttpRequest() {\n                var _this = _super.call(this) || this;\n                /**\n                 *\n                 */\n                _this.timeout = 0;\n                /**\n                 * @private\n                 */\n                _this._url = \"\";\n                _this._method = \"\";\n                return _this;\n            }\n            Object.defineProperty(WebHttpRequest.prototype, \"response\", {\n                /**\n                 * @private\n                 * 本次请求返回的数据，数据类型根据responseType设置的值确定。\n                 */\n                get: function () {\n                    if (!this._xhr) {\n                        return null;\n                    }\n                    if (this._xhr.response != undefined) {\n                        return this._xhr.response;\n                    }\n                    if (this._responseType == \"text\") {\n                        return this._xhr.responseText;\n                    }\n                    if (this._responseType == \"arraybuffer\" && /msie 9.0/i.test(navigator.userAgent)) {\n                        var w = window;\n                        return w.convertResponseBodyToText(this._xhr[\"responseBody\"]);\n                    }\n                    if (this._responseType == \"document\") {\n                        return this._xhr.responseXML;\n                    }\n                    /*if (this._xhr.responseXML) {\n                        return this._xhr.responseXML;\n                    }\n                    if (this._xhr.responseText != undefined) {\n                        return this._xhr.responseText;\n                    }*/\n                    return null;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(WebHttpRequest.prototype, \"responseType\", {\n                /**\n                 * @private\n                 * 设置返回的数据格式，请使用 HttpResponseType 里定义的枚举值。设置非法的值或不设置，都将使用HttpResponseType.TEXT。\n                 */\n                get: function () {\n                    return this._responseType;\n                },\n                set: function (value) {\n                    this._responseType = value;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(WebHttpRequest.prototype, \"withCredentials\", {\n                /**\n                 * @private\n                 * 表明在进行跨站(cross-site)的访问控制(Access-Control)请求时，是否使用认证信息(例如cookie或授权的header)。 默认为 false。(这个标志不会影响同站的请求)\n                 */\n                get: function () {\n                    return this._withCredentials;\n                },\n                set: function (value) {\n                    this._withCredentials = value;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            /**\n             * @private\n             *\n             * @returns\n             */\n            WebHttpRequest.prototype.getXHR = function () {\n                if (window[\"XMLHttpRequest\"]) {\n                    return new window[\"XMLHttpRequest\"]();\n                }\n                else {\n                    return new ActiveXObject(\"MSXML2.XMLHTTP\");\n                }\n            };\n            /**\n             * @private\n             * 初始化一个请求.注意，若在已经发出请求的对象上调用此方法，相当于立即调用abort().\n             * @param url 该请求所要访问的URL该请求所要访问的URL\n             * @param method 请求所使用的HTTP方法， 请使用 HttpMethod 定义的枚举值.\n             */\n            WebHttpRequest.prototype.open = function (url, method) {\n                if (method === void 0) { method = \"GET\"; }\n                this._url = url;\n                this._method = method;\n                if (this._xhr) {\n                    this._xhr.abort();\n                    this._xhr = null;\n                }\n                var xhr = this.getXHR(); //new XMLHttpRequest();\n                if (window[\"XMLHttpRequest\"]) {\n                    xhr.addEventListener(\"load\", this.onload.bind(this));\n                    xhr.addEventListener(\"error\", this.onerror.bind(this));\n                }\n                else {\n                    xhr.onreadystatechange = this.onReadyStateChange.bind(this);\n                }\n                xhr.onprogress = this.updateProgress.bind(this);\n                xhr.ontimeout = this.onTimeout.bind(this);\n                xhr.open(this._method, this._url, true);\n                this._xhr = xhr;\n            };\n            /**\n             * @private\n             * 发送请求.\n             * @param data 需要发送的数据\n             */\n            WebHttpRequest.prototype.send = function (data) {\n                if (this._responseType != null) {\n                    this._xhr.responseType = this._responseType;\n                }\n                if (this._withCredentials != null) {\n                    this._xhr.withCredentials = this._withCredentials;\n                }\n                if (this.headerObj) {\n                    for (var key in this.headerObj) {\n                        this._xhr.setRequestHeader(key, this.headerObj[key]);\n                    }\n                }\n                this._xhr.timeout = this.timeout;\n                this._xhr.send(data);\n            };\n            /**\n             * @private\n             * 如果请求已经被发送,则立刻中止请求.\n             */\n            WebHttpRequest.prototype.abort = function () {\n                if (this._xhr) {\n                    this._xhr.abort();\n                }\n            };\n            /**\n             * @private\n             * 返回所有响应头信息(响应头名和值), 如果响应头还没接受,则返回\"\".\n             */\n            WebHttpRequest.prototype.getAllResponseHeaders = function () {\n                if (!this._xhr) {\n                    return null;\n                }\n                var result = this._xhr.getAllResponseHeaders();\n                return result ? result : \"\";\n            };\n            /**\n             * @private\n             * 给指定的HTTP请求头赋值.在这之前,您必须确认已经调用 open() 方法打开了一个url.\n             * @param header 将要被赋值的请求头名称.\n             * @param value 给指定的请求头赋的值.\n             */\n            WebHttpRequest.prototype.setRequestHeader = function (header, value) {\n                if (!this.headerObj) {\n                    this.headerObj = {};\n                }\n                this.headerObj[header] = value;\n            };\n            /**\n             * @private\n             * 返回指定的响应头的值, 如果响应头还没被接受,或该响应头不存在,则返回\"\".\n             * @param header 要返回的响应头名称\n             */\n            WebHttpRequest.prototype.getResponseHeader = function (header) {\n                if (!this._xhr) {\n                    return null;\n                }\n                var result = this._xhr.getResponseHeader(header);\n                return result ? result : \"\";\n            };\n            /**\n             * @private\n             */\n            WebHttpRequest.prototype.onTimeout = function () {\n                if (true) {\n                    egret.$warn(1052, this._url);\n                }\n                this.dispatchEventWith(egret.IOErrorEvent.IO_ERROR);\n            };\n            /**\n             * @private\n             */\n            WebHttpRequest.prototype.onReadyStateChange = function () {\n                var xhr = this._xhr;\n                if (xhr.readyState == 4) {\n                    var ioError_1 = (xhr.status >= 400 || xhr.status == 0);\n                    var url_1 = this._url;\n                    var self_3 = this;\n                    window.setTimeout(function () {\n                        if (ioError_1) {\n                            if (true && !self_3.hasEventListener(egret.IOErrorEvent.IO_ERROR)) {\n                                egret.$error(1011, url_1);\n                            }\n                            self_3.dispatchEventWith(egret.IOErrorEvent.IO_ERROR);\n                        }\n                        else {\n                            self_3.dispatchEventWith(egret.Event.COMPLETE);\n                        }\n                    }, 0);\n                }\n            };\n            /**\n             * @private\n             */\n            WebHttpRequest.prototype.updateProgress = function (event) {\n                if (event.lengthComputable) {\n                    egret.ProgressEvent.dispatchProgressEvent(this, egret.ProgressEvent.PROGRESS, event.loaded, event.total);\n                }\n            };\n            /**\n             * @private\n             */\n            WebHttpRequest.prototype.onload = function () {\n                var self = this;\n                var xhr = this._xhr;\n                var url = this._url;\n                var ioError = (xhr.status >= 400);\n                window.setTimeout(function () {\n                    if (ioError) {\n                        if (true && !self.hasEventListener(egret.IOErrorEvent.IO_ERROR)) {\n                            egret.$error(1011, url);\n                        }\n                        self.dispatchEventWith(egret.IOErrorEvent.IO_ERROR);\n                    }\n                    else {\n                        self.dispatchEventWith(egret.Event.COMPLETE);\n                    }\n                }, 0);\n            };\n            /**\n             * @private\n             */\n            WebHttpRequest.prototype.onerror = function () {\n                var url = this._url;\n                var self = this;\n                window.setTimeout(function () {\n                    if (true && !self.hasEventListener(egret.IOErrorEvent.IO_ERROR)) {\n                        egret.$error(1011, url);\n                    }\n                    self.dispatchEventWith(egret.IOErrorEvent.IO_ERROR);\n                }, 0);\n            };\n            return WebHttpRequest;\n        }(egret.EventDispatcher));\n        web.WebHttpRequest = WebHttpRequest;\n        __reflect(WebHttpRequest.prototype, \"egret.web.WebHttpRequest\", [\"egret.HttpRequest\"]);\n        egret.HttpRequest = WebHttpRequest;\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        var winURL = window[\"URL\"] || window[\"webkitURL\"];\n        /**\n         * @private\n         * ImageLoader 类可用于加载图像（JPG、PNG 或 GIF）文件。使用 load() 方法来启动加载。被加载的图像对象数据将存储在 ImageLoader.data 属性上 。\n         */\n        var WebImageLoader = (function (_super) {\n            __extends(WebImageLoader, _super);\n            function WebImageLoader() {\n                var _this = _super !== null && _super.apply(this, arguments) || this;\n                /**\n                 * @private\n                 * 使用 load() 方法加载成功的 BitmapData 图像数据。\n                 */\n                _this.data = null;\n                /**\n                 * @private\n                 * 当从其他站点加载一个图片时，指定是否启用跨域资源共享(CORS)，默认值为null。\n                 * 可以设置为\"anonymous\",\"use-credentials\"或null,设置为其他值将等同于\"anonymous\"。\n                 */\n                _this._crossOrigin = null;\n                /**\n                 * @private\n                 * 标记crossOrigin有没有被设置过,设置过之后使用设置的属性\n                 */\n                _this._hasCrossOriginSet = false;\n                /**\n                 * @private\n                 */\n                _this.currentImage = null;\n                /**\n                 * @private\n                 */\n                _this.request = null;\n                return _this;\n            }\n            Object.defineProperty(WebImageLoader.prototype, \"crossOrigin\", {\n                get: function () {\n                    return this._crossOrigin;\n                },\n                set: function (value) {\n                    this._hasCrossOriginSet = true;\n                    this._crossOrigin = value;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            /**\n             * @private\n             * 启动一次图像加载。注意：若之前已经调用过加载请求，重新调用 load() 将终止先前的请求，并开始新的加载。\n             * @param url 要加载的图像文件的地址。\n             */\n            WebImageLoader.prototype.load = function (url) {\n                if (web.Html5Capatibility._canUseBlob\n                    && url.indexOf(\"wxLocalResource:\") != 0 //微信专用不能使用 blob\n                    && url.indexOf(\"data:\") != 0\n                    && url.indexOf(\"http:\") != 0\n                    && url.indexOf(\"https:\") != 0) {\n                    var request = this.request;\n                    if (!request) {\n                        request = this.request = new egret.web.WebHttpRequest();\n                        request.addEventListener(egret.Event.COMPLETE, this.onBlobLoaded, this);\n                        request.addEventListener(egret.IOErrorEvent.IO_ERROR, this.onBlobError, this);\n                        request.responseType = \"blob\";\n                    }\n                    if (true) {\n                        this.currentURL = url;\n                    }\n                    request.open(url);\n                    request.send();\n                }\n                else {\n                    this.loadImage(url);\n                }\n            };\n            /**\n             * @private\n             */\n            WebImageLoader.prototype.onBlobLoaded = function (event) {\n                var blob = this.request.response;\n                this.request = undefined;\n                this.loadImage(winURL.createObjectURL(blob));\n            };\n            /**\n             * @private\n             */\n            WebImageLoader.prototype.onBlobError = function (event) {\n                this.dispatchIOError(this.currentURL);\n                this.request = undefined;\n            };\n            /**\n             * @private\n             */\n            WebImageLoader.prototype.loadImage = function (src) {\n                var image = new Image();\n                this.data = null;\n                this.currentImage = image;\n                if (this._hasCrossOriginSet) {\n                    if (this._crossOrigin) {\n                        image.crossOrigin = this._crossOrigin;\n                    }\n                }\n                else {\n                    if (WebImageLoader.crossOrigin) {\n                        image.crossOrigin = WebImageLoader.crossOrigin;\n                    }\n                }\n                /*else {\n                    if (image.hasAttribute(\"crossOrigin\")) {//兼容猎豹\n                        image.removeAttribute(\"crossOrigin\");\n                    }\n                }*/\n                image.onload = this.onImageComplete.bind(this);\n                image.onerror = this.onLoadError.bind(this);\n                image.src = src;\n            };\n            /**\n             * @private\n             */\n            WebImageLoader.prototype.onImageComplete = function (event) {\n                var image = this.getImage(event);\n                if (!image) {\n                    return;\n                }\n                this.data = new egret.BitmapData(image);\n                var self = this;\n                window.setTimeout(function () {\n                    self.dispatchEventWith(egret.Event.COMPLETE);\n                }, 0);\n            };\n            /**\n             * @private\n             */\n            WebImageLoader.prototype.onLoadError = function (event) {\n                var image = this.getImage(event);\n                if (!image) {\n                    return;\n                }\n                this.dispatchIOError(image.src);\n            };\n            WebImageLoader.prototype.dispatchIOError = function (url) {\n                var self = this;\n                window.setTimeout(function () {\n                    if (true && !self.hasEventListener(egret.IOErrorEvent.IO_ERROR)) {\n                        egret.$error(1011, url);\n                    }\n                    self.dispatchEventWith(egret.IOErrorEvent.IO_ERROR);\n                }, 0);\n            };\n            /**\n             * @private\n             */\n            WebImageLoader.prototype.getImage = function (event) {\n                var image = event.target;\n                var url = image.src;\n                if (url.indexOf(\"blob:\") == 0) {\n                    try {\n                        winURL.revokeObjectURL(image.src);\n                    }\n                    catch (e) {\n                        egret.$warn(1037);\n                    }\n                }\n                image.onerror = null;\n                image.onload = null;\n                if (this.currentImage !== image) {\n                    return null;\n                }\n                this.currentImage = null;\n                return image;\n            };\n            /**\n             * @private\n             * 指定是否启用跨域资源共享,如果ImageLoader实例有设置过crossOrigin属性将使用设置的属性\n             */\n            WebImageLoader.crossOrigin = null;\n            return WebImageLoader;\n        }(egret.EventDispatcher));\n        web.WebImageLoader = WebImageLoader;\n        __reflect(WebImageLoader.prototype, \"egret.web.WebImageLoader\", [\"egret.ImageLoader\"]);\n        egret.ImageLoader = WebImageLoader;\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @classdesc\n         * @extends egret.StageText\n         * @private\n         */\n        var HTML5StageText = (function (_super) {\n            __extends(HTML5StageText, _super);\n            /**\n             * @private\n             */\n            function HTML5StageText() {\n                var _this = _super.call(this) || this;\n                /**\n                 * @private\n                 */\n                _this._isNeedShow = false;\n                /**\n                 * @private\n                 */\n                _this.inputElement = null;\n                /**\n                 * @private\n                 */\n                _this.inputDiv = null;\n                /**\n                 * @private\n                 */\n                _this._gscaleX = 0;\n                /**\n                 * @private\n                 */\n                _this._gscaleY = 0;\n                /**\n                 * @private\n                 */\n                _this.textValue = \"\";\n                /**\n                 * @private\n                 */\n                _this.colorValue = 0xffffff;\n                /**\n                 * @private\n                 */\n                _this._styleInfoes = {};\n                return _this;\n            }\n            /**\n             * @private\n             *\n             * @param textfield\n             */\n            HTML5StageText.prototype.$setTextField = function (textfield) {\n                this.$textfield = textfield;\n                return true;\n            };\n            /**\n             * @private\n             *\n             */\n            HTML5StageText.prototype.$addToStage = function () {\n                this.htmlInput = egret.web.$getTextAdapter(this.$textfield);\n            };\n            /**\n             * @private\n             *\n             */\n            HTML5StageText.prototype._initElement = function () {\n                var point = this.$textfield.localToGlobal(0, 0);\n                var x = point.x;\n                var y = point.y;\n                // let m = this.$textfield.$renderNode.renderMatrix;\n                // let cX = m.a;\n                // let cY = m.d;\n                var scaleX = this.htmlInput.$scaleX;\n                var scaleY = this.htmlInput.$scaleY;\n                this.inputDiv.style.left = x * scaleX + \"px\";\n                this.inputDiv.style.top = y * scaleY + \"px\";\n                if (this.$textfield.multiline && this.$textfield.height > this.$textfield.size) {\n                    this.inputDiv.style.top = (y) * scaleY + \"px\";\n                    this.inputElement.style.top = (-this.$textfield.lineSpacing / 2) * scaleY + \"px\";\n                }\n                else {\n                    this.inputDiv.style.top = y * scaleY + \"px\";\n                    this.inputElement.style.top = 0 + \"px\";\n                }\n                var node = this.$textfield;\n                var cX = 1;\n                var cY = 1;\n                var rotation = 0;\n                while (node.parent) {\n                    cX *= node.scaleX;\n                    cY *= node.scaleY;\n                    rotation += node.rotation;\n                    node = node.parent;\n                }\n                var transformKey = egret.web.getPrefixStyleName(\"transform\");\n                this.inputDiv.style[transformKey] = \"rotate(\" + rotation + \"deg)\";\n                this._gscaleX = scaleX * cX;\n                this._gscaleY = scaleY * cY;\n            };\n            /**\n             * @private\n             *\n             */\n            HTML5StageText.prototype.$show = function () {\n                if (!this.htmlInput.isCurrentStageText(this)) {\n                    this.inputElement = this.htmlInput.getInputElement(this);\n                    if (!this.$textfield.multiline) {\n                        this.inputElement.type = this.$textfield.inputType;\n                    }\n                    else {\n                        this.inputElement.type = \"text\";\n                    }\n                    this.inputDiv = this.htmlInput._inputDIV;\n                }\n                else {\n                    this.inputElement.onblur = null;\n                }\n                this.htmlInput._needShow = true;\n                //标记当前文本被选中\n                this._isNeedShow = true;\n                this._initElement();\n            };\n            /**\n             * @private\n             *\n             */\n            HTML5StageText.prototype.onBlurHandler = function () {\n                this.htmlInput.clearInputElement();\n                window.scrollTo(0, 0);\n            };\n            /**\n             * @private\n             *\n             */\n            HTML5StageText.prototype.onFocusHandler = function () {\n                //the soft keyboard will cover the input box in some cases\n                var self = this;\n                window.setTimeout(function () {\n                    if (self.inputElement) {\n                        self.inputElement.scrollIntoView();\n                    }\n                }, 200);\n            };\n            /**\n             * @private\n             *\n             */\n            HTML5StageText.prototype.executeShow = function () {\n                var self = this;\n                //打开\n                this.inputElement.value = this.$getText();\n                if (this.inputElement.onblur == null) {\n                    this.inputElement.onblur = this.onBlurHandler.bind(this);\n                }\n                if (this.inputElement.onfocus == null) {\n                    this.inputElement.onfocus = this.onFocusHandler.bind(this);\n                }\n                this.$resetStageText();\n                if (this.$textfield.maxChars > 0) {\n                    this.inputElement.setAttribute(\"maxlength\", this.$textfield.maxChars);\n                }\n                else {\n                    this.inputElement.removeAttribute(\"maxlength\");\n                }\n                this.inputElement.selectionStart = this.inputElement.value.length;\n                this.inputElement.selectionEnd = this.inputElement.value.length;\n                this.inputElement.focus();\n            };\n            /**\n             * @private\n             */\n            HTML5StageText.prototype.$hide = function () {\n                if (this.htmlInput) {\n                    this.htmlInput.disconnectStageText(this);\n                }\n            };\n            /**\n             * @private\n             *\n             * @returns\n             */\n            HTML5StageText.prototype.$getText = function () {\n                if (!this.textValue) {\n                    this.textValue = \"\";\n                }\n                return this.textValue;\n            };\n            /**\n             * @private\n             *\n             * @param value\n             */\n            HTML5StageText.prototype.$setText = function (value) {\n                this.textValue = value;\n                this.resetText();\n                return true;\n            };\n            /**\n             * @private\n             *\n             */\n            HTML5StageText.prototype.resetText = function () {\n                if (this.inputElement) {\n                    this.inputElement.value = this.textValue;\n                }\n            };\n            HTML5StageText.prototype.$setColor = function (value) {\n                this.colorValue = value;\n                this.resetColor();\n                return true;\n            };\n            /**\n             * @private\n             *\n             */\n            HTML5StageText.prototype.resetColor = function () {\n                if (this.inputElement) {\n                    this.setElementStyle(\"color\", egret.toColorString(this.colorValue));\n                }\n            };\n            HTML5StageText.prototype.$onBlur = function () {\n            };\n            /**\n             * @private\n             *\n             */\n            HTML5StageText.prototype._onInput = function () {\n                var self = this;\n                window.setTimeout(function () {\n                    if (self.inputElement && self.inputElement.selectionStart == self.inputElement.selectionEnd) {\n                        self.textValue = self.inputElement.value;\n                        egret.Event.dispatchEvent(self, \"updateText\", false);\n                    }\n                }, 0);\n            };\n            HTML5StageText.prototype.setAreaHeight = function () {\n                var textfield = this.$textfield;\n                if (textfield.multiline) {\n                    var textheight = egret.TextFieldUtils.$getTextHeight(textfield);\n                    if (textfield.height <= textfield.size) {\n                        this.setElementStyle(\"height\", (textfield.size) * this._gscaleY + \"px\");\n                        this.setElementStyle(\"padding\", \"0px\");\n                        this.setElementStyle(\"lineHeight\", (textfield.size) * this._gscaleY + \"px\");\n                    }\n                    else if (textfield.height < textheight) {\n                        this.setElementStyle(\"height\", (textfield.height) * this._gscaleY + \"px\");\n                        this.setElementStyle(\"padding\", \"0px\");\n                        this.setElementStyle(\"lineHeight\", (textfield.size + textfield.lineSpacing) * this._gscaleY + \"px\");\n                    }\n                    else {\n                        this.setElementStyle(\"height\", (textheight + textfield.lineSpacing) * this._gscaleY + \"px\");\n                        var rap = (textfield.height - textheight) * this._gscaleY;\n                        var valign = egret.TextFieldUtils.$getValign(textfield);\n                        var top_1 = rap * valign;\n                        var bottom = rap - top_1;\n                        this.setElementStyle(\"padding\", top_1 + \"px 0px \" + bottom + \"px 0px\");\n                        this.setElementStyle(\"lineHeight\", (textfield.size + textfield.lineSpacing) * this._gscaleY + \"px\");\n                    }\n                }\n            };\n            /**\n             * @private\n             *\n             * @param e\n             */\n            HTML5StageText.prototype._onClickHandler = function (e) {\n                if (this._isNeedShow) {\n                    e.stopImmediatePropagation();\n                    //e.preventDefault();\n                    this._isNeedShow = false;\n                    this.executeShow();\n                    this.dispatchEvent(new egret.Event(\"focus\"));\n                }\n            };\n            /**\n             * @private\n             *\n             */\n            HTML5StageText.prototype._onDisconnect = function () {\n                this.inputElement = null;\n                this.dispatchEvent(new egret.Event(\"blur\"));\n            };\n            /**\n             * @private\n             *\n             * @param style\n             * @param value\n             */\n            HTML5StageText.prototype.setElementStyle = function (style, value) {\n                if (this.inputElement) {\n                    if (this._styleInfoes[style] != value) {\n                        this.inputElement.style[style] = value;\n                        //this._styleInfoes[style] = value;\n                    }\n                }\n            };\n            /**\n             * @private\n             *\n             */\n            HTML5StageText.prototype.$removeFromStage = function () {\n                if (this.inputElement) {\n                    this.htmlInput.disconnectStageText(this);\n                }\n            };\n            /**\n             * 修改位置\n             * @private\n             */\n            HTML5StageText.prototype.$resetStageText = function () {\n                if (this.inputElement) {\n                    var textfield = this.$textfield;\n                    this.setElementStyle(\"fontFamily\", textfield.fontFamily);\n                    this.setElementStyle(\"fontStyle\", textfield.italic ? \"italic\" : \"normal\");\n                    this.setElementStyle(\"fontWeight\", textfield.bold ? \"bold\" : \"normal\");\n                    this.setElementStyle(\"textAlign\", textfield.textAlign);\n                    this.setElementStyle(\"fontSize\", textfield.size * this._gscaleY + \"px\");\n                    this.setElementStyle(\"color\", egret.toColorString(textfield.textColor));\n                    var tw = void 0;\n                    if (textfield.stage) {\n                        tw = textfield.localToGlobal(0, 0).x;\n                        tw = Math.min(textfield.width, textfield.stage.stageWidth - tw);\n                    }\n                    else {\n                        tw = textfield.width;\n                    }\n                    this.setElementStyle(\"width\", tw * this._gscaleX + \"px\");\n                    this.setElementStyle(\"verticalAlign\", textfield.verticalAlign);\n                    if (textfield.multiline) {\n                        this.setAreaHeight();\n                    }\n                    else {\n                        this.setElementStyle(\"lineHeight\", (textfield.size) * this._gscaleY + \"px\");\n                        if (textfield.height < textfield.size) {\n                            this.setElementStyle(\"height\", (textfield.size) * this._gscaleY + \"px\");\n                            var bottom = (textfield.size / 2) * this._gscaleY;\n                            this.setElementStyle(\"padding\", \"0px 0px \" + bottom + \"px 0px\");\n                        }\n                        else {\n                            this.setElementStyle(\"height\", (textfield.size) * this._gscaleY + \"px\");\n                            var rap = (textfield.height - textfield.size) * this._gscaleY;\n                            var valign = egret.TextFieldUtils.$getValign(textfield);\n                            var top_2 = rap * valign;\n                            var bottom = rap - top_2;\n                            if (bottom < textfield.size / 2 * this._gscaleY) {\n                                bottom = textfield.size / 2 * this._gscaleY;\n                            }\n                            this.setElementStyle(\"padding\", top_2 + \"px 0px \" + bottom + \"px 0px\");\n                        }\n                    }\n                    this.inputDiv.style.clip = \"rect(0px \" + (textfield.width * this._gscaleX) + \"px \" + (textfield.height * this._gscaleY) + \"px 0px)\";\n                    this.inputDiv.style.height = textfield.height * this._gscaleY + \"px\";\n                    this.inputDiv.style.width = tw * this._gscaleX + \"px\";\n                }\n            };\n            return HTML5StageText;\n        }(egret.EventDispatcher));\n        web.HTML5StageText = HTML5StageText;\n        __reflect(HTML5StageText.prototype, \"egret.web.HTML5StageText\", [\"egret.StageText\"]);\n        egret.StageText = HTML5StageText;\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var HTMLInput = (function () {\n            function HTMLInput() {\n                /**\n                 * @private\n                 */\n                this._needShow = false;\n                /**\n                 * @private\n                 */\n                this.$scaleX = 1;\n                /**\n                 * @private\n                 */\n                this.$scaleY = 1;\n            }\n            /**\n             * @private\n             *\n             * @returns\n             */\n            HTMLInput.prototype.isInputOn = function () {\n                return this._stageText != null;\n            };\n            /**\n             * @private\n             *\n             * @param stageText\n             * @returns\n             */\n            HTMLInput.prototype.isCurrentStageText = function (stageText) {\n                return this._stageText == stageText;\n            };\n            /**\n             * @private\n             *\n             * @param dom\n             */\n            HTMLInput.prototype.initValue = function (dom) {\n                dom.style.position = \"absolute\";\n                dom.style.left = \"0px\";\n                dom.style.top = \"0px\";\n                dom.style.border = \"none\";\n                dom.style.padding = \"0\";\n            };\n            /**\n             * @private\n             *\n             */\n            HTMLInput.prototype.$updateSize = function () {\n                if (!this.canvas) {\n                    return;\n                }\n                this.$scaleX = egret.sys.DisplayList.$canvasScaleX;\n                this.$scaleY = egret.sys.DisplayList.$canvasScaleY;\n                this.StageDelegateDiv.style.left = this.canvas.style.left;\n                this.StageDelegateDiv.style.top = this.canvas.style.top;\n                var transformKey = egret.web.getPrefixStyleName(\"transform\");\n                this.StageDelegateDiv.style[transformKey] = this.canvas.style[transformKey];\n                this.StageDelegateDiv.style[egret.web.getPrefixStyleName(\"transformOrigin\")] = \"0% 0% 0px\";\n            };\n            /**\n             * @private\n             *\n             * @param container\n             * @param canvas\n             * @returns\n             */\n            HTMLInput.prototype._initStageDelegateDiv = function (container, canvas) {\n                this.canvas = canvas;\n                var self = this;\n                var stageDelegateDiv;\n                if (!stageDelegateDiv) {\n                    stageDelegateDiv = document.createElement(\"div\");\n                    this.StageDelegateDiv = stageDelegateDiv;\n                    stageDelegateDiv.id = \"StageDelegateDiv\";\n                    container.appendChild(stageDelegateDiv);\n                    self.initValue(stageDelegateDiv);\n                    self._inputDIV = document.createElement(\"div\");\n                    self.initValue(self._inputDIV);\n                    self._inputDIV.style.width = \"0px\";\n                    self._inputDIV.style.height = \"0px\";\n                    self._inputDIV.style.left = 0 + \"px\";\n                    self._inputDIV.style.top = \"-100px\";\n                    self._inputDIV.style[egret.web.getPrefixStyleName(\"transformOrigin\")] = \"0% 0% 0px\";\n                    stageDelegateDiv.appendChild(self._inputDIV);\n                    this.canvas.addEventListener(\"click\", function (e) {\n                        if (self._needShow) {\n                            self._needShow = false;\n                            self._stageText._onClickHandler(e);\n                            self.show();\n                        }\n                        else {\n                            if (self._inputElement) {\n                                self.clearInputElement();\n                                self._inputElement.blur();\n                                self._inputElement = null;\n                            }\n                        }\n                    });\n                    self.initInputElement(true);\n                    self.initInputElement(false);\n                }\n            };\n            //初始化输入框\n            HTMLInput.prototype.initInputElement = function (multiline) {\n                var self = this;\n                //增加1个空的textarea\n                var inputElement;\n                if (multiline) {\n                    inputElement = document.createElement(\"textarea\");\n                    inputElement.style[\"resize\"] = \"none\";\n                    self._multiElement = inputElement;\n                    inputElement.id = \"egretTextarea\";\n                }\n                else {\n                    inputElement = document.createElement(\"input\");\n                    self._simpleElement = inputElement;\n                    inputElement.id = \"egretInput\";\n                }\n                inputElement.type = \"text\";\n                self._inputDIV.appendChild(inputElement);\n                inputElement.setAttribute(\"tabindex\", \"-1\");\n                inputElement.style.width = \"1px\";\n                inputElement.style.height = \"12px\";\n                self.initValue(inputElement);\n                inputElement.style.outline = \"thin\";\n                inputElement.style.background = \"none\";\n                inputElement.style.overflow = \"hidden\";\n                inputElement.style.wordBreak = \"break-all\";\n                //隐藏输入框\n                inputElement.style.opacity = 0;\n                inputElement.oninput = function () {\n                    if (self._stageText) {\n                        self._stageText._onInput();\n                    }\n                };\n            };\n            /**\n             * @private\n             *\n             */\n            HTMLInput.prototype.show = function () {\n                var self = this;\n                var inputElement = self._inputElement;\n                //隐藏输入框\n                egret.$callAsync(function () {\n                    inputElement.style.opacity = 1;\n                }, self);\n            };\n            /**\n             * @private\n             *\n             * @param stageText\n             */\n            HTMLInput.prototype.disconnectStageText = function (stageText) {\n                if (this._stageText == null || this._stageText == stageText) {\n                    if (this._inputElement) {\n                        this._inputElement.blur();\n                    }\n                    this.clearInputElement();\n                }\n                this._needShow = false;\n            };\n            /**\n             * @private\n             *\n             */\n            HTMLInput.prototype.clearInputElement = function () {\n                var self = this;\n                if (self._inputElement) {\n                    self._inputElement.value = \"\";\n                    self._inputElement.onblur = null;\n                    self._inputElement.onfocus = null;\n                    self._inputElement.style.width = \"1px\";\n                    self._inputElement.style.height = \"12px\";\n                    self._inputElement.style.left = \"0px\";\n                    self._inputElement.style.top = \"0px\";\n                    self._inputElement.style.opacity = 0;\n                    var otherElement = void 0;\n                    if (self._simpleElement == self._inputElement) {\n                        otherElement = self._multiElement;\n                    }\n                    else {\n                        otherElement = self._simpleElement;\n                    }\n                    otherElement.style.display = \"block\";\n                    self._inputDIV.style.left = 0 + \"px\";\n                    self._inputDIV.style.top = \"-100px\";\n                    self._inputDIV.style.height = 0 + \"px\";\n                    self._inputDIV.style.width = 0 + \"px\";\n                }\n                if (self._stageText) {\n                    self._stageText._onDisconnect();\n                    self._stageText = null;\n                    this.canvas['userTyping'] = false;\n                }\n            };\n            /**\n             * @private\n             *\n             * @param stageText\n             * @returns\n             */\n            HTMLInput.prototype.getInputElement = function (stageText) {\n                var self = this;\n                self.clearInputElement();\n                self._stageText = stageText;\n                this.canvas['userTyping'] = true;\n                if (self._stageText.$textfield.multiline) {\n                    self._inputElement = self._multiElement;\n                }\n                else {\n                    self._inputElement = self._simpleElement;\n                }\n                var otherElement;\n                if (self._simpleElement == self._inputElement) {\n                    otherElement = self._multiElement;\n                }\n                else {\n                    otherElement = self._simpleElement;\n                }\n                otherElement.style.display = \"none\";\n                return self._inputElement;\n            };\n            return HTMLInput;\n        }());\n        web.HTMLInput = HTMLInput;\n        __reflect(HTMLInput.prototype, \"egret.web.HTMLInput\");\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n(function (egret) {\n    var web;\n    (function (web) {\n        var stageToTextLayerMap = {};\n        var stageToCanvasMap = {};\n        var stageToContainerMap = {};\n        /**\n         * @private\n         * 获取\n         */\n        function $getTextAdapter(textfield) {\n            var stageHash = textfield.stage ? textfield.stage.$hashCode : 0;\n            var adapter = stageToTextLayerMap[stageHash];\n            var canvas = stageToCanvasMap[stageHash];\n            var container = stageToContainerMap[stageHash];\n            if (canvas && container) {\n                //adapter._initStageDelegateDiv(container, canvas);\n                //adapter.$updateSize();\n                delete stageToCanvasMap[stageHash];\n                delete stageToContainerMap[stageHash];\n            }\n            return adapter;\n        }\n        web.$getTextAdapter = $getTextAdapter;\n        /**\n         * @private\n         */\n        function $cacheTextAdapter(adapter, stage, container, canvas) {\n            adapter._initStageDelegateDiv(container, canvas);\n            stageToTextLayerMap[stage.$hashCode] = adapter;\n            stageToCanvasMap[stage.$hashCode] = canvas;\n            stageToContainerMap[stage.$hashCode] = container;\n        }\n        web.$cacheTextAdapter = $cacheTextAdapter;\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var context = null;\n        /**\n         * @private\n         */\n        var fontCache = {};\n        /**\n         * 测量文本在指定样式下的宽度。\n         * @param text 要测量的文本内容。\n         * @param fontFamily 字体名称\n         * @param fontSize 字体大小\n         * @param bold 是否粗体\n         * @param italic 是否斜体\n         */\n        function measureText(text, fontFamily, fontSize, bold, italic) {\n            if (!context) {\n                createContext();\n            }\n            var font = \"\";\n            if (italic)\n                font += \"italic \";\n            if (bold)\n                font += \"bold \";\n            font += (fontSize || 12) + \"px \";\n            font += (fontFamily || \"Arial\");\n            context.font = font;\n            return egret.sys.measureTextWith(context, text);\n        }\n        /**\n         * @private\n         */\n        function createContext() {\n            context = egret.sys.canvasHitTestBuffer.context;\n            context.textAlign = \"left\";\n            context.textBaseline = \"middle\";\n        }\n        egret.sys.measureText = measureText;\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * 创建一个canvas。\n         */\n        function __createCanvas__(width, height) {\n            var canvas = egret.sys.createCanvas(width, height);\n            var context = canvas.getContext(\"2d\");\n            if (context[\"imageSmoothingEnabled\"] === undefined) {\n                var keys = [\"webkitImageSmoothingEnabled\", \"mozImageSmoothingEnabled\", \"msImageSmoothingEnabled\"];\n                var key_1;\n                for (var i = keys.length - 1; i >= 0; i--) {\n                    key_1 = keys[i];\n                    if (context[key_1] !== void 0) {\n                        break;\n                    }\n                }\n                try {\n                    Object.defineProperty(context, \"imageSmoothingEnabled\", {\n                        get: function () {\n                            return this[key_1];\n                        },\n                        set: function (value) {\n                            this[key_1] = value;\n                        }\n                    });\n                }\n                catch (e) {\n                    context[\"imageSmoothingEnabled\"] = context[key_1];\n                }\n            }\n            return canvas;\n        }\n        var sharedCanvas;\n        /**\n         * @private\n         * Canvas2D渲染缓冲\n         */\n        var CanvasRenderBuffer = (function () {\n            function CanvasRenderBuffer(width, height, root) {\n                this.surface = egret.sys.createCanvasRenderBufferSurface(__createCanvas__, width, height, root);\n                this.context = this.surface.getContext(\"2d\");\n                if (this.context) {\n                    this.context.$offsetX = 0;\n                    this.context.$offsetY = 0;\n                }\n                this.resize(width, height);\n            }\n            Object.defineProperty(CanvasRenderBuffer.prototype, \"width\", {\n                /**\n                 * 渲染缓冲的宽度，以像素为单位。\n                 * @readOnly\n                 */\n                get: function () {\n                    return this.surface.width;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(CanvasRenderBuffer.prototype, \"height\", {\n                /**\n                 * 渲染缓冲的高度，以像素为单位。\n                 * @readOnly\n                 */\n                get: function () {\n                    return this.surface.height;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            /**\n             * 改变渲染缓冲的大小并清空缓冲区\n             * @param width 改变后的宽\n             * @param height 改变后的高\n             * @param useMaxSize 若传入true，则将改变后的尺寸与已有尺寸对比，保留较大的尺寸。\n             */\n            CanvasRenderBuffer.prototype.resize = function (width, height, useMaxSize) {\n                egret.sys.resizeCanvasRenderBuffer(this, width, height, useMaxSize);\n            };\n            /**\n             * 获取指定区域的像素\n             */\n            CanvasRenderBuffer.prototype.getPixels = function (x, y, width, height) {\n                if (width === void 0) { width = 1; }\n                if (height === void 0) { height = 1; }\n                return this.context.getImageData(x, y, width, height).data;\n            };\n            /**\n             * 转换成base64字符串，如果图片（或者包含的图片）跨域，则返回null\n             * @param type 转换的类型，如: \"image/png\",\"image/jpeg\"\n             */\n            CanvasRenderBuffer.prototype.toDataURL = function (type, encoderOptions) {\n                return this.surface.toDataURL(type, encoderOptions);\n            };\n            /**\n             * 清空缓冲区数据\n             */\n            CanvasRenderBuffer.prototype.clear = function () {\n                this.context.setTransform(1, 0, 0, 1, 0, 0);\n                this.context.clearRect(0, 0, this.surface.width, this.surface.height);\n            };\n            /**\n             * 销毁绘制对象\n             */\n            CanvasRenderBuffer.prototype.destroy = function () {\n                this.surface.width = this.surface.height = 0;\n            };\n            return CanvasRenderBuffer;\n        }());\n        web.CanvasRenderBuffer = CanvasRenderBuffer;\n        __reflect(CanvasRenderBuffer.prototype, \"egret.web.CanvasRenderBuffer\", [\"egret.sys.RenderBuffer\"]);\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided this the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var WebTouchHandler = (function (_super) {\n            __extends(WebTouchHandler, _super);\n            /**\n             * @private\n             */\n            function WebTouchHandler(stage, canvas) {\n                var _this = _super.call(this) || this;\n                /**\n                 * @private\n                 */\n                _this.onTouchBegin = function (event) {\n                    var location = _this.getLocation(event);\n                    _this.touch.onTouchBegin(location.x, location.y, event.identifier);\n                };\n                _this.onMouseMove = function (event) {\n                    if (event.buttons == 0) {\n                        _this.onTouchEnd(event);\n                    }\n                    else {\n                        _this.onTouchMove(event);\n                    }\n                };\n                /**\n                 * @private\n                 */\n                _this.onTouchMove = function (event) {\n                    var location = _this.getLocation(event);\n                    _this.touch.onTouchMove(location.x, location.y, event.identifier);\n                };\n                /**\n                 * @private\n                 */\n                _this.onTouchEnd = function (event) {\n                    var location = _this.getLocation(event);\n                    _this.touch.onTouchEnd(location.x, location.y, event.identifier);\n                };\n                /**\n                 * @private\n                 */\n                _this.scaleX = 1;\n                /**\n                 * @private\n                 */\n                _this.scaleY = 1;\n                /**\n                 * @private\n                 */\n                _this.rotation = 0;\n                _this.canvas = canvas;\n                _this.touch = new egret.sys.TouchHandler(stage);\n                _this.addListeners();\n                return _this;\n            }\n            /**\n             * @private\n             * 添加事件监听\n             */\n            WebTouchHandler.prototype.addListeners = function () {\n                var _this = this;\n                if (window.navigator.msPointerEnabled) {\n                    this.canvas.addEventListener(\"MSPointerDown\", function (event) {\n                        event.identifier = event.pointerId;\n                        _this.onTouchBegin(event);\n                        _this.prevent(event);\n                    }, false);\n                    this.canvas.addEventListener(\"MSPointerMove\", function (event) {\n                        event.identifier = event.pointerId;\n                        _this.onTouchMove(event);\n                        _this.prevent(event);\n                    }, false);\n                    this.canvas.addEventListener(\"MSPointerUp\", function (event) {\n                        event.identifier = event.pointerId;\n                        _this.onTouchEnd(event);\n                        _this.prevent(event);\n                    }, false);\n                }\n                else {\n                    if (!egret.Capabilities.isMobile) {\n                        this.addMouseListener();\n                    }\n                    this.addTouchListener();\n                }\n            };\n            /**\n             * @private\n             *\n             */\n            WebTouchHandler.prototype.addMouseListener = function () {\n                this.canvas.addEventListener(\"mousedown\", this.onTouchBegin);\n                this.canvas.addEventListener(\"mousemove\", this.onMouseMove);\n                this.canvas.addEventListener(\"mouseup\", this.onTouchEnd);\n            };\n            /**\n             * @private\n             *\n             */\n            WebTouchHandler.prototype.addTouchListener = function () {\n                var _this = this;\n                this.canvas.addEventListener(\"touchstart\", function (event) {\n                    var l = event.changedTouches.length;\n                    for (var i = 0; i < l; i++) {\n                        _this.onTouchBegin(event.changedTouches[i]);\n                    }\n                    _this.prevent(event);\n                }, false);\n                this.canvas.addEventListener(\"touchmove\", function (event) {\n                    var l = event.changedTouches.length;\n                    for (var i = 0; i < l; i++) {\n                        _this.onTouchMove(event.changedTouches[i]);\n                    }\n                    _this.prevent(event);\n                }, false);\n                this.canvas.addEventListener(\"touchend\", function (event) {\n                    var l = event.changedTouches.length;\n                    for (var i = 0; i < l; i++) {\n                        _this.onTouchEnd(event.changedTouches[i]);\n                    }\n                    _this.prevent(event);\n                }, false);\n                this.canvas.addEventListener(\"touchcancel\", function (event) {\n                    var l = event.changedTouches.length;\n                    for (var i = 0; i < l; i++) {\n                        _this.onTouchEnd(event.changedTouches[i]);\n                    }\n                    _this.prevent(event);\n                }, false);\n            };\n            /**\n             * @private\n             */\n            WebTouchHandler.prototype.prevent = function (event) {\n                event.stopPropagation();\n                if (event[\"isScroll\"] != true && !this.canvas['userTyping']) {\n                    event.preventDefault();\n                }\n            };\n            /**\n             * @private\n             */\n            WebTouchHandler.prototype.getLocation = function (event) {\n                event.identifier = +event.identifier || 0;\n                var doc = document.documentElement;\n                var box = this.canvas.getBoundingClientRect();\n                var left = box.left + window.pageXOffset - doc.clientLeft;\n                var top = box.top + window.pageYOffset - doc.clientTop;\n                var x = event.pageX - left, newx = x;\n                var y = event.pageY - top, newy = y;\n                if (this.rotation == 90) {\n                    newx = y;\n                    newy = box.width - x;\n                }\n                else if (this.rotation == -90) {\n                    newx = box.height - y;\n                    newy = x;\n                }\n                newx = newx / this.scaleX;\n                newy = newy / this.scaleY;\n                return egret.$TempPoint.setTo(Math.round(newx), Math.round(newy));\n            };\n            /**\n             * @private\n             * 更新屏幕当前的缩放比例，用于计算准确的点击位置。\n             * @param scaleX 水平方向的缩放比例。\n             * @param scaleY 垂直方向的缩放比例。\n             */\n            WebTouchHandler.prototype.updateScaleMode = function (scaleX, scaleY, rotation) {\n                this.scaleX = scaleX;\n                this.scaleY = scaleY;\n                this.rotation = rotation;\n            };\n            /**\n             * @private\n             * 更新同时触摸点的数量\n             */\n            WebTouchHandler.prototype.$updateMaxTouches = function () {\n                this.touch.$initMaxTouches();\n            };\n            return WebTouchHandler;\n        }(egret.HashObject));\n        web.WebTouchHandler = WebTouchHandler;\n        __reflect(WebTouchHandler.prototype, \"egret.web.WebTouchHandler\");\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        web.WebLifeCycleHandler = function (context) {\n            var handleVisibilityChange = function () {\n                if (!document[hidden]) {\n                    context.resume();\n                }\n                else {\n                    context.pause();\n                }\n            };\n            window.addEventListener(\"focus\", context.resume, false);\n            window.addEventListener(\"blur\", context.pause, false);\n            var hidden, visibilityChange;\n            if (typeof document.hidden !== \"undefined\") {\n                hidden = \"hidden\";\n                visibilityChange = \"visibilitychange\";\n            }\n            else if (typeof document[\"mozHidden\"] !== \"undefined\") {\n                hidden = \"mozHidden\";\n                visibilityChange = \"mozvisibilitychange\";\n            }\n            else if (typeof document[\"msHidden\"] !== \"undefined\") {\n                hidden = \"msHidden\";\n                visibilityChange = \"msvisibilitychange\";\n            }\n            else if (typeof document[\"webkitHidden\"] !== \"undefined\") {\n                hidden = \"webkitHidden\";\n                visibilityChange = \"webkitvisibilitychange\";\n            }\n            else if (typeof document[\"oHidden\"] !== \"undefined\") {\n                hidden = \"oHidden\";\n                visibilityChange = \"ovisibilitychange\";\n            }\n            if (\"onpageshow\" in window && \"onpagehide\" in window) {\n                window.addEventListener(\"pageshow\", context.resume, false);\n                window.addEventListener(\"pagehide\", context.pause, false);\n            }\n            if (hidden && visibilityChange) {\n                document.addEventListener(visibilityChange, handleVisibilityChange, false);\n            }\n            var ua = navigator.userAgent;\n            var isWX = /micromessenger/gi.test(ua);\n            var isQQBrowser = /mqq/ig.test(ua);\n            var isQQ = /mobile.*qq/gi.test(ua);\n            if (isQQ || isWX) {\n                isQQBrowser = false;\n            }\n            if (isQQBrowser) {\n                var browser = window[\"browser\"] || {};\n                browser.execWebFn = browser.execWebFn || {};\n                browser.execWebFn.postX5GamePlayerMessage = function (event) {\n                    var eventType = event.type;\n                    if (eventType == \"app_enter_background\") {\n                        context.pause();\n                    }\n                    else if (eventType == \"app_enter_foreground\") {\n                        context.resume();\n                    }\n                };\n                window[\"browser\"] = browser;\n            }\n        };\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var AudioType = (function () {\n            function AudioType() {\n            }\n            /**\n             * @private\n             */\n            AudioType.WEB_AUDIO = 2;\n            /**\n             * @private\n             */\n            AudioType.HTML5_AUDIO = 3;\n            return AudioType;\n        }());\n        web.AudioType = AudioType;\n        __reflect(AudioType.prototype, \"egret.web.AudioType\");\n        /**\n         * html5兼容性配置\n         * @private\n         */\n        var Html5Capatibility = (function (_super) {\n            __extends(Html5Capatibility, _super);\n            /**\n             * @private\n             */\n            function Html5Capatibility() {\n                return _super.call(this) || this;\n            }\n            /**\n             * @private\n             *\n             */\n            Html5Capatibility.$init = function () {\n                var ua = navigator.userAgent.toLowerCase();\n                Html5Capatibility.ua = ua;\n                Html5Capatibility._canUseBlob = false;\n                var canUseWebAudio = window[\"AudioContext\"] || window[\"webkitAudioContext\"] || window[\"mozAudioContext\"];\n                var isIos = ua.indexOf(\"iphone\") >= 0 || ua.indexOf(\"ipad\") >= 0 || ua.indexOf(\"ipod\") >= 0;\n                if (canUseWebAudio) {\n                    try {\n                        //防止某些chrome版本创建异常问题\n                        web.WebAudioDecode.ctx = new (window[\"AudioContext\"] || window[\"webkitAudioContext\"] || window[\"mozAudioContext\"])();\n                    }\n                    catch (e) {\n                        canUseWebAudio = false;\n                    }\n                }\n                var audioType = Html5Capatibility._audioType;\n                var checkAudioType;\n                if ((audioType == AudioType.WEB_AUDIO && canUseWebAudio) || audioType == AudioType.HTML5_AUDIO) {\n                    checkAudioType = false;\n                    Html5Capatibility.setAudioType(audioType);\n                }\n                else if (!isIos && ua.indexOf(\"safari\") >= 0 && ua.indexOf(\"chrome\") === -1) {\n                    // In Safari browser on Mac,use web audio\n                    checkAudioType = false;\n                    Html5Capatibility.setAudioType(AudioType.WEB_AUDIO);\n                }\n                else {\n                    checkAudioType = true;\n                    Html5Capatibility.setAudioType(AudioType.HTML5_AUDIO);\n                }\n                if (ua.indexOf(\"android\") >= 0) {\n                    if (checkAudioType && canUseWebAudio) {\n                        Html5Capatibility.setAudioType(AudioType.WEB_AUDIO);\n                    }\n                }\n                else if (isIos) {\n                    if (Html5Capatibility.getIOSVersion() >= 7) {\n                        Html5Capatibility._canUseBlob = true;\n                        if (checkAudioType && canUseWebAudio) {\n                            Html5Capatibility.setAudioType(AudioType.WEB_AUDIO);\n                        }\n                    }\n                }\n                var winURL = window[\"URL\"] || window[\"webkitURL\"];\n                if (!winURL) {\n                    Html5Capatibility._canUseBlob = false;\n                }\n                if (ua.indexOf(\"egretnative\") >= 0) {\n                    Html5Capatibility.setAudioType(AudioType.HTML5_AUDIO);\n                    Html5Capatibility._canUseBlob = true;\n                }\n                egret.Sound = Html5Capatibility._AudioClass;\n            };\n            Html5Capatibility.setAudioType = function (type) {\n                Html5Capatibility._audioType = type;\n                switch (type) {\n                    case AudioType.WEB_AUDIO:\n                        Html5Capatibility._AudioClass = egret.web.WebAudioSound;\n                        break;\n                    case AudioType.HTML5_AUDIO:\n                        Html5Capatibility._AudioClass = egret.web.HtmlSound;\n                        break;\n                }\n            };\n            /**\n             * @private\n             * 获取ios版本\n             * @returns {string}\n             */\n            Html5Capatibility.getIOSVersion = function () {\n                var matches = Html5Capatibility.ua.toLowerCase().match(/cpu [^\\d]*\\d.*like mac os x/);\n                if (!matches || matches.length == 0) {\n                    return 0;\n                }\n                var value = matches[0];\n                return parseInt(value.match(/\\d+(_\\d)*/)[0]) || 0;\n            };\n            //当前浏览器版本是否支持blob\n            Html5Capatibility._canUseBlob = false;\n            //当前浏览器版本是否支持webaudio\n            Html5Capatibility._audioType = 0;\n            /**\n             * @private\n             */\n            Html5Capatibility.ua = \"\";\n            return Html5Capatibility;\n        }(egret.HashObject));\n        web.Html5Capatibility = Html5Capatibility;\n        __reflect(Html5Capatibility.prototype, \"egret.web.Html5Capatibility\");\n        /**\n         * @private\n         */\n        var currentPrefix = null;\n        /**\n         * @private\n         */\n        function getPrefixStyleName(name, element) {\n            var header = \"\";\n            if (element != null) {\n                header = getPrefix(name, element);\n            }\n            else {\n                if (currentPrefix == null) {\n                    var tempStyle = document.createElement('div').style;\n                    currentPrefix = getPrefix(\"transform\", tempStyle);\n                }\n                header = currentPrefix;\n            }\n            if (header == \"\") {\n                return name;\n            }\n            return header + name.charAt(0).toUpperCase() + name.substring(1, name.length);\n        }\n        web.getPrefixStyleName = getPrefixStyleName;\n        /**\n         * @private\n         */\n        function getPrefix(name, element) {\n            if (name in element) {\n                return \"\";\n            }\n            name = name.charAt(0).toUpperCase() + name.substring(1, name.length);\n            var transArr = [\"webkit\", \"ms\", \"Moz\", \"O\"];\n            for (var i = 0; i < transArr.length; i++) {\n                var tempStyle = transArr[i] + name;\n                if (tempStyle in element) {\n                    return transArr[i];\n                }\n            }\n            return \"\";\n        }\n        web.getPrefix = getPrefix;\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * 创建一个canvas。\n         */\n        function mainCanvas(width, height) {\n            return createCanvas(width, height);\n        }\n        egret.sys.mainCanvas = mainCanvas;\n        function createCanvas(width, height) {\n            var canvas = document.createElement(\"canvas\");\n            if (!isNaN(width) && !isNaN(height)) {\n                canvas.width = width;\n                canvas.height = height;\n            }\n            return canvas;\n        }\n        egret.sys.createCanvas = createCanvas;\n        /**\n         * sys.resizeContext。\n         */\n        function resizeContext(renderContext, width, height, useMaxSize) {\n            if (!renderContext) {\n                return;\n            }\n            var webglrendercontext = renderContext;\n            var surface = webglrendercontext.surface;\n            if (useMaxSize) {\n                if (surface.width < width) {\n                    surface.width = width;\n                }\n                if (surface.height < height) {\n                    surface.height = height;\n                }\n            }\n            else {\n                if (surface.width !== width) {\n                    surface.width = width;\n                }\n                if (surface.height !== height) {\n                    surface.height = height;\n                }\n            }\n            webglrendercontext.onResize();\n        }\n        web.resizeContext = resizeContext;\n        egret.sys.resizeContext = resizeContext;\n        /**\n         * sys.getContextWebGL\n         */\n        function getContextWebGL(surface) {\n            var options = {\n                antialias: web.WebGLRenderContext.antialias,\n                stencil: true //设置可以使用模板（用于不规则遮罩）\n            };\n            var gl = null;\n            //todo 是否使用chrome源码names\n            //let contextNames = [\"moz-webgl\", \"webkit-3d\", \"experimental-webgl\", \"webgl\", \"3d\"];\n            var names = [\"webgl\", \"experimental-webgl\"];\n            for (var i = 0; i < names.length; ++i) {\n                try {\n                    gl = surface.getContext(names[i], options);\n                }\n                catch (e) {\n                }\n                if (gl) {\n                    break;\n                }\n            }\n            if (!gl) {\n                egret.$error(1021);\n            }\n            return gl;\n        }\n        egret.sys.getContextWebGL = getContextWebGL;\n        /**\n         * sys.getContext2d\n         */\n        function getContext2d(surface) {\n            return surface ? surface.getContext('2d') : null;\n        }\n        web.getContext2d = getContext2d;\n        egret.sys.getContext2d = getContext2d;\n        /**\n         * 创建一个WebGLTexture\n         */\n        function createTexture(renderContext, bitmapData) {\n            var webglrendercontext = renderContext;\n            var gl = webglrendercontext.context;\n            var texture = gl.createTexture();\n            if (!texture) {\n                //先创建texture失败,然后lost事件才发出来..\n                webglrendercontext.contextLost = true;\n                return;\n            }\n            texture[egret.glContext] = gl;\n            gl.bindTexture(gl.TEXTURE_2D, texture);\n            gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);\n            texture[egret.UNPACK_PREMULTIPLY_ALPHA_WEBGL] = true;\n            gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, bitmapData);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n            return texture;\n        }\n        egret.sys.createTexture = createTexture;\n        /**\n         * 创建一个WebGLTexture\n         */\n        function _createTexture(renderContext, width, height, data) {\n            var webglrendercontext = renderContext;\n            var gl = webglrendercontext.context;\n            var texture = gl.createTexture();\n            if (!texture) {\n                //先创建texture失败,然后lost事件才发出来..\n                webglrendercontext.contextLost = true;\n                return null;\n            }\n            //\n            texture[egret.glContext] = gl;\n            gl.bindTexture(gl.TEXTURE_2D, texture);\n            gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);\n            texture[egret.UNPACK_PREMULTIPLY_ALPHA_WEBGL] = true;\n            gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, width, height, 0, gl.RGBA, gl.UNSIGNED_BYTE, data);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n            return texture;\n        }\n        egret.sys._createTexture = _createTexture;\n        /**\n         * 画texture\n         **/\n        function drawTextureElements(renderContext, data, offset) {\n            var webglrendercontext = renderContext;\n            var gl = webglrendercontext.context;\n            gl.activeTexture(gl.TEXTURE0);\n            gl.bindTexture(gl.TEXTURE_2D, data.texture);\n            var size = data.count * 3;\n            gl.drawElements(gl.TRIANGLES, size, gl.UNSIGNED_SHORT, offset * 2);\n            return size;\n        }\n        egret.sys.drawTextureElements = drawTextureElements;\n        /**\n         * 测量文本的宽度\n         * @param context\n         * @param text\n         */\n        function measureTextWith(context, text) {\n            return context.measureText(text).width;\n        }\n        egret.sys.measureTextWith = measureTextWith;\n        /**\n         * 为CanvasRenderBuffer创建一个HTMLCanvasElement\n         * @param defaultFunc\n         * @param width\n         * @param height\n         * @param root\n         */\n        function createCanvasRenderBufferSurface(defaultFunc, width, height, root) {\n            return defaultFunc(width, height);\n        }\n        egret.sys.createCanvasRenderBufferSurface = createCanvasRenderBufferSurface;\n        /**\n         * 改变渲染缓冲的大小并清空缓冲区\n         * @param renderContext\n         * @param width\n         * @param height\n         * @param useMaxSize\n         */\n        function resizeCanvasRenderBuffer(renderContext, width, height, useMaxSize) {\n            var canvasRenderBuffer = renderContext;\n            var surface = canvasRenderBuffer.surface;\n            if (useMaxSize) {\n                var change = false;\n                if (surface.width < width) {\n                    surface.width = width;\n                    change = true;\n                }\n                if (surface.height < height) {\n                    surface.height = height;\n                    change = true;\n                }\n                //尺寸没有变化时,将绘制属性重置\n                if (!change) {\n                    canvasRenderBuffer.context.globalCompositeOperation = \"source-over\";\n                    canvasRenderBuffer.context.setTransform(1, 0, 0, 1, 0, 0);\n                    canvasRenderBuffer.context.globalAlpha = 1;\n                }\n            }\n            else {\n                if (surface.width != width) {\n                    surface.width = width;\n                }\n                if (surface.height != height) {\n                    surface.height = height;\n                }\n            }\n            canvasRenderBuffer.clear();\n        }\n        egret.sys.resizeCanvasRenderBuffer = resizeCanvasRenderBuffer;\n        egret.Geolocation = egret.web.WebGeolocation;\n        egret.Motion = egret.web.WebMotion;\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         * 刷新所有Egret播放器的显示区域尺寸。仅当使用外部JavaScript代码动态修改了Egret容器大小时，需要手动调用此方法刷新显示区域。\n         * 当网页尺寸发生改变时此方法会自动被调用。\n         */\n        function updateAllScreens() {\n            if (!isRunning) {\n                return;\n            }\n            var containerList = document.querySelectorAll(\".egret-player\");\n            var length = containerList.length;\n            for (var i = 0; i < length; i++) {\n                var container = containerList[i];\n                var player = container[\"egret-player\"];\n                player.updateScreenSize();\n            }\n        }\n        var isRunning = false;\n        /**\n         * @private\n         * 网页加载完成，实例化页面中定义的Egret标签\n         */\n        function runEgret(options) {\n            if (isRunning) {\n                return;\n            }\n            isRunning = true;\n            if (!options) {\n                options = {};\n            }\n            var ua = navigator.userAgent.toLowerCase();\n            if (ua.indexOf(\"egretnative\") >= 0 && ua.indexOf(\"egretwebview\") == -1) {\n                egret.Capabilities[\"runtimeType\" + \"\"] = egret.RuntimeType.RUNTIME2;\n            }\n            if (ua.indexOf(\"egretnative\") >= 0 && egret.nativeRender) {\n                egret_native.addModuleCallback(function () {\n                    web.Html5Capatibility.$init();\n                    // WebGL上下文参数自定义\n                    if (options.renderMode == \"webgl\") {\n                        // WebGL抗锯齿默认关闭，提升PC及某些平台性能\n                        var antialias = options.antialias;\n                        web.WebGLRenderContext.antialias = !!antialias;\n                    }\n                    egret.sys.CanvasRenderBuffer = web.CanvasRenderBuffer;\n                    setRenderMode(options.renderMode);\n                    egret_native.nrSetRenderMode(2);\n                    var canvasScaleFactor;\n                    if (options.canvasScaleFactor) {\n                        canvasScaleFactor = options.canvasScaleFactor;\n                    }\n                    else if (options.calculateCanvasScaleFactor) {\n                        canvasScaleFactor = options.calculateCanvasScaleFactor(egret.sys.canvasHitTestBuffer.context);\n                    }\n                    else {\n                        canvasScaleFactor = window.devicePixelRatio;\n                    }\n                    egret.sys.DisplayList.$canvasScaleFactor = canvasScaleFactor;\n                    var ticker = egret.ticker;\n                    startTicker(ticker);\n                    if (options.screenAdapter) {\n                        egret.sys.screenAdapter = options.screenAdapter;\n                    }\n                    else if (!egret.sys.screenAdapter) {\n                        egret.sys.screenAdapter = new egret.sys.DefaultScreenAdapter();\n                    }\n                    var list = document.querySelectorAll(\".egret-player\");\n                    var length = list.length;\n                    for (var i = 0; i < length; i++) {\n                        var container = list[i];\n                        var player = new web.WebPlayer(container, options);\n                        container[\"egret-player\"] = player;\n                    }\n                    window.addEventListener(\"resize\", function () {\n                        if (isNaN(resizeTimer)) {\n                            resizeTimer = window.setTimeout(doResize, 300);\n                        }\n                    });\n                }, null);\n                egret_native.initNativeRender();\n            }\n            else {\n                web.Html5Capatibility._audioType = options.audioType;\n                web.Html5Capatibility.$init();\n                var renderMode = options.renderMode;\n                // WebGL上下文参数自定义\n                if (renderMode == \"webgl\") {\n                    // WebGL抗锯齿默认关闭，提升PC及某些平台性能\n                    var antialias = options.antialias;\n                    web.WebGLRenderContext.antialias = !!antialias;\n                    // WebGLRenderContext.antialias = (typeof antialias == undefined) ? true : antialias;\n                }\n                egret.sys.CanvasRenderBuffer = web.CanvasRenderBuffer;\n                if (ua.indexOf(\"egretnative\") >= 0 && renderMode != \"webgl\") {\n                    egret.$warn(1051);\n                    renderMode = \"webgl\";\n                }\n                setRenderMode(renderMode);\n                var canvasScaleFactor = void 0;\n                if (options.canvasScaleFactor) {\n                    canvasScaleFactor = options.canvasScaleFactor;\n                }\n                else if (options.calculateCanvasScaleFactor) {\n                    canvasScaleFactor = options.calculateCanvasScaleFactor(egret.sys.canvasHitTestBuffer.context);\n                }\n                else {\n                    //based on : https://github.com/jondavidjohn/hidpi-canvas-polyfill\n                    var context = egret.sys.canvasHitTestBuffer.context;\n                    var backingStore = context.backingStorePixelRatio ||\n                        context.webkitBackingStorePixelRatio ||\n                        context.mozBackingStorePixelRatio ||\n                        context.msBackingStorePixelRatio ||\n                        context.oBackingStorePixelRatio ||\n                        context.backingStorePixelRatio || 1;\n                    canvasScaleFactor = (window.devicePixelRatio || 1) / backingStore;\n                }\n                egret.sys.DisplayList.$canvasScaleFactor = canvasScaleFactor;\n                var ticker_1 = egret.ticker;\n                startTicker(ticker_1);\n                if (options.screenAdapter) {\n                    egret.sys.screenAdapter = options.screenAdapter;\n                }\n                else if (!egret.sys.screenAdapter) {\n                    egret.sys.screenAdapter = new egret.sys.DefaultScreenAdapter();\n                }\n                var list = document.querySelectorAll(\".egret-player\");\n                var length_2 = list.length;\n                for (var i = 0; i < length_2; i++) {\n                    var container = list[i];\n                    var player = new web.WebPlayer(container, options);\n                    container[\"egret-player\"] = player;\n                }\n                window.addEventListener(\"resize\", function () {\n                    if (isNaN(resizeTimer)) {\n                        resizeTimer = window.setTimeout(doResize, 300);\n                    }\n                });\n            }\n        }\n        /**\n         * 设置渲染模式。\"auto\",\"webgl\",\"canvas\"\n         * @param renderMode\n         */\n        function setRenderMode(renderMode) {\n            if (renderMode == \"webgl\" && egret.WebGLUtils.checkCanUseWebGL()) {\n                egret.sys.RenderBuffer = web.WebGLRenderBuffer;\n                egret.sys.systemRenderer = new web.WebGLRenderer();\n                egret.sys.canvasRenderer = new egret.CanvasRenderer();\n                egret.sys.customHitTestBuffer = new web.WebGLRenderBuffer(3, 3);\n                egret.sys.canvasHitTestBuffer = new web.CanvasRenderBuffer(3, 3);\n                egret.Capabilities[\"renderMode\" + \"\"] = \"webgl\";\n            }\n            else {\n                egret.sys.RenderBuffer = web.CanvasRenderBuffer;\n                egret.sys.systemRenderer = new egret.CanvasRenderer();\n                egret.sys.canvasRenderer = egret.sys.systemRenderer;\n                egret.sys.customHitTestBuffer = new web.CanvasRenderBuffer(3, 3);\n                egret.sys.canvasHitTestBuffer = egret.sys.customHitTestBuffer;\n                egret.Capabilities[\"renderMode\" + \"\"] = \"canvas\";\n            }\n        }\n        /**\n         * @private\n         * 启动心跳计时器。\n         */\n        function startTicker(ticker) {\n            var requestAnimationFrame = window[\"requestAnimationFrame\"] ||\n                window[\"webkitRequestAnimationFrame\"] ||\n                window[\"mozRequestAnimationFrame\"] ||\n                window[\"oRequestAnimationFrame\"] ||\n                window[\"msRequestAnimationFrame\"];\n            if (!requestAnimationFrame) {\n                requestAnimationFrame = function (callback) {\n                    return window.setTimeout(callback, 1000 / 60);\n                };\n            }\n            requestAnimationFrame(onTick);\n            function onTick() {\n                requestAnimationFrame(onTick);\n                ticker.update();\n            }\n        }\n        //覆盖原生的isNaN()方法实现，在不同浏览器上有2~10倍性能提升。\n        window[\"isNaN\"] = function (value) {\n            value = +value;\n            return value !== value;\n        };\n        egret.runEgret = runEgret;\n        egret.updateAllScreens = updateAllScreens;\n        var resizeTimer = NaN;\n        function doResize() {\n            resizeTimer = NaN;\n            egret.updateAllScreens();\n        }\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\nif (true) {\n    var language = navigator.language || navigator[\"browserLanguage\"] || \"en_US\";\n    language = language.replace(\"-\", \"_\");\n    if (language in egret.$locale_strings)\n        egret.$language = language;\n}\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var WebCapability = (function () {\n            function WebCapability() {\n            }\n            /**\n             * @private\n             * 检测系统属性\n             */\n            WebCapability.detect = function () {\n                var capabilities = egret.Capabilities;\n                var ua = navigator.userAgent.toLowerCase();\n                capabilities[\"isMobile\" + \"\"] = (ua.indexOf('mobile') != -1 || ua.indexOf('android') != -1);\n                if (capabilities.isMobile) {\n                    if (ua.indexOf(\"windows\") < 0 && (ua.indexOf(\"iphone\") != -1 || ua.indexOf(\"ipad\") != -1 || ua.indexOf(\"ipod\") != -1)) {\n                        capabilities[\"os\" + \"\"] = \"iOS\";\n                    }\n                    else if (ua.indexOf(\"android\") != -1 && ua.indexOf(\"linux\") != -1) {\n                        capabilities[\"os\" + \"\"] = \"Android\";\n                    }\n                    else if (ua.indexOf(\"windows\") != -1) {\n                        capabilities[\"os\" + \"\"] = \"Windows Phone\";\n                    }\n                }\n                else {\n                    if (ua.indexOf(\"windows nt\") != -1) {\n                        capabilities[\"os\" + \"\"] = \"Windows PC\";\n                    }\n                    else if (navigator.platform == \"MacIntel\" && navigator.maxTouchPoints > 1) {\n                        capabilities[\"os\" + \"\"] = \"iOS\";\n                        capabilities[\"isMobile\" + \"\"] = true;\n                    }\n                    else if (ua.indexOf(\"mac os\") != -1) {\n                        capabilities[\"os\" + \"\"] = \"Mac OS\";\n                    }\n                }\n                var language = (navigator.language || navigator[\"browserLanguage\"]).toLowerCase();\n                var strings = language.split(\"-\");\n                if (strings.length > 1) {\n                    strings[1] = strings[1].toUpperCase();\n                }\n                capabilities[\"language\" + \"\"] = strings.join(\"-\");\n                WebCapability.injectUIntFixOnIE9();\n            };\n            WebCapability.injectUIntFixOnIE9 = function () {\n                if (/msie 9.0/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent)) {\n                    var IEBinaryToArray_ByteStr_Script = \"<!-- IEBinaryToArray_ByteStr -->\\r\\n\" +\n                        \"<script type='text/vbscript' language='VBScript'>\\r\\n\" +\n                        \"Function IEBinaryToArray_ByteStr(Binary)\\r\\n\" +\n                        \"   IEBinaryToArray_ByteStr = CStr(Binary)\\r\\n\" +\n                        \"End Function\\r\\n\" +\n                        \"Function IEBinaryToArray_ByteStr_Last(Binary)\\r\\n\" +\n                        \"   Dim lastIndex\\r\\n\" +\n                        \"   lastIndex = LenB(Binary)\\r\\n\" +\n                        \"   if lastIndex mod 2 Then\\r\\n\" +\n                        \"       IEBinaryToArray_ByteStr_Last = Chr( AscB( MidB( Binary, lastIndex, 1 ) ) )\\r\\n\" +\n                        \"   Else\\r\\n\" +\n                        \"       IEBinaryToArray_ByteStr_Last = \" + '\"\"' + \"\\r\\n\" +\n                        \"   End If\\r\\n\" +\n                        \"End Function\\r\\n\" + \"<\\/script>\\r\\n\" +\n                        \"<!-- convertResponseBodyToText -->\\r\\n\" +\n                        \"<script>\\r\\n\" +\n                        \"let convertResponseBodyToText = function (binary) {\\r\\n\" +\n                        \"   let byteMapping = {};\\r\\n\" +\n                        \"   for ( let i = 0; i < 256; i++ ) {\\r\\n\" +\n                        \"       for ( let j = 0; j < 256; j++ ) {\\r\\n\" +\n                        \"           byteMapping[ String.fromCharCode( i + j * 256 ) ] =\\r\\n\" +\n                        \"           String.fromCharCode(i) + String.fromCharCode(j);\\r\\n\" +\n                        \"       }\\r\\n\" +\n                        \"   }\\r\\n\" +\n                        \"   let rawBytes = IEBinaryToArray_ByteStr(binary);\\r\\n\" +\n                        \"   let lastChr = IEBinaryToArray_ByteStr_Last(binary);\\r\\n\" +\n                        \"   return rawBytes.replace(/[\\\\s\\\\S]/g,\" +\n                        \"                           function( match ) { return byteMapping[match]; }) + lastChr;\\r\\n\" +\n                        \"};\\r\\n\" +\n                        \"<\\/script>\\r\\n\";\n                    document.write(IEBinaryToArray_ByteStr_Script);\n                }\n            };\n            return WebCapability;\n        }());\n        web.WebCapability = WebCapability;\n        __reflect(WebCapability.prototype, \"egret.web.WebCapability\");\n        WebCapability.detect();\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var WebFps = (function () {\n            function WebFps(stage, showFPS, showLog, logFilter, styles) {\n                this.showPanle = true;\n                this.fpsHeight = 0;\n                this.WIDTH = 101;\n                this.HEIGHT = 20;\n                this.bgCanvasColor = \"#18304b\";\n                this.fpsFrontColor = \"#18fefe\";\n                this.WIDTH_COST = 50;\n                this.cost1Color = \"#18fefe\";\n                // private cost2Color = \"#ffff00\";\n                this.cost3Color = \"#ff0000\";\n                this.arrFps = [];\n                this.arrCost = [];\n                this.arrLog = [];\n                if (showFPS || showLog) {\n                    if (egret.Capabilities.renderMode == 'canvas') {\n                        this.renderMode = \"Canvas\";\n                    }\n                    else {\n                        this.renderMode = \"WebGL\";\n                    }\n                    this.panelX = styles[\"x\"] === undefined ? 0 : parseInt(styles['x']);\n                    this.panelY = styles[\"y\"] === undefined ? 0 : parseInt(styles['y']);\n                    this.fontColor = styles[\"textColor\"] === undefined ? '#ffffff' : styles['textColor'].replace(\"0x\", \"#\");\n                    this.fontSize = styles[\"size\"] === undefined ? 12 : parseInt(styles['size']);\n                    if (egret.Capabilities.isMobile) {\n                        this.fontSize -= 2;\n                    }\n                    var all = document.createElement('div');\n                    all.style.position = 'absolute';\n                    all.style.background = \"rgba(0,0,0,\" + styles['bgAlpha'] + \")\";\n                    all.style.left = this.panelX + 'px';\n                    all.style.top = this.panelY + 'px';\n                    all.style.pointerEvents = 'none';\n                    all.id = 'egret-fps-panel';\n                    document.body.appendChild(all);\n                    var container = document.createElement('div');\n                    container.style.color = this.fontColor;\n                    container.style.fontSize = this.fontSize + 'px';\n                    container.style.lineHeight = this.fontSize + 'px';\n                    container.style.margin = '4px 4px 4px 4px';\n                    this.container = container;\n                    all.appendChild(container);\n                    if (showFPS)\n                        this.addFps();\n                    if (showLog)\n                        this.addLog();\n                }\n            }\n            WebFps.prototype.addFps = function () {\n                var div = document.createElement('div');\n                div.style.display = 'inline-block';\n                this.containerFps = div;\n                this.container.appendChild(div);\n                var fps = document.createElement('div');\n                fps.style.paddingBottom = '2px';\n                this.fps = fps;\n                this.containerFps.appendChild(fps);\n                fps.innerHTML = \"0 FPS \" + this.renderMode + \"<br/>min0 max0 avg0\";\n                var canvas = document.createElement('canvas');\n                this.containerFps.appendChild(canvas);\n                canvas.width = this.WIDTH;\n                canvas.height = this.HEIGHT;\n                this.canvasFps = canvas;\n                var context = canvas.getContext('2d');\n                this.contextFps = context;\n                context.fillStyle = this.bgCanvasColor;\n                context.fillRect(0, 0, this.WIDTH, this.HEIGHT);\n                var divDatas = document.createElement('div');\n                this.divDatas = divDatas;\n                this.containerFps.appendChild(divDatas);\n                var left = document.createElement('div');\n                left.style['float'] = 'left';\n                left.innerHTML = \"Draw<br/>Cost\";\n                divDatas.appendChild(left);\n                var right = document.createElement('div');\n                right.style.paddingLeft = left.offsetWidth + 20 + \"px\";\n                divDatas.appendChild(right);\n                var draw = document.createElement('div');\n                this.divDraw = draw;\n                draw.innerHTML = \"0<br/>\";\n                right.appendChild(draw);\n                var cost = document.createElement('div');\n                this.divCost = cost;\n                cost.innerHTML = \"<font  style=\\\"color:\" + this.cost1Color + \"\\\">0<font/> <font  style=\\\"color:\" + this.cost3Color + \"\\\">0<font/>\";\n                right.appendChild(cost);\n                canvas = document.createElement('canvas');\n                this.canvasCost = canvas;\n                this.containerFps.appendChild(canvas);\n                canvas.width = this.WIDTH;\n                canvas.height = this.HEIGHT;\n                context = canvas.getContext('2d');\n                this.contextCost = context;\n                context.fillStyle = this.bgCanvasColor;\n                context.fillRect(0, 0, this.WIDTH, this.HEIGHT);\n                context.fillStyle = \"#000000\";\n                context.fillRect(this.WIDTH_COST, 0, 1, this.HEIGHT);\n                this.fpsHeight = this.container.offsetHeight;\n            };\n            WebFps.prototype.addLog = function () {\n                var log = document.createElement('div');\n                log.style.maxWidth = document.body.clientWidth - 8 - this.panelX + 'px';\n                log.style.wordWrap = \"break-word\";\n                this.log = log;\n                this.container.appendChild(log);\n            };\n            WebFps.prototype.update = function (datas, showLastData) {\n                if (showLastData === void 0) { showLastData = false; }\n                var numFps;\n                var numCostTicker;\n                var numCostRender;\n                if (!showLastData) {\n                    numFps = datas.fps;\n                    numCostTicker = datas.costTicker;\n                    numCostRender = datas.costRender;\n                    this.lastNumDraw = datas.draw;\n                    this.arrFps.push(numFps);\n                    this.arrCost.push([numCostTicker, numCostRender]);\n                }\n                else {\n                    numFps = this.arrFps[this.arrFps.length - 1];\n                    numCostTicker = this.arrCost[this.arrCost.length - 1][0];\n                    numCostRender = this.arrCost[this.arrCost.length - 1][1];\n                }\n                var fpsTotal = 0;\n                var lenFps = this.arrFps.length;\n                if (lenFps > 101) {\n                    lenFps = 101;\n                    this.arrFps.shift();\n                    this.arrCost.shift();\n                }\n                var fpsMin = this.arrFps[0];\n                var fpsMax = this.arrFps[0];\n                for (var i = 0; i < lenFps; i++) {\n                    var num = this.arrFps[i];\n                    fpsTotal += num;\n                    if (num < fpsMin)\n                        fpsMin = num;\n                    else if (num > fpsMax)\n                        fpsMax = num;\n                }\n                var WIDTH = this.WIDTH;\n                var HEIGHT = this.HEIGHT;\n                var context = this.contextFps;\n                context.drawImage(this.canvasFps, 1, 0, WIDTH - 1, HEIGHT, 0, 0, WIDTH - 1, HEIGHT);\n                context.fillStyle = this.bgCanvasColor;\n                context.fillRect(WIDTH - 1, 0, 1, HEIGHT);\n                var lastHeight = Math.floor(numFps / 60 * 20);\n                if (lastHeight < 1)\n                    lastHeight = 1;\n                context.fillStyle = this.fpsFrontColor;\n                context.fillRect(WIDTH - 1, 20 - lastHeight, 1, lastHeight);\n                var WIDTH_COST = this.WIDTH_COST;\n                context = this.contextCost;\n                context.drawImage(this.canvasCost, 1, 0, WIDTH_COST - 1, HEIGHT, 0, 0, WIDTH_COST - 1, HEIGHT);\n                context.drawImage(this.canvasCost, WIDTH_COST + 2, 0, WIDTH_COST - 1, HEIGHT, WIDTH_COST + 1, 0, WIDTH_COST - 1, HEIGHT);\n                var c1Height = Math.floor(numCostTicker / 2);\n                if (c1Height < 1)\n                    c1Height = 1;\n                else if (c1Height > 20)\n                    c1Height = 20;\n                //todo lcj\n                var c2Height = Math.floor(numCostRender / 2);\n                if (c2Height < 1)\n                    c2Height = 1;\n                else if (c2Height > 20)\n                    c2Height = 20;\n                context.fillStyle = this.bgCanvasColor;\n                context.fillRect(WIDTH_COST - 1, 0, 1, HEIGHT);\n                context.fillRect(WIDTH_COST * 2, 0, 1, HEIGHT);\n                context.fillRect(WIDTH_COST * 3 + 1, 0, 1, HEIGHT);\n                context.fillStyle = this.cost1Color;\n                context.fillRect(WIDTH_COST - 1, 20 - c1Height, 1, c1Height);\n                context.fillStyle = this.cost3Color;\n                context.fillRect(WIDTH_COST * 2, 20 - c2Height, 1, c2Height);\n                var fpsAvg = Math.floor(fpsTotal / lenFps);\n                var fpsOutput = numFps + \" FPS \" + this.renderMode;\n                if (this.showPanle) {\n                    fpsOutput += \"<br/>min\" + fpsMin + \" max\" + fpsMax + \" avg\" + fpsAvg;\n                    this.divDraw.innerHTML = this.lastNumDraw + \"<br/>\";\n                    this.divCost.innerHTML = \"<font  style=\\\"color:#18fefe\\\">\" + numCostTicker + \"<font/> <font  style=\\\"color:#ff0000\\\">\" + numCostRender + \"<font/>\";\n                }\n                this.fps.innerHTML = fpsOutput;\n            };\n            ;\n            WebFps.prototype.updateInfo = function (info) {\n                this.arrLog.push(info);\n                this.updateLogLayout();\n            };\n            WebFps.prototype.updateWarn = function (info) {\n                this.arrLog.push(\"[Warning]\" + info);\n                this.updateLogLayout();\n            };\n            WebFps.prototype.updateError = function (info) {\n                this.arrLog.push(\"[Error]\" + info);\n                this.updateLogLayout();\n            };\n            WebFps.prototype.updateLogLayout = function () {\n                this.log.innerHTML = this.arrLog.join('<br/>');\n                while (document.body.clientHeight < (this.log.offsetHeight + this.fpsHeight + this.panelY + this.fontSize * 2)) {\n                    this.arrLog.shift();\n                    this.log.innerHTML = this.arrLog.join('<br/>');\n                }\n            };\n            return WebFps;\n        }());\n        web.WebFps = WebFps;\n        __reflect(WebFps.prototype, \"egret.web.WebFps\", [\"egret.FPSDisplay\"]);\n        egret.FPSDisplay = WebFps;\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var localStorage;\n    (function (localStorage) {\n        var web;\n        (function (web) {\n            /**\n             * @private\n             *\n             * @param key\n             * @returns\n             */\n            function getItem(key) {\n                return window.localStorage.getItem(key);\n            }\n            /**\n             * @private\n             *\n             * @param key\n             * @param value\n             * @returns\n             */\n            function setItem(key, value) {\n                try {\n                    window.localStorage.setItem(key, value);\n                    return true;\n                }\n                catch (e) {\n                    egret.$warn(1047, key, value);\n                    return false;\n                }\n            }\n            /**\n             * @private\n             *\n             * @param key\n             */\n            function removeItem(key) {\n                window.localStorage.removeItem(key);\n            }\n            /**\n             * @private\n             *\n             */\n            function clear() {\n                window.localStorage.clear();\n            }\n            localStorage.getItem = getItem;\n            localStorage.setItem = setItem;\n            localStorage.removeItem = removeItem;\n            localStorage.clear = clear;\n        })(web = localStorage.web || (localStorage.web = {}));\n    })(localStorage = egret.localStorage || (egret.localStorage = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var WebPlayer = (function (_super) {\n            __extends(WebPlayer, _super);\n            function WebPlayer(container, options) {\n                var _this = _super.call(this) || this;\n                _this.init(container, options);\n                _this.initOrientation();\n                return _this;\n            }\n            WebPlayer.prototype.init = function (container, options) {\n                console.log(\"Egret Engine Version:\", egret.Capabilities.engineVersion);\n                var option = this.readOption(container, options);\n                var stage = new egret.Stage();\n                stage.$screen = this;\n                stage.$scaleMode = option.scaleMode;\n                stage.$orientation = option.orientation;\n                stage.$maxTouches = option.maxTouches;\n                stage.frameRate = option.frameRate;\n                stage.textureScaleFactor = option.textureScaleFactor;\n                var buffer = new egret.sys.RenderBuffer(undefined, undefined, true);\n                var canvas = buffer.surface;\n                this.attachCanvas(container, canvas);\n                var webTouch = new web.WebTouchHandler(stage, canvas);\n                var player = new egret.sys.Player(buffer, stage, option.entryClassName);\n                egret.lifecycle.stage = stage;\n                egret.lifecycle.addLifecycleListener(web.WebLifeCycleHandler);\n                var webInput = new web.HTMLInput();\n                if (option.showFPS || option.showLog) {\n                    if (!egret.nativeRender) {\n                        player.displayFPS(option.showFPS, option.showLog, option.logFilter, option.fpsStyles);\n                    }\n                }\n                this.playerOption = option;\n                this.container = container;\n                this.canvas = canvas;\n                this.stage = stage;\n                this.player = player;\n                this.webTouchHandler = webTouch;\n                this.webInput = webInput;\n                egret.web.$cacheTextAdapter(webInput, stage, container, canvas);\n                this.updateScreenSize();\n                this.updateMaxTouches();\n                player.start();\n            };\n            WebPlayer.prototype.initOrientation = function () {\n                var self = this;\n                window.addEventListener(\"orientationchange\", function () {\n                    window.setTimeout(function () {\n                        egret.StageOrientationEvent.dispatchStageOrientationEvent(self.stage, egret.StageOrientationEvent.ORIENTATION_CHANGE);\n                    }, 350);\n                });\n            };\n            /**\n             * 读取初始化参数\n             */\n            WebPlayer.prototype.readOption = function (container, options) {\n                var option = {};\n                option.entryClassName = container.getAttribute(\"data-entry-class\");\n                option.scaleMode = container.getAttribute(\"data-scale-mode\") || egret.StageScaleMode.NO_SCALE;\n                option.frameRate = +container.getAttribute(\"data-frame-rate\") || 30;\n                option.contentWidth = +container.getAttribute(\"data-content-width\") || 480;\n                option.contentHeight = +container.getAttribute(\"data-content-height\") || 800;\n                option.orientation = container.getAttribute(\"data-orientation\") || egret.OrientationMode.AUTO;\n                option.maxTouches = +container.getAttribute(\"data-multi-fingered\") || 2;\n                option.textureScaleFactor = +container.getAttribute(\"texture-scale-factor\") || 1;\n                option.showFPS = container.getAttribute(\"data-show-fps\") == \"true\";\n                var styleStr = container.getAttribute(\"data-show-fps-style\") || \"\";\n                var stylesArr = styleStr.split(\",\");\n                var styles = {};\n                for (var i = 0; i < stylesArr.length; i++) {\n                    var tempStyleArr = stylesArr[i].split(\":\");\n                    styles[tempStyleArr[0]] = tempStyleArr[1];\n                }\n                option.fpsStyles = styles;\n                option.showLog = container.getAttribute(\"data-show-log\") == \"true\";\n                option.logFilter = container.getAttribute(\"data-log-filter\");\n                return option;\n            };\n            /**\n             * @private\n             * 添加canvas到container。\n             */\n            WebPlayer.prototype.attachCanvas = function (container, canvas) {\n                var style = canvas.style;\n                style.cursor = \"inherit\";\n                style.position = \"absolute\";\n                style.top = \"0\";\n                style.bottom = \"0\";\n                style.left = \"0\";\n                style.right = \"0\";\n                container.appendChild(canvas);\n                style = container.style;\n                style.overflow = \"hidden\";\n                style.position = \"absolute\";\n            };\n            /**\n             * @private\n             * 更新播放器视口尺寸\n             */\n            WebPlayer.prototype.updateScreenSize = function () {\n                var canvas = this.canvas;\n                if (canvas['userTyping'])\n                    return;\n                var option = this.playerOption;\n                var screenRect = this.container.getBoundingClientRect();\n                var top = 0;\n                var boundingClientWidth = screenRect.width;\n                var boundingClientHeight = screenRect.height;\n                if (boundingClientWidth == 0 || boundingClientHeight == 0) {\n                    return;\n                }\n                if (screenRect.top < 0) {\n                    boundingClientHeight += screenRect.top;\n                    top = -screenRect.top;\n                }\n                var shouldRotate = false;\n                var orientation = this.stage.$orientation;\n                if (orientation != egret.OrientationMode.AUTO) {\n                    shouldRotate = orientation != egret.OrientationMode.PORTRAIT && boundingClientHeight > boundingClientWidth\n                        || orientation == egret.OrientationMode.PORTRAIT && boundingClientWidth > boundingClientHeight;\n                }\n                var screenWidth = shouldRotate ? boundingClientHeight : boundingClientWidth;\n                var screenHeight = shouldRotate ? boundingClientWidth : boundingClientHeight;\n                egret.Capabilities[\"boundingClientWidth\" + \"\"] = screenWidth;\n                egret.Capabilities[\"boundingClientHeight\" + \"\"] = screenHeight;\n                var stageSize = egret.sys.screenAdapter.calculateStageSize(this.stage.$scaleMode, screenWidth, screenHeight, option.contentWidth, option.contentHeight);\n                var stageWidth = stageSize.stageWidth;\n                var stageHeight = stageSize.stageHeight;\n                var displayWidth = stageSize.displayWidth;\n                var displayHeight = stageSize.displayHeight;\n                canvas.style[egret.web.getPrefixStyleName(\"transformOrigin\")] = \"0% 0% 0px\";\n                if (canvas.width != stageWidth) {\n                    canvas.width = stageWidth;\n                }\n                if (canvas.height != stageHeight) {\n                    canvas.height = stageHeight;\n                }\n                var rotation = 0;\n                if (shouldRotate) {\n                    if (orientation == egret.OrientationMode.LANDSCAPE) {\n                        rotation = 90;\n                        canvas.style.top = top + (boundingClientHeight - displayWidth) / 2 + \"px\";\n                        canvas.style.left = (boundingClientWidth + displayHeight) / 2 + \"px\";\n                    }\n                    else {\n                        rotation = -90;\n                        canvas.style.top = top + (boundingClientHeight + displayWidth) / 2 + \"px\";\n                        canvas.style.left = (boundingClientWidth - displayHeight) / 2 + \"px\";\n                    }\n                }\n                else {\n                    canvas.style.top = top + (boundingClientHeight - displayHeight) / 2 + \"px\";\n                    canvas.style.left = (boundingClientWidth - displayWidth) / 2 + \"px\";\n                }\n                var scalex = displayWidth / stageWidth, scaley = displayHeight / stageHeight;\n                var canvasScaleX = scalex * egret.sys.DisplayList.$canvasScaleFactor;\n                var canvasScaleY = scaley * egret.sys.DisplayList.$canvasScaleFactor;\n                if (egret.Capabilities.renderMode == \"canvas\") {\n                    canvasScaleX = Math.ceil(canvasScaleX);\n                    canvasScaleY = Math.ceil(canvasScaleY);\n                }\n                var m = egret.Matrix.create();\n                m.identity();\n                m.scale(scalex / canvasScaleX, scaley / canvasScaleY);\n                m.rotate(rotation * Math.PI / 180);\n                var transform = \"matrix(\" + m.a + \",\" + m.b + \",\" + m.c + \",\" + m.d + \",\" + m.tx + \",\" + m.ty + \")\";\n                egret.Matrix.release(m);\n                canvas.style[egret.web.getPrefixStyleName(\"transform\")] = transform;\n                egret.sys.DisplayList.$setCanvasScale(canvasScaleX, canvasScaleY);\n                this.webTouchHandler.updateScaleMode(scalex, scaley, rotation);\n                this.webInput.$updateSize();\n                this.player.updateStageSize(stageWidth, stageHeight); //不要在这个方法后面修改属性\n                // todo\n                if (egret.nativeRender) {\n                    canvas.width = stageWidth * canvasScaleX;\n                    canvas.height = stageHeight * canvasScaleY;\n                }\n            };\n            WebPlayer.prototype.setContentSize = function (width, height) {\n                var option = this.playerOption;\n                option.contentWidth = width;\n                option.contentHeight = height;\n                this.updateScreenSize();\n            };\n            /**\n             * @private\n             * 更新触摸数量\n             */\n            WebPlayer.prototype.updateMaxTouches = function () {\n                this.webTouchHandler.$updateMaxTouches();\n            };\n            return WebPlayer;\n        }(egret.HashObject));\n        web.WebPlayer = WebPlayer;\n        __reflect(WebPlayer.prototype, \"egret.web.WebPlayer\", [\"egret.sys.Screen\"]);\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        var sharedCanvas;\n        var sharedContext;\n        /**\n         * @private\n         */\n        function convertImageToCanvas(texture, rect) {\n            if (!sharedCanvas) {\n                sharedCanvas = egret.sys.createCanvas();\n                sharedContext = sharedCanvas.getContext(\"2d\");\n            }\n            var w = texture.$getTextureWidth();\n            var h = texture.$getTextureHeight();\n            if (rect == null) {\n                rect = egret.$TempRectangle;\n                rect.x = 0;\n                rect.y = 0;\n                rect.width = w;\n                rect.height = h;\n            }\n            rect.x = Math.min(rect.x, w - 1);\n            rect.y = Math.min(rect.y, h - 1);\n            rect.width = Math.min(rect.width, w - rect.x);\n            rect.height = Math.min(rect.height, h - rect.y);\n            var iWidth = rect.width;\n            var iHeight = rect.height;\n            var surface = sharedCanvas;\n            surface[\"style\"][\"width\"] = iWidth + \"px\";\n            surface[\"style\"][\"height\"] = iHeight + \"px\";\n            sharedCanvas.width = iWidth;\n            sharedCanvas.height = iHeight;\n            if (egret.Capabilities.renderMode == \"webgl\") {\n                var renderTexture = void 0;\n                //webgl下非RenderTexture纹理先画到RenderTexture\n                if (!texture.$renderBuffer) {\n                    renderTexture = new egret.RenderTexture();\n                    renderTexture.drawToTexture(new egret.Bitmap(texture));\n                }\n                else {\n                    renderTexture = texture;\n                }\n                //从RenderTexture中读取像素数据，填入canvas\n                var pixels = renderTexture.$renderBuffer.getPixels(rect.x, rect.y, iWidth, iHeight);\n                var imageData = new ImageData(iWidth, iHeight);\n                for (var i = 0; i < pixels.length; i++) {\n                    imageData.data[i] = pixels[i];\n                }\n                sharedContext.putImageData(imageData, 0, 0);\n                if (!texture.$renderBuffer) {\n                    renderTexture.dispose();\n                }\n                return surface;\n            }\n            else {\n                var bitmapData = texture;\n                var offsetX = Math.round(bitmapData.$offsetX);\n                var offsetY = Math.round(bitmapData.$offsetY);\n                var bitmapWidth = bitmapData.$bitmapWidth;\n                var bitmapHeight = bitmapData.$bitmapHeight;\n                sharedContext.drawImage(bitmapData.$bitmapData.source, bitmapData.$bitmapX + rect.x / egret.$TextureScaleFactor, bitmapData.$bitmapY + rect.y / egret.$TextureScaleFactor, bitmapWidth * rect.width / w, bitmapHeight * rect.height / h, offsetX, offsetY, rect.width, rect.height);\n                return surface;\n            }\n        }\n        /**\n         * @private\n         */\n        function toDataURL(type, rect, encoderOptions) {\n            try {\n                var surface = convertImageToCanvas(this, rect);\n                var result = surface.toDataURL(type, encoderOptions);\n                return result;\n            }\n            catch (e) {\n                egret.$error(1033);\n            }\n            return null;\n        }\n        /**\n         * 有些杀毒软件认为 saveToFile 可能是一个病毒文件\n         */\n        function eliFoTevas(type, filePath, rect, encoderOptions) {\n            var base64 = toDataURL.call(this, type, rect, encoderOptions);\n            if (base64 == null) {\n                return;\n            }\n            var href = base64.replace(/^data:image[^;]*/, \"data:image/octet-stream\");\n            var aLink = document.createElement('a');\n            aLink['download'] = filePath;\n            aLink.href = href;\n            var evt = document.createEvent('MouseEvents');\n            evt.initMouseEvent('click', true, false, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null);\n            aLink.dispatchEvent(evt);\n        }\n        function getPixel32(x, y) {\n            egret.$warn(1041, \"getPixel32\", \"getPixels\");\n            return this.getPixels(x, y);\n        }\n        function getPixels(x, y, width, height) {\n            if (width === void 0) { width = 1; }\n            if (height === void 0) { height = 1; }\n            //webgl环境下不需要转换成canvas获取像素信息\n            if (egret.Capabilities.renderMode == \"webgl\") {\n                var renderTexture = void 0;\n                //webgl下非RenderTexture纹理先画到RenderTexture\n                if (!this.$renderBuffer) {\n                    renderTexture = new egret.RenderTexture();\n                    renderTexture.drawToTexture(new egret.Bitmap(this));\n                }\n                else {\n                    renderTexture = this;\n                }\n                //从RenderTexture中读取像素数据\n                var pixels = renderTexture.$renderBuffer.getPixels(x, y, width, height);\n                return pixels;\n            }\n            try {\n                var surface = convertImageToCanvas(this);\n                var result = sharedContext.getImageData(x, y, width, height).data;\n                return result;\n            }\n            catch (e) {\n                egret.$error(1039);\n            }\n        }\n        egret.Texture.prototype.toDataURL = toDataURL;\n        egret.Texture.prototype.saveToFile = eliFoTevas;\n        egret.Texture.prototype.getPixel32 = getPixel32;\n        egret.Texture.prototype.getPixels = getPixels;\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         * XML节点基类\n         */\n        var XMLNode = (function () {\n            /**\n             * @private\n             */\n            function XMLNode(nodeType, parent) {\n                this.nodeType = nodeType;\n                this.parent = parent;\n            }\n            return XMLNode;\n        }());\n        web.XMLNode = XMLNode;\n        __reflect(XMLNode.prototype, \"egret.web.XMLNode\");\n        /**\n         * @private\n         * XML节点对象\n         */\n        var XML = (function (_super) {\n            __extends(XML, _super);\n            /**\n             * @private\n             */\n            function XML(localName, parent, prefix, namespace, name) {\n                var _this = _super.call(this, 1, parent) || this;\n                /**\n                 * @private\n                 * 当前节点上的属性列表\n                 */\n                _this.attributes = {};\n                /**\n                 * @private\n                 * 当前节点的子节点列表\n                 */\n                _this.children = [];\n                _this.localName = localName;\n                _this.prefix = prefix;\n                _this.namespace = namespace;\n                _this.name = name;\n                return _this;\n            }\n            return XML;\n        }(XMLNode));\n        web.XML = XML;\n        __reflect(XML.prototype, \"egret.web.XML\");\n        /**\n         * @private\n         * XML文本节点\n         */\n        var XMLText = (function (_super) {\n            __extends(XMLText, _super);\n            /**\n             * @private\n             */\n            function XMLText(text, parent) {\n                var _this = _super.call(this, 3, parent) || this;\n                _this.text = text;\n                return _this;\n            }\n            return XMLText;\n        }(XMLNode));\n        web.XMLText = XMLText;\n        __reflect(XMLText.prototype, \"egret.web.XMLText\");\n        var parser = new DOMParser();\n        /**\n         * @private\n         * 解析字符串为XML对象\n         * @param text 要解析的字符串\n         */\n        function parse(text) {\n            var xmlDoc = parser.parseFromString(text, \"text/xml\");\n            var length = xmlDoc.childNodes.length;\n            for (var i = 0; i < length; i++) {\n                var node = xmlDoc.childNodes[i];\n                if (node.nodeType == 1) {\n                    return parseNode(node, null);\n                }\n            }\n            return null;\n        }\n        /**\n         * @private\n         * 解析一个节点\n         */\n        function parseNode(node, parent) {\n            if (node.localName == \"parsererror\") {\n                throw new Error(node.textContent);\n            }\n            var xml = new XML(node.localName, parent, node[\"prefix\"], node.namespaceURI, node.nodeName);\n            var nodeAttributes = node.attributes;\n            var attributes = xml.attributes;\n            var length = nodeAttributes.length;\n            for (var i = 0; i < length; i++) {\n                var attributeNode = nodeAttributes[i];\n                var name_1 = attributeNode.name;\n                if (name_1.indexOf(\"xmlns:\") == 0) {\n                    continue;\n                }\n                attributes[name_1] = attributeNode.value;\n                xml[\"$\" + name_1] = attributeNode.value;\n            }\n            var childNodes = node.childNodes;\n            length = childNodes.length;\n            var children = xml.children;\n            for (var i = 0; i < length; i++) {\n                var childNode = childNodes[i];\n                var nodeType = childNode.nodeType;\n                var childXML = null;\n                if (nodeType == 1) {\n                    childXML = parseNode(childNode, xml);\n                }\n                else if (nodeType == 3) {\n                    var text = childNode.textContent.trim();\n                    if (text) {\n                        childXML = new XMLText(text, xml);\n                    }\n                }\n                if (childXML) {\n                    children.push(childXML);\n                }\n            }\n            return xml;\n        }\n        egret.XML = { parse: parse };\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var WebDeviceOrientation = (function (_super) {\n            __extends(WebDeviceOrientation, _super);\n            function WebDeviceOrientation() {\n                var _this = _super !== null && _super.apply(this, arguments) || this;\n                /**\n                 * @private\n                 */\n                _this.onChange = function (e) {\n                    var event = new egret.OrientationEvent(egret.Event.CHANGE);\n                    event.beta = e.beta;\n                    event.gamma = e.gamma;\n                    event.alpha = e.alpha;\n                    _this.dispatchEvent(event);\n                };\n                return _this;\n            }\n            /**\n             * @private\n             *\n             */\n            WebDeviceOrientation.prototype.start = function () {\n                window.addEventListener(\"deviceorientation\", this.onChange);\n            };\n            /**\n             * @private\n             *\n             */\n            WebDeviceOrientation.prototype.stop = function () {\n                window.removeEventListener(\"deviceorientation\", this.onChange);\n            };\n            return WebDeviceOrientation;\n        }(egret.EventDispatcher));\n        web.WebDeviceOrientation = WebDeviceOrientation;\n        __reflect(WebDeviceOrientation.prototype, \"egret.web.WebDeviceOrientation\", [\"egret.DeviceOrientation\"]);\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\negret.DeviceOrientation = egret.web.WebDeviceOrientation;\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var WebExternalInterface = (function () {\n            function WebExternalInterface() {\n            }\n            /**\n             * @private\n             * @param functionName\n             * @param value\n             */\n            WebExternalInterface.call = function (functionName, value) {\n            };\n            /**\n             * @private\n             * @param functionName\n             * @param listener\n             */\n            WebExternalInterface.addCallback = function (functionName, listener) {\n            };\n            return WebExternalInterface;\n        }());\n        web.WebExternalInterface = WebExternalInterface;\n        __reflect(WebExternalInterface.prototype, \"egret.web.WebExternalInterface\", [\"egret.ExternalInterface\"]);\n        var ua = navigator.userAgent.toLowerCase();\n        if (ua.indexOf(\"egretnative\") < 0) {\n            egret.ExternalInterface = WebExternalInterface;\n        }\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n(function (egret) {\n    var web;\n    (function (web) {\n        var callBackDic = {};\n        /**\n         * @private\n         */\n        var NativeExternalInterface = (function () {\n            function NativeExternalInterface() {\n            }\n            NativeExternalInterface.call = function (functionName, value) {\n                var data = {};\n                data.functionName = functionName;\n                data.value = value;\n                egret_native.sendInfoToPlugin(JSON.stringify(data));\n            };\n            NativeExternalInterface.addCallback = function (functionName, listener) {\n                callBackDic[functionName] = listener;\n            };\n            return NativeExternalInterface;\n        }());\n        web.NativeExternalInterface = NativeExternalInterface;\n        __reflect(NativeExternalInterface.prototype, \"egret.web.NativeExternalInterface\", [\"egret.ExternalInterface\"]);\n        /**\n         * @private\n         * @param info\n         */\n        function onReceivedPluginInfo(info) {\n            var data = JSON.parse(info);\n            var functionName = data.functionName;\n            var listener = callBackDic[functionName];\n            if (listener) {\n                var value = data.value;\n                listener.call(null, value);\n            }\n            else {\n                egret.$warn(1050, functionName);\n            }\n        }\n        var ua = navigator.userAgent.toLowerCase();\n        if (ua.indexOf(\"egretnative\") >= 0) {\n            egret.ExternalInterface = NativeExternalInterface;\n            egret_native.receivedPluginInfo = onReceivedPluginInfo;\n        }\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n(function (egret) {\n    var web;\n    (function (web) {\n        var callBackDic = {};\n        /**\n         * @private\n         */\n        var WebViewExternalInterface = (function () {\n            function WebViewExternalInterface() {\n            }\n            WebViewExternalInterface.call = function (functionName, value) {\n                __global.ExternalInterface.call(functionName, value);\n            };\n            WebViewExternalInterface.addCallback = function (functionName, listener) {\n                callBackDic[functionName] = listener;\n            };\n            WebViewExternalInterface.invokeCallback = function (functionName, value) {\n                var listener = callBackDic[functionName];\n                if (listener) {\n                    listener.call(null, value);\n                }\n                else {\n                    egret.$warn(1050, functionName);\n                }\n            };\n            return WebViewExternalInterface;\n        }());\n        web.WebViewExternalInterface = WebViewExternalInterface;\n        __reflect(WebViewExternalInterface.prototype, \"egret.web.WebViewExternalInterface\", [\"egret.ExternalInterface\"]);\n        var ua = navigator.userAgent.toLowerCase();\n        if (ua.indexOf(\"egretwebview\") >= 0) {\n            egret.ExternalInterface = WebViewExternalInterface;\n        }\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         * @inheritDoc\n         */\n        var HtmlSound = (function (_super) {\n            __extends(HtmlSound, _super);\n            /**\n             * @private\n             * @inheritDoc\n             */\n            function HtmlSound() {\n                var _this = _super.call(this) || this;\n                /**\n                 * @private\n                 */\n                _this.loaded = false;\n                return _this;\n            }\n            Object.defineProperty(HtmlSound.prototype, \"length\", {\n                get: function () {\n                    if (this.originAudio) {\n                        return this.originAudio.duration;\n                    }\n                    throw new Error(\"sound not loaded!\");\n                    //return 0;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            /**\n             * @inheritDoc\n             */\n            HtmlSound.prototype.load = function (url) {\n                var self = this;\n                this.url = url;\n                if (true && !url) {\n                    egret.$error(3002);\n                }\n                var audio = new Audio(url);\n                audio.addEventListener(\"canplaythrough\", onAudioLoaded);\n                audio.addEventListener(\"error\", onAudioError);\n                var ua = navigator.userAgent.toLowerCase();\n                if (ua.indexOf(\"firefox\") >= 0) {\n                    audio.autoplay = !0;\n                    audio.muted = true;\n                }\n                //edge and ie11\n                var ie = ua.indexOf(\"edge\") >= 0 || ua.indexOf(\"trident\") >= 0;\n                if (ie) {\n                    document.body.appendChild(audio);\n                }\n                audio.load();\n                this.originAudio = audio;\n                if (HtmlSound.clearAudios[this.url]) {\n                    delete HtmlSound.clearAudios[this.url];\n                }\n                function onAudioLoaded() {\n                    HtmlSound.$recycle(self.url, audio);\n                    removeListeners();\n                    if (ua.indexOf(\"firefox\") >= 0) {\n                        audio.pause();\n                        audio.muted = false;\n                    }\n                    if (ie) {\n                        document.body.appendChild(audio);\n                    }\n                    self.loaded = true;\n                    self.dispatchEventWith(egret.Event.COMPLETE);\n                }\n                function onAudioError() {\n                    removeListeners();\n                    self.dispatchEventWith(egret.IOErrorEvent.IO_ERROR);\n                }\n                function removeListeners() {\n                    audio.removeEventListener(\"canplaythrough\", onAudioLoaded);\n                    audio.removeEventListener(\"error\", onAudioError);\n                    if (ie) {\n                        document.body.removeChild(audio);\n                    }\n                }\n            };\n            /**\n             * @inheritDoc\n             */\n            HtmlSound.prototype.play = function (startTime, loops) {\n                startTime = +startTime || 0;\n                loops = +loops || 0;\n                if (true && this.loaded == false) {\n                    egret.$error(1049);\n                }\n                var audio = HtmlSound.$pop(this.url);\n                if (audio == null) {\n                    audio = this.originAudio.cloneNode();\n                }\n                else {\n                    //audio.load();\n                }\n                audio.autoplay = true;\n                var channel = new web.HtmlSoundChannel(audio);\n                channel.$url = this.url;\n                channel.$loops = loops;\n                channel.$startTime = startTime;\n                channel.$play();\n                egret.sys.$pushSoundChannel(channel);\n                return channel;\n            };\n            /**\n             * @inheritDoc\n             */\n            HtmlSound.prototype.close = function () {\n                if (this.loaded && this.originAudio) {\n                    this.originAudio.src = \"\";\n                }\n                if (this.originAudio)\n                    this.originAudio = null;\n                HtmlSound.$clear(this.url);\n                this.loaded = false;\n            };\n            HtmlSound.$clear = function (url) {\n                HtmlSound.clearAudios[url] = true;\n                var array = HtmlSound.audios[url];\n                if (array) {\n                    array.length = 0;\n                }\n            };\n            HtmlSound.$pop = function (url) {\n                var array = HtmlSound.audios[url];\n                if (array && array.length > 0) {\n                    return array.pop();\n                }\n                return null;\n            };\n            HtmlSound.$recycle = function (url, audio) {\n                if (HtmlSound.clearAudios[url]) {\n                    return;\n                }\n                var array = HtmlSound.audios[url];\n                if (HtmlSound.audios[url] == null) {\n                    array = HtmlSound.audios[url] = [];\n                }\n                array.push(audio);\n            };\n            /**\n             * Background music\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 背景音乐\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            HtmlSound.MUSIC = \"music\";\n            /**\n             * EFFECT\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 音效\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            HtmlSound.EFFECT = \"effect\";\n            /**\n             * @private\n             */\n            HtmlSound.audios = {};\n            HtmlSound.clearAudios = {};\n            return HtmlSound;\n        }(egret.EventDispatcher));\n        web.HtmlSound = HtmlSound;\n        __reflect(HtmlSound.prototype, \"egret.web.HtmlSound\", [\"egret.Sound\"]);\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        if (true) {\n            var logFuncs_1;\n            function setLogLevel(logType) {\n                if (logFuncs_1 == null) {\n                    logFuncs_1 = {\n                        \"error\": console.error,\n                        \"debug\": console.debug,\n                        \"warn\": console.warn,\n                        \"info\": console.info,\n                        \"log\": console.log\n                    };\n                }\n                switch (logType) {\n                    case egret.Logger.OFF:\n                        console.error = function () {\n                        };\n                    case egret.Logger.ERROR:\n                        console.warn = function () {\n                        };\n                    case egret.Logger.WARN:\n                        console.info = function () {\n                        };\n                        console.log = function () {\n                        };\n                    case egret.Logger.INFO:\n                        console.debug = function () {\n                        };\n                    default:\n                        break;\n                }\n                switch (logType) {\n                    case egret.Logger.ALL:\n                    case egret.Logger.DEBUG:\n                        console.debug = logFuncs_1[\"debug\"];\n                    case egret.Logger.INFO:\n                        console.log = logFuncs_1[\"log\"];\n                        console.info = logFuncs_1[\"info\"];\n                    case egret.Logger.WARN:\n                        console.warn = logFuncs_1[\"warn\"];\n                    case egret.Logger.ERROR:\n                        console.error = logFuncs_1[\"error\"];\n                    default:\n                        break;\n                }\n            }\n            Object.defineProperty(egret.Logger, \"logLevel\", {\n                set: setLogLevel,\n                enumerable: true,\n                configurable: true\n            });\n        }\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         * 绘制指令管理器\n         * 用来维护drawData数组\n         */\n        var WebGLDrawCmdManager = (function () {\n            function WebGLDrawCmdManager() {\n                /**\n                 * 用于缓存绘制命令的数组\n                 */\n                this.drawData = [];\n                this.drawDataLen = 0;\n            }\n            /**\n             * 压入绘制矩形指令\n             */\n            WebGLDrawCmdManager.prototype.pushDrawRect = function () {\n                if (this.drawDataLen == 0 || this.drawData[this.drawDataLen - 1].type != 1 /* RECT */) {\n                    var data = this.drawData[this.drawDataLen] || {};\n                    data.type = 1 /* RECT */;\n                    data.count = 0;\n                    this.drawData[this.drawDataLen] = data;\n                    this.drawDataLen++;\n                }\n                this.drawData[this.drawDataLen - 1].count += 2;\n            };\n            /**\n             * 压入绘制texture指令\n             */\n            WebGLDrawCmdManager.prototype.pushDrawTexture = function (texture, count, filter, textureWidth, textureHeight) {\n                if (count === void 0) { count = 2; }\n                if (filter) {\n                    // 目前有滤镜的情况下不会合并绘制\n                    var data = this.drawData[this.drawDataLen] || {};\n                    data.type = 0 /* TEXTURE */;\n                    data.texture = texture;\n                    data.filter = filter;\n                    data.count = count;\n                    data.textureWidth = textureWidth;\n                    data.textureHeight = textureHeight;\n                    this.drawData[this.drawDataLen] = data;\n                    this.drawDataLen++;\n                }\n                else {\n                    if (this.drawDataLen == 0 || this.drawData[this.drawDataLen - 1].type != 0 /* TEXTURE */ || texture != this.drawData[this.drawDataLen - 1].texture || this.drawData[this.drawDataLen - 1].filter) {\n                        var data = this.drawData[this.drawDataLen] || {};\n                        data.type = 0 /* TEXTURE */;\n                        data.texture = texture;\n                        data.count = 0;\n                        this.drawData[this.drawDataLen] = data;\n                        this.drawDataLen++;\n                    }\n                    this.drawData[this.drawDataLen - 1].count += count;\n                }\n            };\n            WebGLDrawCmdManager.prototype.pushChangeSmoothing = function (texture, smoothing) {\n                texture[\"smoothing\"] = smoothing;\n                var data = this.drawData[this.drawDataLen] || {};\n                data.type = 10 /* SMOOTHING */;\n                data.texture = texture;\n                data.smoothing = smoothing;\n                this.drawData[this.drawDataLen] = data;\n                this.drawDataLen++;\n            };\n            /**\n             * 压入pushMask指令\n             */\n            WebGLDrawCmdManager.prototype.pushPushMask = function (count) {\n                if (count === void 0) { count = 1; }\n                var data = this.drawData[this.drawDataLen] || {};\n                data.type = 2 /* PUSH_MASK */;\n                data.count = count * 2;\n                this.drawData[this.drawDataLen] = data;\n                this.drawDataLen++;\n            };\n            /**\n             * 压入popMask指令\n             */\n            WebGLDrawCmdManager.prototype.pushPopMask = function (count) {\n                if (count === void 0) { count = 1; }\n                var data = this.drawData[this.drawDataLen] || {};\n                data.type = 3 /* POP_MASK */;\n                data.count = count * 2;\n                this.drawData[this.drawDataLen] = data;\n                this.drawDataLen++;\n            };\n            /**\n             * 压入混色指令\n             */\n            WebGLDrawCmdManager.prototype.pushSetBlend = function (value) {\n                var len = this.drawDataLen;\n                // 有无遍历到有效绘图操作\n                var drawState = false;\n                for (var i = len - 1; i >= 0; i--) {\n                    var data = this.drawData[i];\n                    if (data) {\n                        if (data.type == 0 /* TEXTURE */ || data.type == 1 /* RECT */) {\n                            drawState = true;\n                        }\n                        // 如果与上一次blend操作之间无有效绘图，上一次操作无效\n                        if (!drawState && data.type == 4 /* BLEND */) {\n                            this.drawData.splice(i, 1);\n                            this.drawDataLen--;\n                            continue;\n                        }\n                        // 如果与上一次blend操作重复，本次操作无效\n                        if (data.type == 4 /* BLEND */) {\n                            if (data.value == value) {\n                                return;\n                            }\n                            else {\n                                break;\n                            }\n                        }\n                    }\n                }\n                var _data = this.drawData[this.drawDataLen] || {};\n                _data.type = 4 /* BLEND */;\n                _data.value = value;\n                this.drawData[this.drawDataLen] = _data;\n                this.drawDataLen++;\n            };\n            /*\n             * 压入resize render target命令\n             */\n            WebGLDrawCmdManager.prototype.pushResize = function (buffer, width, height) {\n                var data = this.drawData[this.drawDataLen] || {};\n                data.type = 5 /* RESIZE_TARGET */;\n                data.buffer = buffer;\n                data.width = width;\n                data.height = height;\n                this.drawData[this.drawDataLen] = data;\n                this.drawDataLen++;\n            };\n            /*\n             * 压入clear color命令\n             */\n            WebGLDrawCmdManager.prototype.pushClearColor = function () {\n                var data = this.drawData[this.drawDataLen] || {};\n                data.type = 6 /* CLEAR_COLOR */;\n                this.drawData[this.drawDataLen] = data;\n                this.drawDataLen++;\n            };\n            /**\n             * 压入激活buffer命令\n             */\n            WebGLDrawCmdManager.prototype.pushActivateBuffer = function (buffer) {\n                var len = this.drawDataLen;\n                // 有无遍历到有效绘图操作\n                var drawState = false;\n                for (var i = len - 1; i >= 0; i--) {\n                    var data = this.drawData[i];\n                    if (data) {\n                        if (data.type != 4 /* BLEND */ && data.type != 7 /* ACT_BUFFER */) {\n                            drawState = true;\n                        }\n                        // 如果与上一次buffer操作之间无有效绘图，上一次操作无效\n                        if (!drawState && data.type == 7 /* ACT_BUFFER */) {\n                            this.drawData.splice(i, 1);\n                            this.drawDataLen--;\n                            continue;\n                        }\n                        // 如果与上一次buffer操作重复，本次操作无效\n                        // if(data.type == DRAWABLE_TYPE.ACT_BUFFER) {\n                        //     if(data.buffer == buffer) {\n                        //         return;\n                        //     } else {\n                        //         break;\n                        //     }\n                        // }\n                    }\n                }\n                var _data = this.drawData[this.drawDataLen] || {};\n                _data.type = 7 /* ACT_BUFFER */;\n                _data.buffer = buffer;\n                _data.width = buffer.rootRenderTarget.width;\n                _data.height = buffer.rootRenderTarget.height;\n                this.drawData[this.drawDataLen] = _data;\n                this.drawDataLen++;\n            };\n            /*\n             * 压入enabel scissor命令\n             */\n            WebGLDrawCmdManager.prototype.pushEnableScissor = function (x, y, width, height) {\n                var data = this.drawData[this.drawDataLen] || {};\n                data.type = 8 /* ENABLE_SCISSOR */;\n                data.x = x;\n                data.y = y;\n                data.width = width;\n                data.height = height;\n                this.drawData[this.drawDataLen] = data;\n                this.drawDataLen++;\n            };\n            /*\n             * 压入disable scissor命令\n             */\n            WebGLDrawCmdManager.prototype.pushDisableScissor = function () {\n                var data = this.drawData[this.drawDataLen] || {};\n                data.type = 9 /* DISABLE_SCISSOR */;\n                this.drawData[this.drawDataLen] = data;\n                this.drawDataLen++;\n            };\n            /**\n             * 清空命令数组\n             */\n            WebGLDrawCmdManager.prototype.clear = function () {\n                for (var i = 0; i < this.drawDataLen; i++) {\n                    var data = this.drawData[i];\n                    data.type = 0;\n                    data.count = 0;\n                    data.texture = null;\n                    data.filter = null;\n                    //data.uv = null;\n                    data.value = \"\";\n                    data.buffer = null;\n                    data.width = 0;\n                    data.height = 0;\n                    data.textureWidth = 0;\n                    data.textureHeight = 0;\n                    data.smoothing = false;\n                    data.x = 0;\n                    data.y = 0;\n                }\n                this.drawDataLen = 0;\n            };\n            return WebGLDrawCmdManager;\n        }());\n        web.WebGLDrawCmdManager = WebGLDrawCmdManager;\n        __reflect(WebGLDrawCmdManager.prototype, \"egret.web.WebGLDrawCmdManager\");\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         * 顶点数组管理对象\n         * 用来维护顶点数组\n         */\n        var WebGLVertexArrayObject = (function () {\n            function WebGLVertexArrayObject() {\n                /*定义顶点格式\n                * (x: 8 * 4 = 32) + (y: 8 * 4 = 32) + (u: 8 * 4 = 32) + (v: 8 * 4 = 32) + (tintcolor: 8 * 4 = 32) = (8 * 4 = 32) * (x + y + u + v + tintcolor: 5);\n                */\n                this.vertSize = 5;\n                this.vertByteSize = this.vertSize * 4;\n                /*\n                *最多单次提交maxQuadsCount这么多quad\n                */\n                this.maxQuadsCount = 2048;\n                /*\n                *quad = 4个Vertex\n                */\n                this.maxVertexCount = this.maxQuadsCount * 4;\n                /*\n                *配套的Indices = quad * 6.\n                */\n                this.maxIndicesCount = this.maxQuadsCount * 6;\n                this.vertices = null;\n                this.indices = null;\n                this.indicesForMesh = null;\n                this.vertexIndex = 0;\n                this.indexIndex = 0;\n                this.hasMesh = false;\n                /*\n                * refactor:\n                */\n                this._vertices = null;\n                this._verticesFloat32View = null;\n                this._verticesUint32View = null;\n                //old\n                var numVerts = this.maxVertexCount * this.vertSize;\n                this.vertices = new Float32Array(numVerts);\n                ///\n                this._vertices = new ArrayBuffer(this.maxVertexCount * this.vertByteSize);\n                this._verticesFloat32View = new Float32Array(this._vertices);\n                this._verticesUint32View = new Uint32Array(this._vertices);\n                this.vertices = this._verticesFloat32View;\n                //索引缓冲，最大索引数\n                /*\n                0-------1\n                |       |\n                |       |\n                3-------2\n                0->1->2\n                0->2->3\n                两个三角形\n                */\n                var maxIndicesCount = this.maxIndicesCount;\n                this.indices = new Uint16Array(maxIndicesCount);\n                this.indicesForMesh = new Uint16Array(maxIndicesCount);\n                for (var i = 0, j = 0; i < maxIndicesCount; i += 6, j += 4) {\n                    this.indices[i + 0] = j + 0;\n                    this.indices[i + 1] = j + 1;\n                    this.indices[i + 2] = j + 2;\n                    this.indices[i + 3] = j + 0;\n                    this.indices[i + 4] = j + 2;\n                    this.indices[i + 5] = j + 3;\n                }\n            }\n            /**\n             * 是否达到最大缓存数量\n             */\n            WebGLVertexArrayObject.prototype.reachMaxSize = function (vertexCount, indexCount) {\n                if (vertexCount === void 0) { vertexCount = 4; }\n                if (indexCount === void 0) { indexCount = 6; }\n                return this.vertexIndex > this.maxVertexCount - vertexCount || this.indexIndex > this.maxIndicesCount - indexCount;\n            };\n            /**\n             * 获取缓存完成的顶点数组\n             */\n            WebGLVertexArrayObject.prototype.getVertices = function () {\n                var view = this.vertices.subarray(0, this.vertexIndex * this.vertSize);\n                return view;\n            };\n            /**\n             * 获取缓存完成的索引数组\n             */\n            WebGLVertexArrayObject.prototype.getIndices = function () {\n                return this.indices;\n            };\n            /**\n             * 获取缓存完成的mesh索引数组\n             */\n            WebGLVertexArrayObject.prototype.getMeshIndices = function () {\n                return this.indicesForMesh;\n            };\n            /**\n             * 切换成mesh索引缓存方式\n             */\n            WebGLVertexArrayObject.prototype.changeToMeshIndices = function () {\n                if (!this.hasMesh) {\n                    // 拷贝默认index信息到for mesh中\n                    for (var i = 0, l = this.indexIndex; i < l; ++i) {\n                        this.indicesForMesh[i] = this.indices[i];\n                    }\n                    this.hasMesh = true;\n                }\n            };\n            WebGLVertexArrayObject.prototype.isMesh = function () {\n                return this.hasMesh;\n            };\n            /**\n             * 默认构成矩形\n             */\n            // private defaultMeshVertices = [0, 0, 1, 0, 1, 1, 0, 1];\n            // private defaultMeshUvs = [\n            //     0, 0,\n            //     1, 0,\n            //     1, 1,\n            //     0, 1\n            // ];\n            // private defaultMeshIndices = [0, 1, 2, 0, 2, 3];\n            /**\n             * 缓存一组顶点\n             */\n            WebGLVertexArrayObject.prototype.cacheArrays = function (buffer, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight, textureSourceWidth, textureSourceHeight, meshUVs, meshVertices, meshIndices, rotated) {\n                var alpha = buffer.globalAlpha;\n                /*\n                * 混入tintcolor => alpha\n                */\n                alpha = Math.min(alpha, 1.0);\n                var globalTintColor = buffer.globalTintColor || 0xFFFFFF;\n                var currentTexture = buffer.currentTexture;\n                alpha = ((alpha < 1.0 && currentTexture && currentTexture[egret.UNPACK_PREMULTIPLY_ALPHA_WEBGL]) ?\n                    egret.WebGLUtils.premultiplyTint(globalTintColor, alpha)\n                    : globalTintColor + (alpha * 255 << 24));\n                /*\n                临时测试\n                */\n                //计算出绘制矩阵，之后把矩阵还原回之前的\n                var locWorldTransform = buffer.globalMatrix;\n                var a = locWorldTransform.a;\n                var b = locWorldTransform.b;\n                var c = locWorldTransform.c;\n                var d = locWorldTransform.d;\n                var tx = locWorldTransform.tx;\n                var ty = locWorldTransform.ty;\n                var offsetX = buffer.$offsetX;\n                var offsetY = buffer.$offsetY;\n                if (offsetX != 0 || offsetY != 0) {\n                    tx = offsetX * a + offsetY * c + tx;\n                    ty = offsetX * b + offsetY * d + ty;\n                }\n                if (!meshVertices) {\n                    if (destX != 0 || destY != 0) {\n                        tx = destX * a + destY * c + tx;\n                        ty = destX * b + destY * d + ty;\n                    }\n                    var a1 = destWidth / sourceWidth;\n                    if (a1 != 1) {\n                        a = a1 * a;\n                        b = a1 * b;\n                    }\n                    var d1 = destHeight / sourceHeight;\n                    if (d1 != 1) {\n                        c = d1 * c;\n                        d = d1 * d;\n                    }\n                }\n                if (meshVertices) {\n                    // 计算索引位置与赋值\n                    var vertices = this.vertices;\n                    var verticesUint32View = this._verticesUint32View;\n                    var index = this.vertexIndex * this.vertSize;\n                    // 缓存顶点数组\n                    var i = 0, iD = 0, l = 0;\n                    var u = 0, v = 0, x = 0, y = 0;\n                    for (i = 0, l = meshUVs.length; i < l; i += 2) {\n                        iD = index + i * 5 / 2;\n                        x = meshVertices[i];\n                        y = meshVertices[i + 1];\n                        u = meshUVs[i];\n                        v = meshUVs[i + 1];\n                        // xy\n                        vertices[iD + 0] = a * x + c * y + tx;\n                        vertices[iD + 1] = b * x + d * y + ty;\n                        // uv\n                        if (rotated) {\n                            vertices[iD + 2] = (sourceX + (1.0 - v) * sourceHeight) / textureSourceWidth;\n                            vertices[iD + 3] = (sourceY + u * sourceWidth) / textureSourceHeight;\n                        }\n                        else {\n                            vertices[iD + 2] = (sourceX + u * sourceWidth) / textureSourceWidth;\n                            vertices[iD + 3] = (sourceY + v * sourceHeight) / textureSourceHeight;\n                        }\n                        // alpha\n                        verticesUint32View[iD + 4] = alpha;\n                    }\n                    // 缓存索引数组\n                    if (this.hasMesh) {\n                        for (var i_1 = 0, l_1 = meshIndices.length; i_1 < l_1; ++i_1) {\n                            this.indicesForMesh[this.indexIndex + i_1] = meshIndices[i_1] + this.vertexIndex;\n                        }\n                    }\n                    this.vertexIndex += meshUVs.length / 2;\n                    this.indexIndex += meshIndices.length;\n                }\n                else {\n                    var width = textureSourceWidth;\n                    var height = textureSourceHeight;\n                    var w = sourceWidth;\n                    var h = sourceHeight;\n                    sourceX = sourceX / width;\n                    sourceY = sourceY / height;\n                    var vertices = this.vertices;\n                    var verticesUint32View = this._verticesUint32View;\n                    var index = this.vertexIndex * this.vertSize;\n                    if (rotated) {\n                        var temp = sourceWidth;\n                        sourceWidth = sourceHeight / width;\n                        sourceHeight = temp / height;\n                        // xy\n                        vertices[index++] = tx;\n                        vertices[index++] = ty;\n                        // uv\n                        vertices[index++] = sourceWidth + sourceX;\n                        vertices[index++] = sourceY;\n                        // alpha\n                        verticesUint32View[index++] = alpha;\n                        // xy\n                        vertices[index++] = a * w + tx;\n                        vertices[index++] = b * w + ty;\n                        // uv\n                        vertices[index++] = sourceWidth + sourceX;\n                        vertices[index++] = sourceHeight + sourceY;\n                        // alpha\n                        verticesUint32View[index++] = alpha;\n                        // xy\n                        vertices[index++] = a * w + c * h + tx;\n                        vertices[index++] = d * h + b * w + ty;\n                        // uv\n                        vertices[index++] = sourceX;\n                        vertices[index++] = sourceHeight + sourceY;\n                        // alpha\n                        verticesUint32View[index++] = alpha;\n                        // xy\n                        vertices[index++] = c * h + tx;\n                        vertices[index++] = d * h + ty;\n                        // uv\n                        vertices[index++] = sourceX;\n                        vertices[index++] = sourceY;\n                        // alpha\n                        verticesUint32View[index++] = alpha;\n                    }\n                    else {\n                        sourceWidth = sourceWidth / width;\n                        sourceHeight = sourceHeight / height;\n                        // xy\n                        vertices[index++] = tx;\n                        vertices[index++] = ty;\n                        // uv\n                        vertices[index++] = sourceX;\n                        vertices[index++] = sourceY;\n                        // alpha\n                        verticesUint32View[index++] = alpha;\n                        // xy\n                        vertices[index++] = a * w + tx;\n                        vertices[index++] = b * w + ty;\n                        // uv\n                        vertices[index++] = sourceWidth + sourceX;\n                        vertices[index++] = sourceY;\n                        // alpha\n                        verticesUint32View[index++] = alpha;\n                        // xy\n                        vertices[index++] = a * w + c * h + tx;\n                        vertices[index++] = d * h + b * w + ty;\n                        // uv\n                        vertices[index++] = sourceWidth + sourceX;\n                        vertices[index++] = sourceHeight + sourceY;\n                        // alpha\n                        verticesUint32View[index++] = alpha;\n                        // xy\n                        vertices[index++] = c * h + tx;\n                        vertices[index++] = d * h + ty;\n                        // uv\n                        vertices[index++] = sourceX;\n                        vertices[index++] = sourceHeight + sourceY;\n                        // alpha\n                        verticesUint32View[index++] = alpha;\n                    }\n                    // 缓存索引数组\n                    if (this.hasMesh) {\n                        var indicesForMesh = this.indicesForMesh;\n                        indicesForMesh[this.indexIndex + 0] = 0 + this.vertexIndex;\n                        indicesForMesh[this.indexIndex + 1] = 1 + this.vertexIndex;\n                        indicesForMesh[this.indexIndex + 2] = 2 + this.vertexIndex;\n                        indicesForMesh[this.indexIndex + 3] = 0 + this.vertexIndex;\n                        indicesForMesh[this.indexIndex + 4] = 2 + this.vertexIndex;\n                        indicesForMesh[this.indexIndex + 5] = 3 + this.vertexIndex;\n                    }\n                    this.vertexIndex += 4;\n                    this.indexIndex += 6;\n                }\n            };\n            WebGLVertexArrayObject.prototype.clear = function () {\n                this.hasMesh = false;\n                this.vertexIndex = 0;\n                this.indexIndex = 0;\n            };\n            return WebGLVertexArrayObject;\n        }());\n        web.WebGLVertexArrayObject = WebGLVertexArrayObject;\n        __reflect(WebGLVertexArrayObject.prototype, \"egret.web.WebGLVertexArrayObject\");\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         * WebGLRenderTarget\n         * A WebGL render target with a frame buffer and texture\n         */\n        var WebGLRenderTarget = (function (_super) {\n            __extends(WebGLRenderTarget, _super);\n            function WebGLRenderTarget(gl, width, height) {\n                var _this = _super.call(this) || this;\n                _this.clearColor = [0, 0, 0, 0];\n                /**\n                 * If frame buffer is enabled, the default is true\n                 */\n                _this.useFrameBuffer = true;\n                _this.gl = gl;\n                _this._resize(width, height);\n                return _this;\n            }\n            WebGLRenderTarget.prototype._resize = function (width, height) {\n                // Chrome alerts if the size is 0\n                width = width || 1;\n                height = height || 1;\n                if (width < 1) {\n                    if (true) {\n                        egret.warn('WebGLRenderTarget _resize width = ' + width);\n                    }\n                    width = 1;\n                }\n                if (height < 1) {\n                    if (true) {\n                        egret.warn('WebGLRenderTarget _resize height = ' + height);\n                    }\n                    height = 1;\n                }\n                this.width = width;\n                this.height = height;\n            };\n            WebGLRenderTarget.prototype.resize = function (width, height) {\n                this._resize(width, height);\n                var gl = this.gl;\n                if (this.frameBuffer) {\n                    gl.bindTexture(gl.TEXTURE_2D, this.texture);\n                    gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n                    // gl.bindTexture(gl.TEXTURE_2D, null);\n                }\n                if (this.stencilBuffer) {\n                    gl.deleteRenderbuffer(this.stencilBuffer);\n                    this.stencilBuffer = null;\n                }\n            };\n            WebGLRenderTarget.prototype.activate = function () {\n                var gl = this.gl;\n                gl.bindFramebuffer(gl.FRAMEBUFFER, this.getFrameBuffer());\n            };\n            WebGLRenderTarget.prototype.getFrameBuffer = function () {\n                if (!this.useFrameBuffer) {\n                    return null;\n                }\n                return this.frameBuffer;\n            };\n            WebGLRenderTarget.prototype.initFrameBuffer = function () {\n                if (!this.frameBuffer) {\n                    var gl = this.gl;\n                    this.texture = this.createTexture();\n                    this.frameBuffer = gl.createFramebuffer();\n                    gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer);\n                    gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, this.texture, 0);\n                }\n            };\n            WebGLRenderTarget.prototype.createTexture = function () {\n                //就是创建空的纹理\n                var webglrendercontext = web.WebGLRenderContext.getInstance(0, 0);\n                return egret.sys._createTexture(webglrendercontext, this.width, this.height, null);\n                /*\n                const gl = this.gl;\n                const texture: WebGLTexture = gl.createTexture();\n                texture[glContext] = gl;\n                gl.bindTexture(gl.TEXTURE_2D, texture);\n                gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, this.width, this.height, 0, gl.RGBA, gl.UNSIGNED_BYTE, null);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n                return texture;\n                */\n            };\n            WebGLRenderTarget.prototype.clear = function (bind) {\n                var gl = this.gl;\n                if (bind) {\n                    this.activate();\n                }\n                gl.colorMask(true, true, true, true);\n                gl.clearColor(this.clearColor[0], this.clearColor[1], this.clearColor[2], this.clearColor[3]);\n                gl.clear(gl.COLOR_BUFFER_BIT);\n            };\n            WebGLRenderTarget.prototype.enabledStencil = function () {\n                if (!this.frameBuffer || this.stencilBuffer) {\n                    return;\n                }\n                var gl = this.gl;\n                gl.bindFramebuffer(gl.FRAMEBUFFER, this.frameBuffer);\n                this.stencilBuffer = gl.createRenderbuffer();\n                gl.bindRenderbuffer(gl.RENDERBUFFER, this.stencilBuffer);\n                gl.renderbufferStorage(gl.RENDERBUFFER, gl.DEPTH_STENCIL, this.width, this.height);\n                gl.framebufferRenderbuffer(gl.FRAMEBUFFER, gl.DEPTH_STENCIL_ATTACHMENT, gl.RENDERBUFFER, this.stencilBuffer);\n                // Is unbundling a bug here?\n                // gl.bindFramebuffer(gl.FRAMEBUFFER, null);\n            };\n            WebGLRenderTarget.prototype.dispose = function () {\n                egret.WebGLUtils.deleteWebGLTexture(this.texture);\n            };\n            return WebGLRenderTarget;\n        }(egret.HashObject));\n        web.WebGLRenderTarget = WebGLRenderTarget;\n        __reflect(WebGLRenderTarget.prototype, \"egret.web.WebGLRenderTarget\");\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        //TO DO\n        var debugLogCompressedTextureNotSupported = {};\n        /**\n         * @private\n         * WebGL上下文对象，提供简单的绘图接口\n         * 抽象出此类，以实现共用一个context\n         */\n        var WebGLRenderContext = (function () {\n            function WebGLRenderContext(width, height) {\n                //\n                this._defaultEmptyTexture = null;\n                this.glID = null;\n                this.projectionX = NaN;\n                this.projectionY = NaN;\n                this.contextLost = false;\n                //refactor\n                this._supportedCompressedTextureInfo = [];\n                this.$scissorState = false;\n                this.vertSize = 5;\n                this.surface = egret.sys.mainCanvas(width, height);\n                if (egret.nativeRender) {\n                    return;\n                }\n                this.initWebGL();\n                this.$bufferStack = [];\n                var gl = this.context;\n                this.vertexBuffer = gl.createBuffer();\n                this.indexBuffer = gl.createBuffer();\n                gl.bindBuffer(gl.ARRAY_BUFFER, this.vertexBuffer);\n                gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, this.indexBuffer);\n                this.drawCmdManager = new web.WebGLDrawCmdManager();\n                this.vao = new web.WebGLVertexArrayObject();\n                this.setGlobalCompositeOperation(\"source-over\");\n            }\n            WebGLRenderContext.getInstance = function (width, height) {\n                if (this.instance) {\n                    return this.instance;\n                }\n                this.instance = new WebGLRenderContext(width, height);\n                return this.instance;\n            };\n            /**\n             * 推入一个RenderBuffer并绑定\n             */\n            WebGLRenderContext.prototype.pushBuffer = function (buffer) {\n                this.$bufferStack.push(buffer);\n                if (buffer != this.currentBuffer) {\n                    if (this.currentBuffer) {\n                        // this.$drawWebGL();\n                    }\n                    this.drawCmdManager.pushActivateBuffer(buffer);\n                }\n                this.currentBuffer = buffer;\n            };\n            /**\n             * 推出一个RenderBuffer并绑定上一个RenderBuffer\n             */\n            WebGLRenderContext.prototype.popBuffer = function () {\n                // 如果只剩下一个buffer，则不执行pop操作\n                // 保证舞台buffer永远在最开始\n                if (this.$bufferStack.length <= 1) {\n                    return;\n                }\n                var buffer = this.$bufferStack.pop();\n                var lastBuffer = this.$bufferStack[this.$bufferStack.length - 1];\n                // 重新绑定\n                if (buffer != lastBuffer) {\n                    // this.$drawWebGL();\n                    this.drawCmdManager.pushActivateBuffer(lastBuffer);\n                }\n                this.currentBuffer = lastBuffer;\n            };\n            /**\n             * 启用RenderBuffer\n             */\n            WebGLRenderContext.prototype.activateBuffer = function (buffer, width, height) {\n                buffer.rootRenderTarget.activate();\n                if (!this.bindIndices) {\n                    this.uploadIndicesArray(this.vao.getIndices());\n                }\n                buffer.restoreStencil();\n                buffer.restoreScissor();\n                this.onResize(width, height);\n            };\n            /**\n             * 上传顶点数据\n             */\n            WebGLRenderContext.prototype.uploadVerticesArray = function (array) {\n                var gl = this.context;\n                gl.bufferData(gl.ARRAY_BUFFER, array, gl.STREAM_DRAW);\n                // gl.bufferSubData(gl.ARRAY_BUFFER, 0, array);\n            };\n            /**\n             * 上传索引数据\n             */\n            WebGLRenderContext.prototype.uploadIndicesArray = function (array) {\n                var gl = this.context;\n                gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, array, gl.STATIC_DRAW);\n                this.bindIndices = true;\n            };\n            /**\n             * 销毁绘制对象\n             */\n            WebGLRenderContext.prototype.destroy = function () {\n                this.surface.width = this.surface.height = 0;\n            };\n            WebGLRenderContext.prototype.onResize = function (width, height) {\n                width = width || this.surface.width;\n                height = height || this.surface.height;\n                this.projectionX = width / 2;\n                this.projectionY = -height / 2;\n                if (this.context) {\n                    this.context.viewport(0, 0, width, height);\n                }\n            };\n            /**\n             * 改变渲染缓冲的大小并清空缓冲区\n             * @param width 改变后的宽\n             * @param height 改变后的高\n             * @param useMaxSize 若传入true，则将改变后的尺寸与已有尺寸对比，保留较大的尺寸。\n             */\n            WebGLRenderContext.prototype.resize = function (width, height, useMaxSize) {\n                egret.sys.resizeContext(this, width, height, useMaxSize);\n                /*\n                let surface = this.surface;\n                if (useMaxSize) {\n                    if (surface.width < width) {\n                        surface.width = width;\n                    }\n                    if (surface.height < height) {\n                        surface.height = height;\n                    }\n                }\n                else {\n                    if (surface.width != width) {\n                        surface.width = width;\n                    }\n                    if (surface.height != height) {\n                        surface.height = height;\n                    }\n                }\n    \n                this.onResize();\n                */\n            };\n            WebGLRenderContext.prototype._buildSupportedCompressedTextureInfo = function (/*gl: WebGLRenderingContext, compressedTextureExNames: string[],*/ extensions) {\n                // if (compressedTextureExNames.length === 0) {\n                //     return [];\n                // }\n                var returnValue = [];\n                // for (const exName of compressedTextureExNames) {\n                //     const extension = gl.getExtension(exName);\n                for (var _i = 0, extensions_1 = extensions; _i < extensions_1.length; _i++) {\n                    var extension = extensions_1[_i];\n                    if (!extension) {\n                        continue;\n                    }\n                    var info = {\n                        extensionName: extension.name,\n                        supportedFormats: []\n                    };\n                    //\n                    for (var key in extension) {\n                        info.supportedFormats.push([key, extension[key]]);\n                    }\n                    //\n                    if (true) {\n                        if (info.supportedFormats.length === 0) {\n                            console.error('buildSupportedCompressedTextureInfo failed = ' + extension.name);\n                        }\n                        else {\n                            egret.log('support: ' + extension.name);\n                            for (var key in extension) {\n                                egret.log(key, extension[key], '0x' + extension[key].toString(16));\n                            }\n                        }\n                    }\n                    returnValue.push(info);\n                }\n                return returnValue;\n            };\n            WebGLRenderContext.prototype.initWebGL = function () {\n                this.onResize();\n                this.surface.addEventListener(\"webglcontextlost\", this.handleContextLost.bind(this), false);\n                this.surface.addEventListener(\"webglcontextrestored\", this.handleContextRestored.bind(this), false);\n                this.getWebGLContext();\n                var gl = this.context;\n                this.$maxTextureSize = gl.getParameter(gl.MAX_TEXTURE_SIZE);\n                //refactor\n                // this._caps.astc = this._gl.getExtension('WEBGL_compressed_texture_astc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_astc');\n                // this._caps.s3tc = this._gl.getExtension('WEBGL_compressed_texture_s3tc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_s3tc');\n                // this._caps.pvrtc = this._gl.getExtension('WEBGL_compressed_texture_pvrtc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc');\n                // this._caps.etc1 = this._gl.getExtension('WEBGL_compressed_texture_etc1') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_etc1');\n                // this._caps.etc2 = this._gl.getExtension('WEBGL_compressed_texture_etc') || this._gl.getExtension('WEBKIT_WEBGL_compressed_texture_etc') ||\n                //     this._gl.getExtension('WEBGL_compressed_texture_es3_0'); // also a requirement of OpenGL ES 3\n                // const compressedTextureExNames = [\n                //     'WEBGL_compressed_texture_pvrtc', 'WEBKIT_WEBGL_compressed_texture_pvrtc',\n                //     'WEBGL_compressed_texture_etc1', 'WEBKIT_WEBGL_compressed_texture_etc1',\n                //     'WEBGL_compressed_texture_etc', 'WEBKIT_WEBGL_compressed_texture_etc',\n                //     'WEBGL_compressed_texture_astc', 'WEBKIT_WEBGL_compressed_texture_astc',\n                //     'WEBGL_compressed_texture_s3tc', 'WEBKIT_WEBGL_compressed_texture_s3tc',\n                //     'WEBGL_compressed_texture_es3_0'];\n                //\n                this.pvrtc = gl.getExtension('WEBGL_compressed_texture_pvrtc') || gl.getExtension('WEBKIT_WEBGL_compressed_texture_pvrtc');\n                if (this.pvrtc) {\n                    this.pvrtc.name = 'WEBGL_compressed_texture_pvrtc';\n                }\n                //\n                this.etc1 = gl.getExtension('WEBGL_compressed_texture_etc1') || gl.getExtension('WEBKIT_WEBGL_compressed_texture_etc1');\n                if (this.etc1) {\n                    this.etc1.name = 'WEBGL_compressed_texture_etc1';\n                }\n                //\n                egret.Capabilities.supportedCompressedTexture = egret.Capabilities.supportedCompressedTexture || {};\n                egret.Capabilities.supportedCompressedTexture.pvrtc = !!this.pvrtc;\n                egret.Capabilities.supportedCompressedTexture.etc1 = !!this.etc1;\n                //\n                this._supportedCompressedTextureInfo = this._buildSupportedCompressedTextureInfo(/*this.context, compressedTextureExNames,*/ [this.etc1, this.pvrtc]);\n            };\n            WebGLRenderContext.prototype.handleContextLost = function () {\n                this.contextLost = true;\n            };\n            WebGLRenderContext.prototype.handleContextRestored = function () {\n                this.initWebGL();\n                this.contextLost = false;\n            };\n            WebGLRenderContext.prototype.getWebGLContext = function () {\n                /*\n                let options = {\n                    antialias: WebGLRenderContext.antialias,\n                    stencil: true//设置可以使用模板（用于不规则遮罩）\n                };\n                let gl: any;\n                //todo 是否使用chrome源码names\n                //let contextNames = [\"moz-webgl\", \"webkit-3d\", \"experimental-webgl\", \"webgl\", \"3d\"];\n                let names = [\"webgl\", \"experimental-webgl\"];\n                for (let i = 0; i < names.length; i++) {\n                    try {\n                        gl = this.surface.getContext(names[i], options);\n                    } catch (e) {\n                    }\n                    if (gl) {\n                        break;\n                    }\n                }\n                if (!gl) {\n                    $error(1021);\n                }\n                */\n                var gl = egret.sys.getContextWebGL(this.surface);\n                this.setContext(gl);\n            };\n            WebGLRenderContext.prototype.setContext = function (gl) {\n                this.context = gl;\n                gl.id = WebGLRenderContext.glContextId++;\n                this.glID = gl.id;\n                gl.disable(gl.DEPTH_TEST);\n                gl.disable(gl.CULL_FACE);\n                gl.enable(gl.BLEND);\n                gl.colorMask(true, true, true, true);\n                // 目前只使用0号材质单元，默认开启\n                gl.activeTexture(gl.TEXTURE0);\n            };\n            /**\n             * 开启模版检测\n             */\n            WebGLRenderContext.prototype.enableStencilTest = function () {\n                var gl = this.context;\n                gl.enable(gl.STENCIL_TEST);\n            };\n            /**\n             * 关闭模版检测\n             */\n            WebGLRenderContext.prototype.disableStencilTest = function () {\n                var gl = this.context;\n                gl.disable(gl.STENCIL_TEST);\n            };\n            /**\n             * 开启scissor检测\n             */\n            WebGLRenderContext.prototype.enableScissorTest = function (rect) {\n                var gl = this.context;\n                gl.enable(gl.SCISSOR_TEST);\n                gl.scissor(rect.x, rect.y, rect.width, rect.height);\n            };\n            /**\n             * 关闭scissor检测\n             */\n            WebGLRenderContext.prototype.disableScissorTest = function () {\n                var gl = this.context;\n                gl.disable(gl.SCISSOR_TEST);\n            };\n            /**\n             * 获取像素信息\n             */\n            WebGLRenderContext.prototype.getPixels = function (x, y, width, height, pixels) {\n                var gl = this.context;\n                gl.readPixels(x, y, width, height, gl.RGBA, gl.UNSIGNED_BYTE, pixels);\n            };\n            /**\n             * 创建一个WebGLTexture\n             */\n            WebGLRenderContext.prototype.createTexture = function (bitmapData) {\n                return egret.sys.createTexture(this, bitmapData);\n            };\n            /*\n            * TO DO\n            */\n            WebGLRenderContext.prototype.checkCompressedTextureInternalFormat = function (supportedCompressedTextureInfo, internalFormat) {\n                //width: number, height: number max ?\n                for (var i = 0, length_3 = supportedCompressedTextureInfo.length; i < length_3; ++i) {\n                    var ss = supportedCompressedTextureInfo[i];\n                    // const formats = ss._COMPRESSED_TEXTURE_FORMATS_;\n                    // for (let j = 0, length = formats.length; j < length; ++j) {\n                    //     if (formats[j] === internalFormat) {\n                    //         return true;\n                    //     }\n                    // }\n                    var supportedFormats = ss.supportedFormats;\n                    for (var j = 0, length_4 = supportedFormats.length; j < length_4; ++j) {\n                        if (supportedFormats[j][1] === internalFormat) {\n                            return true;\n                        }\n                    }\n                }\n                return false;\n            };\n            /*\n            * TO DO\n            */\n            WebGLRenderContext.prototype.$debugLogCompressedTextureNotSupported = function (supportedCompressedTextureInfo, internalFormat) {\n                if (!debugLogCompressedTextureNotSupported[internalFormat]) {\n                    debugLogCompressedTextureNotSupported[internalFormat] = true;\n                    egret.log('internalFormat = ' + internalFormat + ':' + ('0x' + internalFormat.toString(16)) + ', the current hardware does not support the corresponding compression format.');\n                    for (var i = 0, length_5 = supportedCompressedTextureInfo.length; i < length_5; ++i) {\n                        var ss = supportedCompressedTextureInfo[i];\n                        if (ss.supportedFormats.length > 0) {\n                            egret.log('support = ' + ss.extensionName);\n                            for (var j = 0, length_6 = ss.supportedFormats.length; j < length_6; ++j) {\n                                var tp = ss.supportedFormats[j];\n                                egret.log(tp[0] + ' : ' + tp[1] + ' : ' + ('0x' + tp[1].toString(16)));\n                            }\n                        }\n                    }\n                }\n            };\n            //\n            WebGLRenderContext.prototype.createCompressedTexture = function (data, width, height, levels, internalFormat) {\n                var checkSupported = this.checkCompressedTextureInternalFormat(this._supportedCompressedTextureInfo, internalFormat);\n                if (!checkSupported) {\n                    this.$debugLogCompressedTextureNotSupported(this._supportedCompressedTextureInfo, internalFormat);\n                    return this.defaultEmptyTexture;\n                }\n                ///\n                var gl = this.context;\n                var texture = gl.createTexture();\n                if (!texture) {\n                    this.contextLost = true;\n                    return;\n                }\n                texture[egret.glContext] = gl;\n                texture[egret.is_compressed_texture] = true;\n                gl.bindTexture(gl.TEXTURE_2D, texture);\n                gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, 1);\n                texture[egret.UNPACK_PREMULTIPLY_ALPHA_WEBGL] = true;\n                gl.compressedTexImage2D(gl.TEXTURE_2D, levels, internalFormat, width, height, 0, data);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE);\n                gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE);\n                gl.bindTexture(gl.TEXTURE_2D, null);\n                return texture;\n            };\n            /**\n             * 更新材质的bitmapData\n             */\n            WebGLRenderContext.prototype.updateTexture = function (texture, bitmapData) {\n                var gl = this.context;\n                gl.bindTexture(gl.TEXTURE_2D, texture);\n                gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, bitmapData);\n            };\n            Object.defineProperty(WebGLRenderContext.prototype, \"defaultEmptyTexture\", {\n                get: function () {\n                    if (!this._defaultEmptyTexture) {\n                        var size = 16;\n                        var canvas = egret.sys.createCanvas(size, size);\n                        var context = egret.sys.getContext2d(canvas); //canvas.getContext('2d');\n                        context.fillStyle = 'white';\n                        context.fillRect(0, 0, size, size);\n                        this._defaultEmptyTexture = this.createTexture(canvas);\n                        this._defaultEmptyTexture[egret.engine_default_empty_texture] = true;\n                    }\n                    return this._defaultEmptyTexture;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            WebGLRenderContext.prototype.getWebGLTexture = function (bitmapData) {\n                if (!bitmapData.webGLTexture) {\n                    if (bitmapData.format == \"image\" && !bitmapData.hasCompressed2d()) {\n                        bitmapData.webGLTexture = this.createTexture(bitmapData.source);\n                    }\n                    else if (bitmapData.hasCompressed2d()) {\n                        var compressedData = bitmapData.getCompressed2dTextureData();\n                        bitmapData.webGLTexture = this.createCompressedTexture(compressedData.byteArray, compressedData.width, compressedData.height, compressedData.level, compressedData.glInternalFormat);\n                        ///\n                        var etcAlphaMask = bitmapData.etcAlphaMask;\n                        if (etcAlphaMask) {\n                            var maskTexture = this.getWebGLTexture(etcAlphaMask);\n                            if (maskTexture) {\n                                bitmapData.webGLTexture[egret.etc_alpha_mask] = maskTexture;\n                            }\n                        }\n                    }\n                    if (bitmapData.$deleteSource && bitmapData.webGLTexture) {\n                        if (bitmapData.source) {\n                            // WeChat Memory leakage bug\n                            bitmapData.source.src = '';\n                            bitmapData.source = null;\n                        }\n                        bitmapData.clearCompressedTextureData();\n                    }\n                    if (bitmapData.webGLTexture) {\n                        //todo 默认值\n                        bitmapData.webGLTexture[\"smoothing\"] = true;\n                    }\n                }\n                return bitmapData.webGLTexture;\n            };\n            /**\n             * 清除矩形区域\n             */\n            WebGLRenderContext.prototype.clearRect = function (x, y, width, height) {\n                if (x != 0 || y != 0 || width != this.surface.width || height != this.surface.height) {\n                    var buffer = this.currentBuffer;\n                    if (buffer.$hasScissor) {\n                        this.setGlobalCompositeOperation(\"destination-out\");\n                        this.drawRect(x, y, width, height);\n                        this.setGlobalCompositeOperation(\"source-over\");\n                    }\n                    else {\n                        var m = buffer.globalMatrix;\n                        if (m.b == 0 && m.c == 0) {\n                            x = x * m.a + m.tx;\n                            y = y * m.d + m.ty;\n                            width = width * m.a;\n                            height = height * m.d;\n                            this.enableScissor(x, -y - height + buffer.height, width, height);\n                            this.clear();\n                            this.disableScissor();\n                        }\n                        else {\n                            this.setGlobalCompositeOperation(\"destination-out\");\n                            this.drawRect(x, y, width, height);\n                            this.setGlobalCompositeOperation(\"source-over\");\n                        }\n                    }\n                }\n                else {\n                    this.clear();\n                }\n            };\n            /**\n             * 设置混色\n             */\n            WebGLRenderContext.prototype.setGlobalCompositeOperation = function (value) {\n                this.drawCmdManager.pushSetBlend(value);\n            };\n            /**\n             * 绘制图片，image参数可以是BitmapData或者renderTarget\n             */\n            WebGLRenderContext.prototype.drawImage = function (image, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight, imageSourceWidth, imageSourceHeight, rotated, smoothing) {\n                var buffer = this.currentBuffer;\n                if (this.contextLost || !image || !buffer) {\n                    return;\n                }\n                var texture;\n                var offsetX;\n                var offsetY;\n                if (image[\"texture\"] || (image.source && image.source[\"texture\"])) {\n                    // 如果是render target\n                    texture = image[\"texture\"] || image.source[\"texture\"];\n                    buffer.saveTransform();\n                    offsetX = buffer.$offsetX;\n                    offsetY = buffer.$offsetY;\n                    buffer.useOffset();\n                    buffer.transform(1, 0, 0, -1, 0, destHeight + destY * 2); // 翻转\n                }\n                else if (!image.source && !image.webGLTexture) {\n                    return;\n                }\n                else {\n                    texture = this.getWebGLTexture(image);\n                }\n                if (!texture) {\n                    return;\n                }\n                this.drawTexture(texture, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight, imageSourceWidth, imageSourceHeight, undefined, undefined, undefined, undefined, rotated, smoothing);\n                if (image.source && image.source[\"texture\"]) {\n                    buffer.$offsetX = offsetX;\n                    buffer.$offsetY = offsetY;\n                    buffer.restoreTransform();\n                }\n            };\n            /**\n             * 绘制Mesh\n             */\n            WebGLRenderContext.prototype.drawMesh = function (image, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight, imageSourceWidth, imageSourceHeight, meshUVs, meshVertices, meshIndices, bounds, rotated, smoothing) {\n                var buffer = this.currentBuffer;\n                if (this.contextLost || !image || !buffer) {\n                    return;\n                }\n                var texture;\n                var offsetX;\n                var offsetY;\n                if (image[\"texture\"] || (image.source && image.source[\"texture\"])) {\n                    // 如果是render target\n                    texture = image[\"texture\"] || image.source[\"texture\"];\n                    buffer.saveTransform();\n                    offsetX = buffer.$offsetX;\n                    offsetY = buffer.$offsetY;\n                    buffer.useOffset();\n                    buffer.transform(1, 0, 0, -1, 0, destHeight + destY * 2); // 翻转\n                }\n                else if (!image.source && !image.webGLTexture) {\n                    return;\n                }\n                else {\n                    texture = this.getWebGLTexture(image);\n                }\n                if (!texture) {\n                    return;\n                }\n                this.drawTexture(texture, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight, imageSourceWidth, imageSourceHeight, meshUVs, meshVertices, meshIndices, bounds, rotated, smoothing);\n                if (image[\"texture\"] || (image.source && image.source[\"texture\"])) {\n                    buffer.$offsetX = offsetX;\n                    buffer.$offsetY = offsetY;\n                    buffer.restoreTransform();\n                }\n            };\n            /**\n             * 绘制材质\n             */\n            WebGLRenderContext.prototype.drawTexture = function (texture, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight, textureWidth, textureHeight, meshUVs, meshVertices, meshIndices, bounds, rotated, smoothing) {\n                var buffer = this.currentBuffer;\n                if (this.contextLost || !texture || !buffer) {\n                    return;\n                }\n                if (meshVertices && meshIndices) {\n                    if (this.vao.reachMaxSize(meshVertices.length / 2, meshIndices.length)) {\n                        this.$drawWebGL();\n                    }\n                }\n                else {\n                    if (this.vao.reachMaxSize()) {\n                        this.$drawWebGL();\n                    }\n                }\n                if (smoothing != undefined && texture[\"smoothing\"] != smoothing) {\n                    this.drawCmdManager.pushChangeSmoothing(texture, smoothing);\n                }\n                if (meshUVs) {\n                    this.vao.changeToMeshIndices();\n                }\n                var count = meshIndices ? meshIndices.length / 3 : 2;\n                // 应用$filter，因为只可能是colorMatrixFilter，最后两个参数可不传\n                this.drawCmdManager.pushDrawTexture(texture, count, this.$filter, textureWidth, textureHeight);\n                buffer.currentTexture = texture;\n                this.vao.cacheArrays(buffer, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight, textureWidth, textureHeight, meshUVs, meshVertices, meshIndices, rotated);\n            };\n            /**\n             * 绘制矩形（仅用于遮罩擦除等）\n             */\n            WebGLRenderContext.prototype.drawRect = function (x, y, width, height) {\n                var buffer = this.currentBuffer;\n                if (this.contextLost || !buffer) {\n                    return;\n                }\n                if (this.vao.reachMaxSize()) {\n                    this.$drawWebGL();\n                }\n                this.drawCmdManager.pushDrawRect();\n                buffer.currentTexture = null;\n                this.vao.cacheArrays(buffer, 0, 0, width, height, x, y, width, height, width, height);\n            };\n            /**\n             * 绘制遮罩\n             */\n            WebGLRenderContext.prototype.pushMask = function (x, y, width, height) {\n                var buffer = this.currentBuffer;\n                if (this.contextLost || !buffer) {\n                    return;\n                }\n                buffer.$stencilList.push({ x: x, y: y, width: width, height: height });\n                if (this.vao.reachMaxSize()) {\n                    this.$drawWebGL();\n                }\n                this.drawCmdManager.pushPushMask();\n                buffer.currentTexture = null;\n                this.vao.cacheArrays(buffer, 0, 0, width, height, x, y, width, height, width, height);\n            };\n            /**\n             * 恢复遮罩\n             */\n            WebGLRenderContext.prototype.popMask = function () {\n                var buffer = this.currentBuffer;\n                if (this.contextLost || !buffer) {\n                    return;\n                }\n                var mask = buffer.$stencilList.pop();\n                if (this.vao.reachMaxSize()) {\n                    this.$drawWebGL();\n                }\n                this.drawCmdManager.pushPopMask();\n                buffer.currentTexture = null;\n                this.vao.cacheArrays(buffer, 0, 0, mask.width, mask.height, mask.x, mask.y, mask.width, mask.height, mask.width, mask.height);\n            };\n            /**\n             * 清除颜色缓存\n             */\n            WebGLRenderContext.prototype.clear = function () {\n                this.drawCmdManager.pushClearColor();\n            };\n            /**\n             * 开启scissor test\n             */\n            WebGLRenderContext.prototype.enableScissor = function (x, y, width, height) {\n                var buffer = this.currentBuffer;\n                this.drawCmdManager.pushEnableScissor(x, y, width, height);\n                buffer.$hasScissor = true;\n            };\n            /**\n             * 关闭scissor test\n             */\n            WebGLRenderContext.prototype.disableScissor = function () {\n                var buffer = this.currentBuffer;\n                this.drawCmdManager.pushDisableScissor();\n                buffer.$hasScissor = false;\n            };\n            WebGLRenderContext.prototype.$drawWebGL = function () {\n                if (this.drawCmdManager.drawDataLen == 0 || this.contextLost) {\n                    return;\n                }\n                this.uploadVerticesArray(this.vao.getVertices());\n                // 有mesh，则使用indicesForMesh\n                if (this.vao.isMesh()) {\n                    this.uploadIndicesArray(this.vao.getMeshIndices());\n                }\n                var length = this.drawCmdManager.drawDataLen;\n                var offset = 0;\n                for (var i = 0; i < length; i++) {\n                    var data = this.drawCmdManager.drawData[i];\n                    offset = this.drawData(data, offset);\n                    // 计算draw call\n                    if (data.type == 7 /* ACT_BUFFER */) {\n                        this.activatedBuffer = data.buffer;\n                    }\n                    if (data.type == 0 /* TEXTURE */ || data.type == 1 /* RECT */ || data.type == 2 /* PUSH_MASK */ || data.type == 3 /* POP_MASK */) {\n                        if (this.activatedBuffer && this.activatedBuffer.$computeDrawCall) {\n                            this.activatedBuffer.$drawCalls++;\n                        }\n                    }\n                }\n                // 切换回默认indices\n                if (this.vao.isMesh()) {\n                    this.uploadIndicesArray(this.vao.getIndices());\n                }\n                // 清空数据\n                this.drawCmdManager.clear();\n                this.vao.clear();\n            };\n            /**\n             * 执行绘制命令\n             */\n            WebGLRenderContext.prototype.drawData = function (data, offset) {\n                if (!data) {\n                    return;\n                }\n                var gl = this.context;\n                var program;\n                var filter = data.filter;\n                switch (data.type) {\n                    case 0 /* TEXTURE */:\n                        //这段的切换可以优化\n                        if (filter) {\n                            if (filter.type === \"custom\") {\n                                program = web.EgretWebGLProgram.getProgram(gl, filter.$vertexSrc, filter.$fragmentSrc, filter.$shaderKey);\n                            }\n                            else if (filter.type === \"colorTransform\") {\n                                if (data.texture[egret.etc_alpha_mask]) {\n                                    gl.activeTexture(gl.TEXTURE1);\n                                    gl.bindTexture(gl.TEXTURE_2D, data.texture[egret.etc_alpha_mask]);\n                                    program = web.EgretWebGLProgram.getProgram(gl, web.EgretShaderLib.default_vert, web.EgretShaderLib.colorTransform_frag_etc_alphamask_frag, \"colorTransform_frag_etc_alphamask_frag\");\n                                }\n                                else {\n                                    program = web.EgretWebGLProgram.getProgram(gl, web.EgretShaderLib.default_vert, web.EgretShaderLib.colorTransform_frag, \"colorTransform\");\n                                }\n                            }\n                            else if (filter.type === \"blurX\") {\n                                program = web.EgretWebGLProgram.getProgram(gl, web.EgretShaderLib.default_vert, web.EgretShaderLib.blur_frag, \"blur\");\n                            }\n                            else if (filter.type === \"blurY\") {\n                                program = web.EgretWebGLProgram.getProgram(gl, web.EgretShaderLib.default_vert, web.EgretShaderLib.blur_frag, \"blur\");\n                            }\n                            else if (filter.type === \"glow\") {\n                                program = web.EgretWebGLProgram.getProgram(gl, web.EgretShaderLib.default_vert, web.EgretShaderLib.glow_frag, \"glow\");\n                            }\n                        }\n                        else {\n                            if (data.texture[egret.etc_alpha_mask]) {\n                                program = web.EgretWebGLProgram.getProgram(gl, web.EgretShaderLib.default_vert, web.EgretShaderLib.texture_etc_alphamask_frag, egret.etc_alpha_mask);\n                                ///need refactor\n                                gl.activeTexture(gl.TEXTURE1);\n                                gl.bindTexture(gl.TEXTURE_2D, data.texture[egret.etc_alpha_mask]);\n                            }\n                            else {\n                                program = web.EgretWebGLProgram.getProgram(gl, web.EgretShaderLib.default_vert, web.EgretShaderLib.texture_frag, \"texture\");\n                            }\n                        }\n                        this.activeProgram(gl, program);\n                        this.syncUniforms(program, filter, data.textureWidth, data.textureHeight);\n                        offset += this.drawTextureElements(data, offset);\n                        break;\n                    case 1 /* RECT */:\n                        program = web.EgretWebGLProgram.getProgram(gl, web.EgretShaderLib.default_vert, web.EgretShaderLib.primitive_frag, \"primitive\");\n                        this.activeProgram(gl, program);\n                        this.syncUniforms(program, filter, data.textureWidth, data.textureHeight);\n                        offset += this.drawRectElements(data, offset);\n                        break;\n                    case 2 /* PUSH_MASK */:\n                        program = web.EgretWebGLProgram.getProgram(gl, web.EgretShaderLib.default_vert, web.EgretShaderLib.primitive_frag, \"primitive\");\n                        this.activeProgram(gl, program);\n                        this.syncUniforms(program, filter, data.textureWidth, data.textureHeight);\n                        offset += this.drawPushMaskElements(data, offset);\n                        break;\n                    case 3 /* POP_MASK */:\n                        program = web.EgretWebGLProgram.getProgram(gl, web.EgretShaderLib.default_vert, web.EgretShaderLib.primitive_frag, \"primitive\");\n                        this.activeProgram(gl, program);\n                        this.syncUniforms(program, filter, data.textureWidth, data.textureHeight);\n                        offset += this.drawPopMaskElements(data, offset);\n                        break;\n                    case 4 /* BLEND */:\n                        this.setBlendMode(data.value);\n                        break;\n                    case 5 /* RESIZE_TARGET */:\n                        data.buffer.rootRenderTarget.resize(data.width, data.height);\n                        this.onResize(data.width, data.height);\n                        break;\n                    case 6 /* CLEAR_COLOR */:\n                        if (this.activatedBuffer) {\n                            var target = this.activatedBuffer.rootRenderTarget;\n                            if (target.width != 0 || target.height != 0) {\n                                target.clear(true);\n                            }\n                        }\n                        break;\n                    case 7 /* ACT_BUFFER */:\n                        this.activateBuffer(data.buffer, data.width, data.height);\n                        break;\n                    case 8 /* ENABLE_SCISSOR */:\n                        var buffer = this.activatedBuffer;\n                        if (buffer) {\n                            if (buffer.rootRenderTarget) {\n                                buffer.rootRenderTarget.enabledStencil();\n                            }\n                            buffer.enableScissor(data.x, data.y, data.width, data.height);\n                        }\n                        break;\n                    case 9 /* DISABLE_SCISSOR */:\n                        buffer = this.activatedBuffer;\n                        if (buffer) {\n                            buffer.disableScissor();\n                        }\n                        break;\n                    case 10 /* SMOOTHING */:\n                        gl.bindTexture(gl.TEXTURE_2D, data.texture);\n                        if (data.smoothing) {\n                            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR);\n                            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);\n                        }\n                        else {\n                            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST);\n                            gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST);\n                        }\n                        break;\n                    default:\n                        break;\n                }\n                return offset;\n            };\n            WebGLRenderContext.prototype.activeProgram = function (gl, program) {\n                if (program != this.currentProgram) {\n                    gl.useProgram(program.id);\n                    // 目前所有attribute buffer的绑定方法都是一致的\n                    var attribute = program.attributes;\n                    for (var key in attribute) {\n                        if (key === \"aVertexPosition\") {\n                            gl.vertexAttribPointer(attribute[\"aVertexPosition\"].location, 2, gl.FLOAT, false, 5 * 4, 0);\n                            gl.enableVertexAttribArray(attribute[\"aVertexPosition\"].location);\n                        }\n                        else if (key === \"aTextureCoord\") {\n                            gl.vertexAttribPointer(attribute[\"aTextureCoord\"].location, 2, gl.FLOAT, false, 5 * 4, 2 * 4);\n                            gl.enableVertexAttribArray(attribute[\"aTextureCoord\"].location);\n                        }\n                        else if (key === \"aColor\") {\n                            gl.vertexAttribPointer(attribute[\"aColor\"].location, 4, gl.UNSIGNED_BYTE, true, 5 * 4, 4 * 4);\n                            gl.enableVertexAttribArray(attribute[\"aColor\"].location);\n                        }\n                    }\n                    this.currentProgram = program;\n                }\n            };\n            WebGLRenderContext.prototype.syncUniforms = function (program, filter, textureWidth, textureHeight) {\n                var uniforms = program.uniforms;\n                var isCustomFilter = filter && filter.type === \"custom\";\n                for (var key in uniforms) {\n                    if (key === \"projectionVector\") {\n                        uniforms[key].setValue({ x: this.projectionX, y: this.projectionY });\n                    }\n                    else if (key === \"uTextureSize\") {\n                        uniforms[key].setValue({ x: textureWidth, y: textureHeight });\n                    }\n                    else if (key === \"uSampler\") {\n                        uniforms[key].setValue(0);\n                    }\n                    else if (key === \"uSamplerAlphaMask\") {\n                        uniforms[key].setValue(1);\n                    }\n                    else {\n                        var value = filter.$uniforms[key];\n                        if (value !== undefined) {\n                            uniforms[key].setValue(value);\n                        }\n                        else {\n                            // egret.warn(\"filter custom: uniform \" + key + \" not defined!\");\n                        }\n                    }\n                }\n            };\n            /**\n             * 画texture\n             **/\n            WebGLRenderContext.prototype.drawTextureElements = function (data, offset) {\n                return egret.sys.drawTextureElements(this, data, offset);\n                /*\n                let gl: any = this.context;\n                gl.activeTexture(gl.TEXTURE0); ///refactor\n                gl.bindTexture(gl.TEXTURE_2D, data.texture);\n                let size = data.count * 3;\n                gl.drawElements(gl.TRIANGLES, size, gl.UNSIGNED_SHORT, offset * 2);\n                return size;\n                */\n            };\n            /**\n             * @private\n             * 画rect\n             **/\n            WebGLRenderContext.prototype.drawRectElements = function (data, offset) {\n                var gl = this.context;\n                // gl.bindTexture(gl.TEXTURE_2D, null);\n                var size = data.count * 3;\n                gl.drawElements(gl.TRIANGLES, size, gl.UNSIGNED_SHORT, offset * 2);\n                return size;\n            };\n            /**\n             * 画push mask\n             **/\n            WebGLRenderContext.prototype.drawPushMaskElements = function (data, offset) {\n                var gl = this.context;\n                var size = data.count * 3;\n                var buffer = this.activatedBuffer;\n                if (buffer) {\n                    if (buffer.rootRenderTarget) {\n                        buffer.rootRenderTarget.enabledStencil();\n                    }\n                    if (buffer.stencilHandleCount == 0) {\n                        buffer.enableStencil();\n                        gl.clear(gl.STENCIL_BUFFER_BIT); // clear\n                    }\n                    var level = buffer.stencilHandleCount;\n                    buffer.stencilHandleCount++;\n                    gl.colorMask(false, false, false, false);\n                    gl.stencilFunc(gl.EQUAL, level, 0xFF);\n                    gl.stencilOp(gl.KEEP, gl.KEEP, gl.INCR);\n                    // gl.bindTexture(gl.TEXTURE_2D, null);\n                    gl.drawElements(gl.TRIANGLES, size, gl.UNSIGNED_SHORT, offset * 2);\n                    gl.stencilFunc(gl.EQUAL, level + 1, 0xFF);\n                    gl.colorMask(true, true, true, true);\n                    gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n                }\n                return size;\n            };\n            /**\n             * 画pop mask\n             **/\n            WebGLRenderContext.prototype.drawPopMaskElements = function (data, offset) {\n                var gl = this.context;\n                var size = data.count * 3;\n                var buffer = this.activatedBuffer;\n                if (buffer) {\n                    buffer.stencilHandleCount--;\n                    if (buffer.stencilHandleCount == 0) {\n                        buffer.disableStencil(); // skip this draw\n                    }\n                    else {\n                        var level = buffer.stencilHandleCount;\n                        gl.colorMask(false, false, false, false);\n                        gl.stencilFunc(gl.EQUAL, level + 1, 0xFF);\n                        gl.stencilOp(gl.KEEP, gl.KEEP, gl.DECR);\n                        // gl.bindTexture(gl.TEXTURE_2D, null);\n                        gl.drawElements(gl.TRIANGLES, size, gl.UNSIGNED_SHORT, offset * 2);\n                        gl.stencilFunc(gl.EQUAL, level, 0xFF);\n                        gl.colorMask(true, true, true, true);\n                        gl.stencilOp(gl.KEEP, gl.KEEP, gl.KEEP);\n                    }\n                }\n                return size;\n            };\n            /**\n             * 设置混色\n             */\n            WebGLRenderContext.prototype.setBlendMode = function (value) {\n                var gl = this.context;\n                var blendModeWebGL = WebGLRenderContext.blendModesForGL[value];\n                if (blendModeWebGL) {\n                    gl.blendFunc(blendModeWebGL[0], blendModeWebGL[1]);\n                }\n            };\n            /**\n             * 应用滤镜绘制给定的render target\n             * 此方法不会导致input被释放，所以如果需要释放input，需要调用此方法后手动调用release\n             */\n            WebGLRenderContext.prototype.drawTargetWidthFilters = function (filters, input) {\n                var originInput = input, filtersLen = filters.length, output;\n                // 应用前面的滤镜\n                if (filtersLen > 1) {\n                    for (var i = 0; i < filtersLen - 1; i++) {\n                        var filter_1 = filters[i];\n                        var width = input.rootRenderTarget.width;\n                        var height = input.rootRenderTarget.height;\n                        output = web.WebGLRenderBuffer.create(width, height);\n                        output.setTransform(1, 0, 0, 1, 0, 0);\n                        output.globalAlpha = 1;\n                        this.drawToRenderTarget(filter_1, input, output);\n                        if (input != originInput) {\n                            web.WebGLRenderBuffer.release(input);\n                        }\n                        input = output;\n                    }\n                }\n                // 应用最后一个滤镜并绘制到当前场景中\n                var filter = filters[filtersLen - 1];\n                this.drawToRenderTarget(filter, input, this.currentBuffer);\n                // 释放掉用于交换的buffer\n                if (input != originInput) {\n                    web.WebGLRenderBuffer.release(input);\n                }\n            };\n            /**\n             * 向一个renderTarget中绘制\n             * */\n            WebGLRenderContext.prototype.drawToRenderTarget = function (filter, input, output) {\n                if (this.contextLost) {\n                    return;\n                }\n                if (this.vao.reachMaxSize()) {\n                    this.$drawWebGL();\n                }\n                this.pushBuffer(output);\n                var originInput = input, temp, width = input.rootRenderTarget.width, height = input.rootRenderTarget.height;\n                // 模糊滤镜分别处理blurX与blurY\n                if (filter.type == \"blur\") {\n                    var blurXFilter = filter.blurXFilter;\n                    var blurYFilter = filter.blurYFilter;\n                    if (blurXFilter.blurX != 0 && blurYFilter.blurY != 0) {\n                        temp = web.WebGLRenderBuffer.create(width, height);\n                        temp.setTransform(1, 0, 0, 1, 0, 0);\n                        temp.globalAlpha = 1;\n                        this.drawToRenderTarget(filter.blurXFilter, input, temp);\n                        if (input != originInput) {\n                            web.WebGLRenderBuffer.release(input);\n                        }\n                        input = temp;\n                        filter = blurYFilter;\n                    }\n                    else {\n                        filter = blurXFilter.blurX === 0 ? blurYFilter : blurXFilter;\n                    }\n                }\n                // 绘制input结果到舞台\n                output.saveTransform();\n                output.transform(1, 0, 0, -1, 0, height);\n                output.currentTexture = input.rootRenderTarget.texture;\n                this.vao.cacheArrays(output, 0, 0, width, height, 0, 0, width, height, width, height);\n                output.restoreTransform();\n                this.drawCmdManager.pushDrawTexture(input.rootRenderTarget.texture, 2, filter, width, height);\n                // 释放掉input\n                if (input != originInput) {\n                    web.WebGLRenderBuffer.release(input);\n                }\n                this.popBuffer();\n            };\n            WebGLRenderContext.initBlendMode = function () {\n                /*参考\n                gl.ZERO = 0\n                gl.ONE = 1\n                gl.SRC_COLOR = 768\n                gl.ONE_MINUS_SRC_COLOR = 769\n                gl.DST_COLOR = 774\n                gl.ONE_MINUS_DST_COLOR = 775\n                gl.SRC_ALPHA = 770\n                gl.ONE_MINUS_SRC_ALPHA = 771\n                gl.DST_ALPHA = 772\n                gl.ONE_MINUS_DST_ALPHA = 773\n                gl.CONSTANT_COLOR = 32769\n                gl.ONE_MINUS_CONSTANT_COLOR = 32770\n                gl.CONSTANT_ALPHA = 32771\n                gl.ONE_MINUS_CONSTANT_ALPHA = 32772\n                gl.SRC_ALPHA_SATURATE = 776\n                */\n                WebGLRenderContext.blendModesForGL = {};\n                WebGLRenderContext.blendModesForGL[\"source-over\"] = [1, 771];\n                WebGLRenderContext.blendModesForGL[\"lighter\"] = [1, 1];\n                WebGLRenderContext.blendModesForGL[\"lighter-in\"] = [770, 771];\n                WebGLRenderContext.blendModesForGL[\"destination-out\"] = [0, 771];\n                WebGLRenderContext.blendModesForGL[\"destination-in\"] = [0, 770];\n            };\n            WebGLRenderContext.glContextId = 0;\n            WebGLRenderContext.blendModesForGL = null;\n            return WebGLRenderContext;\n        }());\n        web.WebGLRenderContext = WebGLRenderContext;\n        __reflect(WebGLRenderContext.prototype, \"egret.web.WebGLRenderContext\", [\"egret.sys.RenderContext\"]);\n        WebGLRenderContext.initBlendMode();\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         * WebGL渲染缓存\n         */\n        var WebGLRenderBuffer = (function (_super) {\n            __extends(WebGLRenderBuffer, _super);\n            function WebGLRenderBuffer(width, height, root) {\n                var _this = _super.call(this) || this;\n                //\n                _this.currentTexture = null;\n                _this.globalAlpha = 1;\n                _this.globalTintColor = 0xFFFFFF;\n                /**\n                 * stencil state\n                 * 模版开关状态\n                 */\n                _this.stencilState = false;\n                _this.$stencilList = [];\n                _this.stencilHandleCount = 0;\n                /**\n                 * scissor state\n                 * scissor 开关状态\n                 */\n                _this.$scissorState = false;\n                _this.scissorRect = new egret.Rectangle();\n                _this.$hasScissor = false;\n                _this.$drawCalls = 0;\n                _this.$computeDrawCall = false;\n                _this.globalMatrix = new egret.Matrix();\n                _this.savedGlobalMatrix = new egret.Matrix();\n                _this.$offsetX = 0;\n                _this.$offsetY = 0;\n                // 获取webglRenderContext\n                _this.context = web.WebGLRenderContext.getInstance(width, height);\n                if (egret.nativeRender) {\n                    if (root) {\n                        _this.surface = _this.context.surface;\n                    }\n                    else {\n                        _this.surface = new egret_native.NativeRenderSurface(_this, width, height, root);\n                    }\n                    _this.rootRenderTarget = null;\n                    return _this;\n                }\n                // buffer 对应的 render target\n                _this.rootRenderTarget = new web.WebGLRenderTarget(_this.context.context, 3, 3);\n                if (width && height) {\n                    _this.resize(width, height);\n                }\n                // 如果是第一个加入的buffer，说明是舞台buffer\n                _this.root = root;\n                // 如果是用于舞台渲染的renderBuffer，则默认添加renderTarget到renderContext中，而且是第一个\n                if (_this.root) {\n                    _this.context.pushBuffer(_this);\n                    // 画布\n                    _this.surface = _this.context.surface;\n                    _this.$computeDrawCall = true;\n                }\n                else {\n                    // 由于创建renderTarget造成的frameBuffer绑定，这里重置绑定\n                    var lastBuffer = _this.context.activatedBuffer;\n                    if (lastBuffer) {\n                        lastBuffer.rootRenderTarget.activate();\n                    }\n                    _this.rootRenderTarget.initFrameBuffer();\n                    _this.surface = _this.rootRenderTarget;\n                }\n                return _this;\n            }\n            WebGLRenderBuffer.prototype.enableStencil = function () {\n                if (!this.stencilState) {\n                    this.context.enableStencilTest();\n                    this.stencilState = true;\n                }\n            };\n            WebGLRenderBuffer.prototype.disableStencil = function () {\n                if (this.stencilState) {\n                    this.context.disableStencilTest();\n                    this.stencilState = false;\n                }\n            };\n            WebGLRenderBuffer.prototype.restoreStencil = function () {\n                if (this.stencilState) {\n                    this.context.enableStencilTest();\n                }\n                else {\n                    this.context.disableStencilTest();\n                }\n            };\n            WebGLRenderBuffer.prototype.enableScissor = function (x, y, width, height) {\n                if (!this.$scissorState) {\n                    this.$scissorState = true;\n                    this.scissorRect.setTo(x, y, width, height);\n                    this.context.enableScissorTest(this.scissorRect);\n                }\n            };\n            WebGLRenderBuffer.prototype.disableScissor = function () {\n                if (this.$scissorState) {\n                    this.$scissorState = false;\n                    this.scissorRect.setEmpty();\n                    this.context.disableScissorTest();\n                }\n            };\n            WebGLRenderBuffer.prototype.restoreScissor = function () {\n                if (this.$scissorState) {\n                    this.context.enableScissorTest(this.scissorRect);\n                }\n                else {\n                    this.context.disableScissorTest();\n                }\n            };\n            Object.defineProperty(WebGLRenderBuffer.prototype, \"width\", {\n                /**\n                 * 渲染缓冲的宽度，以像素为单位。\n                 * @readOnly\n                 */\n                get: function () {\n                    if (egret.nativeRender) {\n                        return this.surface.width;\n                    }\n                    else {\n                        return this.rootRenderTarget.width;\n                    }\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(WebGLRenderBuffer.prototype, \"height\", {\n                /**\n                 * 渲染缓冲的高度，以像素为单位。\n                 * @readOnly\n                 */\n                get: function () {\n                    if (egret.nativeRender) {\n                        return this.surface.height;\n                    }\n                    else {\n                        return this.rootRenderTarget.height;\n                    }\n                },\n                enumerable: true,\n                configurable: true\n            });\n            /**\n             * 改变渲染缓冲的大小并清空缓冲区\n             * @param width 改变后的宽\n             * @param height 改变后的高\n             * @param useMaxSize 若传入true，则将改变后的尺寸与已有尺寸对比，保留较大的尺寸。\n             */\n            WebGLRenderBuffer.prototype.resize = function (width, height, useMaxSize) {\n                width = width || 1;\n                height = height || 1;\n                if (egret.nativeRender) {\n                    this.surface.resize(width, height);\n                    return;\n                }\n                this.context.pushBuffer(this);\n                // render target 尺寸重置\n                if (width != this.rootRenderTarget.width || height != this.rootRenderTarget.height) {\n                    this.context.drawCmdManager.pushResize(this, width, height);\n                    // 同步更改宽高\n                    this.rootRenderTarget.width = width;\n                    this.rootRenderTarget.height = height;\n                }\n                // 如果是舞台的渲染缓冲，执行resize，否则surface大小不随之改变\n                if (this.root) {\n                    this.context.resize(width, height, useMaxSize);\n                }\n                this.context.clear();\n                this.context.popBuffer();\n            };\n            /**\n             * 获取指定区域的像素\n             */\n            WebGLRenderBuffer.prototype.getPixels = function (x, y, width, height) {\n                if (width === void 0) { width = 1; }\n                if (height === void 0) { height = 1; }\n                var pixels = new Uint8Array(4 * width * height);\n                if (egret.nativeRender) {\n                    egret_native.activateBuffer(this);\n                    egret_native.nrGetPixels(x, y, width, height, pixels);\n                    egret_native.activateBuffer(null);\n                }\n                else {\n                    var useFrameBuffer = this.rootRenderTarget.useFrameBuffer;\n                    this.rootRenderTarget.useFrameBuffer = true;\n                    this.rootRenderTarget.activate();\n                    this.context.getPixels(x, y, width, height, pixels);\n                    this.rootRenderTarget.useFrameBuffer = useFrameBuffer;\n                    this.rootRenderTarget.activate();\n                }\n                //图像反转\n                var result = new Uint8Array(4 * width * height);\n                for (var i = 0; i < height; i++) {\n                    for (var j = 0; j < width; j++) {\n                        var index1 = (width * (height - i - 1) + j) * 4;\n                        var index2 = (width * i + j) * 4;\n                        var a = pixels[index2 + 3];\n                        result[index1] = Math.round(pixels[index2] / a * 255);\n                        result[index1 + 1] = Math.round(pixels[index2 + 1] / a * 255);\n                        result[index1 + 2] = Math.round(pixels[index2 + 2] / a * 255);\n                        result[index1 + 3] = pixels[index2 + 3];\n                    }\n                }\n                return result;\n            };\n            /**\n             * 转换成base64字符串，如果图片（或者包含的图片）跨域，则返回null\n             * @param type 转换的类型，如: \"image/png\",\"image/jpeg\"\n             */\n            WebGLRenderBuffer.prototype.toDataURL = function (type, encoderOptions) {\n                return this.context.surface.toDataURL(type, encoderOptions);\n            };\n            /**\n             * 销毁绘制对象\n             */\n            WebGLRenderBuffer.prototype.destroy = function () {\n                this.context.destroy();\n            };\n            WebGLRenderBuffer.prototype.onRenderFinish = function () {\n                this.$drawCalls = 0;\n            };\n            /**\n             * 交换frameBuffer中的图像到surface中\n             * @param width 宽度\n             * @param height 高度\n             */\n            WebGLRenderBuffer.prototype.drawFrameBufferToSurface = function (sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight, clear) {\n                if (clear === void 0) { clear = false; }\n                this.rootRenderTarget.useFrameBuffer = false;\n                this.rootRenderTarget.activate();\n                this.context.disableStencilTest(); // 切换frameBuffer注意要禁用STENCIL_TEST\n                this.context.disableScissorTest();\n                this.setTransform(1, 0, 0, 1, 0, 0);\n                this.globalAlpha = 1;\n                this.context.setGlobalCompositeOperation(\"source-over\");\n                clear && this.context.clear();\n                this.context.drawImage(this.rootRenderTarget, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight, sourceWidth, sourceHeight, false);\n                this.context.$drawWebGL();\n                this.rootRenderTarget.useFrameBuffer = true;\n                this.rootRenderTarget.activate();\n                this.restoreStencil();\n                this.restoreScissor();\n            };\n            /**\n             * 交换surface的图像到frameBuffer中\n             * @param width 宽度\n             * @param height 高度\n             */\n            WebGLRenderBuffer.prototype.drawSurfaceToFrameBuffer = function (sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight, clear) {\n                if (clear === void 0) { clear = false; }\n                this.rootRenderTarget.useFrameBuffer = true;\n                this.rootRenderTarget.activate();\n                this.context.disableStencilTest(); // 切换frameBuffer注意要禁用STENCIL_TEST\n                this.context.disableScissorTest();\n                this.setTransform(1, 0, 0, 1, 0, 0);\n                this.globalAlpha = 1;\n                this.context.setGlobalCompositeOperation(\"source-over\");\n                clear && this.context.clear();\n                this.context.drawImage(this.context.surface, sourceX, sourceY, sourceWidth, sourceHeight, destX, destY, destWidth, destHeight, sourceWidth, sourceHeight, false);\n                this.context.$drawWebGL();\n                this.rootRenderTarget.useFrameBuffer = false;\n                this.rootRenderTarget.activate();\n                this.restoreStencil();\n                this.restoreScissor();\n            };\n            /**\n             * 清空缓冲区数据\n             */\n            WebGLRenderBuffer.prototype.clear = function () {\n                this.context.pushBuffer(this);\n                this.context.clear();\n                this.context.popBuffer();\n            };\n            WebGLRenderBuffer.prototype.setTransform = function (a, b, c, d, tx, ty) {\n                // this.globalMatrix.setTo(a, b, c, d, tx, ty);\n                var matrix = this.globalMatrix;\n                matrix.a = a;\n                matrix.b = b;\n                matrix.c = c;\n                matrix.d = d;\n                matrix.tx = tx;\n                matrix.ty = ty;\n            };\n            WebGLRenderBuffer.prototype.transform = function (a, b, c, d, tx, ty) {\n                var matrix = this.globalMatrix;\n                var a1 = matrix.a;\n                var b1 = matrix.b;\n                var c1 = matrix.c;\n                var d1 = matrix.d;\n                if (a != 1 || b != 0 || c != 0 || d != 1) {\n                    matrix.a = a * a1 + b * c1;\n                    matrix.b = a * b1 + b * d1;\n                    matrix.c = c * a1 + d * c1;\n                    matrix.d = c * b1 + d * d1;\n                }\n                matrix.tx = tx * a1 + ty * c1 + matrix.tx;\n                matrix.ty = tx * b1 + ty * d1 + matrix.ty;\n            };\n            WebGLRenderBuffer.prototype.useOffset = function () {\n                var self = this;\n                if (self.$offsetX != 0 || self.$offsetY != 0) {\n                    self.globalMatrix.append(1, 0, 0, 1, self.$offsetX, self.$offsetY);\n                    self.$offsetX = self.$offsetY = 0;\n                }\n            };\n            WebGLRenderBuffer.prototype.saveTransform = function () {\n                var matrix = this.globalMatrix;\n                var sMatrix = this.savedGlobalMatrix;\n                sMatrix.a = matrix.a;\n                sMatrix.b = matrix.b;\n                sMatrix.c = matrix.c;\n                sMatrix.d = matrix.d;\n                sMatrix.tx = matrix.tx;\n                sMatrix.ty = matrix.ty;\n            };\n            WebGLRenderBuffer.prototype.restoreTransform = function () {\n                var matrix = this.globalMatrix;\n                var sMatrix = this.savedGlobalMatrix;\n                matrix.a = sMatrix.a;\n                matrix.b = sMatrix.b;\n                matrix.c = sMatrix.c;\n                matrix.d = sMatrix.d;\n                matrix.tx = sMatrix.tx;\n                matrix.ty = sMatrix.ty;\n            };\n            /**\n             * 创建一个buffer实例\n             */\n            WebGLRenderBuffer.create = function (width, height) {\n                var buffer = renderBufferPool.pop();\n                // width = Math.min(width, 1024);\n                // height = Math.min(height, 1024);\n                if (buffer) {\n                    buffer.resize(width, height);\n                    var matrix = buffer.globalMatrix;\n                    matrix.a = 1;\n                    matrix.b = 0;\n                    matrix.c = 0;\n                    matrix.d = 1;\n                    matrix.tx = 0;\n                    matrix.ty = 0;\n                    buffer.globalAlpha = 1;\n                    buffer.$offsetX = 0;\n                    buffer.$offsetY = 0;\n                }\n                else {\n                    buffer = new WebGLRenderBuffer(width, height);\n                    buffer.$computeDrawCall = false;\n                }\n                return buffer;\n            };\n            /**\n             * 回收一个buffer实例\n             */\n            WebGLRenderBuffer.release = function (buffer) {\n                renderBufferPool.push(buffer);\n            };\n            WebGLRenderBuffer.autoClear = true;\n            return WebGLRenderBuffer;\n        }(egret.HashObject));\n        web.WebGLRenderBuffer = WebGLRenderBuffer;\n        __reflect(WebGLRenderBuffer.prototype, \"egret.web.WebGLRenderBuffer\", [\"egret.sys.RenderBuffer\"]);\n        var renderBufferPool = []; //渲染缓冲区对象池\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        var blendModes = [\"source-over\", \"lighter\", \"destination-out\"];\n        var defaultCompositeOp = \"source-over\";\n        var BLACK_COLOR = \"#000000\";\n        var CAPS_STYLES = { none: 'butt', square: 'square', round: 'round' };\n        var renderBufferPool = []; //渲染缓冲区对象池\n        /**\n         * @private\n         * WebGL渲染器\n         */\n        var WebGLRenderer = (function () {\n            function WebGLRenderer() {\n                /**\n                 * Do special treatment on wechat ios10\n                 */\n                this.wxiOS10 = false;\n                this.nestLevel = 0; //渲染的嵌套层次，0表示在调用堆栈的最外层。\n            }\n            /**\n             * 渲染一个显示对象\n             * @param displayObject 要渲染的显示对象\n             * @param buffer 渲染缓冲\n             * @param matrix 要对显示对象整体叠加的变换矩阵\n             * @param dirtyList 脏矩形列表\n             * @param forRenderTexture 绘制目标是RenderTexture的标志\n             * @returns drawCall触发绘制的次数\n             */\n            WebGLRenderer.prototype.render = function (displayObject, buffer, matrix, forRenderTexture) {\n                this.nestLevel++;\n                var webglBuffer = buffer;\n                var webglBufferContext = webglBuffer.context;\n                var root = forRenderTexture ? displayObject : null;\n                webglBufferContext.pushBuffer(webglBuffer);\n                //绘制显示对象\n                webglBuffer.transform(matrix.a, matrix.b, matrix.c, matrix.d, 0, 0);\n                this.drawDisplayObject(displayObject, webglBuffer, matrix.tx, matrix.ty, true);\n                webglBufferContext.$drawWebGL();\n                var drawCall = webglBuffer.$drawCalls;\n                webglBuffer.onRenderFinish();\n                webglBufferContext.popBuffer();\n                var invert = egret.Matrix.create();\n                matrix.$invertInto(invert);\n                webglBuffer.transform(invert.a, invert.b, invert.c, invert.d, 0, 0);\n                egret.Matrix.release(invert);\n                this.nestLevel--;\n                if (this.nestLevel === 0) {\n                    //最大缓存6个渲染缓冲\n                    if (renderBufferPool.length > 6) {\n                        renderBufferPool.length = 6;\n                    }\n                    var length_7 = renderBufferPool.length;\n                    for (var i = 0; i < length_7; i++) {\n                        renderBufferPool[i].resize(0, 0);\n                    }\n                }\n                return drawCall;\n            };\n            /**\n             * @private\n             * 绘制一个显示对象\n             */\n            WebGLRenderer.prototype.drawDisplayObject = function (displayObject, buffer, offsetX, offsetY, isStage) {\n                var drawCalls = 0;\n                var node;\n                var displayList = displayObject.$displayList;\n                if (displayList && !isStage) {\n                    if (displayObject.$cacheDirty || displayObject.$renderDirty ||\n                        displayList.$canvasScaleX != egret.sys.DisplayList.$canvasScaleX ||\n                        displayList.$canvasScaleY != egret.sys.DisplayList.$canvasScaleY) {\n                        drawCalls += displayList.drawToSurface();\n                    }\n                    node = displayList.$renderNode;\n                }\n                else {\n                    if (displayObject.$renderDirty) {\n                        node = displayObject.$getRenderNode();\n                    }\n                    else {\n                        node = displayObject.$renderNode;\n                    }\n                }\n                displayObject.$cacheDirty = false;\n                if (node) {\n                    drawCalls++;\n                    buffer.$offsetX = offsetX;\n                    buffer.$offsetY = offsetY;\n                    switch (node.type) {\n                        case 1 /* BitmapNode */:\n                            this.renderBitmap(node, buffer);\n                            break;\n                        case 2 /* TextNode */:\n                            this.renderText(node, buffer);\n                            break;\n                        case 3 /* GraphicsNode */:\n                            this.renderGraphics(node, buffer);\n                            break;\n                        case 4 /* GroupNode */:\n                            this.renderGroup(node, buffer);\n                            break;\n                        case 5 /* MeshNode */:\n                            this.renderMesh(node, buffer);\n                            break;\n                        case 6 /* NormalBitmapNode */:\n                            this.renderNormalBitmap(node, buffer);\n                            break;\n                    }\n                    buffer.$offsetX = 0;\n                    buffer.$offsetY = 0;\n                }\n                if (displayList && !isStage) {\n                    return drawCalls;\n                }\n                var children = displayObject.$children;\n                if (children) {\n                    if (displayObject.sortableChildren && displayObject.$sortDirty) {\n                        //绘制排序\n                        displayObject.sortChildren();\n                    }\n                    var length_8 = children.length;\n                    for (var i = 0; i < length_8; i++) {\n                        var child = children[i];\n                        var offsetX2 = void 0;\n                        var offsetY2 = void 0;\n                        var tempAlpha = void 0;\n                        var tempTintColor = void 0;\n                        if (child.$alpha != 1) {\n                            tempAlpha = buffer.globalAlpha;\n                            buffer.globalAlpha *= child.$alpha;\n                        }\n                        if (child.tint !== 0xFFFFFF) {\n                            tempTintColor = buffer.globalTintColor;\n                            buffer.globalTintColor = child.$tintRGB;\n                        }\n                        var savedMatrix = void 0;\n                        if (child.$useTranslate) {\n                            var m = child.$getMatrix();\n                            offsetX2 = offsetX + child.$x;\n                            offsetY2 = offsetY + child.$y;\n                            var m2 = buffer.globalMatrix;\n                            savedMatrix = egret.Matrix.create();\n                            savedMatrix.a = m2.a;\n                            savedMatrix.b = m2.b;\n                            savedMatrix.c = m2.c;\n                            savedMatrix.d = m2.d;\n                            savedMatrix.tx = m2.tx;\n                            savedMatrix.ty = m2.ty;\n                            buffer.transform(m.a, m.b, m.c, m.d, offsetX2, offsetY2);\n                            offsetX2 = -child.$anchorOffsetX;\n                            offsetY2 = -child.$anchorOffsetY;\n                        }\n                        else {\n                            offsetX2 = offsetX + child.$x - child.$anchorOffsetX;\n                            offsetY2 = offsetY + child.$y - child.$anchorOffsetY;\n                        }\n                        switch (child.$renderMode) {\n                            case 1 /* NONE */:\n                                break;\n                            case 2 /* FILTER */:\n                                drawCalls += this.drawWithFilter(child, buffer, offsetX2, offsetY2);\n                                break;\n                            case 3 /* CLIP */:\n                                drawCalls += this.drawWithClip(child, buffer, offsetX2, offsetY2);\n                                break;\n                            case 4 /* SCROLLRECT */:\n                                drawCalls += this.drawWithScrollRect(child, buffer, offsetX2, offsetY2);\n                                break;\n                            default:\n                                drawCalls += this.drawDisplayObject(child, buffer, offsetX2, offsetY2);\n                                break;\n                        }\n                        if (tempAlpha) {\n                            buffer.globalAlpha = tempAlpha;\n                        }\n                        if (tempTintColor) {\n                            buffer.globalTintColor = tempTintColor;\n                        }\n                        if (savedMatrix) {\n                            var m = buffer.globalMatrix;\n                            m.a = savedMatrix.a;\n                            m.b = savedMatrix.b;\n                            m.c = savedMatrix.c;\n                            m.d = savedMatrix.d;\n                            m.tx = savedMatrix.tx;\n                            m.ty = savedMatrix.ty;\n                            egret.Matrix.release(savedMatrix);\n                        }\n                    }\n                }\n                return drawCalls;\n            };\n            /**\n             * @private\n             */\n            WebGLRenderer.prototype.drawWithFilter = function (displayObject, buffer, offsetX, offsetY) {\n                var drawCalls = 0;\n                if (displayObject.$children && displayObject.$children.length == 0 && (!displayObject.$renderNode || displayObject.$renderNode.$getRenderCount() == 0)) {\n                    return drawCalls;\n                }\n                var filters = displayObject.$filters;\n                var hasBlendMode = (displayObject.$blendMode !== 0);\n                var compositeOp;\n                if (hasBlendMode) {\n                    compositeOp = blendModes[displayObject.$blendMode];\n                    if (!compositeOp) {\n                        compositeOp = defaultCompositeOp;\n                    }\n                }\n                var displayBounds = displayObject.$getOriginalBounds();\n                var displayBoundsX = displayBounds.x;\n                var displayBoundsY = displayBounds.y;\n                var displayBoundsWidth = displayBounds.width;\n                var displayBoundsHeight = displayBounds.height;\n                if (displayBoundsWidth <= 0 || displayBoundsHeight <= 0) {\n                    return drawCalls;\n                }\n                if (!displayObject.mask && filters.length == 1 && (filters[0].type == \"colorTransform\" || (filters[0].type === \"custom\" && filters[0].padding === 0))) {\n                    var childrenDrawCount = this.getRenderCount(displayObject);\n                    if (!displayObject.$children || childrenDrawCount == 1) {\n                        if (hasBlendMode) {\n                            buffer.context.setGlobalCompositeOperation(compositeOp);\n                        }\n                        buffer.context.$filter = filters[0];\n                        if (displayObject.$mask) {\n                            drawCalls += this.drawWithClip(displayObject, buffer, offsetX, offsetY);\n                        }\n                        else if (displayObject.$scrollRect || displayObject.$maskRect) {\n                            drawCalls += this.drawWithScrollRect(displayObject, buffer, offsetX, offsetY);\n                        }\n                        else {\n                            drawCalls += this.drawDisplayObject(displayObject, buffer, offsetX, offsetY);\n                        }\n                        buffer.context.$filter = null;\n                        if (hasBlendMode) {\n                            buffer.context.setGlobalCompositeOperation(defaultCompositeOp);\n                        }\n                        return drawCalls;\n                    }\n                }\n                // 为显示对象创建一个新的buffer\n                var displayBuffer = this.createRenderBuffer(displayBoundsWidth, displayBoundsHeight);\n                displayBuffer.context.pushBuffer(displayBuffer);\n                //todo 可以优化减少draw次数\n                if (displayObject.$mask) {\n                    drawCalls += this.drawWithClip(displayObject, displayBuffer, -displayBoundsX, -displayBoundsY);\n                }\n                else if (displayObject.$scrollRect || displayObject.$maskRect) {\n                    drawCalls += this.drawWithScrollRect(displayObject, displayBuffer, -displayBoundsX, -displayBoundsY);\n                }\n                else {\n                    drawCalls += this.drawDisplayObject(displayObject, displayBuffer, -displayBoundsX, -displayBoundsY);\n                }\n                displayBuffer.context.popBuffer();\n                //绘制结果到屏幕\n                if (drawCalls > 0) {\n                    if (hasBlendMode) {\n                        buffer.context.setGlobalCompositeOperation(compositeOp);\n                    }\n                    drawCalls++;\n                    // 绘制结果的时候，应用滤镜\n                    buffer.$offsetX = offsetX + displayBoundsX;\n                    buffer.$offsetY = offsetY + displayBoundsY;\n                    var savedMatrix = egret.Matrix.create();\n                    var curMatrix = buffer.globalMatrix;\n                    savedMatrix.a = curMatrix.a;\n                    savedMatrix.b = curMatrix.b;\n                    savedMatrix.c = curMatrix.c;\n                    savedMatrix.d = curMatrix.d;\n                    savedMatrix.tx = curMatrix.tx;\n                    savedMatrix.ty = curMatrix.ty;\n                    buffer.useOffset();\n                    buffer.context.drawTargetWidthFilters(filters, displayBuffer);\n                    curMatrix.a = savedMatrix.a;\n                    curMatrix.b = savedMatrix.b;\n                    curMatrix.c = savedMatrix.c;\n                    curMatrix.d = savedMatrix.d;\n                    curMatrix.tx = savedMatrix.tx;\n                    curMatrix.ty = savedMatrix.ty;\n                    egret.Matrix.release(savedMatrix);\n                    if (hasBlendMode) {\n                        buffer.context.setGlobalCompositeOperation(defaultCompositeOp);\n                    }\n                }\n                renderBufferPool.push(displayBuffer);\n                return drawCalls;\n            };\n            WebGLRenderer.prototype.getRenderCount = function (displayObject) {\n                var drawCount = 0;\n                var node = displayObject.$getRenderNode();\n                if (node) {\n                    drawCount += node.$getRenderCount();\n                }\n                if (displayObject.$children) {\n                    for (var _i = 0, _a = displayObject.$children; _i < _a.length; _i++) {\n                        var child = _a[_i];\n                        var filters = child.$filters;\n                        // 特殊处理有滤镜的对象\n                        if (filters && filters.length > 0) {\n                            return 2;\n                        }\n                        else if (child.$children) {\n                            drawCount += this.getRenderCount(child);\n                        }\n                        else {\n                            var node_1 = child.$getRenderNode();\n                            if (node_1) {\n                                drawCount += node_1.$getRenderCount();\n                            }\n                        }\n                    }\n                }\n                return drawCount;\n            };\n            /**\n             * @private\n             */\n            WebGLRenderer.prototype.drawWithClip = function (displayObject, buffer, offsetX, offsetY) {\n                var drawCalls = 0;\n                var hasBlendMode = (displayObject.$blendMode !== 0);\n                var compositeOp;\n                if (hasBlendMode) {\n                    compositeOp = blendModes[displayObject.$blendMode];\n                    if (!compositeOp) {\n                        compositeOp = defaultCompositeOp;\n                    }\n                }\n                var scrollRect = displayObject.$scrollRect ? displayObject.$scrollRect : displayObject.$maskRect;\n                var mask = displayObject.$mask;\n                if (mask) {\n                    var maskRenderMatrix = mask.$getMatrix();\n                    //遮罩scaleX或scaleY为0，放弃绘制\n                    if ((maskRenderMatrix.a == 0 && maskRenderMatrix.b == 0) || (maskRenderMatrix.c == 0 && maskRenderMatrix.d == 0)) {\n                        return drawCalls;\n                    }\n                }\n                //没有遮罩,同时显示对象没有子项\n                if (!mask && (!displayObject.$children || displayObject.$children.length == 0)) {\n                    if (scrollRect) {\n                        buffer.context.pushMask(scrollRect.x + offsetX, scrollRect.y + offsetY, scrollRect.width, scrollRect.height);\n                    }\n                    //绘制显示对象\n                    if (hasBlendMode) {\n                        buffer.context.setGlobalCompositeOperation(compositeOp);\n                    }\n                    drawCalls += this.drawDisplayObject(displayObject, buffer, offsetX, offsetY);\n                    if (hasBlendMode) {\n                        buffer.context.setGlobalCompositeOperation(defaultCompositeOp);\n                    }\n                    if (scrollRect) {\n                        buffer.context.popMask();\n                    }\n                    return drawCalls;\n                }\n                else {\n                    var displayBounds = displayObject.$getOriginalBounds();\n                    var displayBoundsX = displayBounds.x;\n                    var displayBoundsY = displayBounds.y;\n                    var displayBoundsWidth = displayBounds.width;\n                    var displayBoundsHeight = displayBounds.height;\n                    if (displayBoundsWidth <= 0 || displayBoundsHeight <= 0) {\n                        return drawCalls;\n                    }\n                    //绘制显示对象自身，若有scrollRect，应用clip\n                    var displayBuffer = this.createRenderBuffer(displayBoundsWidth, displayBoundsHeight);\n                    displayBuffer.context.pushBuffer(displayBuffer);\n                    drawCalls += this.drawDisplayObject(displayObject, displayBuffer, -displayBoundsX, -displayBoundsY);\n                    //绘制遮罩\n                    if (mask) {\n                        var maskBuffer = this.createRenderBuffer(displayBoundsWidth, displayBoundsHeight);\n                        maskBuffer.context.pushBuffer(maskBuffer);\n                        var maskMatrix = egret.Matrix.create();\n                        maskMatrix.copyFrom(mask.$getConcatenatedMatrix());\n                        mask.$getConcatenatedMatrixAt(displayObject, maskMatrix);\n                        maskMatrix.translate(-displayBoundsX, -displayBoundsY);\n                        maskBuffer.setTransform(maskMatrix.a, maskMatrix.b, maskMatrix.c, maskMatrix.d, maskMatrix.tx, maskMatrix.ty);\n                        egret.Matrix.release(maskMatrix);\n                        drawCalls += this.drawDisplayObject(mask, maskBuffer, 0, 0);\n                        maskBuffer.context.popBuffer();\n                        displayBuffer.context.setGlobalCompositeOperation(\"destination-in\");\n                        displayBuffer.setTransform(1, 0, 0, -1, 0, maskBuffer.height);\n                        var maskBufferWidth = maskBuffer.rootRenderTarget.width;\n                        var maskBufferHeight = maskBuffer.rootRenderTarget.height;\n                        displayBuffer.context.drawTexture(maskBuffer.rootRenderTarget.texture, 0, 0, maskBufferWidth, maskBufferHeight, 0, 0, maskBufferWidth, maskBufferHeight, maskBufferWidth, maskBufferHeight);\n                        displayBuffer.setTransform(1, 0, 0, 1, 0, 0);\n                        displayBuffer.context.setGlobalCompositeOperation(\"source-over\");\n                        maskBuffer.setTransform(1, 0, 0, 1, 0, 0);\n                        renderBufferPool.push(maskBuffer);\n                    }\n                    displayBuffer.context.setGlobalCompositeOperation(defaultCompositeOp);\n                    displayBuffer.context.popBuffer();\n                    //绘制结果到屏幕\n                    if (drawCalls > 0) {\n                        drawCalls++;\n                        if (hasBlendMode) {\n                            buffer.context.setGlobalCompositeOperation(compositeOp);\n                        }\n                        if (scrollRect) {\n                            buffer.context.pushMask(scrollRect.x + offsetX, scrollRect.y + offsetY, scrollRect.width, scrollRect.height);\n                        }\n                        var savedMatrix = egret.Matrix.create();\n                        var curMatrix = buffer.globalMatrix;\n                        savedMatrix.a = curMatrix.a;\n                        savedMatrix.b = curMatrix.b;\n                        savedMatrix.c = curMatrix.c;\n                        savedMatrix.d = curMatrix.d;\n                        savedMatrix.tx = curMatrix.tx;\n                        savedMatrix.ty = curMatrix.ty;\n                        curMatrix.append(1, 0, 0, -1, offsetX + displayBoundsX, offsetY + displayBoundsY + displayBuffer.height);\n                        var displayBufferWidth = displayBuffer.rootRenderTarget.width;\n                        var displayBufferHeight = displayBuffer.rootRenderTarget.height;\n                        buffer.context.drawTexture(displayBuffer.rootRenderTarget.texture, 0, 0, displayBufferWidth, displayBufferHeight, 0, 0, displayBufferWidth, displayBufferHeight, displayBufferWidth, displayBufferHeight);\n                        if (scrollRect) {\n                            displayBuffer.context.popMask();\n                        }\n                        if (hasBlendMode) {\n                            buffer.context.setGlobalCompositeOperation(defaultCompositeOp);\n                        }\n                        var matrix = buffer.globalMatrix;\n                        matrix.a = savedMatrix.a;\n                        matrix.b = savedMatrix.b;\n                        matrix.c = savedMatrix.c;\n                        matrix.d = savedMatrix.d;\n                        matrix.tx = savedMatrix.tx;\n                        matrix.ty = savedMatrix.ty;\n                        egret.Matrix.release(savedMatrix);\n                    }\n                    renderBufferPool.push(displayBuffer);\n                    return drawCalls;\n                }\n            };\n            /**\n             * @private\n             */\n            WebGLRenderer.prototype.drawWithScrollRect = function (displayObject, buffer, offsetX, offsetY) {\n                var drawCalls = 0;\n                var scrollRect = displayObject.$scrollRect ? displayObject.$scrollRect : displayObject.$maskRect;\n                if (scrollRect.isEmpty()) {\n                    return drawCalls;\n                }\n                if (displayObject.$scrollRect) {\n                    offsetX -= scrollRect.x;\n                    offsetY -= scrollRect.y;\n                }\n                var m = buffer.globalMatrix;\n                var context = buffer.context;\n                var scissor = false;\n                if (buffer.$hasScissor || m.b != 0 || m.c != 0) {\n                    buffer.context.pushMask(scrollRect.x + offsetX, scrollRect.y + offsetY, scrollRect.width, scrollRect.height);\n                }\n                else {\n                    var a = m.a;\n                    var d = m.d;\n                    var tx = m.tx;\n                    var ty = m.ty;\n                    var x = scrollRect.x + offsetX;\n                    var y = scrollRect.y + offsetY;\n                    var xMax = x + scrollRect.width;\n                    var yMax = y + scrollRect.height;\n                    var minX = void 0, minY = void 0, maxX = void 0, maxY = void 0;\n                    //优化，通常情况下不缩放的对象占多数，直接加上偏移量即可。\n                    if (a == 1.0 && d == 1.0) {\n                        minX = x + tx;\n                        minY = y + ty;\n                        maxX = xMax + tx;\n                        maxY = yMax + ty;\n                    }\n                    else {\n                        var x0 = a * x + tx;\n                        var y0 = d * y + ty;\n                        var x1 = a * xMax + tx;\n                        var y1 = d * y + ty;\n                        var x2 = a * xMax + tx;\n                        var y2 = d * yMax + ty;\n                        var x3 = a * x + tx;\n                        var y3 = d * yMax + ty;\n                        var tmp = 0;\n                        if (x0 > x1) {\n                            tmp = x0;\n                            x0 = x1;\n                            x1 = tmp;\n                        }\n                        if (x2 > x3) {\n                            tmp = x2;\n                            x2 = x3;\n                            x3 = tmp;\n                        }\n                        minX = (x0 < x2 ? x0 : x2);\n                        maxX = (x1 > x3 ? x1 : x3);\n                        if (y0 > y1) {\n                            tmp = y0;\n                            y0 = y1;\n                            y1 = tmp;\n                        }\n                        if (y2 > y3) {\n                            tmp = y2;\n                            y2 = y3;\n                            y3 = tmp;\n                        }\n                        minY = (y0 < y2 ? y0 : y2);\n                        maxY = (y1 > y3 ? y1 : y3);\n                    }\n                    context.enableScissor(minX, -maxY + buffer.height, maxX - minX, maxY - minY);\n                    scissor = true;\n                }\n                drawCalls += this.drawDisplayObject(displayObject, buffer, offsetX, offsetY);\n                if (scissor) {\n                    context.disableScissor();\n                }\n                else {\n                    context.popMask();\n                }\n                return drawCalls;\n            };\n            /**\n             * 将一个RenderNode对象绘制到渲染缓冲\n             * @param node 要绘制的节点\n             * @param buffer 渲染缓冲\n             * @param matrix 要叠加的矩阵\n             * @param forHitTest 绘制结果是用于碰撞检测。若为true，当渲染GraphicsNode时，会忽略透明度样式设置，全都绘制为不透明的。\n             */\n            WebGLRenderer.prototype.drawNodeToBuffer = function (node, buffer, matrix, forHitTest) {\n                var webglBuffer = buffer;\n                //pushRenderTARGET\n                webglBuffer.context.pushBuffer(webglBuffer);\n                webglBuffer.setTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty);\n                this.renderNode(node, buffer, 0, 0, forHitTest);\n                webglBuffer.context.$drawWebGL();\n                webglBuffer.onRenderFinish();\n                //popRenderTARGET\n                webglBuffer.context.popBuffer();\n            };\n            /**\n             * 将一个DisplayObject绘制到渲染缓冲，用于RenderTexture绘制\n             * @param displayObject 要绘制的显示对象\n             * @param buffer 渲染缓冲\n             * @param matrix 要叠加的矩阵\n             */\n            WebGLRenderer.prototype.drawDisplayToBuffer = function (displayObject, buffer, matrix) {\n                buffer.context.pushBuffer(buffer);\n                if (matrix) {\n                    buffer.setTransform(matrix.a, matrix.b, matrix.c, matrix.d, matrix.tx, matrix.ty);\n                }\n                var node;\n                if (displayObject.$renderDirty) {\n                    node = displayObject.$getRenderNode();\n                }\n                else {\n                    node = displayObject.$renderNode;\n                }\n                var drawCalls = 0;\n                if (node) {\n                    drawCalls++;\n                    switch (node.type) {\n                        case 1 /* BitmapNode */:\n                            this.renderBitmap(node, buffer);\n                            break;\n                        case 2 /* TextNode */:\n                            this.renderText(node, buffer);\n                            break;\n                        case 3 /* GraphicsNode */:\n                            this.renderGraphics(node, buffer);\n                            break;\n                        case 4 /* GroupNode */:\n                            this.renderGroup(node, buffer);\n                            break;\n                        case 5 /* MeshNode */:\n                            this.renderMesh(node, buffer);\n                            break;\n                        case 6 /* NormalBitmapNode */:\n                            this.renderNormalBitmap(node, buffer);\n                            break;\n                    }\n                }\n                var children = displayObject.$children;\n                if (children) {\n                    var length_9 = children.length;\n                    for (var i = 0; i < length_9; i++) {\n                        var child = children[i];\n                        switch (child.$renderMode) {\n                            case 1 /* NONE */:\n                                break;\n                            case 2 /* FILTER */:\n                                drawCalls += this.drawWithFilter(child, buffer, 0, 0);\n                                break;\n                            case 3 /* CLIP */:\n                                drawCalls += this.drawWithClip(child, buffer, 0, 0);\n                                break;\n                            case 4 /* SCROLLRECT */:\n                                drawCalls += this.drawWithScrollRect(child, buffer, 0, 0);\n                                break;\n                            default:\n                                drawCalls += this.drawDisplayObject(child, buffer, 0, 0);\n                                break;\n                        }\n                    }\n                }\n                buffer.context.$drawWebGL();\n                buffer.onRenderFinish();\n                buffer.context.popBuffer();\n                return drawCalls;\n            };\n            /**\n             * @private\n             */\n            WebGLRenderer.prototype.renderNode = function (node, buffer, offsetX, offsetY, forHitTest) {\n                buffer.$offsetX = offsetX;\n                buffer.$offsetY = offsetY;\n                switch (node.type) {\n                    case 1 /* BitmapNode */:\n                        this.renderBitmap(node, buffer);\n                        break;\n                    case 2 /* TextNode */:\n                        this.renderText(node, buffer);\n                        break;\n                    case 3 /* GraphicsNode */:\n                        this.renderGraphics(node, buffer, forHitTest);\n                        break;\n                    case 4 /* GroupNode */:\n                        this.renderGroup(node, buffer);\n                        break;\n                    case 5 /* MeshNode */:\n                        this.renderMesh(node, buffer);\n                        break;\n                    case 6 /* NormalBitmapNode */:\n                        this.renderNormalBitmap(node, buffer);\n                        break;\n                }\n            };\n            /**\n             * @private\n             */\n            WebGLRenderer.prototype.renderNormalBitmap = function (node, buffer) {\n                var image = node.image;\n                if (!image) {\n                    return;\n                }\n                buffer.context.drawImage(image, node.sourceX, node.sourceY, node.sourceW, node.sourceH, node.drawX, node.drawY, node.drawW, node.drawH, node.imageWidth, node.imageHeight, node.rotated, node.smoothing);\n            };\n            /**\n             * @private\n             */\n            WebGLRenderer.prototype.renderBitmap = function (node, buffer) {\n                var image = node.image;\n                if (!image) {\n                    return;\n                }\n                //buffer.imageSmoothingEnabled = node.smoothing;\n                var data = node.drawData;\n                var length = data.length;\n                var pos = 0;\n                var m = node.matrix;\n                var blendMode = node.blendMode;\n                var alpha = node.alpha;\n                var savedMatrix;\n                var offsetX;\n                var offsetY;\n                if (m) {\n                    savedMatrix = egret.Matrix.create();\n                    var curMatrix = buffer.globalMatrix;\n                    savedMatrix.a = curMatrix.a;\n                    savedMatrix.b = curMatrix.b;\n                    savedMatrix.c = curMatrix.c;\n                    savedMatrix.d = curMatrix.d;\n                    savedMatrix.tx = curMatrix.tx;\n                    savedMatrix.ty = curMatrix.ty;\n                    offsetX = buffer.$offsetX;\n                    offsetY = buffer.$offsetY;\n                    buffer.useOffset();\n                    buffer.transform(m.a, m.b, m.c, m.d, m.tx, m.ty);\n                }\n                //这里不考虑嵌套\n                if (blendMode) {\n                    buffer.context.setGlobalCompositeOperation(blendModes[blendMode]);\n                }\n                var originAlpha;\n                if (alpha == alpha) {\n                    originAlpha = buffer.globalAlpha;\n                    buffer.globalAlpha *= alpha;\n                }\n                if (node.filter) {\n                    buffer.context.$filter = node.filter;\n                    while (pos < length) {\n                        buffer.context.drawImage(image, data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], node.imageWidth, node.imageHeight, node.rotated, node.smoothing);\n                    }\n                    buffer.context.$filter = null;\n                }\n                else {\n                    while (pos < length) {\n                        buffer.context.drawImage(image, data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], node.imageWidth, node.imageHeight, node.rotated, node.smoothing);\n                    }\n                }\n                if (blendMode) {\n                    buffer.context.setGlobalCompositeOperation(defaultCompositeOp);\n                }\n                if (alpha == alpha) {\n                    buffer.globalAlpha = originAlpha;\n                }\n                if (m) {\n                    var matrix = buffer.globalMatrix;\n                    matrix.a = savedMatrix.a;\n                    matrix.b = savedMatrix.b;\n                    matrix.c = savedMatrix.c;\n                    matrix.d = savedMatrix.d;\n                    matrix.tx = savedMatrix.tx;\n                    matrix.ty = savedMatrix.ty;\n                    buffer.$offsetX = offsetX;\n                    buffer.$offsetY = offsetY;\n                    egret.Matrix.release(savedMatrix);\n                }\n            };\n            /**\n             * @private\n             */\n            WebGLRenderer.prototype.renderMesh = function (node, buffer) {\n                var image = node.image;\n                //buffer.imageSmoothingEnabled = node.smoothing;\n                var data = node.drawData;\n                var length = data.length;\n                var pos = 0;\n                var m = node.matrix;\n                var blendMode = node.blendMode;\n                var alpha = node.alpha;\n                var savedMatrix;\n                var offsetX;\n                var offsetY;\n                if (m) {\n                    savedMatrix = egret.Matrix.create();\n                    var curMatrix = buffer.globalMatrix;\n                    savedMatrix.a = curMatrix.a;\n                    savedMatrix.b = curMatrix.b;\n                    savedMatrix.c = curMatrix.c;\n                    savedMatrix.d = curMatrix.d;\n                    savedMatrix.tx = curMatrix.tx;\n                    savedMatrix.ty = curMatrix.ty;\n                    offsetX = buffer.$offsetX;\n                    offsetY = buffer.$offsetY;\n                    buffer.useOffset();\n                    buffer.transform(m.a, m.b, m.c, m.d, m.tx, m.ty);\n                }\n                //这里不考虑嵌套\n                if (blendMode) {\n                    buffer.context.setGlobalCompositeOperation(blendModes[blendMode]);\n                }\n                var originAlpha;\n                if (alpha == alpha) {\n                    originAlpha = buffer.globalAlpha;\n                    buffer.globalAlpha *= alpha;\n                }\n                if (node.filter) {\n                    buffer.context.$filter = node.filter;\n                    while (pos < length) {\n                        buffer.context.drawMesh(image, data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], node.imageWidth, node.imageHeight, node.uvs, node.vertices, node.indices, node.bounds, node.rotated, node.smoothing);\n                    }\n                    buffer.context.$filter = null;\n                }\n                else {\n                    while (pos < length) {\n                        buffer.context.drawMesh(image, data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], data[pos++], node.imageWidth, node.imageHeight, node.uvs, node.vertices, node.indices, node.bounds, node.rotated, node.smoothing);\n                    }\n                }\n                if (blendMode) {\n                    buffer.context.setGlobalCompositeOperation(defaultCompositeOp);\n                }\n                if (alpha == alpha) {\n                    buffer.globalAlpha = originAlpha;\n                }\n                if (m) {\n                    var matrix = buffer.globalMatrix;\n                    matrix.a = savedMatrix.a;\n                    matrix.b = savedMatrix.b;\n                    matrix.c = savedMatrix.c;\n                    matrix.d = savedMatrix.d;\n                    matrix.tx = savedMatrix.tx;\n                    matrix.ty = savedMatrix.ty;\n                    buffer.$offsetX = offsetX;\n                    buffer.$offsetY = offsetY;\n                    egret.Matrix.release(savedMatrix);\n                }\n            };\n            /**\n             * @private\n             */\n            WebGLRenderer.prototype.___renderText____ = function (node, buffer) {\n                var width = node.width - node.x;\n                var height = node.height - node.y;\n                if (width <= 0 || height <= 0 || !width || !height || node.drawData.length === 0) {\n                    return;\n                }\n                var canvasScaleX = egret.sys.DisplayList.$canvasScaleX;\n                var canvasScaleY = egret.sys.DisplayList.$canvasScaleY;\n                var maxTextureSize = buffer.context.$maxTextureSize;\n                if (width * canvasScaleX > maxTextureSize) {\n                    canvasScaleX *= maxTextureSize / (width * canvasScaleX);\n                }\n                if (height * canvasScaleY > maxTextureSize) {\n                    canvasScaleY *= maxTextureSize / (height * canvasScaleY);\n                }\n                width *= canvasScaleX;\n                height *= canvasScaleY;\n                var x = node.x * canvasScaleX;\n                var y = node.y * canvasScaleY;\n                if (node.$canvasScaleX !== canvasScaleX || node.$canvasScaleY !== canvasScaleY) {\n                    node.$canvasScaleX = canvasScaleX;\n                    node.$canvasScaleY = canvasScaleY;\n                    node.dirtyRender = true;\n                }\n                if (x || y) {\n                    buffer.transform(1, 0, 0, 1, x / canvasScaleX, y / canvasScaleY);\n                }\n                if (node.dirtyRender) {\n                    web.TextAtlasRender.analysisTextNodeAndFlushDrawLabel(node);\n                }\n                var drawCommands = node[web.property_drawLabel];\n                if (drawCommands && drawCommands.length > 0) {\n                    //存一下\n                    var saveOffsetX = buffer.$offsetX;\n                    var saveOffsetY = buffer.$offsetY;\n                    //开始画\n                    var cmd = null;\n                    var anchorX = 0;\n                    var anchorY = 0;\n                    var textBlocks = null;\n                    var tb = null;\n                    var page = null;\n                    for (var i = 0, length_10 = drawCommands.length; i < length_10; ++i) {\n                        cmd = drawCommands[i];\n                        anchorX = cmd.anchorX;\n                        anchorY = cmd.anchorY;\n                        textBlocks = cmd.textBlocks;\n                        buffer.$offsetX = saveOffsetX + anchorX;\n                        for (var j = 0, length1 = textBlocks.length; j < length1; ++j) {\n                            tb = textBlocks[j];\n                            if (j > 0) {\n                                buffer.$offsetX -= tb.canvasWidthOffset;\n                            }\n                            buffer.$offsetY = saveOffsetY + anchorY - (tb.measureHeight + (tb.stroke2 ? tb.canvasHeightOffset : 0)) / 2;\n                            page = tb.line.page;\n                            buffer.context.drawTexture(page.webGLTexture, tb.u, tb.v, tb.contentWidth, tb.contentHeight, 0, 0, tb.contentWidth, tb.contentHeight, page.pageWidth, page.pageHeight);\n                            buffer.$offsetX += (tb.contentWidth - tb.canvasWidthOffset);\n                        }\n                    }\n                    //还原回去\n                    buffer.$offsetX = saveOffsetX;\n                    buffer.$offsetY = saveOffsetY;\n                }\n                if (x || y) {\n                    buffer.transform(1, 0, 0, 1, -x / canvasScaleX, -y / canvasScaleY);\n                }\n                node.dirtyRender = false;\n            };\n            /**\n             * @private\n             */\n            WebGLRenderer.prototype.renderText = function (node, buffer) {\n                if (web.textAtlasRenderEnable) {\n                    //新的文字渲染机制\n                    this.___renderText____(node, buffer);\n                    return;\n                }\n                var width = node.width - node.x;\n                var height = node.height - node.y;\n                if (width <= 0 || height <= 0 || !width || !height || node.drawData.length == 0) {\n                    return;\n                }\n                var canvasScaleX = egret.sys.DisplayList.$canvasScaleX;\n                var canvasScaleY = egret.sys.DisplayList.$canvasScaleY;\n                var maxTextureSize = buffer.context.$maxTextureSize;\n                if (width * canvasScaleX > maxTextureSize) {\n                    canvasScaleX *= maxTextureSize / (width * canvasScaleX);\n                }\n                if (height * canvasScaleY > maxTextureSize) {\n                    canvasScaleY *= maxTextureSize / (height * canvasScaleY);\n                }\n                width *= canvasScaleX;\n                height *= canvasScaleY;\n                var x = node.x * canvasScaleX;\n                var y = node.y * canvasScaleY;\n                if (node.$canvasScaleX != canvasScaleX || node.$canvasScaleY != canvasScaleY) {\n                    node.$canvasScaleX = canvasScaleX;\n                    node.$canvasScaleY = canvasScaleY;\n                    node.dirtyRender = true;\n                }\n                if (this.wxiOS10) {\n                    if (!this.canvasRenderer) {\n                        this.canvasRenderer = new egret.CanvasRenderer();\n                    }\n                    if (node.dirtyRender) {\n                        this.canvasRenderBuffer = new web.CanvasRenderBuffer(width, height);\n                    }\n                }\n                else {\n                    if (!this.canvasRenderBuffer || !this.canvasRenderBuffer.context) {\n                        this.canvasRenderer = new egret.CanvasRenderer();\n                        this.canvasRenderBuffer = new web.CanvasRenderBuffer(width, height);\n                    }\n                    else if (node.dirtyRender) {\n                        this.canvasRenderBuffer.resize(width, height);\n                    }\n                }\n                if (!this.canvasRenderBuffer.context) {\n                    return;\n                }\n                if (canvasScaleX != 1 || canvasScaleY != 1) {\n                    this.canvasRenderBuffer.context.setTransform(canvasScaleX, 0, 0, canvasScaleY, 0, 0);\n                }\n                if (x || y) {\n                    if (node.dirtyRender) {\n                        this.canvasRenderBuffer.context.setTransform(canvasScaleX, 0, 0, canvasScaleY, -x, -y);\n                    }\n                    buffer.transform(1, 0, 0, 1, x / canvasScaleX, y / canvasScaleY);\n                }\n                else if (canvasScaleX != 1 || canvasScaleY != 1) {\n                    this.canvasRenderBuffer.context.setTransform(canvasScaleX, 0, 0, canvasScaleY, 0, 0);\n                }\n                if (node.dirtyRender) {\n                    var surface = this.canvasRenderBuffer.surface;\n                    this.canvasRenderer.renderText(node, this.canvasRenderBuffer.context);\n                    if (this.wxiOS10) {\n                        surface[\"isCanvas\"] = true;\n                        node.$texture = surface;\n                    }\n                    else {\n                        // 拷贝canvas到texture\n                        var texture = node.$texture;\n                        if (!texture) {\n                            texture = buffer.context.createTexture(surface);\n                            node.$texture = texture;\n                        }\n                        else {\n                            // 重新拷贝新的图像\n                            buffer.context.updateTexture(texture, surface);\n                        }\n                    }\n                    // 保存材质尺寸\n                    node.$textureWidth = surface.width;\n                    node.$textureHeight = surface.height;\n                }\n                var textureWidth = node.$textureWidth;\n                var textureHeight = node.$textureHeight;\n                buffer.context.drawTexture(node.$texture, 0, 0, textureWidth, textureHeight, 0, 0, textureWidth / canvasScaleX, textureHeight / canvasScaleY, textureWidth, textureHeight);\n                if (x || y) {\n                    if (node.dirtyRender) {\n                        this.canvasRenderBuffer.context.setTransform(canvasScaleX, 0, 0, canvasScaleY, 0, 0);\n                    }\n                    buffer.transform(1, 0, 0, 1, -x / canvasScaleX, -y / canvasScaleY);\n                }\n                node.dirtyRender = false;\n            };\n            /**\n             * @private\n             */\n            WebGLRenderer.prototype.renderGraphics = function (node, buffer, forHitTest) {\n                var width = node.width;\n                var height = node.height;\n                if (width <= 0 || height <= 0 || !width || !height || node.drawData.length == 0) {\n                    return;\n                }\n                var canvasScaleX = egret.sys.DisplayList.$canvasScaleX;\n                var canvasScaleY = egret.sys.DisplayList.$canvasScaleY;\n                if (width * canvasScaleX < 1 || height * canvasScaleY < 1) {\n                    canvasScaleX = canvasScaleY = 1;\n                }\n                if (node.$canvasScaleX != canvasScaleX || node.$canvasScaleY != canvasScaleY) {\n                    node.$canvasScaleX = canvasScaleX;\n                    node.$canvasScaleY = canvasScaleY;\n                    node.dirtyRender = true;\n                }\n                //缩放叠加 width2 / width 填满整个区域\n                width = width * canvasScaleX;\n                height = height * canvasScaleY;\n                var width2 = Math.ceil(width);\n                var height2 = Math.ceil(height);\n                canvasScaleX *= width2 / width;\n                canvasScaleY *= height2 / height;\n                width = width2;\n                height = height2;\n                if (this.wxiOS10) {\n                    if (!this.canvasRenderer) {\n                        this.canvasRenderer = new egret.CanvasRenderer();\n                    }\n                    if (node.dirtyRender) {\n                        this.canvasRenderBuffer = new web.CanvasRenderBuffer(width, height);\n                    }\n                }\n                else {\n                    if (!this.canvasRenderBuffer || !this.canvasRenderBuffer.context) {\n                        this.canvasRenderer = new egret.CanvasRenderer();\n                        this.canvasRenderBuffer = new web.CanvasRenderBuffer(width, height);\n                    }\n                    else if (node.dirtyRender) {\n                        this.canvasRenderBuffer.resize(width, height);\n                    }\n                }\n                if (!this.canvasRenderBuffer.context) {\n                    return;\n                }\n                if (canvasScaleX != 1 || canvasScaleY != 1) {\n                    this.canvasRenderBuffer.context.setTransform(canvasScaleX, 0, 0, canvasScaleY, 0, 0);\n                }\n                if (node.x || node.y) {\n                    if (node.dirtyRender || forHitTest) {\n                        this.canvasRenderBuffer.context.translate(-node.x, -node.y);\n                    }\n                    buffer.transform(1, 0, 0, 1, node.x, node.y);\n                }\n                var surface = this.canvasRenderBuffer.surface;\n                if (forHitTest) {\n                    this.canvasRenderer.renderGraphics(node, this.canvasRenderBuffer.context, true);\n                    var texture = void 0;\n                    if (this.wxiOS10) {\n                        surface[\"isCanvas\"] = true;\n                        texture = surface;\n                    }\n                    else {\n                        egret.WebGLUtils.deleteWebGLTexture(surface);\n                        texture = buffer.context.getWebGLTexture(surface);\n                    }\n                    buffer.context.drawTexture(texture, 0, 0, width, height, 0, 0, width, height, surface.width, surface.height);\n                }\n                else {\n                    if (node.dirtyRender) {\n                        this.canvasRenderer.renderGraphics(node, this.canvasRenderBuffer.context);\n                        if (this.wxiOS10) {\n                            surface[\"isCanvas\"] = true;\n                            node.$texture = surface;\n                        }\n                        else {\n                            // 拷贝canvas到texture\n                            var texture = node.$texture;\n                            if (!texture) {\n                                texture = buffer.context.createTexture(surface);\n                                node.$texture = texture;\n                            }\n                            else {\n                                // 重新拷贝新的图像\n                                buffer.context.updateTexture(texture, surface);\n                            }\n                        }\n                        // 保存材质尺寸\n                        node.$textureWidth = surface.width;\n                        node.$textureHeight = surface.height;\n                    }\n                    var textureWidth = node.$textureWidth;\n                    var textureHeight = node.$textureHeight;\n                    buffer.context.drawTexture(node.$texture, 0, 0, textureWidth, textureHeight, 0, 0, textureWidth / canvasScaleX, textureHeight / canvasScaleY, textureWidth, textureHeight);\n                }\n                if (node.x || node.y) {\n                    if (node.dirtyRender || forHitTest) {\n                        this.canvasRenderBuffer.context.translate(node.x, node.y);\n                    }\n                    buffer.transform(1, 0, 0, 1, -node.x, -node.y);\n                }\n                if (!forHitTest) {\n                    node.dirtyRender = false;\n                }\n            };\n            WebGLRenderer.prototype.renderGroup = function (groupNode, buffer) {\n                var m = groupNode.matrix;\n                var savedMatrix;\n                var offsetX;\n                var offsetY;\n                if (m) {\n                    savedMatrix = egret.Matrix.create();\n                    var curMatrix = buffer.globalMatrix;\n                    savedMatrix.a = curMatrix.a;\n                    savedMatrix.b = curMatrix.b;\n                    savedMatrix.c = curMatrix.c;\n                    savedMatrix.d = curMatrix.d;\n                    savedMatrix.tx = curMatrix.tx;\n                    savedMatrix.ty = curMatrix.ty;\n                    offsetX = buffer.$offsetX;\n                    offsetY = buffer.$offsetY;\n                    buffer.useOffset();\n                    buffer.transform(m.a, m.b, m.c, m.d, m.tx, m.ty);\n                }\n                var children = groupNode.drawData;\n                var length = children.length;\n                for (var i = 0; i < length; i++) {\n                    var node = children[i];\n                    this.renderNode(node, buffer, buffer.$offsetX, buffer.$offsetY);\n                }\n                if (m) {\n                    var matrix = buffer.globalMatrix;\n                    matrix.a = savedMatrix.a;\n                    matrix.b = savedMatrix.b;\n                    matrix.c = savedMatrix.c;\n                    matrix.d = savedMatrix.d;\n                    matrix.tx = savedMatrix.tx;\n                    matrix.ty = savedMatrix.ty;\n                    buffer.$offsetX = offsetX;\n                    buffer.$offsetY = offsetY;\n                    egret.Matrix.release(savedMatrix);\n                }\n            };\n            /**\n             * @private\n             */\n            WebGLRenderer.prototype.createRenderBuffer = function (width, height) {\n                var buffer = renderBufferPool.pop();\n                if (buffer) {\n                    buffer.resize(width, height);\n                }\n                else {\n                    buffer = new web.WebGLRenderBuffer(width, height);\n                    buffer.$computeDrawCall = false;\n                }\n                return buffer;\n            };\n            return WebGLRenderer;\n        }());\n        web.WebGLRenderer = WebGLRenderer;\n        __reflect(WebGLRenderer.prototype, \"egret.web.WebGLRenderer\", [\"egret.sys.SystemRenderer\"]);\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n/*\n*** 一个管理模型，逐级包含: back -> page -> line -> textBlock\n*/\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        var TextBlock = (function (_super) {\n            __extends(TextBlock, _super);\n            function TextBlock(width, height, measureWidth, measureHeight, canvasWidthOffset, canvasHeightOffset, stroke2, border) {\n                var _this = _super.call(this) || this;\n                _this._width = 0;\n                _this._height = 0;\n                _this._border = 0;\n                _this.line = null;\n                _this.x = 0;\n                _this.y = 0;\n                _this.u = 0;\n                _this.v = 0;\n                _this.tag = '';\n                _this.measureWidth = 0;\n                _this.measureHeight = 0;\n                _this.canvasWidthOffset = 0;\n                _this.canvasHeightOffset = 0;\n                _this.stroke2 = 0;\n                _this._width = width;\n                _this._height = height;\n                _this._border = border;\n                _this.measureWidth = measureWidth;\n                _this.measureHeight = measureHeight;\n                _this.canvasWidthOffset = canvasWidthOffset;\n                _this.canvasHeightOffset = canvasHeightOffset;\n                _this.stroke2 = stroke2;\n                return _this;\n            }\n            Object.defineProperty(TextBlock.prototype, \"border\", {\n                get: function () {\n                    return this._border;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(TextBlock.prototype, \"width\", {\n                get: function () {\n                    return this._width + this.border * 2;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(TextBlock.prototype, \"height\", {\n                get: function () {\n                    return this._height + this.border * 2;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(TextBlock.prototype, \"contentWidth\", {\n                get: function () {\n                    return this._width;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(TextBlock.prototype, \"contentHeight\", {\n                get: function () {\n                    return this._height;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(TextBlock.prototype, \"page\", {\n                get: function () {\n                    return this.line ? this.line.page : null;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            TextBlock.prototype.updateUV = function () {\n                var line = this.line;\n                if (!line) {\n                    return false; //不属于任何的line就是错的\n                }\n                this.u = line.x + this.x + this.border * 1;\n                this.v = line.y + this.y + this.border * 1;\n                return true;\n            };\n            Object.defineProperty(TextBlock.prototype, \"subImageOffsetX\", {\n                get: function () {\n                    var line = this.line;\n                    if (!line) {\n                        return 0;\n                    }\n                    return line.x + this.x + this.border;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(TextBlock.prototype, \"subImageOffsetY\", {\n                get: function () {\n                    var line = this.line;\n                    if (!line) {\n                        return 0;\n                    }\n                    return line.y + this.y + this.border;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            return TextBlock;\n        }(egret.HashObject));\n        web.TextBlock = TextBlock;\n        __reflect(TextBlock.prototype, \"egret.web.TextBlock\");\n        var Line = (function (_super) {\n            __extends(Line, _super);\n            function Line(maxWidth) {\n                var _this = _super.call(this) || this;\n                _this.page = null;\n                _this.textBlocks = [];\n                _this.dynamicMaxHeight = 0;\n                _this.maxWidth = 0;\n                _this.x = 0;\n                _this.y = 0;\n                _this.maxWidth = maxWidth;\n                return _this;\n            }\n            Line.prototype.isCapacityOf = function (textBlock) {\n                if (!textBlock) {\n                    return false;\n                }\n                //\n                var posx = 0;\n                var posy = 0;\n                var lastTxtBlock = this.lastTextBlock();\n                if (lastTxtBlock) {\n                    posx = lastTxtBlock.x + lastTxtBlock.width;\n                    posy = lastTxtBlock.y;\n                }\n                //\n                if (posx + textBlock.width > this.maxWidth) {\n                    return false; //宽度不够\n                }\n                //\n                if (this.dynamicMaxHeight > 0) {\n                    if (textBlock.height > this.dynamicMaxHeight || (textBlock.height / this.dynamicMaxHeight < 0.5)) {\n                        return false; //如果有已经有动态高度，到这里，要么高度不够，要么小于动态高度的0.6差距, 就不填充\n                    }\n                }\n                return true;\n            };\n            Line.prototype.lastTextBlock = function () {\n                var textBlocks = this.textBlocks;\n                if (textBlocks.length > 0) {\n                    return textBlocks[textBlocks.length - 1];\n                }\n                return null;\n            };\n            Line.prototype.addTextBlock = function (textBlock, needCheck) {\n                //\n                if (!textBlock) {\n                    return false;\n                }\n                //\n                if (needCheck) {\n                    if (!this.isCapacityOf(textBlock)) {\n                        return false;\n                    }\n                }\n                //\n                var posx = 0;\n                var posy = 0;\n                var lastTxtBlock = this.lastTextBlock();\n                if (lastTxtBlock) {\n                    posx = lastTxtBlock.x + lastTxtBlock.width;\n                    posy = lastTxtBlock.y;\n                }\n                //\n                textBlock.x = posx;\n                textBlock.y = posy;\n                textBlock.line = this;\n                this.textBlocks.push(textBlock);\n                this.dynamicMaxHeight = Math.max(this.dynamicMaxHeight, textBlock.height);\n                return true;\n            };\n            return Line;\n        }(egret.HashObject));\n        web.Line = Line;\n        __reflect(Line.prototype, \"egret.web.Line\");\n        var Page = (function (_super) {\n            __extends(Page, _super);\n            function Page(pageWidth, pageHeight) {\n                var _this = _super.call(this) || this;\n                _this.lines = [];\n                _this.pageWidth = 0;\n                _this.pageHeight = 0;\n                _this.webGLTexture = null;\n                _this.pageWidth = pageWidth;\n                _this.pageHeight = pageHeight;\n                return _this;\n            }\n            Page.prototype.addLine = function (line) {\n                if (!line) {\n                    return false;\n                }\n                //\n                var posx = 0;\n                var posy = 0;\n                //\n                var lines = this.lines;\n                if (lines.length > 0) {\n                    var lastLine = lines[lines.length - 1];\n                    posx = lastLine.x;\n                    posy = lastLine.y + lastLine.dynamicMaxHeight;\n                }\n                if (line.maxWidth > this.pageWidth) {\n                    console.error('line.maxWidth = ' + line.maxWidth + ', ' + 'this.pageWidth = ' + this.pageWidth);\n                    return false; //宽度不够\n                }\n                if (posy + line.dynamicMaxHeight > this.pageHeight) {\n                    return false; //满了\n                }\n                //更新数据\n                line.x = posx;\n                line.y = posy;\n                line.page = this;\n                this.lines.push(line);\n                return true;\n            };\n            return Page;\n        }(egret.HashObject));\n        web.Page = Page;\n        __reflect(Page.prototype, \"egret.web.Page\");\n        var Book = (function (_super) {\n            __extends(Book, _super);\n            function Book(maxSize, border) {\n                var _this = _super.call(this) || this;\n                _this._pages = [];\n                _this._sortLines = [];\n                _this._maxSize = 1024;\n                _this._border = 1;\n                _this._maxSize = maxSize;\n                _this._border = border;\n                return _this;\n            }\n            Book.prototype.addTextBlock = function (textBlock) {\n                var result = this._addTextBlock(textBlock);\n                if (!result) {\n                    return false;\n                }\n                //更新下uv\n                textBlock.updateUV();\n                //没有才要添加\n                var exist = false;\n                var cast = result;\n                var _sortLines = this._sortLines;\n                for (var _i = 0, _sortLines_1 = _sortLines; _i < _sortLines_1.length; _i++) {\n                    var line = _sortLines_1[_i];\n                    if (line === cast[1]) {\n                        exist = true;\n                        break;\n                    }\n                }\n                if (!exist) {\n                    _sortLines.push(cast[1]);\n                }\n                //重新排序\n                this.sort();\n                return true;\n            };\n            Book.prototype._addTextBlock = function (textBlock) {\n                if (!textBlock) {\n                    return null;\n                }\n                if (textBlock.width > this._maxSize || textBlock.height > this._maxSize) {\n                    //console.log('this._maxSize = ' + this._maxSize + ', textBlock.width = ' + textBlock.width + ', textBlock.height = ' + textBlock.height);\n                    return null;\n                }\n                //找到最合适的\n                var _sortLines = this._sortLines;\n                for (var i = 0, length_11 = _sortLines.length; i < length_11; ++i) {\n                    var line = _sortLines[i];\n                    if (!line.isCapacityOf(textBlock)) {\n                        continue;\n                    }\n                    if (line.addTextBlock(textBlock, false)) {\n                        return [line.page, line];\n                    }\n                }\n                //做新的行\n                var newLine = new Line(this._maxSize);\n                if (!newLine.addTextBlock(textBlock, true)) {\n                    console.error('_addTextBlock !newLine.addTextBlock(textBlock, true)');\n                    return null;\n                }\n                //现有的page中插入\n                var _pages = this._pages;\n                for (var i = 0, length_12 = _pages.length; i < length_12; ++i) {\n                    var page = _pages[i];\n                    if (page.addLine(newLine)) {\n                        return [page, newLine];\n                    }\n                }\n                //都没有，就做新的page\n                //添加目标行\n                var newPage = this.createPage(this._maxSize, this._maxSize);\n                if (!newPage.addLine(newLine)) {\n                    console.error('_addText newPage.addLine failed');\n                    return null;\n                }\n                return [newPage, newLine];\n            };\n            Book.prototype.createPage = function (pageWidth, pageHeight) {\n                var newPage = new Page(pageWidth, pageHeight);\n                this._pages.push(newPage);\n                return newPage;\n            };\n            Book.prototype.sort = function () {\n                if (this._sortLines.length <= 1) {\n                    return;\n                }\n                var sortFunc = function (a, b) {\n                    return (a.dynamicMaxHeight < b.dynamicMaxHeight) ? -1 : 1;\n                };\n                this._sortLines = this._sortLines.sort(sortFunc);\n            };\n            Book.prototype.createTextBlock = function (tag, width, height, measureWidth, measureHeight, canvasWidthOffset, canvasHeightOffset, stroke2) {\n                var txtBlock = new TextBlock(width, height, measureWidth, measureHeight, canvasWidthOffset, canvasHeightOffset, stroke2, this._border);\n                if (!this.addTextBlock(txtBlock)) {\n                    //走到这里几乎是不可能的，除非内存分配没了\n                    //暂时还没有到提交纹理的地步，现在都是虚拟的\n                    return null;\n                }\n                txtBlock.tag = tag;\n                return txtBlock;\n            };\n            return Book;\n        }(egret.HashObject));\n        web.Book = Book;\n        __reflect(Book.prototype, \"egret.web.Book\");\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        //测试开关,打开会截住老的字体渲染\n        web.textAtlasRenderEnable = false;\n        //测试对象, 先不用singleton的，后续整理代码，就new一个，放在全局的context上做成员变量\n        web.__textAtlasRender__ = null;\n        //不想改TextNode的代码了，先用这种方式实现，以后稳了再改\n        web.property_drawLabel = 'DrawLabel';\n        //开启这个，用textAtlas渲染出来的，都是红字，而且加黑框\n        var textAtlasDebug = false;\n        //画一行\n        var DrawLabel = (function (_super) {\n            __extends(DrawLabel, _super);\n            function DrawLabel() {\n                var _this = _super !== null && _super.apply(this, arguments) || this;\n                //记录初始位置\n                _this.anchorX = 0;\n                _this.anchorY = 0;\n                //要画的字块\n                _this.textBlocks = [];\n                return _this;\n            }\n            //清除数据，回池\n            DrawLabel.prototype.clear = function () {\n                this.anchorX = 0;\n                this.anchorY = 0;\n                this.textBlocks.length = 0; //这个没事,实体在book里面存着\n            };\n            //池子创建\n            DrawLabel.create = function () {\n                var pool = DrawLabel.pool;\n                if (pool.length === 0) {\n                    pool.push(new DrawLabel);\n                }\n                return pool.pop();\n            };\n            //回池\n            DrawLabel.back = function (drawLabel, checkRepeat) {\n                if (!drawLabel) {\n                    return;\n                }\n                var pool = DrawLabel.pool;\n                if (checkRepeat && pool.indexOf(drawLabel) >= 0) {\n                    console.error('DrawLabel.back repeat');\n                    return;\n                }\n                drawLabel.clear();\n                pool.push(drawLabel);\n            };\n            //池子，防止反复创建\n            DrawLabel.pool = [];\n            return DrawLabel;\n        }(egret.HashObject));\n        web.DrawLabel = DrawLabel;\n        __reflect(DrawLabel.prototype, \"egret.web.DrawLabel\");\n        //记录样式的\n        var StyleInfo = (function (_super) {\n            __extends(StyleInfo, _super);\n            //\n            function StyleInfo(textNode, format) {\n                var _this = _super.call(this) || this;\n                _this.format = null;\n                //debug强制红色\n                var saveTextColorForDebug = 0;\n                if (textAtlasDebug) {\n                    saveTextColorForDebug = textNode.textColor;\n                    textNode.textColor = 0xff0000;\n                }\n                //存上\n                _this.textColor = textNode.textColor;\n                _this.strokeColor = textNode.strokeColor;\n                _this.size = textNode.size;\n                _this.stroke = textNode.stroke;\n                _this.bold = textNode.bold;\n                _this.italic = textNode.italic;\n                _this.fontFamily = textNode.fontFamily;\n                _this.format = format;\n                _this.font = egret.getFontString(textNode, _this.format);\n                //描述用于生成hashcode\n                var textColor = (!format.textColor ? textNode.textColor : format.textColor);\n                var strokeColor = (!format.strokeColor ? textNode.strokeColor : format.strokeColor);\n                var stroke = (!format.stroke ? textNode.stroke : format.stroke);\n                var size = (!format.size ? textNode.size : format.size);\n                //\n                _this.description = '' + _this.font + '-' + size;\n                _this.description += '-' + egret.toColorString(textColor);\n                _this.description += '-' + egret.toColorString(strokeColor);\n                if (stroke) {\n                    _this.description += '-' + stroke * 2;\n                }\n                //还原\n                if (textAtlasDebug) {\n                    textNode.textColor = saveTextColorForDebug;\n                }\n                return _this;\n            }\n            return StyleInfo;\n        }(egret.HashObject));\n        __reflect(StyleInfo.prototype, \"StyleInfo\");\n        //测量字体和绘制的\n        var CharImageRender = (function (_super) {\n            __extends(CharImageRender, _super);\n            function CharImageRender() {\n                var _this = _super !== null && _super.apply(this, arguments) || this;\n                //要渲染的字符串\n                _this.char = '';\n                //StyleInfo\n                _this.styleInfo = null;\n                //生成hashcode的字符串\n                _this.hashCodeString = '';\n                //字母：style设置行程唯一值\n                _this.charWithStyleHashCode = 0;\n                //测量实际的size\n                _this.measureWidth = 0;\n                _this.measureHeight = 0;\n                //边缘放大之后的偏移\n                _this.canvasWidthOffset = 0;\n                _this.canvasHeightOffset = 0;\n                //描边的记录\n                _this.stroke2 = 0;\n                return _this;\n            }\n            CharImageRender.prototype.reset = function (char, styleKey) {\n                this.char = char;\n                this.styleInfo = styleKey;\n                this.hashCodeString = char + ':' + styleKey.description;\n                this.charWithStyleHashCode = egret.NumberUtils.convertStringToHashCode(this.hashCodeString);\n                this.canvasWidthOffset = 0;\n                this.canvasHeightOffset = 0;\n                this.stroke2 = 0;\n                return this;\n            };\n            CharImageRender.prototype.measureAndDraw = function (targetCanvas) {\n                var canvas = targetCanvas;\n                if (!canvas) {\n                    return;\n                }\n                //读取设置\n                var text = this.char;\n                var format = this.styleInfo.format;\n                var textColor = (!format.textColor ? this.styleInfo.textColor : format.textColor);\n                var strokeColor = (!format.strokeColor ? this.styleInfo.strokeColor : format.strokeColor);\n                var stroke = (!format.stroke ? this.styleInfo.stroke : format.stroke);\n                var size = (!format.size ? this.styleInfo.size : format.size);\n                //开始测量---------------------------------------\n                this.measureWidth = this.measure(text, this.styleInfo, size);\n                this.measureHeight = size; //this.styleInfo.size;\n                //调整 参考TextField: $getRenderBounds(): Rectangle {\n                var canvasWidth = this.measureWidth;\n                var canvasHeight = this.measureHeight;\n                var _strokeDouble = stroke * 2;\n                if (_strokeDouble > 0) {\n                    canvasWidth += _strokeDouble * 2;\n                    canvasHeight += _strokeDouble * 2;\n                }\n                this.stroke2 = _strokeDouble;\n                //赋值\n                canvas.width = canvasWidth = Math.ceil(canvasWidth) + 2 * 2;\n                canvas.height = canvasHeight = Math.ceil(canvasHeight) + 2 * 2;\n                this.canvasWidthOffset = (canvas.width - this.measureWidth) / 2;\n                this.canvasHeightOffset = (canvas.height - this.measureHeight) / 2;\n                //全部保留numberOfPrecision位小数\n                var numberOfPrecision = 3;\n                var precision = Math.pow(10, numberOfPrecision);\n                this.canvasWidthOffset = Math.floor(this.canvasWidthOffset * precision) / precision;\n                this.canvasHeightOffset = Math.floor(this.canvasHeightOffset * precision) / precision;\n                //再开始绘制---------------------------------------\n                var context = egret.sys.getContext2d(canvas);\n                context.save();\n                context.textAlign = 'center';\n                context.textBaseline = 'middle';\n                context.lineJoin = 'round';\n                context.font = this.styleInfo.font;\n                context.fillStyle = egret.toColorString(textColor);\n                context.strokeStyle = egret.toColorString(strokeColor);\n                context.clearRect(0, 0, canvas.width, canvas.height);\n                if (stroke) {\n                    context.lineWidth = stroke * 2;\n                    context.strokeText(text, canvas.width / 2, canvas.height / 2);\n                }\n                context.fillText(text, canvas.width / 2, canvas.height / 2);\n                context.restore();\n            };\n            CharImageRender.prototype.measure = function (text, styleKey, textFlowSize) {\n                var isChinese = CharImageRender.chineseCharactersRegExp.test(text);\n                if (isChinese) {\n                    if (CharImageRender.chineseCharacterMeasureFastMap[styleKey.font]) {\n                        return CharImageRender.chineseCharacterMeasureFastMap[styleKey.font];\n                    }\n                }\n                var measureTextWidth = egret.sys.measureText(text, styleKey.fontFamily, textFlowSize || styleKey.size, styleKey.bold, styleKey.italic);\n                if (isChinese) {\n                    CharImageRender.chineseCharacterMeasureFastMap[styleKey.font] = measureTextWidth;\n                }\n                return measureTextWidth;\n            };\n            //针对中文的加速查找\n            CharImageRender.chineseCharactersRegExp = new RegExp(\"^[\\u4E00-\\u9FA5]$\");\n            CharImageRender.chineseCharacterMeasureFastMap = {};\n            return CharImageRender;\n        }(egret.HashObject));\n        __reflect(CharImageRender.prototype, \"CharImageRender\");\n        //对外的类\n        var TextAtlasRender = (function (_super) {\n            __extends(TextAtlasRender, _super);\n            //\n            function TextAtlasRender(webglRenderContext, maxSize, border) {\n                var _this = _super.call(this) || this;\n                _this.book = null;\n                _this.charImageRender = new CharImageRender;\n                _this.textBlockMap = {};\n                _this._canvas = null;\n                _this.textAtlasTextureCache = [];\n                _this.webglRenderContext = null;\n                _this.webglRenderContext = webglRenderContext;\n                _this.book = new web.Book(maxSize, border);\n                return _this;\n            }\n            //分析textNode，把数据提取出来，然后给textNode挂上渲染的信息\n            TextAtlasRender.analysisTextNodeAndFlushDrawLabel = function (textNode) {\n                if (!textNode) {\n                    return;\n                }\n                if (!web.__textAtlasRender__) {\n                    //创建，后续会转移给WebGLRenderContext\n                    var webglcontext = egret.web.WebGLRenderContext.getInstance(0, 0);\n                    //初期先512，因为不会大规模batch, 老项目最好不要直接使用这个，少数几个总变内容的TextField可以用，所以先不用$maxTextureSize\n                    web.__textAtlasRender__ = new TextAtlasRender(webglcontext, textAtlasDebug ? 512 : 512 /*webglcontext.$maxTextureSize*/, textAtlasDebug ? 12 : 1);\n                }\n                //清除命令\n                textNode[web.property_drawLabel] = textNode[web.property_drawLabel] || [];\n                var drawLabels = textNode[web.property_drawLabel];\n                for (var _i = 0, drawLabels_1 = drawLabels; _i < drawLabels_1.length; _i++) {\n                    var drawLabel = drawLabels_1[_i];\n                    //还回去\n                    DrawLabel.back(drawLabel, false);\n                }\n                drawLabels.length = 0;\n                //重新装填\n                var offset = 4;\n                var drawData = textNode.drawData;\n                var anchorX = 0;\n                var anchorY = 0;\n                var labelString = '';\n                var labelFormat = {};\n                var resultAsRenderTextBlocks = [];\n                for (var i = 0, length_13 = drawData.length; i < length_13; i += offset) {\n                    anchorX = drawData[i + 0];\n                    anchorY = drawData[i + 1];\n                    labelString = drawData[i + 2];\n                    labelFormat = drawData[i + 3] || {};\n                    resultAsRenderTextBlocks.length = 0;\n                    //提取数据\n                    web.__textAtlasRender__.convertLabelStringToTextAtlas(labelString, new StyleInfo(textNode, labelFormat), resultAsRenderTextBlocks);\n                    //pool创建 + 添加命令\n                    var drawLabel = DrawLabel.create();\n                    drawLabel.anchorX = anchorX;\n                    drawLabel.anchorY = anchorY;\n                    drawLabel.textBlocks = [].concat(resultAsRenderTextBlocks);\n                    drawLabels.push(drawLabel);\n                }\n            };\n            //字符串转化成为TextBlock\n            TextAtlasRender.prototype.convertLabelStringToTextAtlas = function (labelstring, styleKey, resultAsRenderTextBlocks) {\n                var canvas = this.canvas;\n                var charImageRender = this.charImageRender;\n                var textBlockMap = this.textBlockMap;\n                for (var _i = 0, labelstring_1 = labelstring; _i < labelstring_1.length; _i++) {\n                    var char = labelstring_1[_i];\n                    //不反复创建\n                    charImageRender.reset(char, styleKey);\n                    if (textBlockMap[charImageRender.charWithStyleHashCode]) {\n                        //检查重复\n                        resultAsRenderTextBlocks.push(textBlockMap[charImageRender.charWithStyleHashCode]);\n                        continue;\n                    }\n                    //画到到canvas\n                    charImageRender.measureAndDraw(canvas);\n                    //创建新的文字块\n                    var txtBlock = this.book.createTextBlock(char, canvas.width, canvas.height, charImageRender.measureWidth, charImageRender.measureHeight, charImageRender.canvasWidthOffset, charImageRender.canvasHeightOffset, charImageRender.stroke2);\n                    if (!txtBlock) {\n                        continue;\n                    }\n                    //需要绘制\n                    resultAsRenderTextBlocks.push(txtBlock);\n                    //记录快速查找\n                    textBlockMap[charImageRender.charWithStyleHashCode] = txtBlock;\n                    //生成纹理\n                    var page = txtBlock.page;\n                    if (!page.webGLTexture) {\n                        page.webGLTexture = this.createTextTextureAtlas(page.pageWidth, page.pageHeight, textAtlasDebug);\n                    }\n                    var gl = this.webglRenderContext.context;\n                    page.webGLTexture[egret.glContext] = gl;\n                    gl.bindTexture(gl.TEXTURE_2D, page.webGLTexture);\n                    gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true);\n                    page.webGLTexture[egret.UNPACK_PREMULTIPLY_ALPHA_WEBGL] = true;\n                    gl.texSubImage2D(gl.TEXTURE_2D, 0, txtBlock.subImageOffsetX, txtBlock.subImageOffsetY, gl.RGBA, gl.UNSIGNED_BYTE, canvas);\n                    gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false);\n                }\n            };\n            //给一个page创建一个纹理\n            TextAtlasRender.prototype.createTextTextureAtlas = function (width, height, debug) {\n                var texture = null;\n                if (debug) {\n                    //做一个黑底子的，方便调试代码\n                    var canvas = egret.sys.createCanvas(width, width);\n                    var context = egret.sys.getContext2d(canvas);\n                    context.fillStyle = 'black';\n                    context.fillRect(0, 0, width, width);\n                    texture = egret.sys.createTexture(this.webglRenderContext, canvas);\n                }\n                else {\n                    //真的\n                    texture = egret.sys._createTexture(this.webglRenderContext, width, height, null);\n                }\n                if (texture) {\n                    //存起来，未来可以删除，或者查看\n                    this.textAtlasTextureCache.push(texture);\n                }\n                return texture;\n            };\n            Object.defineProperty(TextAtlasRender.prototype, \"canvas\", {\n                //给CharImageRender用的canvas\n                get: function () {\n                    if (!this._canvas) {\n                        //就用默认体积24\n                        this._canvas = egret.sys.createCanvas(24, 24);\n                    }\n                    return this._canvas;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            return TextAtlasRender;\n        }(egret.HashObject));\n        web.TextAtlasRender = TextAtlasRender;\n        __reflect(TextAtlasRender.prototype, \"egret.web.TextAtlasRender\");\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var EgretWebGLAttribute = (function () {\n            function EgretWebGLAttribute(gl, program, attributeData) {\n                this.gl = gl;\n                this.name = attributeData.name;\n                this.type = attributeData.type;\n                this.size = attributeData.size;\n                this.location = gl.getAttribLocation(program, this.name);\n                this.count = 0;\n                this.initCount(gl);\n                this.format = gl.FLOAT;\n                this.initFormat(gl);\n            }\n            EgretWebGLAttribute.prototype.initCount = function (gl) {\n                var type = this.type;\n                switch (type) {\n                    case 5126 /* FLOAT */:\n                    case 5120 /* BYTE */:\n                    case 5121 /* UNSIGNED_BYTE */:\n                    case 5123 /* UNSIGNED_SHORT */:\n                        this.count = 1;\n                        break;\n                    case 35664 /* FLOAT_VEC2 */:\n                        this.count = 2;\n                        break;\n                    case 35665 /* FLOAT_VEC3 */:\n                        this.count = 3;\n                        break;\n                    case 35666 /* FLOAT_VEC4 */:\n                        this.count = 4;\n                        break;\n                }\n            };\n            EgretWebGLAttribute.prototype.initFormat = function (gl) {\n                var type = this.type;\n                switch (type) {\n                    case 5126 /* FLOAT */:\n                    case 35664 /* FLOAT_VEC2 */:\n                    case 35665 /* FLOAT_VEC3 */:\n                    case 35666 /* FLOAT_VEC4 */:\n                        this.format = gl.FLOAT;\n                        break;\n                    case 5121 /* UNSIGNED_BYTE */:\n                        this.format = gl.UNSIGNED_BYTE;\n                        break;\n                    case 5123 /* UNSIGNED_SHORT */:\n                        this.format = gl.UNSIGNED_SHORT;\n                        break;\n                    case 5120 /* BYTE */:\n                        this.format = gl.BYTE;\n                        break;\n                }\n            };\n            return EgretWebGLAttribute;\n        }());\n        web.EgretWebGLAttribute = EgretWebGLAttribute;\n        __reflect(EgretWebGLAttribute.prototype, \"egret.web.EgretWebGLAttribute\");\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        function loadShader(gl, type, source) {\n            var shader = gl.createShader(type);\n            gl.shaderSource(shader, source);\n            gl.compileShader(shader);\n            var compiled = gl.getShaderParameter(shader, gl.COMPILE_STATUS);\n            if (!compiled) {\n                console.log(\"shader not compiled!\");\n                console.log(gl.getShaderInfoLog(shader));\n            }\n            return shader;\n        }\n        function createWebGLProgram(gl, vertexShader, fragmentShader) {\n            var program = gl.createProgram();\n            gl.attachShader(program, vertexShader);\n            gl.attachShader(program, fragmentShader);\n            gl.linkProgram(program);\n            return program;\n        }\n        function extractAttributes(gl, program) {\n            var attributes = {};\n            var totalAttributes = gl.getProgramParameter(program, gl.ACTIVE_ATTRIBUTES);\n            for (var i = 0; i < totalAttributes; i++) {\n                var attribData = gl.getActiveAttrib(program, i);\n                var name_2 = attribData.name;\n                var attribute = new web.EgretWebGLAttribute(gl, program, attribData);\n                attributes[name_2] = attribute;\n            }\n            return attributes;\n        }\n        function extractUniforms(gl, program) {\n            var uniforms = {};\n            var totalUniforms = gl.getProgramParameter(program, gl.ACTIVE_UNIFORMS);\n            for (var i = 0; i < totalUniforms; i++) {\n                var uniformData = gl.getActiveUniform(program, i);\n                var name_3 = uniformData.name;\n                var uniform = new web.EgretWebGLUniform(gl, program, uniformData);\n                uniforms[name_3] = uniform;\n            }\n            return uniforms;\n        }\n        /**\n         * @private\n         */\n        var EgretWebGLProgram = (function () {\n            function EgretWebGLProgram(gl, vertSource, fragSource) {\n                this.vshaderSource = vertSource;\n                this.fshaderSource = fragSource;\n                this.vertexShader = loadShader(gl, gl.VERTEX_SHADER, this.vshaderSource);\n                this.fragmentShader = loadShader(gl, gl.FRAGMENT_SHADER, this.fshaderSource);\n                this.id = createWebGLProgram(gl, this.vertexShader, this.fragmentShader);\n                this.uniforms = extractUniforms(gl, this.id);\n                this.attributes = extractAttributes(gl, this.id);\n            }\n            /**\n             * 获取所需的WebGL Program\n             * @param key {string} 对于唯一的program程序，对应唯一的key\n             */\n            EgretWebGLProgram.getProgram = function (gl, vertSource, fragSource, key) {\n                if (!this.programCache[key]) {\n                    this.programCache[key] = new EgretWebGLProgram(gl, vertSource, fragSource);\n                }\n                return this.programCache[key];\n            };\n            EgretWebGLProgram.deleteProgram = function (gl, vertSource, fragSource, key) {\n                // TODO delete\n            };\n            EgretWebGLProgram.programCache = {};\n            return EgretWebGLProgram;\n        }());\n        web.EgretWebGLProgram = EgretWebGLProgram;\n        __reflect(EgretWebGLProgram.prototype, \"egret.web.EgretWebGLProgram\");\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        /**\n         * @private\n         */\n        var EgretWebGLUniform = (function () {\n            function EgretWebGLUniform(gl, program, uniformData) {\n                this.gl = gl;\n                this.name = uniformData.name;\n                this.type = uniformData.type;\n                this.size = uniformData.size;\n                this.location = gl.getUniformLocation(program, this.name);\n                this.setDefaultValue();\n                this.generateSetValue();\n                this.generateUpload();\n            }\n            EgretWebGLUniform.prototype.setDefaultValue = function () {\n                var type = this.type;\n                switch (type) {\n                    case 5126 /* FLOAT */:\n                    case 35678 /* SAMPLER_2D */:\n                    case 35680 /* SAMPLER_CUBE */:\n                    case 35670 /* BOOL */:\n                    case 5124 /* INT */:\n                        this.value = 0;\n                        break;\n                    case 35664 /* FLOAT_VEC2 */:\n                    case 35671 /* BOOL_VEC2 */:\n                    case 35667 /* INT_VEC2 */:\n                        this.value = [0, 0];\n                        break;\n                    case 35665 /* FLOAT_VEC3 */:\n                    case 35672 /* BOOL_VEC3 */:\n                    case 35668 /* INT_VEC3 */:\n                        this.value = [0, 0, 0];\n                        break;\n                    case 35666 /* FLOAT_VEC4 */:\n                    case 35673 /* BOOL_VEC4 */:\n                    case 35669 /* INT_VEC4 */:\n                        this.value = [0, 0, 0, 0];\n                        break;\n                    case 35674 /* FLOAT_MAT2 */:\n                        this.value = new Float32Array([\n                            1, 0,\n                            0, 1\n                        ]);\n                        break;\n                    case 35675 /* FLOAT_MAT3 */:\n                        this.value = new Float32Array([\n                            1, 0, 0,\n                            0, 1, 0,\n                            0, 0, 1\n                        ]);\n                        break;\n                    case 35676 /* FLOAT_MAT4 */:\n                        this.value = new Float32Array([\n                            1, 0, 0, 0,\n                            0, 1, 0, 0,\n                            0, 0, 1, 0,\n                            0, 0, 0, 1\n                        ]);\n                        break;\n                }\n            };\n            EgretWebGLUniform.prototype.generateSetValue = function () {\n                var type = this.type;\n                switch (type) {\n                    case 5126 /* FLOAT */:\n                    case 35678 /* SAMPLER_2D */:\n                    case 35680 /* SAMPLER_CUBE */:\n                    case 35670 /* BOOL */:\n                    case 5124 /* INT */:\n                        this.setValue = function (value) {\n                            var notEqual = this.value !== value;\n                            this.value = value;\n                            notEqual && this.upload();\n                        };\n                        break;\n                    case 35664 /* FLOAT_VEC2 */:\n                    case 35671 /* BOOL_VEC2 */:\n                    case 35667 /* INT_VEC2 */:\n                        this.setValue = function (value) {\n                            var notEqual = this.value[0] !== value.x || this.value[1] !== value.y;\n                            this.value[0] = value.x;\n                            this.value[1] = value.y;\n                            notEqual && this.upload();\n                        };\n                        break;\n                    case 35665 /* FLOAT_VEC3 */:\n                    case 35672 /* BOOL_VEC3 */:\n                    case 35668 /* INT_VEC3 */:\n                        this.setValue = function (value) {\n                            this.value[0] = value.x;\n                            this.value[1] = value.y;\n                            this.value[2] = value.z;\n                            this.upload();\n                        };\n                        break;\n                    case 35666 /* FLOAT_VEC4 */:\n                    case 35673 /* BOOL_VEC4 */:\n                    case 35669 /* INT_VEC4 */:\n                        this.setValue = function (value) {\n                            this.value[0] = value.x;\n                            this.value[1] = value.y;\n                            this.value[2] = value.z;\n                            this.value[3] = value.w;\n                            this.upload();\n                        };\n                        break;\n                    case 35674 /* FLOAT_MAT2 */:\n                    case 35675 /* FLOAT_MAT3 */:\n                    case 35676 /* FLOAT_MAT4 */:\n                        this.setValue = function (value) {\n                            this.value.set(value);\n                            this.upload();\n                        };\n                        break;\n                }\n            };\n            EgretWebGLUniform.prototype.generateUpload = function () {\n                var gl = this.gl;\n                var type = this.type;\n                var location = this.location;\n                switch (type) {\n                    case 5126 /* FLOAT */:\n                        this.upload = function () {\n                            var value = this.value;\n                            gl.uniform1f(location, value);\n                        };\n                        break;\n                    case 35664 /* FLOAT_VEC2 */:\n                        this.upload = function () {\n                            var value = this.value;\n                            gl.uniform2f(location, value[0], value[1]);\n                        };\n                        break;\n                    case 35665 /* FLOAT_VEC3 */:\n                        this.upload = function () {\n                            var value = this.value;\n                            gl.uniform3f(location, value[0], value[1], value[2]);\n                        };\n                        break;\n                    case 35666 /* FLOAT_VEC4 */:\n                        this.upload = function () {\n                            var value = this.value;\n                            gl.uniform4f(location, value[0], value[1], value[2], value[3]);\n                        };\n                        break;\n                    case 35678 /* SAMPLER_2D */:\n                    case 35680 /* SAMPLER_CUBE */:\n                    case 35670 /* BOOL */:\n                    case 5124 /* INT */:\n                        this.upload = function () {\n                            var value = this.value;\n                            gl.uniform1i(location, value);\n                        };\n                        break;\n                    case 35671 /* BOOL_VEC2 */:\n                    case 35667 /* INT_VEC2 */:\n                        this.upload = function () {\n                            var value = this.value;\n                            gl.uniform2i(location, value[0], value[1]);\n                        };\n                        break;\n                    case 35672 /* BOOL_VEC3 */:\n                    case 35668 /* INT_VEC3 */:\n                        this.upload = function () {\n                            var value = this.value;\n                            gl.uniform3i(location, value[0], value[1], value[2]);\n                        };\n                        break;\n                    case 35673 /* BOOL_VEC4 */:\n                    case 35669 /* INT_VEC4 */:\n                        this.upload = function () {\n                            var value = this.value;\n                            gl.uniform4i(location, value[0], value[1], value[2], value[3]);\n                        };\n                        break;\n                    case 35674 /* FLOAT_MAT2 */:\n                        this.upload = function () {\n                            var value = this.value;\n                            gl.uniformMatrix2fv(location, false, value);\n                        };\n                        break;\n                    case 35675 /* FLOAT_MAT3 */:\n                        this.upload = function () {\n                            var value = this.value;\n                            gl.uniformMatrix3fv(location, false, value);\n                        };\n                        break;\n                    case 35676 /* FLOAT_MAT4 */:\n                        this.upload = function () {\n                            var value = this.value;\n                            gl.uniformMatrix4fv(location, false, value);\n                        };\n                        break;\n                }\n            };\n            return EgretWebGLUniform;\n        }());\n        web.EgretWebGLUniform = EgretWebGLUniform;\n        __reflect(EgretWebGLUniform.prototype, \"egret.web.EgretWebGLUniform\");\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var web;\n    (function (web) {\n        var EgretShaderLib = (function () {\n            function EgretShaderLib() {\n            }\n            EgretShaderLib.blur_frag = \"precision mediump float;\\r\\nuniform vec2 blur;\\r\\nuniform sampler2D uSampler;\\r\\nvarying vec2 vTextureCoord;\\r\\nuniform vec2 uTextureSize;\\r\\nvoid main()\\r\\n{\\r\\n    const int sampleRadius = 5;\\r\\n    const int samples = sampleRadius * 2 + 1;\\r\\n    vec2 blurUv = blur / uTextureSize;\\r\\n    vec4 color = vec4(0, 0, 0, 0);\\r\\n    vec2 uv = vec2(0.0, 0.0);\\r\\n    blurUv /= float(sampleRadius);\\r\\n\\r\\n    for (int i = -sampleRadius; i <= sampleRadius; i++) {\\r\\n        uv.x = vTextureCoord.x + float(i) * blurUv.x;\\r\\n        uv.y = vTextureCoord.y + float(i) * blurUv.y;\\r\\n        color += texture2D(uSampler, uv);\\r\\n    }\\r\\n\\r\\n    color /= float(samples);\\r\\n    gl_FragColor = color;\\r\\n}\";\n            EgretShaderLib.colorTransform_frag = \"precision mediump float;\\r\\nvarying vec2 vTextureCoord;\\r\\nvarying vec4 vColor;\\r\\nuniform mat4 matrix;\\r\\nuniform vec4 colorAdd;\\r\\nuniform sampler2D uSampler;\\r\\n\\r\\nvoid main(void) {\\r\\n    vec4 texColor = texture2D(uSampler, vTextureCoord);\\r\\n    if(texColor.a > 0.) {\\r\\n        // 抵消预乘的alpha通道\\r\\n        texColor = vec4(texColor.rgb / texColor.a, texColor.a);\\r\\n    }\\r\\n    vec4 locColor = clamp(texColor * matrix + colorAdd, 0., 1.);\\r\\n    gl_FragColor = vColor * vec4(locColor.rgb * locColor.a, locColor.a);\\r\\n}\";\n            EgretShaderLib.default_vert = \"attribute vec2 aVertexPosition;\\r\\nattribute vec2 aTextureCoord;\\r\\nattribute vec4 aColor;\\r\\n\\r\\nuniform vec2 projectionVector;\\r\\n// uniform vec2 offsetVector;\\r\\n\\r\\nvarying vec2 vTextureCoord;\\r\\nvarying vec4 vColor;\\r\\n\\r\\nconst vec2 center = vec2(-1.0, 1.0);\\r\\n\\r\\nvoid main(void) {\\r\\n   gl_Position = vec4( (aVertexPosition / projectionVector) + center , 0.0, 1.0);\\r\\n   vTextureCoord = aTextureCoord;\\r\\n   vColor = aColor;\\r\\n}\";\n            EgretShaderLib.glow_frag = \"precision highp float;\\r\\nvarying vec2 vTextureCoord;\\r\\n\\r\\nuniform sampler2D uSampler;\\r\\n\\r\\nuniform float dist;\\r\\nuniform float angle;\\r\\nuniform vec4 color;\\r\\nuniform float alpha;\\r\\nuniform float blurX;\\r\\nuniform float blurY;\\r\\n// uniform vec4 quality;\\r\\nuniform float strength;\\r\\nuniform float inner;\\r\\nuniform float knockout;\\r\\nuniform float hideObject;\\r\\n\\r\\nuniform vec2 uTextureSize;\\r\\n\\r\\nfloat random(vec2 scale)\\r\\n{\\r\\n    return fract(sin(dot(gl_FragCoord.xy, scale)) * 43758.5453);\\r\\n}\\r\\n\\r\\nvoid main(void) {\\r\\n    vec2 px = vec2(1.0 / uTextureSize.x, 1.0 / uTextureSize.y);\\r\\n    // TODO 自动调节采样次数？\\r\\n    const float linearSamplingTimes = 7.0;\\r\\n    const float circleSamplingTimes = 12.0;\\r\\n    vec4 ownColor = texture2D(uSampler, vTextureCoord);\\r\\n    vec4 curColor;\\r\\n    float totalAlpha = 0.0;\\r\\n    float maxTotalAlpha = 0.0;\\r\\n    float curDistanceX = 0.0;\\r\\n    float curDistanceY = 0.0;\\r\\n    float offsetX = dist * cos(angle) * px.x;\\r\\n    float offsetY = dist * sin(angle) * px.y;\\r\\n\\r\\n    const float PI = 3.14159265358979323846264;\\r\\n    float cosAngle;\\r\\n    float sinAngle;\\r\\n    float offset = PI * 2.0 / circleSamplingTimes * random(vec2(12.9898, 78.233));\\r\\n    float stepX = blurX * px.x / linearSamplingTimes;\\r\\n    float stepY = blurY * px.y / linearSamplingTimes;\\r\\n    for (float a = 0.0; a <= PI * 2.0; a += PI * 2.0 / circleSamplingTimes) {\\r\\n        cosAngle = cos(a + offset);\\r\\n        sinAngle = sin(a + offset);\\r\\n        for (float i = 1.0; i <= linearSamplingTimes; i++) {\\r\\n            curDistanceX = i * stepX * cosAngle;\\r\\n            curDistanceY = i * stepY * sinAngle;\\r\\n            if (vTextureCoord.x + curDistanceX - offsetX >= 0.0 && vTextureCoord.y + curDistanceY + offsetY <= 1.0){\\r\\n                curColor = texture2D(uSampler, vec2(vTextureCoord.x + curDistanceX - offsetX, vTextureCoord.y + curDistanceY + offsetY));\\r\\n                totalAlpha += (linearSamplingTimes - i) * curColor.a;\\r\\n            }\\r\\n            maxTotalAlpha += (linearSamplingTimes - i);\\r\\n        }\\r\\n    }\\r\\n\\r\\n    ownColor.a = max(ownColor.a, 0.0001);\\r\\n    ownColor.rgb = ownColor.rgb / ownColor.a;\\r\\n\\r\\n    float outerGlowAlpha = (totalAlpha / maxTotalAlpha) * strength * alpha * (1. - inner) * max(min(hideObject, knockout), 1. - ownColor.a);\\r\\n    float innerGlowAlpha = ((maxTotalAlpha - totalAlpha) / maxTotalAlpha) * strength * alpha * inner * ownColor.a;\\r\\n\\r\\n    ownColor.a = max(ownColor.a * knockout * (1. - hideObject), 0.0001);\\r\\n    vec3 mix1 = mix(ownColor.rgb, color.rgb, innerGlowAlpha / (innerGlowAlpha + ownColor.a));\\r\\n    vec3 mix2 = mix(mix1, color.rgb, outerGlowAlpha / (innerGlowAlpha + ownColor.a + outerGlowAlpha));\\r\\n    float resultAlpha = min(ownColor.a + outerGlowAlpha + innerGlowAlpha, 1.);\\r\\n    gl_FragColor = vec4(mix2 * resultAlpha, resultAlpha);\\r\\n}\";\n            EgretShaderLib.primitive_frag = \"precision lowp float;\\r\\nvarying vec2 vTextureCoord;\\r\\nvarying vec4 vColor;\\r\\n\\r\\nvoid main(void) {\\r\\n    gl_FragColor = vColor;\\r\\n}\";\n            EgretShaderLib.texture_frag = \"precision lowp float;\\r\\nvarying vec2 vTextureCoord;\\r\\nvarying vec4 vColor;\\r\\nuniform sampler2D uSampler;\\r\\n\\r\\nvoid main(void) {\\r\\n    gl_FragColor = texture2D(uSampler, vTextureCoord) * vColor;\\r\\n}\";\n            /*\n            \"precision lowp float;\n            varying vec2 vTextureCoord;\n            varying vec4 vColor;\n            uniform sampler2D uSampler;\n            uniform sampler2D uSamplerAlphaMask;\n            void main(void) {\n                float alpha = texture2D(uSamplerAlphaMask, vTextureCoord).r;\n                if (alpha < 0.0039) { discard; }\n                vec4 v4Color = texture2D(uSampler, vTextureCoord);\n                v4Color.rgb = v4Color.rgb * alpha;\n                v4Color.a = alpha;\n                gl_FragColor = v4Color * vColor;\n            }\"\n            */\n            EgretShaderLib.texture_etc_alphamask_frag = \"precision lowp float;\\r\\nvarying vec2 vTextureCoord;\\r\\nvarying vec4 vColor;\\r\\nuniform sampler2D uSampler;\\r\\nuniform sampler2D uSamplerAlphaMask;\\r\\nvoid main(void) {\\r\\nfloat alpha = texture2D(uSamplerAlphaMask, vTextureCoord).r;\\r\\nif (alpha < 0.0039) { discard; }\\r\\nvec4 v4Color = texture2D(uSampler, vTextureCoord);\\r\\nv4Color.rgb = v4Color.rgb * alpha;\\r\\nv4Color.a = alpha;\\r\\ngl_FragColor = v4Color * vColor;\\r\\n}\";\n            /*\n            \"precision mediump float;\n            varying vec2 vTextureCoord;\n            varying vec4 vColor;\n            uniform mat4 matrix;\n            uniform vec4 colorAdd;\n            uniform sampler2D uSampler;\n            uniform sampler2D uSamplerAlphaMask;\n    \n            void main(void){\n                float alpha = texture2D(uSamplerAlphaMask, vTextureCoord).r;\n                if (alpha < 0.0039) { discard; }\n                vec4 texColor = texture2D(uSampler, vTextureCoord);\n                if(texColor.a > 0.0) {\n                    // 抵消预乘的alpha通道\n                    texColor = vec4(texColor.rgb / texColor.a, texColor.a);\n                }\n                vec4 v4Color = clamp(texColor * matrix + colorAdd, 0.0, 1.0);\n                v4Color.rgb = v4Color.rgb * alpha;\n                v4Color.a = alpha;\n                gl_FragColor = v4Color * vColor;\n            }\"\n            */\n            EgretShaderLib.colorTransform_frag_etc_alphamask_frag = \"precision mediump float;\\r\\nvarying vec2 vTextureCoord;\\r\\nvarying vec4 vColor;\\r\\nuniform mat4 matrix;\\r\\nuniform vec4 colorAdd;\\r\\nuniform sampler2D uSampler;\\r\\nuniform sampler2D uSamplerAlphaMask;\\r\\n\\r\\nvoid main(void){\\r\\nfloat alpha = texture2D(uSamplerAlphaMask, vTextureCoord).r;\\r\\nif (alpha < 0.0039) { discard; }\\r\\nvec4 texColor = texture2D(uSampler, vTextureCoord);\\r\\nif(texColor.a > 0.0) {\\r\\n // 抵消预乘的alpha通道\\r\\ntexColor = vec4(texColor.rgb / texColor.a, texColor.a);\\r\\n}\\r\\nvec4 v4Color = clamp(texColor * matrix + colorAdd, 0.0, 1.0);\\r\\nv4Color.rgb = v4Color.rgb * alpha;\\r\\nv4Color.a = alpha;\\r\\ngl_FragColor = v4Color * vColor;\\r\\n}\";\n            return EgretShaderLib;\n        }());\n        web.EgretShaderLib = EgretShaderLib;\n        __reflect(EgretShaderLib.prototype, \"egret.web.EgretShaderLib\");\n    })(web = egret.web || (egret.web = {}));\n})(egret || (egret = {}));\n;\n"
  },
  {
    "path": "demo/libs/modules/game/game.d.ts",
    "content": "declare namespace egret {\n    /**\n     * The URLLoaderDataFormat class provides values that specify how downloaded data is received.\n     * @see http://edn.egret.com/cn/docs/page/600 Read different data format\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLLoaderDataFormat.ts\n     * @language en_US\n     */\n    /**\n     * URLLoaderDataFormat 类提供了一些用于指定如何接收已下载数据的值。\n     * @see http://edn.egret.com/cn/docs/page/600 读取不同数据格式\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLLoaderDataFormat.ts\n     * @language zh_CN\n     */\n    class URLLoaderDataFormat {\n        /**\n         * Specify that downloaded data is received as raw binary data.\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 指定以原始二进制数据形式接收下载的数据。\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        static BINARY: string;\n        /**\n         * Specify that downloaded data is received as text.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定以文本形式接收已下载的数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TEXT: string;\n        /**\n         * Specify that downloaded data is received as URL-encoded variables.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定以 URL 编码变量形式接收下载的数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static VARIABLES: string;\n        /**\n         * Specify that downloaded data is received as bitmap texture.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定以位图纹理形式接收已下载的数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TEXTURE: string;\n        /**\n         * Specify that downloaded data is received as sound.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定以声音形式接收已下载的数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static SOUND: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @private\n     */\n    class FrameLabel extends EventDispatcher {\n        /**\n         * @private\n         */\n        private _name;\n        /**\n         * @private\n         */\n        private _frame;\n        /**\n         * @private\n         */\n        private _end;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor(name: string, frame: number, end?: number);\n        /**\n         * Frame number\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 标签名\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly name: string;\n        /**\n         * Frame serial number of the label\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 标签所在帧序号\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly frame: number;\n        /**\n         * Frame serial number, the end of the label\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 标签对应的结束帧序号\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly end: number;\n        /**\n         * Duplicate the current frame label object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 复制当前帧标签对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        clone(): FrameLabel;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @classdesc 使用 MovieClipData 类，您可以创建 MovieClip 对象和处理 MovieClip 对象的数据。MovieClipData 一般由MovieClipDataFactory生成\n     * @see http://edn.egret.com/cn/docs/page/596 MovieClip序列帧动画\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    class MovieClipData extends HashObject {\n        /**\n         * @private\n         * MovieClip数据\n         */\n        $mcData: any;\n        /**\n         * 总帧数\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        numFrames: number;\n        /**\n         * 帧数据列表\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        frames: any[];\n        /**\n         * 帧标签列表\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        labels: any[];\n        /**\n         * 帧事件列表\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        events: any[];\n        /**\n         * 帧率\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        frameRate: number;\n        /**\n         * 纹理数据\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        textureData: any;\n        /**\n         * 纹理集\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        spriteSheet: SpriteSheet;\n        /**\n         * 创建一个 egret.MovieClipData 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor();\n        /**\n         * @private\n         *\n         * @param mcData\n         * @param textureData\n         * @param spriteSheet\n         */\n        $init(mcData: any, textureData: any, spriteSheet: SpriteSheet): void;\n        /**\n         * 根据指定帧序号获取该帧对应的关键帧数据\n         * @param frame {number} 帧序号\n         * @returns {any} 帧数据对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        getKeyFrameData(frame: number): any;\n        /**\n         * 根据指定帧序号获取该帧对应的Texture对象\n         * @param frame {number} 帧序号\n         * @returns {egret.Texture} Texture对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        getTextureByFrame(frame: number): Texture;\n        $getOffsetByFrame(frame: number, point: Point): void;\n        /**\n         * @private\n         *\n         * @param resName\n         * @returns\n         */\n        private getTextureByResName(resName);\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $isDataValid(): boolean;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $isTextureValid(): boolean;\n        /**\n         * @private\n         *\n         * @param mcData\n         */\n        $fillMCData(mcData: any): void;\n        /**\n         * @private\n         *\n         * @param framesData\n         */\n        private fillFramesData(framesData);\n        /**\n         * @private\n         *\n         * @param frameLabelsData\n         */\n        private fillFrameLabelsData(frameLabelsData);\n        /**\n         * @private\n         *\n         * @param frameEventsData\n         */\n        private fillFrameEventsData(frameEventsData);\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * MovieClip数据源\n         */\n        mcData: MovieClipData;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        private setMCData(value);\n    }\n}\ndeclare namespace egret {\n    /**\n     * @classdesc 使用 MovieClipDataFactory 类，可以生成 MovieClipData 对象用于创建MovieClip\n     * @see http://edn.egret.com/cn/docs/page/596 MovieClip序列帧动画\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    class MovieClipDataFactory extends EventDispatcher {\n        /**\n         * 是否开启缓存\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        enableCache: boolean;\n        /**\n         * @private\n         */\n        $mcDataSet: any;\n        /**\n         * @private\n         */\n        $spriteSheet: SpriteSheet;\n        /**\n         * @private\n         */\n        $mcDataCache: any;\n        /**\n         * 创建一个 egret.MovieClipDataFactory 对象\n         * @param movieClipDataSet {any} MovieClip数据集，该数据集必须由Egret官方工具生成\n         * @param texture {Texture} 纹理\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor(movieClipDataSet?: any, texture?: Texture);\n        /**\n         * 清空缓存\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        clearCache(): void;\n        /**\n         * 根据名字生成一个MovieClipData实例。可以用于创建MovieClip。\n         * @param movieClipName {string} MovieClip名字. 可选参数，默认为\"\", 相当于取第一个MovieClip数据\n         * @returns {MovieClipData} 生成的MovieClipData对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        generateMovieClipData(movieClipName?: string): MovieClipData;\n        /**\n         * @private\n         *\n         * @param movieClipName\n         * @param cache\n         * @returns\n         */\n        private findFromCache(movieClipName, cache);\n        /**\n         * @private\n         *\n         * @param movieClipName\n         * @param movieClip\n         * @param cache\n         */\n        private fillData(movieClipName, movieClip, cache);\n        /**\n         * MovieClip数据集\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        mcDataSet: any;\n        /**\n         * MovieClip需要使用的纹理图\n         */\n        texture: Texture;\n        /**\n         * 由纹理图生成的精灵表\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly spriteSheet: SpriteSheet;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        private setTexture(value);\n    }\n}\ndeclare namespace egret {\n    /**\n     * When the movieClip's current frame have a frameLabel, dispatches MovieClipEvent object. FrameLabel Event type: MovieClipEvent.FRAME_LABEL\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 当动画的当前帧有事件，将调度 MovieClipEvent 对象。帧事件类型 MovieClipEvent.FRAME_LABEL.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class MovieClipEvent extends Event {\n        /**\n         * TextEvent create an object that contains information about movieClip events.\n         * @param type Type of event, you can access the MovieClipEvent.type.\n         * @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determine whether the Event object can be canceled. The default value is false.\n         * @param frameLabel When the current frame have a frameLabel, the event listeners can access this information through the frameLabel property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 MovieClipEvent 对象，其中包含有关帧事件的信息。\n         * @param type 事件的类型，可以作为 MovieClipEvent.type 访问。\n         * @param bubbles 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param frameLabel 动画上的帧事件。事件侦听器可以通过 frameLabel 属性访问此信息。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean, frameLabel?: string);\n        /**\n         * Dispatched whenever the current frame have a frameLabel.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 动画的当前帧上有事件时调度\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static FRAME_LABEL: string;\n        /**\n         * In MovieClipEvent.FRAME_LABEL event, event corresponding string.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在 MovieClipEvent.FRAME_LABEL 事件中，event对应的字符串。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        frameLabel: string;\n        /**\n         * EventDispatcher object using the specified event object thrown MovieClipEvent. The objects will be thrown in the object cache pool for the next round robin.\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param frameLabel  MovieClipEvent object frameLabel\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出 MovieClipEvent 事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target 派发事件目标\n         * @param type  事件类型\n         * @param frameLabel  MovieClipEvent 对象的 frameLabel 赋值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchMovieClipEvent(target: IEventDispatcher, type: string, frameLabel?: string): boolean;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    class ScrollEase {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor();\n        /**\n         *\n         * @param amount\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static get(amount: any): Function;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static quintOut: Function;\n        /**\n         *\n         * @param pow\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static getPowOut(pow: any): Function;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static quartOut: Function;\n    }\n    /**\n     * @private\n     */\n    class ScrollTween extends EventDispatcher {\n        /**\n         * @private\n         */\n        private static _tweens;\n        /**\n         * @private\n         */\n        private static IGNORE;\n        /**\n         * @private\n         */\n        private static _plugins;\n        /**\n         * @private\n         */\n        private static _inited;\n        /**\n         * @private\n         */\n        private _target;\n        /**\n         * @private\n         */\n        private _useTicks;\n        /**\n         * @private\n         */\n        private ignoreGlobalPause;\n        /**\n         * @private\n         */\n        private loop;\n        /**\n         * @private\n         */\n        private pluginData;\n        /**\n         * @private\n         */\n        private _curQueueProps;\n        /**\n         * @private\n         */\n        private _initQueueProps;\n        /**\n         * @private\n         */\n        private _steps;\n        /**\n         * @private\n         */\n        private _actions;\n        /**\n         * @private\n         */\n        private paused;\n        /**\n         * @private\n         */\n        private duration;\n        /**\n         * @private\n         */\n        private _prevPos;\n        /**\n         * @private\n         */\n        private position;\n        /**\n         * @private\n         */\n        private _prevPosition;\n        /**\n         * @private\n         */\n        private _stepPosition;\n        /**\n         * @private\n         */\n        private passive;\n        /**\n         * Activate an object and add a ScrollTween animation to the object\n         * @param target {any} The object to be activated\n         * @param props {any} Parameters, support loop onChange onChangeObj\n         * @param pluginData {any} Write realized\n         * @param override {boolean} Whether to remove the object before adding a tween, the default value false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 激活一个对象，对其添加 ScrollTween 动画\n         * @param target {any} 要激活 ScrollTween 的对象\n         * @param props {any} 参数，支持loop(循环播放) onChange(变化函数) onChangeObj(变化函数作用域)\n         * @param pluginData {any} 暂未实现\n         * @param override {boolean} 是否移除对象之前添加的tween，默认值false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static get(target: any, props?: any, pluginData?: any, override?: boolean): ScrollTween;\n        /**\n         * Delete all ScrollTween animations from an object\n         * @param target The object whose ScrollTween to be deleted\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 删除一个对象上的全部 ScrollTween 动画\n         * @param target  需要移除 ScrollTween 的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static removeTweens(target: any): void;\n        /**\n         * @private\n         *\n         * @param delta\n         * @param paused\n         */\n        private static tick(timeStamp, paused?);\n        private static _lastTime;\n        /**\n         * @private\n         *\n         * @param tween\n         * @param value\n         */\n        private static _register(tween, value);\n        /**\n         * 创建一个 egret.ScrollTween 对象\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor(target: any, props: any, pluginData: any);\n        /**\n         * @private\n         *\n         * @param target\n         * @param props\n         * @param pluginData\n         */\n        private initialize(target, props, pluginData);\n        /**\n         * @private\n         *\n         * @param value\n         * @param actionsMode\n         * @returns\n         */\n        private setPosition(value, actionsMode?);\n        /**\n         * @private\n         *\n         * @param startPos\n         * @param endPos\n         * @param includeStart\n         */\n        private _runActions(startPos, endPos, includeStart?);\n        /**\n         * @private\n         *\n         * @param step\n         * @param ratio\n         */\n        private _updateTargetProps(step, ratio);\n        /**\n         * Whether setting is paused\n         * @param value {boolean} Whether to pause\n         * @returns ScrollTween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置是否暂停\n         * @param value {boolean} 是否暂停\n         * @returns Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setPaused(value: boolean): ScrollTween;\n        /**\n         * @private\n         *\n         * @param props\n         * @returns\n         */\n        private _cloneProps(props);\n        /**\n         * @private\n         *\n         * @param o\n         * @returns\n         */\n        private _addStep(o);\n        /**\n         * @private\n         *\n         * @param o\n         * @returns\n         */\n        private _appendQueueProps(o);\n        /**\n         * @private\n         *\n         * @param o\n         * @returns\n         */\n        private _addAction(o);\n        /**\n         * Modify the property of the specified display object to a specified value\n         * @param props {Object} Property set of an object\n         * @param duration {number} Duration\n         * @param ease {egret.ScrollEase} Easing algorithm\n         * @returns {egret.ScrollTween} ScrollTween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将指定显示对象的属性修改为指定值\n         * @param props {Object} 对象的属性集合\n         * @param duration {number} 持续时间\n         * @param ease {egret.ScrollEase} 缓动算法\n         * @returns {egret.ScrollTween} Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        to(props: any, duration?: number, ease?: Function): ScrollTween;\n        /**\n         * Execute callback function\n         * @param callback {Function} Callback method\n         * @param thisObj {any} this action scope of the callback method\n         * @param params {any[]} Parameter of the callback method\n         * @returns {egret.ScrollTween} ScrollTween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 执行回调函数\n         * @param callback {Function} 回调方法\n         * @param thisObj {any} 回调方法this作用域\n         * @param params {any[]} 回调方法参数\n         * @returns {egret.ScrollTween} Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        call(callback: Function, thisObj?: any, params?: any[]): ScrollTween;\n        /**\n         * @method egret.ScrollTween#tick\n         * @param delta {number}\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        tick(delta: number): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * ScrollView auxiliary classes for slides, you will pass a display object constructor. It can display more than the range display object within the specified size range. And can easily drag in this range.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/display/ScrollView.ts\n     * @language en_US\n     */\n    /**\n     * ScrollView 是用于滑动的辅助类，将一个显示对象传入构造函数即可。可以在指定的尺寸范围内显示超过该范围的显示对象。并可以在此范围内随意拖动。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/display/ScrollView.ts\n     * @language zh_CN\n     */\n    class ScrollView extends DisplayObjectContainer {\n        /**\n         * @private\n         */\n        _ScrV_Props_: ScrollViewProperties;\n        /**\n         * Start rolling threshold when the touch point from the initial touch point at a distance exceeding this value will trigger roll\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 开始滚动的阈值，当触摸点偏离初始触摸点的距离超过这个值时才会触发滚动\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        scrollBeginThreshold: number;\n        /**\n         * Scrolling speed, the speed is required and the default speed ratio.\n         * The range of scrollSpeed> 0 assigned to 2:00, the speed is 2 times the default speed\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 滚动速度，这个值为需要的速度与默认速度的比值。\n         * 取值范围为 scrollSpeed > 0 赋值为 2 时，速度是默认速度的 2 倍\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        scrollSpeed: number;\n        /**\n         * Whether to enable rebound, rebound When enabled, ScrollView contents allowed to continue to drag the border after arriving at the end user drag operation, and then bounce back boundary position\n         * @default true\n         * @version Egret 2.4\n         * @language en_US\n         */\n        /**\n         * 是否启用回弹，当启用回弹后，ScrollView中内容在到达边界后允许继续拖动，在用户拖动操作结束后，再反弹回边界位置\n         * @default true\n         * @version Egret 2.4\n         * @language zh_CN\n         */\n        bounces: boolean;\n        /**\n         * Create a egret.ScrollView objects\n         * @param content {egret.DisplayObject} You need to scroll object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.ScrollView 对象\n         * @param content {egret.DisplayObject} 需要滚动的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(content?: DisplayObject);\n        /**\n         * @private\n         */\n        _content: DisplayObject;\n        /**\n         * Set to scroll object\n         * @param content {egret.DisplayObject} You need to scroll object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置需要滚动的对象\n         * @param content {egret.DisplayObject} 需要滚动的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setContent(content: DisplayObject): void;\n        /**\n         * Remove rolling objects\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 移除滚动的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        removeContent(): void;\n        /**\n         * Vertical scroll bar display policy, on / off / auto.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 垂直滚动条显示策略，on/off/auto。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        verticalScrollPolicy: string;\n        /**\n         * The horizontal scroll bar display policy, on / off / auto.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 水平滚动条显示策略，on/off/auto。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        horizontalScrollPolicy: string;\n        /**\n         * Gets or sets the horizontal scroll position\n         * @returns {number}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取或设置水平滚动位置,\n         * @returns {number}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        scrollLeft: number;\n        /**\n         * Gets or sets the vertical scroll position\n         * @returns {number}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取或设置垂直滚动位置,\n         * @returns {number}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        scrollTop: number;\n        /**\n         * Set scroll position\n         * @param top {number} The vertical scroll position\n         * @param left {number} The horizontal scroll position\n         * @param isOffset {boolean} Optional parameter, the default is false, whether it is the amount of scrolling increase as top = 1 on behalf of one pixel scroll up\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置滚动位置\n         * @param top {number} 垂直滚动位置\n         * @param left {number} 水平滚动位置\n         * @param isOffset {boolean} 可选参数，默认是false，是否是滚动增加量，如 top=1 代表往上滚动1像素\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setScrollPosition(top: number, left: number, isOffset?: boolean): void;\n        /**\n         * @private\n         *\n         * @param top\n         * @param left\n         */\n        private _validatePosition(top?, left?);\n        /**\n         * @private\n         * @inheritDoc\n         */\n        $setWidth(value: number): void;\n        /**\n         * @private\n         * @inheritDoc\n         */\n        $setHeight(value: number): void;\n        /**\n         * @private\n         *\n         */\n        _updateContentPosition(): void;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        _checkScrollPolicy(): boolean;\n        /**\n         * @private\n         *\n         * @param policy\n         * @param contentLength\n         * @param viewLength\n         * @returns\n         */\n        private __checkScrollPolicy(policy, contentLength, viewLength);\n        /**\n         * @private\n         *\n         * @returns\n         */\n        _addEvents(): void;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        _removeEvents(): void;\n        private _tempStage;\n        /**\n         * @private\n         *\n         * @param e\n         */\n        _onTouchBegin(e: TouchEvent): void;\n        /**\n         * @private\n         */\n        private delayTouchBeginEvent;\n        /**\n         * @private\n         */\n        private touchBeginTimer;\n        /**\n         * @private\n         *\n         * @param event\n         */\n        _onTouchBeginCapture(event: TouchEvent): void;\n        /**\n         * @private\n         *\n         * @param event\n         * @returns\n         */\n        private _onTouchEndCapture(event);\n        /**\n         * @private\n         *\n         */\n        private _onTouchBeginTimer();\n        /**\n         * @private\n         *\n         * @param event\n         * @returns\n         */\n        private dispatchPropagationEvent(event);\n        /**\n         * @private\n         *\n         * @param event\n         * @returns\n         */\n        _onTouchMove(event: TouchEvent): void;\n        /**\n         * @private\n         *\n         * @param event\n         * @returns\n         */\n        _onTouchEnd(event: TouchEvent): void;\n        /**\n         * @private\n         *\n         * @param event\n         * @returns\n         */\n        _onEnterFrame(event: Event): void;\n        /**\n         * @private\n         *\n         * @param e\n         * @returns\n         */\n        private _logTouchEvent(e);\n        /**\n         * @private\n         *\n         * @param e\n         * @returns\n         */\n        private _getPointChange(e);\n        /**\n         * @private\n         *\n         * @param e\n         * @returns\n         */\n        private _calcVelocitys(e);\n        /**\n         * @private\n         *\n         * @returns\n         */\n        _getContentWidth(): number;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        _getContentHeight(): number;\n        /**\n         * The left side of the maximum distance\n         * @returns The left side of the maximum distance\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 距离左侧的最大值\n         * @returns 距离左侧最大值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getMaxScrollLeft(): number;\n        /**\n         * Above the maximum distance\n         * @returns Above the maximum distance\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 距离上方最大值\n         * @returns 距离上方最大值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getMaxScrollTop(): number;\n        /**\n         * @private\n         */\n        private static weight;\n        /**\n         * @private\n         *\n         */\n        private _moveAfterTouchEnd();\n        /**\n         * @private\n         *\n         * @param tw\n         */\n        private onTweenFinished(tw);\n        /**\n         * @private\n         *\n         * @returns\n         */\n        _onScrollStarted(): void;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        _onScrollFinished(): void;\n        /**\n         * Set the scroll position above the distance\n         * @param scrollTop Position above distance\n         * @param duration Easing of time, in milliseconds\n         * @returns Get tween vertical scrolling\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置滚动距离上方的位置\n         * @param scrollTop 距离上方的位置\n         * @param duration 缓动时间，毫秒单位\n         * @returns 获取垂直滚动的tween\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setScrollTop(scrollTop: number, duration?: number): void;\n        /**\n         * Set the scroll position from the left side\n         * @param scrollLeft From the position on the left side\n         * @param duration Get tween vertical scrolling\n         * @returns Gets the horizontal scroll tween\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置滚动距离左侧的位置\n         * @param scrollLeft 距离左侧的位置\n         * @param duration 缓动时间，毫秒单位\n         * @returns 获取水平滚动的tween\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setScrollLeft(scrollLeft: number, duration?: number): void;\n        /**\n         * @private\n         *\n         * @param pixelsPerMS\n         * @param curPos\n         * @param maxPos\n         * @returns\n         */\n        private getAnimationDatas(pixelsPerMS, curPos, maxPos);\n        /**\n         * @private\n         *\n         * @param event\n         * @returns\n         */\n        private cloneTouchEvent(event);\n        /**\n         * @private\n         *\n         * @returns\n         */\n        private throwNotSupportedError();\n        /**\n         * @deprecated\n         * @inheritDoc\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        addChild(child: DisplayObject): DisplayObject;\n        /**\n         * @deprecated\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        addChildAt(child: DisplayObject, index: number): DisplayObject;\n        /**\n         * @deprecated\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        removeChild(child: DisplayObject): DisplayObject;\n        /**\n         * @deprecated\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        removeChildAt(index: number): DisplayObject;\n        /**\n         * @deprecated\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        setChildIndex(child: DisplayObject, index: number): void;\n        /**\n         * @deprecated\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        swapChildren(child1: DisplayObject, child2: DisplayObject): void;\n        /**\n         * @deprecated\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        swapChildrenAt(index1: number, index2: number): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    class ScrollViewProperties {\n        /**\n         * @private\n         */\n        _verticalScrollPolicy: string;\n        /**\n         * @private\n         */\n        _horizontalScrollPolicy: string;\n        /**\n         * @private\n         */\n        _scrollLeft: number;\n        /**\n         * @private\n         */\n        _scrollTop: number;\n        /**\n         * @private\n         */\n        _hCanScroll: boolean;\n        /**\n         * @private\n         */\n        _vCanScroll: boolean;\n        /**\n         * @private\n         */\n        _lastTouchPosition: egret.Point;\n        /**\n         * @private\n         */\n        _touchStartPosition: egret.Point;\n        /**\n         * @private\n         */\n        _scrollStarted: boolean;\n        /**\n         * @private\n         */\n        _lastTouchTime: number;\n        /**\n         * @private\n         */\n        _lastTouchEvent: TouchEvent;\n        /**\n         * @private\n         */\n        _velocitys: Array<{\n            x: number;\n            y: number;\n        }>;\n        /**\n         * @private\n         */\n        _isHTweenPlaying: boolean;\n        /**\n         * @private\n         */\n        _isVTweenPlaying: boolean;\n        /**\n         * @private\n         */\n        _hScrollTween: ScrollTween;\n        /**\n         * @private\n         */\n        _vScrollTween: ScrollTween;\n        /**\n         * @private\n         */\n        _bounces: boolean;\n    }\n}\ndeclare namespace egret {\n    /**\n     * UThe URLLoader class downloads data from a URL as text, binary data, or URL-encoded variables.  It is useful for downloading text files, XML, or other information to be used in a dynamic, data-driven application.\n     * A URLLoader object downloads all of the data from a URL before making it available to code in the applications. It sends out notifications about the progress of the download,\n     * which you can monitor through bytesLoaded and bytesTotal properties, as well as through dispatched events.\n     * @see http://edn.egret.com/cn/docs/page/601 Build communication request\n     * @event egret.Event.COMPLETE Dispatched when the net request is complete.\n     * @event egret.IOErrorEvent.IO_ERROR io error.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLLoader.ts\n     * @language en_US\n     */\n    /**\n     * URLLoader 类以文本、二进制数据或 URL 编码变量的形式从 URL 下载数据。在下载文本文件、XML 或其他用于动态数据驱动应用程序的信息时，它很有用。\n     * URLLoader 对象会先从 URL 中下载所有数据，然后才将数据用于应用程序中的代码。它会发出有关下载进度的通知，\n     * 通过 bytesLoaded 和 bytesTotal 属性以及已调度的事件，可以监视下载进度。\n     * @see http://edn.egret.com/cn/docs/page/601 构建通信请求\n     * @event egret.Event.COMPLETE 加载完成后调度。\n     * @event egret.IOErrorEvent.IO_ERROR 加载错误后调度。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLLoader.ts\n     * @language zh_CN\n     */\n    class URLLoader extends EventDispatcher {\n        /**\n         * Create an egret.URLLoader object\n         * @param request {URLRequest} A URLRequest object specifies the URL to be downloaded.\n         * If this parameter is omitted, no load operation begins. If a parameter is specified, the load operation begins immediately\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建 egret.URLLoader 对象\n         * @param request {URLRequest} 一个 URLRequest 对象，指定要下载的 URL。\n         * 如果省略该参数，则不开始加载操作。如果已指定参数，则立即开始加载操作\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(request?: URLRequest);\n        /**\n         * Control whether the downloaded data is received as text (URLLoaderDataFormat.TEXT), raw binary data (URLLoaderDataFormat.BINARY), or URL-encoded variables (URLLoaderDataFormat.VARIABLES).\n         * If the value of the dataFormat property is URLLoaderDataFormat.TEXT, the received data is a string containing the text of the loaded file.\n         * If the value of the dataFormat property is URLLoaderDataFormat.BINARY, the received data is a ByteArray object containing the raw binary data.\n         * If the value of the dataFormat property is URLLoaderDataFormat.TEXTURE, the received data is a Texture object containing the bitmap data.\n         * If the value of the dataFormat property is URLLoaderDataFormat.VARIABLES, the received data is a URLVariables object containing the URL-encoded variables.\n         * The default value is URLLoaderDataFormat.TEXT.\n         * @default egret.URLLoaderDataFormat.TEXT\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 控制是以文本 (URLLoaderDataFormat.TEXT)、原始二进制数据 (URLLoaderDataFormat.BINARY) 还是 URL 编码变量 (URLLoaderDataFormat.VARIABLES) 接收下载的数据。\n         * 如果 dataFormat 属性的值是 URLLoaderDataFormat.TEXT，则所接收的数据是一个包含已加载文件文本的字符串。\n         * 如果 dataFormat 属性的值是 URLLoaderDataFormat.BINARY，则所接收的数据是一个包含原始二进制数据的 ByteArray 对象。\n         * 如果 dataFormat 属性的值是 URLLoaderDataFormat.TEXTURE，则所接收的数据是一个包含位图数据的Texture对象。\n         * 如果 dataFormat 属性的值是 URLLoaderDataFormat.VARIABLES，则所接收的数据是一个包含 URL 编码变量的 URLVariables 对象。\n         * @default egret.URLLoaderDataFormat.TEXT\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        dataFormat: string;\n        /**\n         * The data received from the load operation. This property is populated only when the load operation is complete. The format of the data depends on the setting of the dataFormat property:\n         * If the dataFormat property is URLLoaderDataFormat.TEXT, the received data is a string containing the text of the loaded file.\n         * If the dataFormat property is URLLoaderDataFormat.BINARY, the received data is a ByteArray object containing the raw binary data.\n         * If the dataFormat property is URLLoaderDataFormat.TEXTURE, the received data is a Texture object containing the bitmap data.\n         * If the dataFormat property is URLLoaderDataFormat.VARIABLES, the received data is a URLVariables object containing the URL-encoded variables.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从加载操作接收的数据。只有完成加载操作时，才会填充该属性。该数据的格式取决于 dataFormat 属性的设置：\n         * 如果 dataFormat 属性是 URLLoaderDataFormat.TEXT，则所接收的数据是一个包含已加载文件文本的字符串。\n         * 如果 dataFormat 属性是 URLLoaderDataFormat.BINARY，则所接收的数据是一个包含原始二进制数据的 ByteArray 对象。\n         * 如果 dataFormat 属性是 URLLoaderDataFormat.TEXTURE，则所接收的数据是一个包含位图数据的Texture对象。\n         * 如果 dataFormat 属性是 URLLoaderDataFormat.VARIABLES，则所接收的数据是一个包含 URL 编码变量的 URLVariables 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        data: any;\n        /**\n         * @private\n         */\n        _request: URLRequest;\n        /**\n         * Send and load data from the specified URL. The data can be received as text, raw binary data, or URL-encoded variables, depending on the value you set for the dataFormat property.\n         * Note that the default value of the dataFormat property is text. If you want to send data to the specified URL, you can set the data property in the URLRequest object.\n         * @param request {URLRequest}  A URLRequest object specifies the URL to be downloaded.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从指定的 URL 发送和加载数据。可以以文本、原始二进制数据或 URL 编码变量格式接收数据，这取决于为 dataFormat 属性所设置的值。\n         * 请注意 dataFormat 属性的默认值为文本。如果想将数据发送至指定的 URL，则可以在 URLRequest 对象中设置 data 属性。\n         * @param request {URLRequest}  一个 URLRequest 对象，指定要下载的 URL。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        load(request: URLRequest): void;\n        private getResponseType(dataFormat);\n        /**\n         * @private\n         *\n         * @param loader\n         */\n        private loadSound(loader);\n        /**\n         * @private\n         *\n         * @param loader\n         */\n        private loadTexture(loader);\n        /**\n         * @private\n         */\n        _status: number;\n        /**\n         * @private\n         *\n         */\n        __recycle(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n    * @version Egret 2.4\n    * @platform Web,Native\n    * @includeExample extension/game/display/MovieClip.ts\n    * @language en_US\n    */\n    /**\n     * 影片剪辑，可以通过影片剪辑播放序列帧动画。MovieClip 类从以下类继承而来：DisplayObject 和 EventDispatcher。不同于 DisplayObject 对象，MovieClip 对象拥有一个时间轴。\n     * @extends egret.DisplayObject\n     * @event egret.Event.COMPLETE 动画播放完成。\n     * @event egret.Event.LOOP_COMPLETE 动画循环播放完成。循环最后一次只派发 COMPLETE 事件，不派发 LOOP_COMPLETE 事件。\n     * @see http://edn.egret.com/cn/docs/page/596 MovieClip序列帧动画\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/display/MovieClip.ts\n     * @language zh_CN\n     */\n    class MovieClip extends DisplayObject {\n        $texture: Texture;\n        private offsetPoint;\n        $movieClipData: MovieClipData;\n        /**\n         * @private\n         */\n        private frames;\n        /**\n         * @private\n         */\n        $totalFrames: number;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @private\n         */\n        frameLabels: any[];\n        /**\n         * @private\n         */\n        $frameLabelStart: number;\n        /**\n         * @private\n         */\n        $frameLabelEnd: number;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @private\n         */\n        frameEvents: any[];\n        /**\n         * @private\n         */\n        private frameIntervalTime;\n        /**\n         * @private\n         */\n        $eventPool: string[];\n        $isPlaying: boolean;\n        /**\n         * @private\n         */\n        private isStopped;\n        /**\n         * @private\n         */\n        private playTimes;\n        /**\n         * @private\n         */\n        $currentFrameNum: number;\n        /**\n         * @private\n         */\n        $nextFrameNum: number;\n        /**\n         * @private\n         */\n        private displayedKeyFrameNum;\n        /**\n         * @private\n         */\n        private passedTime;\n        /**\n         * @private\n         */\n        private $frameRate;\n        /**\n         * 创建新的 MovieClip 实例。创建 MovieClip 之后，调用舞台上的显示对象容器的addElement方法。\n         * @param movieClipData {movieClipData} 被引用的 movieClipData 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor(movieClipData?: MovieClipData);\n        protected createNativeDisplayObject(): void;\n        /**\n         * @private\n         */\n        $smoothing: boolean;\n        /**\n         * Whether or not is smoothed when scaled.\n         * @version Egret 3.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 控制在缩放时是否进行平滑处理。\n         * @version Egret 3.0\n         * @platform Web\n         * @language zh_CN\n         */\n        smoothing: boolean;\n        /**\n         * @private\n         *\n         */\n        $init(): void;\n        /**\n         * @private\n         *\n         */\n        $reset(): void;\n        /**\n         * @private\n         *\n         */\n        private _initFrame();\n        /**\n         * @private\n         */\n        $updateRenderNode(): void;\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        /**\n         * @private\n         *\n         * @param stage\n         * @param nestLevel\n         */\n        $onAddToStage(stage: Stage, nestLevel: number): void;\n        /**\n         * @private\n         *\n         */\n        $onRemoveFromStage(): void;\n        /**\n         * @private\n         * 返回帧标签为指定字符串的FrameLabel对象\n         * @param labelName {string} 帧标签名\n         * @param ignoreCase {boolean} 是否忽略大小写，可选参数，默认false\n         * @returns {egret.FrameLabel} FrameLabel对象\n         */\n        private getFrameLabelByName(labelName, ignoreCase?);\n        /**\n         * @private\n         * 根据帧标签，设置开始和结束的帧数\n         * @param labelName {string} 帧标签名\n         */\n        private getFrameStartEnd(labelName);\n        /**\n         * @private\n         * 返回指定序号的帧的FrameLabel对象\n         * @param frame {number} 帧序号\n         * @returns {egret.FrameLabel} FrameLabel对象\n         */\n        private getFrameLabelByFrame(frame);\n        /**\n         * @private\n         * 返回指定序号的帧对应的FrameLabel对象，如果当前帧没有标签，则返回前面最近的有标签的帧的FrameLabel对象\n         * @method egret.MovieClip#getFrameLabelForFrame\n         * @param frame {number} 帧序号\n         * @returns {egret.FrameLabel} FrameLabel对象\n         */\n        private getFrameLabelForFrame(frame);\n        /**\n         * 继续播放当前动画\n         * @param playTimes {number} 播放次数。 参数为整数，可选参数，>=1：设定播放次数，<0：循环播放，默认值 0：不改变播放次数(MovieClip初始播放次数设置为1)，\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        play(playTimes?: number): void;\n        /**\n         * 暂停播放动画\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        stop(): void;\n        /**\n         * 将播放头移到前一帧并停止\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        prevFrame(): void;\n        /**\n         * 跳到后一帧并停止\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        nextFrame(): void;\n        /**\n         * 将播放头移到指定帧并播放\n         * @param frame {any} 指定帧的帧号或帧标签\n         * @param playTimes {number} 播放次数。 参数为整数，可选参数，>=1：设定播放次数，<0：循环播放，默认值 0：不改变播放次数，\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        gotoAndPlay(frame: string | number, playTimes?: number): void;\n        /**\n         * 将播放头移到指定帧并停止\n         * @param frame {any} 指定帧的帧号或帧标签\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        gotoAndStop(frame: string | number): void;\n        /**\n         * @private\n         *\n         * @param frame\n         */\n        private gotoFrame(frame);\n        /**\n         * @private\n         */\n        private lastTime;\n        /**\n         * @private\n         *\n         * @param advancedTime\n         * @returns\n         */\n        private advanceTime(timeStamp);\n        /**\n         * @private\n         *\n         */\n        private advanceFrame();\n        /**\n         * @private\n         *\n         */\n        private constructFrame();\n        /**\n         * @private\n         *\n         */\n        $renderFrame(): void;\n        /**\n         * @private\n         *\n         */\n        private handlePendingEvent();\n        /**\n         * MovieClip 实例中帧的总数\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly totalFrames: number;\n        /**\n         * MovieClip 实例当前播放的帧的序号\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly currentFrame: number;\n        /**\n         * MovieClip 实例当前播放的帧的标签。如果当前帧没有标签，则 currentFrameLabel返回null。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly currentFrameLabel: string;\n        /**\n         * 当前播放的帧对应的标签，如果当前帧没有标签，则currentLabel返回包含标签的先前帧的标签。如果当前帧和先前帧都不包含标签，currentLabel返回null。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly currentLabel: string;\n        /**\n         * MovieClip 实例的帧频\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        frameRate: number;\n        /**\n         * MovieClip 实例当前是否正在播放\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly isPlaying: boolean;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * MovieClip数据源\n         */\n        movieClipData: MovieClipData;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        private setMovieClipData(value);\n        /**\n         * @private\n         *\n         * @param value\n         */\n        private setPlayTimes(value);\n        /**\n         * @private\n         *\n         * @param value\n         */\n        private setIsStopped(value);\n    }\n}\ndeclare namespace egret {\n    /**\n     * The URLRequest class captures all of the information in a single HTTP request.\n     * @see http://edn.egret.com/cn/index.php/article/index/id/601 Build communication request\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLRequest.ts\n     * @language en_US\n     */\n    /**\n     * URLRequest 类可捕获单个 HTTP 请求中的所有信息。\n     * @see http://edn.egret.com/cn/index.php/article/index/id/601 构建通信请求\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLRequest.ts\n     * @language zh_CN\n     */\n    class URLRequest extends HashObject {\n        /**\n         * Create an egret.URLRequest object\n         * @param url {string} Addresses for URL requests\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.URLRequest 对象\n         * @param url {string} 进行网络请求的地址\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(url?: string);\n        /**\n         * An object contains data to be transmitted with the URL request.\n         * This property is used in conjunction with the method property.  When the value of method is GET, the value of data is appended to the value of URLRequest.url, using HTTP query-string syntax.\n         * When the method value is POST (or any value other than GET), the value of data is transmitted in the body of the HTTP request.\n         * The URLRequest API offers binary POST support and support for URL-encoded variables, as well as support for strings. The data object can be a ArrayBuffer, URLVariables, or String object.\n         * The way in which the data is used depends on the type of object used:\n         * If the object is a ArrayBuffer object, the binary data of the ArrayBuffer object is used as POST data. For GET, data of ArrayBuffer type is not supported.\n         * If the object is a URLVariables object and the method is POST, then the variables are encoded using x-www-form-urlencoded format and the resulting string is used as POST data.\n         * If the object is a URLVariables object and the method is GET, the URLVariables object will define variables to be sent with the URLRequest object.\n         * Otherwise, the object is converted into a string, and the string is used as the POST or GET data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个对象，它包含将随 URL 请求一起传输的数据。\n         * 该属性与 method 属性配合使用。当 method 值为 GET 时，将使用 HTTP 查询字符串语法将 data 值追加到 URLRequest.url 值。\n         * 当 method 值为 POST（或 GET 之外的任何值）时，将在 HTTP 请求体中传输 data 值。\n         * URLRequest API 支持二进制 POST，并支持 URL 编码变量和字符串。该数据对象可以是 ArrayBuffer、URLVariables 或 String 对象。\n         * 该数据的使用方式取决于所用对象的类型：\n         * 如果该对象为 ArrayBuffer 对象，则 ArrayBuffer 对象的二进制数据用作 POST 数据。对于 GET，不支持 ArrayBuffer 类型的数据。\n         * 如果该对象是 URLVariables 对象，并且该方法是 POST，则使用 x-www-form-urlencoded 格式对变量进行编码，并且生成的字符串会用作 POST 数据。\n         * 如果该对象是 URLVariables 对象，并且该方法是 GET，则 URLVariables 对象将定义要随 URLRequest 对象一起发送的变量。\n         * 否则，该对象会转换为字符串，并且该字符串会用作 POST 或 GET 数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        data: any;\n        /**\n         * Request method, valid values are URLRequestMethod.GET or URLRequestMethod.POST.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 请求方式，有效值为URLRequestMethod.GET 或 URLRequestMethod.POST。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        method: string;\n        /**\n         * The requested URL.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 所请求的 URL。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        url: string;\n        /**\n         * The array of HTTP request headers to be appended to the HTTP request. The array is composed of URLRequestHeader objects.\n         * Each object in the array must be a URLRequestHeader object that contains a name string and a value string.\n         * Because of browser compatibility, this property has not been achieved in html5\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 要追加到 HTTP 请求的 HTTP 请求标头的数组。该数组由 URLRequestHeader 对象组成。\n         * 数组中的每一对象必须是包含一个名称字符串和一个值字符串的 URLRequestHeader 对象。\n         * 由于浏览器兼容性原因，该属性在 html5 中并未实现\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        requestHeaders: Array<URLRequestHeader>;\n    }\n}\ndeclare namespace egret {\n    /**\n     * A URLRequestHeader object encapsulates a single HTTP request header and consists of a name/value pair.  URLRequestHeader objects are used in the requestHeaders property of the URLRequest class.\n     * Note: Because of browser compatibility, this property has not been achieved in html5\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLRequestHeader.ts\n     * @language en_US\n     */\n    /**\n     * URLRequestHeader 对象封装了一个 HTTP 请求标头并由一个名称/值对组成。URLRequestHeader 对象在 URLRequest 类的 requestHeaders 属性中使用。\n     * 注意：由于浏览器兼容性原因，在 html5 中并未实现\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLRequestHeader.ts\n     * @language zh_CN\n     */\n    class URLRequestHeader {\n        /**\n         * HTTP request header name, such as Content-Type\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * HTTP 请求标头名称，如 Content-Type\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * The values associated with the name property (such as text/plain).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 与 name 属性相关联的值，如 text/plain\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        value: string;\n        /**\n         * Create an egret.URLRequestHeader object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.URLRequestHeader 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(name: string, value: string);\n    }\n}\ndeclare namespace egret {\n    /**\n     * The URLRequestMethod class provides values that specify whether the\n     * URLRequest object should use the POST method or the GET method when sending data to a server.\n     * @see http://edn.egret.com/cn/docs/page/599 POST与GET\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLRequestMethod.ts\n     * @language en_US\n     */\n    /**\n     * URLRequestMethod 类提供了一些值，这些值可指定在将数据发送到服务器时，\n     * URLRequest 对象应使用 POST 方法还是 GET 方法。\n     * @see http://edn.egret.com/cn/docs/page/599 POST与GET\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLRequestMethod.ts\n     * @language zh_CN\n     */\n    class URLRequestMethod {\n        /**\n         * Specify that the URLRequest object is a GET.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 URLRequest 对象是一个 GET。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static GET: string;\n        /**\n         * Specify that the URLRequest object is a POST.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 URLRequest 对象是一个 POST。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static POST: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The URLVariables class allows you to transfer variables between an application and a server.\n     * Use URLVariables objects with methods of the URLLoader class and the data property of the URLRequest class.\n     * @see http://edn.egret.com/cn/docs/page/598 Send the request with parameters\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLVariables.ts\n     * @language en_US\n     */\n    /**\n     * 使用 URLVariables 类可以在应用程序和服务器之间传输变量。\n     * 将 URLVariables 对象与 URLLoader 类的方法、URLRequest 类的 data 属性一起使用。\n     * @see http://edn.egret.com/cn/docs/page/598 发送带参数的请求\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLVariables.ts\n     * @language zh_CN\n     */\n    class URLVariables extends HashObject {\n        /**\n         * Create an egret.URLVariable object\n         * @param source {String} A URL-encoded string containing name/value pairs.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.URLVariables 对象\n         * @param source {String} 包含名称/值对的 URL 编码的字符串。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(source?: string);\n        /**\n         * Key-value pair data object saved in this URLVariables object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 此 URLVariables 储存的键值对数据对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        variables: Object;\n        /**\n         * Convert the variable string into the property of this URLVariables.variables object.\n         * @param source {string}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将变量字符串转换为此 URLVariables.variables 对象的属性。\n         * @param source {string}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        decode(source: string): void;\n        /**\n         * Return a string containing all enumerable variables using  the MIME content encoding format : application/x-www-form-urlencoded.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 以 MIME 内容编码格式 application/x-www-form-urlencoded 返回包含所有可枚举变量的字符串。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        toString(): string;\n        /**\n         * @private\n         *\n         * @param key\n         * @param value\n         */\n        private encodeValue(key, value);\n        /**\n         * @private\n         *\n         * @param key\n         * @param value\n         */\n        private encodeArray(key, value);\n    }\n}\ndeclare namespace egret {\n    /**\n    * @version Egret 2.4\n    * @platform Web,Native\n    * @includeExample extension/game/player/Ticker.ts\n    * @language en_US\n    */\n    /**\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/player/Ticker.ts\n     * @language zh_CN\n     */\n    class Ticker extends EventDispatcher {\n        /**\n         * @deprecated\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor();\n        private _timeScale;\n        private _paused;\n        private _callIndex;\n        private _callList;\n        private _lastTime;\n        private update(timeStamp);\n        private callBackList;\n        /**\n         * 注册帧回调事件，同一函数的重复监听会被忽略。推荐使用 egret.startTick 替代此方法。\n         * @method egret.Ticker#register\n         * @param listener {Function} 帧回调函数,参数返回上一帧和这帧的间隔时间。示例：onEnterFrame(frameTime:number):void\n         * @param thisObject {any} 帧回调函数的this对象\n         * @param priority {number} 事件优先级，开发者请勿传递 Number.NEGATIVE_INFINITY 和 Number.POSITIVE_INFINITY\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @deprecated\n         */\n        register(listener: Function, thisObject: any, priority?: number): void;\n        /**\n         * 取消侦听enterFrame事件。推荐使用 egret.stopTick 替代此方法。\n         * @method egret.Ticker#unregister\n         * @param listener {Function} 事件侦听函数\n         * @param thisObject {any} 侦听函数的this对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @deprecated\n         */\n        unregister(listener: Function, thisObject: any): void;\n        /**\n         * @deprecated\n         * @param timeScale {number}\n         * @private\n         */\n        setTimeScale(timeScale: number): void;\n        /**\n         * @deprecated\n         * @method egret.Ticker#getTimeScale\n         * @private\n         */\n        getTimeScale(): number;\n        /**\n         * 暂停\n         * @deprecated\n         * @method egret.Ticker#pause\n         */\n        pause(): void;\n        /**\n         * 继续\n         * @deprecated\n         * @method egret.Ticker#resume\n         */\n        resume(): void;\n        /**\n         * @private\n         */\n        private static instance;\n        /**\n         * @method egret.Ticker.getInstance\n         * @returns {Ticker}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @deprecated\n         */\n        static getInstance(): egret.Ticker;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @class egret.MainContext\n     * @classdesc\n     * MainContext是游戏的核心跨平台接口，组合了多个功能Context，并是游戏启动的主入口\n     * @extends egret.EventDispatcher\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    class MainContext extends EventDispatcher {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor();\n        /**\n         * 渲染Context\n         * @member egret.MainContext#rendererContext\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * 触摸Context\n         * @member egret.MainContext#touchContext\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * 设备divice\n         * @member egret.MainContext#deviceContext\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * 舞台\n         * @member egret.MainContext#stage\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly stage: Stage;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static deviceType: string;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static DEVICE_PC: string;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static DEVICE_MOBILE: string;\n        /**\n         * 游戏启动，开启主循环，参考Flash的滑动跑道模型\n         * @method egret.MainContext#run\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * @private\n         */\n        private static _instance;\n        /**\n         * @method egret.Ticker.getInstance\n         * @returns {Ticker}\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static readonly instance: egret.MainContext;\n    }\n}\ndeclare namespace egret {\n    /**\n     * Tool class for object cache repeat use, which can be used to construct an object pool. Objects are automatically recycled after a certain duration.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/utils/Recycler.ts\n     * @private\n     * @language en_US\n     */\n    /**\n     * 对象缓存复用工具类，可用于构建对象池，一段时间后会自动回收对象。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/utils/Recycler.ts\n     * @private\n     * @language zh_CN\n     */\n    class Recycler extends HashObject {\n        /**\n         * Create an egret.Recycler object\n         * @param autoDisposeTime {number} Number of frames when objects are destroyed automatically. Default value: 300\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.Recycler 对象\n         * @param autoDisposeTime {number} 多少帧后自动销毁对象，默认值300\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(autoDisposeTime?: number);\n        /**\n         * @private\n         */\n        static _callBackList: any[];\n        static $init(): void;\n        static onUpdate(timeStamp: number): boolean;\n        /**\n         * @private\n         * 多少帧后自动销毁对象。\n         */\n        private autoDisposeTime;\n        /**\n         * @private\n         */\n        private frameCount;\n        /**\n         * @private\n         *\n         */\n        $checkFrame(): void;\n        /**\n         * @private\n         */\n        private objectPool;\n        /**\n         * @private\n         */\n        private _length;\n        /**\n         * Number of cached objects\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 缓存的对象数量\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly length: number;\n        /**\n         * Cache an object for repeat use\n         * @param object {any} The object to be cached\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 缓存一个对象以复用\n         * @param object {any} 需要缓存的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        push(object: any): void;\n        /**\n         * Obtain a cached object\n         * @returns {any} The obtained cached object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取一个缓存的对象\n         * @returns {any} 获得的缓存对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        pop(): any;\n        /**\n         * Immediately clear all cached objects.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 立即清空所有缓存的对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        dispose(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * To specify a delay (in milliseconds) calls the function specified interval loop.\n     * @param listener {Function} Listener function\n     * @param thisObject {any} this object\n     * @param delay {number} Delay time, in milliseconds\n     * @param ...args {any} Parameter list\n     * @returns {number} Return index which can be used for clearInterval\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/utils/setInterval.ts\n     * @language en_US\n     */\n    /**\n     * 以指定的延迟（以毫秒为单位）间隔循环调用指定的函数。\n     * @param listener {Function} 侦听函数\n     * @param thisObject {any} this对象\n     * @param delay {number} 延迟时间，以毫秒为单位\n     * @param ...args {any} 参数列表\n     * @returns {number} 返回索引，可以用于 clearInterval\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/utils/setInterval.ts\n     * @language zh_CN\n     */\n    function setInterval<Z>(listener: (this: Z, ...arg) => void, thisObject: Z, delay: number, ...args: any[]): number;\n    /**\n     * Clear function to run after a specified delay.\n     * @param key {number} Index that egret.setInterval returns\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/setInterval.ts\n     * @language en_US\n     */\n    /**\n     * 清除指定延迟后运行的函数。\n     * @param key {number} egret.setInterval所返回的索引\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/setInterval.ts\n     * @language zh_CN\n     */\n    function clearInterval(key: number): void;\n}\ndeclare namespace egret {\n    /**\n     * Run the designated function in specified delay (in milliseconds).\n     * @param listener {Function} Listener function\n     * @param thisObject {any} this object\n     * @param delay {number} Delay time, in milliseconds\n     * @param ...args {any} Parameter list\n     * @returns {number} Return index which can be used for clearTimeout\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/utils/setTimeout.ts\n     * @language en_US\n     */\n    /**\n     * 在指定的延迟（以毫秒为单位）后运行指定的函数。\n     * @param listener {Function} 侦听函数\n     * @param thisObject {any} this对象\n     * @param delay {number} 延迟时间，以毫秒为单位\n     * @param ...args {any} 参数列表\n     * @returns {number} 返回索引，可以用于 clearTimeout\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/utils/setTimeout.ts\n     * @language zh_CN\n     */\n    function setTimeout<Z>(listener: (this: Z, ...arg) => void, thisObject: Z, delay: number, ...args: any[]): number;\n    /**\n     * Function run after the specified delay is cleared.\n     * @param key {number} Index that egret.setTimeout returns\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 清除指定延迟后运行的函数。\n     * @param key {number} egret.setTimeout所返回的索引\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function clearTimeout(key: number): void;\n}\n"
  },
  {
    "path": "demo/libs/modules/game/game.js",
    "content": "var __reflect = (this && this.__reflect) || function (p, c, t) {\n    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;\n};\nvar __extends = this && this.__extends || function __extends(t, e) { \n function r() { \n this.constructor = t;\n}\nfor (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);\nr.prototype = e.prototype, t.prototype = new r();\n};\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The URLLoaderDataFormat class provides values that specify how downloaded data is received.\n     * @see http://edn.egret.com/cn/docs/page/600 Read different data format\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLLoaderDataFormat.ts\n     * @language en_US\n     */\n    /**\n     * URLLoaderDataFormat 类提供了一些用于指定如何接收已下载数据的值。\n     * @see http://edn.egret.com/cn/docs/page/600 读取不同数据格式\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLLoaderDataFormat.ts\n     * @language zh_CN\n     */\n    var URLLoaderDataFormat = (function () {\n        function URLLoaderDataFormat() {\n        }\n        /**\n         * Specify that downloaded data is received as raw binary data.\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 指定以原始二进制数据形式接收下载的数据。\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        URLLoaderDataFormat.BINARY = \"binary\";\n        /**\n         * Specify that downloaded data is received as text.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定以文本形式接收已下载的数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        URLLoaderDataFormat.TEXT = \"text\";\n        /**\n         * Specify that downloaded data is received as URL-encoded variables.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定以 URL 编码变量形式接收下载的数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        URLLoaderDataFormat.VARIABLES = \"variables\";\n        /**\n         * Specify that downloaded data is received as bitmap texture.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定以位图纹理形式接收已下载的数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        URLLoaderDataFormat.TEXTURE = \"texture\";\n        /**\n         * Specify that downloaded data is received as sound.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定以声音形式接收已下载的数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        URLLoaderDataFormat.SOUND = \"sound\";\n        return URLLoaderDataFormat;\n    }());\n    egret.URLLoaderDataFormat = URLLoaderDataFormat;\n    __reflect(URLLoaderDataFormat.prototype, \"egret.URLLoaderDataFormat\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @private\n     */\n    var FrameLabel = (function (_super) {\n        __extends(FrameLabel, _super);\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function FrameLabel(name, frame /*int*/, end /*int*/) {\n            var _this = _super.call(this) || this;\n            _this._name = name;\n            _this._frame = frame | 0;\n            if (end)\n                _this._end = end | 0;\n            return _this;\n        }\n        Object.defineProperty(FrameLabel.prototype, \"name\", {\n            /**\n             * Frame number\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 标签名\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._name;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(FrameLabel.prototype, \"frame\", {\n            /**\n             * Frame serial number of the label\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 标签所在帧序号\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._frame;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(FrameLabel.prototype, \"end\", {\n            /**\n             * Frame serial number, the end of the label\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 标签对应的结束帧序号\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._end;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * Duplicate the current frame label object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 复制当前帧标签对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        FrameLabel.prototype.clone = function () {\n            return new FrameLabel(this._name, this._frame, this._end);\n        };\n        return FrameLabel;\n    }(egret.EventDispatcher));\n    egret.FrameLabel = FrameLabel;\n    __reflect(FrameLabel.prototype, \"egret.FrameLabel\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @classdesc 使用 MovieClipData 类，您可以创建 MovieClip 对象和处理 MovieClip 对象的数据。MovieClipData 一般由MovieClipDataFactory生成\n     * @see http://edn.egret.com/cn/docs/page/596 MovieClip序列帧动画\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    var MovieClipData = (function (_super) {\n        __extends(MovieClipData, _super);\n        /**\n         * 创建一个 egret.MovieClipData 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function MovieClipData() {\n            var _this = _super.call(this) || this;\n            /**\n             * @private\n             * MovieClip数据\n             */\n            _this.$mcData = null;\n            /**\n             * 总帧数\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            _this.numFrames = 1;\n            /**\n             * 帧数据列表\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            _this.frames = [];\n            /**\n             * 帧标签列表\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            _this.labels = null;\n            /**\n             * 帧事件列表\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            _this.events = [];\n            /**\n             * 帧率\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            _this.frameRate = 0;\n            /**\n             * 纹理数据\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            _this.textureData = null;\n            /**\n             * 纹理集\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            _this.spriteSheet = null;\n            return _this;\n        }\n        /**\n         * @private\n         *\n         * @param mcData\n         * @param textureData\n         * @param spriteSheet\n         */\n        MovieClipData.prototype.$init = function (mcData, textureData, spriteSheet) {\n            this.textureData = textureData;\n            this.spriteSheet = spriteSheet;\n            this.setMCData(mcData);\n        };\n        /**\n         * 根据指定帧序号获取该帧对应的关键帧数据\n         * @param frame {number} 帧序号\n         * @returns {any} 帧数据对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MovieClipData.prototype.getKeyFrameData = function (frame) {\n            var outputFrameData = this.frames[frame - 1];\n            if (outputFrameData.frame) {\n                outputFrameData = this.frames[outputFrameData.frame - 1];\n            }\n            return outputFrameData;\n        };\n        /**\n         * 根据指定帧序号获取该帧对应的Texture对象\n         * @param frame {number} 帧序号\n         * @returns {egret.Texture} Texture对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MovieClipData.prototype.getTextureByFrame = function (frame) {\n            var frameData = this.getKeyFrameData(frame);\n            if (frameData.res) {\n                var outputTexture = this.getTextureByResName(frameData.res);\n                return outputTexture;\n            }\n            return null;\n        };\n        MovieClipData.prototype.$getOffsetByFrame = function (frame, point) {\n            var frameData = this.getKeyFrameData(frame);\n            if (frameData.res) {\n                point.setTo(frameData.x | 0, frameData.y | 0);\n            }\n        };\n        /**\n         * @private\n         *\n         * @param resName\n         * @returns\n         */\n        MovieClipData.prototype.getTextureByResName = function (resName) {\n            if (this.spriteSheet == null) {\n                return null;\n            }\n            var texture = this.spriteSheet.getTexture(resName);\n            if (!texture) {\n                var textureData = this.textureData[resName];\n                texture = this.spriteSheet.createTexture(resName, textureData.x, textureData.y, textureData.w, textureData.h);\n            }\n            return texture;\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        MovieClipData.prototype.$isDataValid = function () {\n            return this.frames.length > 0;\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        MovieClipData.prototype.$isTextureValid = function () {\n            return this.textureData != null && this.spriteSheet != null;\n        };\n        /**\n         * @private\n         *\n         * @param mcData\n         */\n        MovieClipData.prototype.$fillMCData = function (mcData) {\n            this.frameRate = mcData[\"frameRate\"] || 24;\n            this.fillFramesData(mcData.frames);\n            this.fillFrameLabelsData(mcData.labels);\n            this.fillFrameEventsData(mcData.events);\n        };\n        /**\n         * @private\n         *\n         * @param framesData\n         */\n        MovieClipData.prototype.fillFramesData = function (framesData) {\n            var frames = this.frames;\n            var length = framesData ? framesData.length : 0;\n            var keyFramePosition;\n            for (var i = 0; i < length; i++) {\n                var frameData = framesData[i];\n                frames.push(frameData);\n                if (frameData.duration) {\n                    var duration = parseInt(frameData.duration);\n                    if (duration > 1) {\n                        keyFramePosition = frames.length;\n                        for (var j = 1; j < duration; j++) {\n                            frames.push({ \"frame\": keyFramePosition });\n                        }\n                    }\n                }\n            }\n            this.numFrames = frames.length;\n        };\n        /**\n         * @private\n         *\n         * @param frameLabelsData\n         */\n        MovieClipData.prototype.fillFrameLabelsData = function (frameLabelsData) {\n            if (frameLabelsData) {\n                var length_1 = frameLabelsData.length;\n                if (length_1 > 0) {\n                    this.labels = [];\n                    for (var i = 0; i < length_1; i++) {\n                        var label = frameLabelsData[i];\n                        this.labels.push(new egret.FrameLabel(label.name, label.frame, label.end));\n                    }\n                }\n            }\n        };\n        /**\n         * @private\n         *\n         * @param frameEventsData\n         */\n        MovieClipData.prototype.fillFrameEventsData = function (frameEventsData) {\n            if (frameEventsData) {\n                var length_2 = frameEventsData.length;\n                if (length_2 > 0) {\n                    this.events = [];\n                    for (var i = 0; i < length_2; i++) {\n                        var events = frameEventsData[i];\n                        this.events[events.frame] = events.name;\n                    }\n                }\n            }\n        };\n        Object.defineProperty(MovieClipData.prototype, \"mcData\", {\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$mcData;\n            },\n            /**\n             * MovieClip数据源\n             */\n            set: function (value) {\n                this.setMCData(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        MovieClipData.prototype.setMCData = function (value) {\n            if (this.$mcData == value) {\n                return;\n            }\n            this.$mcData = value;\n            if (value) {\n                this.$fillMCData(value);\n            }\n        };\n        return MovieClipData;\n    }(egret.HashObject));\n    egret.MovieClipData = MovieClipData;\n    __reflect(MovieClipData.prototype, \"egret.MovieClipData\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @classdesc 使用 MovieClipDataFactory 类，可以生成 MovieClipData 对象用于创建MovieClip\n     * @see http://edn.egret.com/cn/docs/page/596 MovieClip序列帧动画\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    var MovieClipDataFactory = (function (_super) {\n        __extends(MovieClipDataFactory, _super);\n        /**\n         * 创建一个 egret.MovieClipDataFactory 对象\n         * @param movieClipDataSet {any} MovieClip数据集，该数据集必须由Egret官方工具生成\n         * @param texture {Texture} 纹理\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function MovieClipDataFactory(movieClipDataSet, texture) {\n            var _this = _super.call(this) || this;\n            /**\n             * 是否开启缓存\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            _this.enableCache = true;\n            /**\n             * @private\n             */\n            _this.$mcDataCache = {};\n            _this.$mcDataSet = movieClipDataSet;\n            _this.setTexture(texture);\n            return _this;\n        }\n        /**\n         * 清空缓存\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MovieClipDataFactory.prototype.clearCache = function () {\n            this.$mcDataCache = {};\n        };\n        /**\n         * 根据名字生成一个MovieClipData实例。可以用于创建MovieClip。\n         * @param movieClipName {string} MovieClip名字. 可选参数，默认为\"\", 相当于取第一个MovieClip数据\n         * @returns {MovieClipData} 生成的MovieClipData对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MovieClipDataFactory.prototype.generateMovieClipData = function (movieClipName) {\n            if (movieClipName === void 0) { movieClipName = \"\"; }\n            if (movieClipName == \"\") {\n                if (this.$mcDataSet) {\n                    for (movieClipName in this.$mcDataSet.mc) {\n                        break;\n                    }\n                }\n            }\n            if (movieClipName == \"\") {\n                return null;\n            }\n            var output = this.findFromCache(movieClipName, this.$mcDataCache);\n            if (!output) {\n                output = new egret.MovieClipData();\n                this.fillData(movieClipName, output, this.$mcDataCache);\n            }\n            return output;\n        };\n        /**\n         * @private\n         *\n         * @param movieClipName\n         * @param cache\n         * @returns\n         */\n        MovieClipDataFactory.prototype.findFromCache = function (movieClipName, cache) {\n            if (this.enableCache && cache[movieClipName]) {\n                return cache[movieClipName];\n            }\n            return null;\n        };\n        /**\n         * @private\n         *\n         * @param movieClipName\n         * @param movieClip\n         * @param cache\n         */\n        MovieClipDataFactory.prototype.fillData = function (movieClipName, movieClip, cache) {\n            if (this.$mcDataSet) {\n                var mcData = this.$mcDataSet.mc[movieClipName];\n                if (mcData) {\n                    movieClip.$init(mcData, this.$mcDataSet.res, this.$spriteSheet);\n                    if (this.enableCache) {\n                        cache[movieClipName] = movieClip;\n                    }\n                }\n            }\n        };\n        Object.defineProperty(MovieClipDataFactory.prototype, \"mcDataSet\", {\n            /**\n             * MovieClip数据集\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$mcDataSet;\n            },\n            set: function (value) {\n                this.$mcDataSet = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClipDataFactory.prototype, \"texture\", {\n            /**\n             * MovieClip需要使用的纹理图\n             */\n            set: function (value) {\n                this.setTexture(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClipDataFactory.prototype, \"spriteSheet\", {\n            /**\n             * 由纹理图生成的精灵表\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$spriteSheet;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        MovieClipDataFactory.prototype.setTexture = function (value) {\n            this.$spriteSheet = value ? new egret.SpriteSheet(value) : null;\n        };\n        return MovieClipDataFactory;\n    }(egret.EventDispatcher));\n    egret.MovieClipDataFactory = MovieClipDataFactory;\n    __reflect(MovieClipDataFactory.prototype, \"egret.MovieClipDataFactory\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * When the movieClip's current frame have a frameLabel, dispatches MovieClipEvent object. FrameLabel Event type: MovieClipEvent.FRAME_LABEL\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 当动画的当前帧有事件，将调度 MovieClipEvent 对象。帧事件类型 MovieClipEvent.FRAME_LABEL.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var MovieClipEvent = (function (_super) {\n        __extends(MovieClipEvent, _super);\n        /**\n         * TextEvent create an object that contains information about movieClip events.\n         * @param type Type of event, you can access the MovieClipEvent.type.\n         * @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determine whether the Event object can be canceled. The default value is false.\n         * @param frameLabel When the current frame have a frameLabel, the event listeners can access this information through the frameLabel property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 MovieClipEvent 对象，其中包含有关帧事件的信息。\n         * @param type 事件的类型，可以作为 MovieClipEvent.type 访问。\n         * @param bubbles 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param frameLabel 动画上的帧事件。事件侦听器可以通过 frameLabel 属性访问此信息。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function MovieClipEvent(type, bubbles, cancelable, frameLabel) {\n            if (bubbles === void 0) { bubbles = false; }\n            if (cancelable === void 0) { cancelable = false; }\n            if (frameLabel === void 0) { frameLabel = null; }\n            var _this = _super.call(this, type, bubbles, cancelable) || this;\n            /**\n             * In MovieClipEvent.FRAME_LABEL event, event corresponding string.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 在 MovieClipEvent.FRAME_LABEL 事件中，event对应的字符串。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.frameLabel = null;\n            _this.frameLabel = frameLabel;\n            return _this;\n        }\n        /**\n         * EventDispatcher object using the specified event object thrown MovieClipEvent. The objects will be thrown in the object cache pool for the next round robin.\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param frameLabel  MovieClipEvent object frameLabel\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出 MovieClipEvent 事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target 派发事件目标\n         * @param type  事件类型\n         * @param frameLabel  MovieClipEvent 对象的 frameLabel 赋值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        MovieClipEvent.dispatchMovieClipEvent = function (target, type, frameLabel) {\n            if (frameLabel === void 0) { frameLabel = null; }\n            var event = egret.Event.create(MovieClipEvent, type);\n            event.frameLabel = frameLabel;\n            var result = target.dispatchEvent(event);\n            egret.Event.release(event);\n            return result;\n        };\n        /**\n         * Dispatched whenever the current frame have a frameLabel.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 动画的当前帧上有事件时调度\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        MovieClipEvent.FRAME_LABEL = \"frame_label\";\n        return MovieClipEvent;\n    }(egret.Event));\n    egret.MovieClipEvent = MovieClipEvent;\n    __reflect(MovieClipEvent.prototype, \"egret.MovieClipEvent\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @private\n     */\n    var ScrollEase = (function () {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function ScrollEase() {\n            egret.$error(1014);\n        }\n        /**\n         *\n         * @param amount\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        ScrollEase.get = function (amount) {\n            if (amount < -1) {\n                amount = -1;\n            }\n            if (amount > 1) {\n                amount = 1;\n            }\n            return function (t) {\n                if (amount == 0) {\n                    return t;\n                }\n                if (amount < 0) {\n                    return t * (t * -amount + 1 + amount);\n                }\n                return t * ((2 - t) * amount + (1 - amount));\n            };\n        };\n        /**\n         *\n         * @param pow\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        ScrollEase.getPowOut = function (pow) {\n            return function (t) {\n                return 1 - Math.pow(1 - t, pow);\n            };\n        };\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        ScrollEase.quintOut = ScrollEase.getPowOut(5);\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        ScrollEase.quartOut = ScrollEase.getPowOut(4);\n        return ScrollEase;\n    }());\n    egret.ScrollEase = ScrollEase;\n    __reflect(ScrollEase.prototype, \"egret.ScrollEase\");\n    /**\n     * @private\n     */\n    var ScrollTween = (function (_super) {\n        __extends(ScrollTween, _super);\n        /**\n         * 创建一个 egret.ScrollTween 对象\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function ScrollTween(target, props, pluginData) {\n            var _this = _super.call(this) || this;\n            /**\n             * @private\n             */\n            _this._target = null;\n            /**\n             * @private\n             */\n            _this._useTicks = false;\n            /**\n             * @private\n             */\n            _this.ignoreGlobalPause = false;\n            /**\n             * @private\n             */\n            _this.loop = false;\n            /**\n             * @private\n             */\n            _this.pluginData = null;\n            /**\n             * @private\n             */\n            _this._steps = null;\n            /**\n             * @private\n             */\n            _this._actions = null;\n            /**\n             * @private\n             */\n            _this.paused = false;\n            /**\n             * @private\n             */\n            _this.duration = 0;\n            /**\n             * @private\n             */\n            _this._prevPos = -1;\n            /**\n             * @private\n             */\n            _this.position = null;\n            /**\n             * @private\n             */\n            _this._prevPosition = 0;\n            /**\n             * @private\n             */\n            _this._stepPosition = 0;\n            /**\n             * @private\n             */\n            _this.passive = false;\n            _this.initialize(target, props, pluginData);\n            return _this;\n        }\n        /**\n         * Activate an object and add a ScrollTween animation to the object\n         * @param target {any} The object to be activated\n         * @param props {any} Parameters, support loop onChange onChangeObj\n         * @param pluginData {any} Write realized\n         * @param override {boolean} Whether to remove the object before adding a tween, the default value false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 激活一个对象，对其添加 ScrollTween 动画\n         * @param target {any} 要激活 ScrollTween 的对象\n         * @param props {any} 参数，支持loop(循环播放) onChange(变化函数) onChangeObj(变化函数作用域)\n         * @param pluginData {any} 暂未实现\n         * @param override {boolean} 是否移除对象之前添加的tween，默认值false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ScrollTween.get = function (target, props, pluginData, override) {\n            if (props === void 0) { props = null; }\n            if (pluginData === void 0) { pluginData = null; }\n            if (override === void 0) { override = false; }\n            if (override) {\n                ScrollTween.removeTweens(target);\n            }\n            return new ScrollTween(target, props, pluginData);\n        };\n        /**\n         * Delete all ScrollTween animations from an object\n         * @param target The object whose ScrollTween to be deleted\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 删除一个对象上的全部 ScrollTween 动画\n         * @param target  需要移除 ScrollTween 的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ScrollTween.removeTweens = function (target) {\n            if (!target.tween_count) {\n                return;\n            }\n            var tweens = ScrollTween._tweens;\n            for (var i = tweens.length - 1; i >= 0; i--) {\n                if (tweens[i]._target == target) {\n                    tweens[i].paused = true;\n                    tweens.splice(i, 1);\n                }\n            }\n            target.tween_count = 0;\n        };\n        /**\n         * @private\n         *\n         * @param delta\n         * @param paused\n         */\n        ScrollTween.tick = function (timeStamp, paused) {\n            if (paused === void 0) { paused = false; }\n            var delta = timeStamp - ScrollTween._lastTime;\n            ScrollTween._lastTime = timeStamp;\n            var tweens = ScrollTween._tweens.concat();\n            for (var i = tweens.length - 1; i >= 0; i--) {\n                var tween = tweens[i];\n                if ((paused && !tween.ignoreGlobalPause) || tween.paused) {\n                    continue;\n                }\n                tween.tick(tween._useTicks ? 1 : delta);\n            }\n            return false;\n        };\n        /**\n         * @private\n         *\n         * @param tween\n         * @param value\n         */\n        ScrollTween._register = function (tween, value) {\n            var target = tween._target;\n            var tweens = ScrollTween._tweens;\n            if (value) {\n                if (target) {\n                    target.tween_count = target.tween_count > 0 ? target.tween_count + 1 : 1;\n                }\n                tweens.push(tween);\n                if (!ScrollTween._inited) {\n                    ScrollTween._lastTime = egret.getTimer();\n                    egret.ticker.$startTick(ScrollTween.tick, null);\n                    ScrollTween._inited = true;\n                }\n            }\n            else {\n                if (target) {\n                    target.tween_count--;\n                }\n                var i = tweens.length;\n                while (i--) {\n                    if (tweens[i] == tween) {\n                        tweens.splice(i, 1);\n                        return;\n                    }\n                }\n            }\n        };\n        /**\n         * @private\n         *\n         * @param target\n         * @param props\n         * @param pluginData\n         */\n        ScrollTween.prototype.initialize = function (target, props, pluginData) {\n            this._target = target;\n            if (props) {\n                this._useTicks = props.useTicks;\n                this.ignoreGlobalPause = props.ignoreGlobalPause;\n                this.loop = props.loop;\n                props.onChange && this.addEventListener(\"change\", props.onChange, props.onChangeObj);\n                if (props.override) {\n                    ScrollTween.removeTweens(target);\n                }\n            }\n            this.pluginData = pluginData || {};\n            this._curQueueProps = {};\n            this._initQueueProps = {};\n            this._steps = [];\n            this._actions = [];\n            if (props && props.paused) {\n                this.paused = true;\n            }\n            else {\n                ScrollTween._register(this, true);\n            }\n            if (props && props.position != null) {\n                this.setPosition(props.position);\n            }\n        };\n        /**\n         * @private\n         *\n         * @param value\n         * @param actionsMode\n         * @returns\n         */\n        ScrollTween.prototype.setPosition = function (value, actionsMode) {\n            if (actionsMode === void 0) { actionsMode = 1; }\n            if (value < 0) {\n                value = 0;\n            }\n            //正常化位置\n            var t = value;\n            var end = false;\n            if (t >= this.duration) {\n                if (this.loop) {\n                    t = t % this.duration;\n                }\n                else {\n                    t = this.duration;\n                    end = true;\n                }\n            }\n            if (t == this._prevPos) {\n                return end;\n            }\n            var prevPos = this._prevPos;\n            this.position = this._prevPos = t;\n            this._prevPosition = value;\n            if (this._target) {\n                if (end) {\n                    //结束\n                    this._updateTargetProps(null, 1);\n                }\n                else if (this._steps.length > 0) {\n                    // 找到新的tween\n                    var i = void 0;\n                    var l = this._steps.length;\n                    for (i = 0; i < l; i++) {\n                        if (this._steps[i].t > t) {\n                            break;\n                        }\n                    }\n                    var step = this._steps[i - 1];\n                    this._updateTargetProps(step, (this._stepPosition = t - step.t) / step.d);\n                }\n            }\n            if (end) {\n                this.setPaused(true);\n            }\n            //执行actions\n            if (actionsMode != 0 && this._actions.length > 0) {\n                if (this._useTicks) {\n                    this._runActions(t, t);\n                }\n                else if (actionsMode == 1 && t < prevPos) {\n                    if (prevPos != this.duration) {\n                        this._runActions(prevPos, this.duration);\n                    }\n                    this._runActions(0, t, true);\n                }\n                else {\n                    this._runActions(prevPos, t);\n                }\n            }\n            this.dispatchEventWith(\"change\");\n            return end;\n        };\n        /**\n         * @private\n         *\n         * @param startPos\n         * @param endPos\n         * @param includeStart\n         */\n        ScrollTween.prototype._runActions = function (startPos, endPos, includeStart) {\n            if (includeStart === void 0) { includeStart = false; }\n            var sPos = startPos;\n            var ePos = endPos;\n            var i = -1;\n            var j = this._actions.length;\n            var k = 1;\n            if (startPos > endPos) {\n                //把所有的倒置\n                sPos = endPos;\n                ePos = startPos;\n                i = j;\n                j = k = -1;\n            }\n            while ((i += k) != j) {\n                var action = this._actions[i];\n                var pos = action.t;\n                if (pos == ePos || (pos > sPos && pos < ePos) || (includeStart && pos == startPos)) {\n                    action.f.apply(action.o, action.p);\n                }\n            }\n        };\n        /**\n         * @private\n         *\n         * @param step\n         * @param ratio\n         */\n        ScrollTween.prototype._updateTargetProps = function (step, ratio) {\n            var p0, p1, v, v0, v1, arr;\n            if (!step && ratio == 1) {\n                this.passive = false;\n                p0 = p1 = this._curQueueProps;\n            }\n            else {\n                this.passive = !!step.v;\n                //不更新props.\n                if (this.passive) {\n                    return;\n                }\n                //使用ease\n                if (step.e) {\n                    ratio = step.e(ratio, 0, 1, 1);\n                }\n                p0 = step.p0;\n                p1 = step.p1;\n            }\n            for (var n in this._initQueueProps) {\n                if ((v0 = p0[n]) == null) {\n                    p0[n] = v0 = this._initQueueProps[n];\n                }\n                if ((v1 = p1[n]) == null) {\n                    p1[n] = v1 = v0;\n                }\n                if (v0 == v1 || ratio == 0 || ratio == 1 || (typeof (v0) != \"number\")) {\n                    v = ratio == 1 ? v1 : v0;\n                }\n                else {\n                    v = v0 + (v1 - v0) * ratio;\n                }\n                var ignore = false;\n                if (arr = ScrollTween._plugins[n]) {\n                    for (var i = 0, l = arr.length; i < l; i++) {\n                        var v2 = arr[i].tween(this, n, v, p0, p1, ratio, !!step && p0 == p1, !step);\n                        if (v2 == ScrollTween.IGNORE) {\n                            ignore = true;\n                        }\n                        else {\n                            v = v2;\n                        }\n                    }\n                }\n                if (!ignore) {\n                    this._target[n] = v;\n                }\n            }\n        };\n        /**\n         * Whether setting is paused\n         * @param value {boolean} Whether to pause\n         * @returns ScrollTween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置是否暂停\n         * @param value {boolean} 是否暂停\n         * @returns Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ScrollTween.prototype.setPaused = function (value) {\n            this.paused = value;\n            ScrollTween._register(this, !value);\n            return this;\n        };\n        /**\n         * @private\n         *\n         * @param props\n         * @returns\n         */\n        ScrollTween.prototype._cloneProps = function (props) {\n            var o = {};\n            for (var n in props) {\n                o[n] = props[n];\n            }\n            return o;\n        };\n        /**\n         * @private\n         *\n         * @param o\n         * @returns\n         */\n        ScrollTween.prototype._addStep = function (o) {\n            if (o.d > 0) {\n                this._steps.push(o);\n                o.t = this.duration;\n                this.duration += o.d;\n            }\n            return this;\n        };\n        /**\n         * @private\n         *\n         * @param o\n         * @returns\n         */\n        ScrollTween.prototype._appendQueueProps = function (o) {\n            var arr, oldValue, i, l, injectProps;\n            for (var n in o) {\n                if (this._initQueueProps[n] === undefined) {\n                    oldValue = this._target[n];\n                    //设置plugins\n                    if (arr = ScrollTween._plugins[n]) {\n                        for (i = 0, l = arr.length; i < l; i++) {\n                            oldValue = arr[i].init(this, n, oldValue);\n                        }\n                    }\n                    this._initQueueProps[n] = this._curQueueProps[n] = (oldValue === undefined) ? null : oldValue;\n                }\n                else {\n                    oldValue = this._curQueueProps[n];\n                }\n            }\n            for (var n in o) {\n                oldValue = this._curQueueProps[n];\n                if (arr = ScrollTween._plugins[n]) {\n                    injectProps = injectProps || {};\n                    for (i = 0, l = arr.length; i < l; i++) {\n                        if (arr[i].step) {\n                            arr[i].step(this, n, oldValue, o[n], injectProps);\n                        }\n                    }\n                }\n                this._curQueueProps[n] = o[n];\n            }\n            if (injectProps) {\n                this._appendQueueProps(injectProps);\n            }\n            return this._curQueueProps;\n        };\n        /**\n         * @private\n         *\n         * @param o\n         * @returns\n         */\n        ScrollTween.prototype._addAction = function (o) {\n            o.t = this.duration;\n            this._actions.push(o);\n            return this;\n        };\n        /**\n         * Modify the property of the specified display object to a specified value\n         * @param props {Object} Property set of an object\n         * @param duration {number} Duration\n         * @param ease {egret.ScrollEase} Easing algorithm\n         * @returns {egret.ScrollTween} ScrollTween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将指定显示对象的属性修改为指定值\n         * @param props {Object} 对象的属性集合\n         * @param duration {number} 持续时间\n         * @param ease {egret.ScrollEase} 缓动算法\n         * @returns {egret.ScrollTween} Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ScrollTween.prototype.to = function (props, duration, ease) {\n            if (ease === void 0) { ease = undefined; }\n            if (isNaN(duration) || duration < 0) {\n                duration = 0;\n            }\n            return this._addStep({ d: duration || 0, p0: this._cloneProps(this._curQueueProps), e: ease, p1: this._cloneProps(this._appendQueueProps(props)) });\n        };\n        /**\n         * Execute callback function\n         * @param callback {Function} Callback method\n         * @param thisObj {any} this action scope of the callback method\n         * @param params {any[]} Parameter of the callback method\n         * @returns {egret.ScrollTween} ScrollTween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 执行回调函数\n         * @param callback {Function} 回调方法\n         * @param thisObj {any} 回调方法this作用域\n         * @param params {any[]} 回调方法参数\n         * @returns {egret.ScrollTween} Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ScrollTween.prototype.call = function (callback, thisObj, params) {\n            if (thisObj === void 0) { thisObj = undefined; }\n            if (params === void 0) { params = undefined; }\n            return this._addAction({ f: callback, p: params ? params : [], o: thisObj ? thisObj : this._target });\n        };\n        /**\n         * @method egret.ScrollTween#tick\n         * @param delta {number}\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        ScrollTween.prototype.tick = function (delta) {\n            if (this.paused) {\n                return;\n            }\n            this.setPosition(this._prevPosition + delta);\n        };\n        /**\n         * @private\n         */\n        ScrollTween._tweens = [];\n        /**\n         * @private\n         */\n        ScrollTween.IGNORE = {};\n        /**\n         * @private\n         */\n        ScrollTween._plugins = {};\n        /**\n         * @private\n         */\n        ScrollTween._inited = false;\n        ScrollTween._lastTime = 0;\n        return ScrollTween;\n    }(egret.EventDispatcher));\n    egret.ScrollTween = ScrollTween;\n    __reflect(ScrollTween.prototype, \"egret.ScrollTween\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * ScrollView auxiliary classes for slides, you will pass a display object constructor. It can display more than the range display object within the specified size range. And can easily drag in this range.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/display/ScrollView.ts\n     * @language en_US\n     */\n    /**\n     * ScrollView 是用于滑动的辅助类，将一个显示对象传入构造函数即可。可以在指定的尺寸范围内显示超过该范围的显示对象。并可以在此范围内随意拖动。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/display/ScrollView.ts\n     * @language zh_CN\n     */\n    var ScrollView = (function (_super) {\n        __extends(ScrollView, _super);\n        /**\n         * Create a egret.ScrollView objects\n         * @param content {egret.DisplayObject} You need to scroll object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.ScrollView 对象\n         * @param content {egret.DisplayObject} 需要滚动的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function ScrollView(content) {\n            if (content === void 0) { content = null; }\n            var _this = _super.call(this) || this;\n            /**\n             * Start rolling threshold when the touch point from the initial touch point at a distance exceeding this value will trigger roll\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 开始滚动的阈值，当触摸点偏离初始触摸点的距离超过这个值时才会触发滚动\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.scrollBeginThreshold = 10;\n            /**\n             * Scrolling speed, the speed is required and the default speed ratio.\n             * The range of scrollSpeed> 0 assigned to 2:00, the speed is 2 times the default speed\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 滚动速度，这个值为需要的速度与默认速度的比值。\n             * 取值范围为 scrollSpeed > 0 赋值为 2 时，速度是默认速度的 2 倍\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.scrollSpeed = 1;\n            /**\n             * @private\n             */\n            _this._content = null;\n            /**\n             * @private\n             */\n            _this.delayTouchBeginEvent = null;\n            /**\n             * @private\n             */\n            _this.touchBeginTimer = null;\n            _this.touchEnabled = true;\n            _this._ScrV_Props_ = new egret.ScrollViewProperties();\n            if (content) {\n                _this.setContent(content);\n            }\n            return _this;\n        }\n        Object.defineProperty(ScrollView.prototype, \"bounces\", {\n            /**\n             * Whether to enable rebound, rebound When enabled, ScrollView contents allowed to continue to drag the border after arriving at the end user drag operation, and then bounce back boundary position\n             * @default true\n             * @version Egret 2.4\n             * @language en_US\n             */\n            /**\n             * 是否启用回弹，当启用回弹后，ScrollView中内容在到达边界后允许继续拖动，在用户拖动操作结束后，再反弹回边界位置\n             * @default true\n             * @version Egret 2.4\n             * @language zh_CN\n             */\n            get: function () {\n                return this._ScrV_Props_._bounces;\n            },\n            set: function (value) {\n                this._ScrV_Props_._bounces = !!value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * Set to scroll object\n         * @param content {egret.DisplayObject} You need to scroll object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置需要滚动的对象\n         * @param content {egret.DisplayObject} 需要滚动的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ScrollView.prototype.setContent = function (content) {\n            if (this._content === content)\n                return;\n            this.removeContent();\n            if (content) {\n                this._content = content;\n                _super.prototype.addChild.call(this, content);\n                this._addEvents();\n            }\n        };\n        /**\n         * Remove rolling objects\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 移除滚动的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ScrollView.prototype.removeContent = function () {\n            if (this._content) {\n                this._removeEvents();\n                _super.prototype.removeChildAt.call(this, 0);\n            }\n            this._content = null;\n        };\n        Object.defineProperty(ScrollView.prototype, \"verticalScrollPolicy\", {\n            /**\n             * Vertical scroll bar display policy, on / off / auto.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 垂直滚动条显示策略，on/off/auto。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._ScrV_Props_._verticalScrollPolicy;\n            },\n            set: function (value) {\n                if (value == this._ScrV_Props_._verticalScrollPolicy)\n                    return;\n                this._ScrV_Props_._verticalScrollPolicy = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollView.prototype, \"horizontalScrollPolicy\", {\n            /**\n             * The horizontal scroll bar display policy, on / off / auto.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 水平滚动条显示策略，on/off/auto。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._ScrV_Props_._horizontalScrollPolicy;\n            },\n            set: function (value) {\n                if (value == this._ScrV_Props_._horizontalScrollPolicy)\n                    return;\n                this._ScrV_Props_._horizontalScrollPolicy = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollView.prototype, \"scrollLeft\", {\n            /**\n             * Gets or sets the horizontal scroll position\n             * @returns {number}\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 获取或设置水平滚动位置,\n             * @returns {number}\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._ScrV_Props_._scrollLeft;\n            },\n            set: function (value) {\n                if (value == this._ScrV_Props_._scrollLeft)\n                    return;\n                this._ScrV_Props_._scrollLeft = value;\n                this._validatePosition(false, true);\n                this._updateContentPosition();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollView.prototype, \"scrollTop\", {\n            /**\n             * Gets or sets the vertical scroll position\n             * @returns {number}\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 获取或设置垂直滚动位置,\n             * @returns {number}\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._ScrV_Props_._scrollTop;\n            },\n            set: function (value) {\n                if (value == this._ScrV_Props_._scrollTop)\n                    return;\n                this._ScrV_Props_._scrollTop = value;\n                this._validatePosition(true, false);\n                this._updateContentPosition();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * Set scroll position\n         * @param top {number} The vertical scroll position\n         * @param left {number} The horizontal scroll position\n         * @param isOffset {boolean} Optional parameter, the default is false, whether it is the amount of scrolling increase as top = 1 on behalf of one pixel scroll up\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置滚动位置\n         * @param top {number} 垂直滚动位置\n         * @param left {number} 水平滚动位置\n         * @param isOffset {boolean} 可选参数，默认是false，是否是滚动增加量，如 top=1 代表往上滚动1像素\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ScrollView.prototype.setScrollPosition = function (top, left, isOffset) {\n            if (isOffset === void 0) { isOffset = false; }\n            if (isOffset && top == 0 && left == 0)\n                return;\n            if (!isOffset && this._ScrV_Props_._scrollTop == top\n                && this._ScrV_Props_._scrollLeft == left)\n                return;\n            var oldTop = this._ScrV_Props_._scrollTop, oldLeft = this._ScrV_Props_._scrollLeft;\n            if (isOffset) {\n                var maxLeft = this.getMaxScrollLeft();\n                var maxTop = this.getMaxScrollTop();\n                if (oldTop <= 0 || oldTop >= maxTop) {\n                    top = top / 2;\n                }\n                if (oldLeft <= 0 || oldLeft >= maxLeft) {\n                    left = left / 2;\n                }\n                var newTop = oldTop + top;\n                var newLeft = oldLeft + left;\n                //判断是否回弹\n                var bounces = this._ScrV_Props_._bounces;\n                if (!bounces) {\n                    if (newTop <= 0 || newTop >= maxTop)\n                        newTop = Math.max(0, Math.min(newTop, maxTop));\n                    if (newLeft <= 0 || newLeft >= maxLeft)\n                        newLeft = Math.max(0, Math.min(newLeft, maxLeft));\n                }\n                this._ScrV_Props_._scrollTop = newTop;\n                this._ScrV_Props_._scrollLeft = newLeft;\n            }\n            else {\n                this._ScrV_Props_._scrollTop = top;\n                this._ScrV_Props_._scrollLeft = left;\n            }\n            this._validatePosition(true, true);\n            this._updateContentPosition();\n        };\n        /**\n         * @private\n         *\n         * @param top\n         * @param left\n         */\n        ScrollView.prototype._validatePosition = function (top, left) {\n            if (top === void 0) { top = false; }\n            if (left === void 0) { left = false; }\n            if (top) {\n                var height = this.height;\n                var contentHeight = this._getContentHeight();\n                this._ScrV_Props_._scrollTop = Math.max(this._ScrV_Props_._scrollTop, (0 - height) / 2);\n                this._ScrV_Props_._scrollTop = Math.min(this._ScrV_Props_._scrollTop, contentHeight > height ? (contentHeight - height / 2) : height / 2);\n            }\n            if (left) {\n                var width = this.width;\n                var contentWidth = this._getContentWidth();\n                this._ScrV_Props_._scrollLeft = Math.max(this._ScrV_Props_._scrollLeft, (0 - width) / 2);\n                this._ScrV_Props_._scrollLeft = Math.min(this._ScrV_Props_._scrollLeft, contentWidth > width ? (contentWidth - width / 2) : width / 2);\n            }\n        };\n        /**\n         * @private\n         * @inheritDoc\n         */\n        ScrollView.prototype.$setWidth = function (value) {\n            if (this.$explicitWidth == value) {\n                return;\n            }\n            _super.prototype.$setWidth.call(this, value);\n            this._updateContentPosition();\n        };\n        /**\n         * @private\n         * @inheritDoc\n         */\n        ScrollView.prototype.$setHeight = function (value) {\n            if (this.$explicitHeight == value) {\n                return;\n            }\n            _super.prototype.$setHeight.call(this, value);\n            this._updateContentPosition();\n        };\n        /**\n         * @private\n         *\n         */\n        ScrollView.prototype._updateContentPosition = function () {\n            var height = this.height;\n            var width = this.width;\n            //这里将坐标取整，避免有些浏览器精度低产生“黑线”问题\n            this.scrollRect = new egret.Rectangle(Math.round(this._ScrV_Props_._scrollLeft), Math.round(this._ScrV_Props_._scrollTop), width, height);\n            this.dispatchEvent(new egret.Event(egret.Event.CHANGE));\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        ScrollView.prototype._checkScrollPolicy = function () {\n            var hpolicy = this._ScrV_Props_._horizontalScrollPolicy;\n            var hCanScroll = this.__checkScrollPolicy(hpolicy, this._getContentWidth(), this.width);\n            this._ScrV_Props_._hCanScroll = hCanScroll;\n            var vpolicy = this._ScrV_Props_._verticalScrollPolicy;\n            var vCanScroll = this.__checkScrollPolicy(vpolicy, this._getContentHeight(), this.height);\n            this._ScrV_Props_._vCanScroll = vCanScroll;\n            return hCanScroll || vCanScroll;\n        };\n        /**\n         * @private\n         *\n         * @param policy\n         * @param contentLength\n         * @param viewLength\n         * @returns\n         */\n        ScrollView.prototype.__checkScrollPolicy = function (policy, contentLength, viewLength) {\n            if (policy == \"on\")\n                return true;\n            if (policy == \"off\")\n                return false;\n            return contentLength > viewLength;\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        ScrollView.prototype._addEvents = function () {\n            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);\n            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, true);\n            this.addEventListener(egret.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, true);\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        ScrollView.prototype._removeEvents = function () {\n            this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this._onTouchBegin, this);\n            this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this._onTouchBeginCapture, this, true);\n            this.removeEventListener(egret.TouchEvent.TOUCH_END, this._onTouchEndCapture, this, true);\n        };\n        /**\n         * @private\n         *\n         * @param e\n         */\n        ScrollView.prototype._onTouchBegin = function (e) {\n            if (e.$isDefaultPrevented) {\n                return;\n            }\n            var canScroll = this._checkScrollPolicy();\n            if (!canScroll) {\n                return;\n            }\n            this._ScrV_Props_._touchStartPosition.x = e.stageX;\n            this._ScrV_Props_._touchStartPosition.y = e.stageY;\n            if (this._ScrV_Props_._isHTweenPlaying || this._ScrV_Props_._isVTweenPlaying) {\n                this._onScrollFinished();\n            }\n            this._tempStage = this.stage;\n            this._tempStage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);\n            this._tempStage.addEventListener(egret.TouchEvent.TOUCH_END, this._onTouchEnd, this);\n            this._tempStage.addEventListener(egret.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this);\n            this.addEventListener(egret.Event.ENTER_FRAME, this._onEnterFrame, this);\n            this._logTouchEvent(e);\n            e.preventDefault();\n        };\n        /**\n         * @private\n         *\n         * @param event\n         */\n        ScrollView.prototype._onTouchBeginCapture = function (event) {\n            var canScroll = this._checkScrollPolicy();\n            if (!canScroll) {\n                return;\n            }\n            var target = event.target;\n            while (target != this) {\n                if (\"_checkScrollPolicy\" in target) {\n                    canScroll = target._checkScrollPolicy();\n                    if (canScroll) {\n                        return;\n                    }\n                }\n                target = target.parent;\n            }\n            event.stopPropagation();\n            var evt = this.cloneTouchEvent(event);\n            this.delayTouchBeginEvent = evt;\n            if (!this.touchBeginTimer) {\n                this.touchBeginTimer = new egret.Timer(100, 1);\n                this.touchBeginTimer.addEventListener(egret.TimerEvent.TIMER_COMPLETE, this._onTouchBeginTimer, this);\n            }\n            this.touchBeginTimer.start();\n            this._onTouchBegin(event);\n        };\n        /**\n         * @private\n         *\n         * @param event\n         * @returns\n         */\n        ScrollView.prototype._onTouchEndCapture = function (event) {\n            var _this = this;\n            if (!this.delayTouchBeginEvent) {\n                return;\n            }\n            this._onTouchBeginTimer();\n            event.stopPropagation();\n            var evt = this.cloneTouchEvent(event);\n            egret.callLater(function () {\n                if (_this.stage) {\n                    _this.dispatchPropagationEvent(evt);\n                }\n            }, this);\n        };\n        /**\n         * @private\n         *\n         */\n        ScrollView.prototype._onTouchBeginTimer = function () {\n            this.touchBeginTimer.stop();\n            var event = this.delayTouchBeginEvent;\n            this.delayTouchBeginEvent = null;\n            //Dispatch event only if the scroll view is still on the stage\n            if (this.stage)\n                this.dispatchPropagationEvent(event);\n        };\n        /**\n         * @private\n         *\n         * @param event\n         * @returns\n         */\n        ScrollView.prototype.dispatchPropagationEvent = function (event) {\n            var target = event.$target;\n            var list = this.$getPropagationList(target);\n            var length = list.length;\n            var targetIndex = list.length * 0.5;\n            var startIndex = -1;\n            for (var i = 0; i < length; i++) {\n                if (list[i] === this._content) {\n                    startIndex = i;\n                    break;\n                }\n            }\n            list.splice(0, startIndex + 1);\n            targetIndex -= startIndex + 1;\n            this.$dispatchPropagationEvent(event, list, targetIndex);\n            egret.Event.release(event);\n        };\n        /**\n         * @private\n         *\n         * @param event\n         * @returns\n         */\n        ScrollView.prototype._onTouchMove = function (event) {\n            if (this._ScrV_Props_._lastTouchPosition.x == event.stageX && this._ScrV_Props_._lastTouchPosition.y == event.stageY)\n                return;\n            if (!this._ScrV_Props_._scrollStarted) {\n                var x = event.stageX - this._ScrV_Props_._touchStartPosition.x, y = event.stageY - this._ScrV_Props_._touchStartPosition.y;\n                var distance = Math.sqrt(x * x + y * y);\n                if (distance < this.scrollBeginThreshold) {\n                    this._logTouchEvent(event);\n                    return;\n                }\n            }\n            this._ScrV_Props_._scrollStarted = true;\n            if (this.delayTouchBeginEvent) {\n                this.delayTouchBeginEvent = null;\n                this.touchBeginTimer.stop();\n            }\n            this.touchChildren = false;\n            var offset = this._getPointChange(event);\n            this.setScrollPosition(offset.y, offset.x, true);\n            this._calcVelocitys(event);\n            this._logTouchEvent(event);\n        };\n        /**\n         * @private\n         *\n         * @param event\n         * @returns\n         */\n        ScrollView.prototype._onTouchEnd = function (event) {\n            this.touchChildren = true;\n            this._ScrV_Props_._scrollStarted = false;\n            this._tempStage.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this._onTouchMove, this);\n            this._tempStage.removeEventListener(egret.TouchEvent.TOUCH_END, this._onTouchEnd, this);\n            this._tempStage.removeEventListener(egret.TouchEvent.LEAVE_STAGE, this._onTouchEnd, this);\n            this.removeEventListener(egret.Event.ENTER_FRAME, this._onEnterFrame, this);\n            this._moveAfterTouchEnd();\n        };\n        /**\n         * @private\n         *\n         * @param event\n         * @returns\n         */\n        ScrollView.prototype._onEnterFrame = function (event) {\n            var time = egret.getTimer();\n            if (time - this._ScrV_Props_._lastTouchTime > 100 && time - this._ScrV_Props_._lastTouchTime < 300) {\n                this._calcVelocitys(this._ScrV_Props_._lastTouchEvent);\n            }\n        };\n        /**\n         * @private\n         *\n         * @param e\n         * @returns\n         */\n        ScrollView.prototype._logTouchEvent = function (e) {\n            this._ScrV_Props_._lastTouchPosition.x = e.stageX;\n            this._ScrV_Props_._lastTouchPosition.y = e.stageY;\n            this._ScrV_Props_._lastTouchEvent = this.cloneTouchEvent(e);\n            this._ScrV_Props_._lastTouchTime = egret.getTimer();\n        };\n        /**\n         * @private\n         *\n         * @param e\n         * @returns\n         */\n        ScrollView.prototype._getPointChange = function (e) {\n            return {\n                x: this._ScrV_Props_._hCanScroll === false ? 0 : (this._ScrV_Props_._lastTouchPosition.x - e.stageX),\n                y: this._ScrV_Props_._vCanScroll === false ? 0 : (this._ScrV_Props_._lastTouchPosition.y - e.stageY)\n            };\n        };\n        /**\n         * @private\n         *\n         * @param e\n         * @returns\n         */\n        ScrollView.prototype._calcVelocitys = function (e) {\n            var time = egret.getTimer();\n            if (this._ScrV_Props_._lastTouchTime == 0) {\n                this._ScrV_Props_._lastTouchTime = time;\n                return;\n            }\n            var change = this._getPointChange(e);\n            var timeoffset = time - this._ScrV_Props_._lastTouchTime;\n            change.x /= timeoffset;\n            change.y /= timeoffset;\n            this._ScrV_Props_._velocitys.push(change);\n            if (this._ScrV_Props_._velocitys.length > 5)\n                this._ScrV_Props_._velocitys.shift();\n            this._ScrV_Props_._lastTouchPosition.x = e.stageX;\n            this._ScrV_Props_._lastTouchPosition.y = e.stageY;\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        ScrollView.prototype._getContentWidth = function () {\n            return this._content.$explicitWidth || this._content.width;\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        ScrollView.prototype._getContentHeight = function () {\n            return this._content.$explicitHeight || this._content.height;\n        };\n        /**\n         * The left side of the maximum distance\n         * @returns The left side of the maximum distance\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 距离左侧的最大值\n         * @returns 距离左侧最大值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ScrollView.prototype.getMaxScrollLeft = function () {\n            var max = this._getContentWidth() - this.width;\n            return Math.max(0, max);\n        };\n        /**\n         * Above the maximum distance\n         * @returns Above the maximum distance\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 距离上方最大值\n         * @returns 距离上方最大值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ScrollView.prototype.getMaxScrollTop = function () {\n            var max = this._getContentHeight() - this.height;\n            return Math.max(0, max);\n        };\n        /**\n         * @private\n         *\n         */\n        ScrollView.prototype._moveAfterTouchEnd = function () {\n            if (this._ScrV_Props_._velocitys.length == 0)\n                return;\n            var sum = { x: 0, y: 0 }, totalW = 0;\n            for (var i = 0; i < this._ScrV_Props_._velocitys.length; i++) {\n                var v = this._ScrV_Props_._velocitys[i];\n                var w = ScrollView.weight[i];\n                sum.x += v.x * w;\n                sum.y += v.y * w;\n                totalW += w;\n            }\n            this._ScrV_Props_._velocitys.length = 0;\n            if (this.scrollSpeed <= 0)\n                this.scrollSpeed = 1;\n            var x = sum.x / totalW * this.scrollSpeed, y = sum.y / totalW * this.scrollSpeed;\n            var pixelsPerMSX = Math.abs(x), pixelsPerMSY = Math.abs(y);\n            var maxLeft = this.getMaxScrollLeft();\n            var maxTop = this.getMaxScrollTop();\n            var datax = pixelsPerMSX > 0.02 ? this.getAnimationDatas(x, this._ScrV_Props_._scrollLeft, maxLeft) : {\n                position: this._ScrV_Props_._scrollLeft,\n                duration: 1\n            };\n            var datay = pixelsPerMSY > 0.02 ? this.getAnimationDatas(y, this._ScrV_Props_._scrollTop, maxTop) : {\n                position: this._ScrV_Props_._scrollTop,\n                duration: 1\n            };\n            this.setScrollLeft(datax.position, datax.duration);\n            this.setScrollTop(datay.position, datay.duration);\n        };\n        /**\n         * @private\n         *\n         * @param tw\n         */\n        ScrollView.prototype.onTweenFinished = function (tw) {\n            if (tw == this._ScrV_Props_._vScrollTween)\n                this._ScrV_Props_._isVTweenPlaying = false;\n            if (tw == this._ScrV_Props_._hScrollTween)\n                this._ScrV_Props_._isHTweenPlaying = false;\n            if (this._ScrV_Props_._isHTweenPlaying == false && this._ScrV_Props_._isVTweenPlaying == false) {\n                this._onScrollFinished();\n            }\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        ScrollView.prototype._onScrollStarted = function () {\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        ScrollView.prototype._onScrollFinished = function () {\n            egret.ScrollTween.removeTweens(this);\n            this._ScrV_Props_._hScrollTween = null;\n            this._ScrV_Props_._vScrollTween = null;\n            this._ScrV_Props_._isHTweenPlaying = false;\n            this._ScrV_Props_._isVTweenPlaying = false;\n            this.dispatchEvent(new egret.Event(egret.Event.COMPLETE));\n        };\n        /**\n         * Set the scroll position above the distance\n         * @param scrollTop Position above distance\n         * @param duration Easing of time, in milliseconds\n         * @returns Get tween vertical scrolling\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置滚动距离上方的位置\n         * @param scrollTop 距离上方的位置\n         * @param duration 缓动时间，毫秒单位\n         * @returns 获取垂直滚动的tween\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ScrollView.prototype.setScrollTop = function (scrollTop, duration) {\n            if (duration === void 0) { duration = 0; }\n            var finalPosition = Math.min(this.getMaxScrollTop(), Math.max(scrollTop, 0));\n            if (duration == 0) {\n                this.scrollTop = finalPosition;\n                return;\n            }\n            if (this._ScrV_Props_._bounces == false)\n                scrollTop = finalPosition;\n            var vtween = egret.ScrollTween.get(this).to({ scrollTop: scrollTop }, duration, egret.ScrollEase.quartOut);\n            if (finalPosition != scrollTop) {\n                vtween.to({ scrollTop: finalPosition }, 300, egret.ScrollEase.quintOut);\n            }\n            this._ScrV_Props_._isVTweenPlaying = true;\n            this._ScrV_Props_._vScrollTween = vtween;\n            vtween.call(this.onTweenFinished, this, [vtween]);\n            if (!this._ScrV_Props_._isHTweenPlaying)\n                this._onScrollStarted();\n        };\n        /**\n         * Set the scroll position from the left side\n         * @param scrollLeft From the position on the left side\n         * @param duration Get tween vertical scrolling\n         * @returns Gets the horizontal scroll tween\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置滚动距离左侧的位置\n         * @param scrollLeft 距离左侧的位置\n         * @param duration 缓动时间，毫秒单位\n         * @returns 获取水平滚动的tween\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ScrollView.prototype.setScrollLeft = function (scrollLeft, duration) {\n            if (duration === void 0) { duration = 0; }\n            var finalPosition = Math.min(this.getMaxScrollLeft(), Math.max(scrollLeft, 0));\n            if (duration == 0) {\n                this.scrollLeft = finalPosition;\n                return;\n            }\n            if (this._ScrV_Props_._bounces == false)\n                scrollLeft = finalPosition;\n            var htween = egret.ScrollTween.get(this).to({ scrollLeft: scrollLeft }, duration, egret.ScrollEase.quartOut);\n            if (finalPosition != scrollLeft) {\n                htween.to({ scrollLeft: finalPosition }, 300, egret.ScrollEase.quintOut);\n            }\n            this._ScrV_Props_._isHTweenPlaying = true;\n            this._ScrV_Props_._hScrollTween = htween;\n            htween.call(this.onTweenFinished, this, [htween]);\n            if (!this._ScrV_Props_._isVTweenPlaying)\n                this._onScrollStarted();\n        };\n        /**\n         * @private\n         *\n         * @param pixelsPerMS\n         * @param curPos\n         * @param maxPos\n         * @returns\n         */\n        ScrollView.prototype.getAnimationDatas = function (pixelsPerMS, curPos, maxPos) {\n            var absPixelsPerMS = Math.abs(pixelsPerMS);\n            var extraFricition = 0.95;\n            var duration = 0;\n            var friction = 0.998;\n            var minVelocity = 0.02;\n            var posTo = curPos + pixelsPerMS * 500;\n            if (posTo < 0 || posTo > maxPos) {\n                posTo = curPos;\n                while (Math.abs(pixelsPerMS) != Infinity && Math.abs(pixelsPerMS) > minVelocity) {\n                    posTo += pixelsPerMS;\n                    if (posTo < 0 || posTo > maxPos) {\n                        pixelsPerMS *= friction * extraFricition;\n                    }\n                    else {\n                        pixelsPerMS *= friction;\n                    }\n                    duration++;\n                }\n            }\n            else {\n                duration = -Math.log(minVelocity / absPixelsPerMS) * 500;\n            }\n            var result = {\n                position: Math.min(maxPos + 50, Math.max(posTo, -50)),\n                duration: duration\n            };\n            return result;\n        };\n        /**\n         * @private\n         *\n         * @param event\n         * @returns\n         */\n        ScrollView.prototype.cloneTouchEvent = function (event) {\n            var evt = new egret.TouchEvent(event.type, event.bubbles, event.cancelable);\n            evt.touchPointID = event.touchPointID;\n            evt.$stageX = event.stageX;\n            evt.$stageY = event.stageY;\n            //evt.ctrlKey = event.ctrlKey;\n            //evt.altKey = event.altKey;\n            //evt.shiftKey = event.shiftKey;\n            evt.touchDown = event.touchDown;\n            evt.$isDefaultPrevented = false;\n            evt.$target = event.target;\n            return evt;\n        };\n        /**\n         * @private\n         *\n         * @returns\n         */\n        ScrollView.prototype.throwNotSupportedError = function () {\n            egret.$error(1023);\n        };\n        /**\n         * @deprecated\n         * @inheritDoc\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        ScrollView.prototype.addChild = function (child) {\n            this.throwNotSupportedError();\n            return null;\n        };\n        /**\n         * @deprecated\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        ScrollView.prototype.addChildAt = function (child, index) {\n            this.throwNotSupportedError();\n            return null;\n        };\n        /**\n         * @deprecated\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        ScrollView.prototype.removeChild = function (child) {\n            this.throwNotSupportedError();\n            return null;\n        };\n        /**\n         * @deprecated\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        ScrollView.prototype.removeChildAt = function (index) {\n            this.throwNotSupportedError();\n            return null;\n        };\n        /**\n         * @deprecated\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        ScrollView.prototype.setChildIndex = function (child, index) {\n            this.throwNotSupportedError();\n        };\n        /**\n         * @deprecated\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        ScrollView.prototype.swapChildren = function (child1, child2) {\n            this.throwNotSupportedError();\n        };\n        /**\n         * @deprecated\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        ScrollView.prototype.swapChildrenAt = function (index1, index2) {\n            this.throwNotSupportedError();\n        };\n        /**\n         * @private\n         */\n        ScrollView.weight = [1, 1.33, 1.66, 2, 2.33];\n        return ScrollView;\n    }(egret.DisplayObjectContainer));\n    egret.ScrollView = ScrollView;\n    __reflect(ScrollView.prototype, \"egret.ScrollView\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    var ScrollViewProperties = (function () {\n        function ScrollViewProperties() {\n            /**\n             * @private\n             */\n            this._verticalScrollPolicy = \"auto\";\n            /**\n             * @private\n             */\n            this._horizontalScrollPolicy = \"auto\";\n            /**\n             * @private\n             */\n            this._scrollLeft = 0;\n            /**\n             * @private\n             */\n            this._scrollTop = 0;\n            /**\n             * @private\n             */\n            this._hCanScroll = false;\n            /**\n             * @private\n             */\n            this._vCanScroll = false;\n            /**\n             * @private\n             */\n            this._lastTouchPosition = new egret.Point(0, 0);\n            /**\n             * @private\n             */\n            this._touchStartPosition = new egret.Point(0, 0);\n            /**\n             * @private\n             */\n            this._scrollStarted = false;\n            /**\n             * @private\n             */\n            this._lastTouchTime = 0;\n            /**\n             * @private\n             */\n            this._lastTouchEvent = null;\n            /**\n             * @private\n             */\n            this._velocitys = [];\n            /**\n             * @private\n             */\n            this._isHTweenPlaying = false;\n            /**\n             * @private\n             */\n            this._isVTweenPlaying = false;\n            /**\n             * @private\n             */\n            this._hScrollTween = null;\n            /**\n             * @private\n             */\n            this._vScrollTween = null;\n            /**\n             * @private\n             */\n            this._bounces = true;\n        }\n        return ScrollViewProperties;\n    }());\n    egret.ScrollViewProperties = ScrollViewProperties;\n    __reflect(ScrollViewProperties.prototype, \"egret.ScrollViewProperties\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    function $getUrl(request) {\n        var url = request.url;\n        //get请求没有设置参数，而是设置URLVariables的情况\n        if (url.indexOf(\"?\") == -1 && request.method == egret.URLRequestMethod.GET && request.data && request.data instanceof egret.URLVariables) {\n            url = url + \"?\" + request.data.toString();\n        }\n        return url;\n    }\n    /**\n     * UThe URLLoader class downloads data from a URL as text, binary data, or URL-encoded variables.  It is useful for downloading text files, XML, or other information to be used in a dynamic, data-driven application.\n     * A URLLoader object downloads all of the data from a URL before making it available to code in the applications. It sends out notifications about the progress of the download,\n     * which you can monitor through bytesLoaded and bytesTotal properties, as well as through dispatched events.\n     * @see http://edn.egret.com/cn/docs/page/601 Build communication request\n     * @event egret.Event.COMPLETE Dispatched when the net request is complete.\n     * @event egret.IOErrorEvent.IO_ERROR io error.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLLoader.ts\n     * @language en_US\n     */\n    /**\n     * URLLoader 类以文本、二进制数据或 URL 编码变量的形式从 URL 下载数据。在下载文本文件、XML 或其他用于动态数据驱动应用程序的信息时，它很有用。\n     * URLLoader 对象会先从 URL 中下载所有数据，然后才将数据用于应用程序中的代码。它会发出有关下载进度的通知，\n     * 通过 bytesLoaded 和 bytesTotal 属性以及已调度的事件，可以监视下载进度。\n     * @see http://edn.egret.com/cn/docs/page/601 构建通信请求\n     * @event egret.Event.COMPLETE 加载完成后调度。\n     * @event egret.IOErrorEvent.IO_ERROR 加载错误后调度。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLLoader.ts\n     * @language zh_CN\n     */\n    var URLLoader = (function (_super) {\n        __extends(URLLoader, _super);\n        /**\n         * Create an egret.URLLoader object\n         * @param request {URLRequest} A URLRequest object specifies the URL to be downloaded.\n         * If this parameter is omitted, no load operation begins. If a parameter is specified, the load operation begins immediately\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建 egret.URLLoader 对象\n         * @param request {URLRequest} 一个 URLRequest 对象，指定要下载的 URL。\n         * 如果省略该参数，则不开始加载操作。如果已指定参数，则立即开始加载操作\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function URLLoader(request) {\n            if (request === void 0) { request = null; }\n            var _this = _super.call(this) || this;\n            /**\n             * Control whether the downloaded data is received as text (URLLoaderDataFormat.TEXT), raw binary data (URLLoaderDataFormat.BINARY), or URL-encoded variables (URLLoaderDataFormat.VARIABLES).\n             * If the value of the dataFormat property is URLLoaderDataFormat.TEXT, the received data is a string containing the text of the loaded file.\n             * If the value of the dataFormat property is URLLoaderDataFormat.BINARY, the received data is a ByteArray object containing the raw binary data.\n             * If the value of the dataFormat property is URLLoaderDataFormat.TEXTURE, the received data is a Texture object containing the bitmap data.\n             * If the value of the dataFormat property is URLLoaderDataFormat.VARIABLES, the received data is a URLVariables object containing the URL-encoded variables.\n             * The default value is URLLoaderDataFormat.TEXT.\n             * @default egret.URLLoaderDataFormat.TEXT\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 控制是以文本 (URLLoaderDataFormat.TEXT)、原始二进制数据 (URLLoaderDataFormat.BINARY) 还是 URL 编码变量 (URLLoaderDataFormat.VARIABLES) 接收下载的数据。\n             * 如果 dataFormat 属性的值是 URLLoaderDataFormat.TEXT，则所接收的数据是一个包含已加载文件文本的字符串。\n             * 如果 dataFormat 属性的值是 URLLoaderDataFormat.BINARY，则所接收的数据是一个包含原始二进制数据的 ByteArray 对象。\n             * 如果 dataFormat 属性的值是 URLLoaderDataFormat.TEXTURE，则所接收的数据是一个包含位图数据的Texture对象。\n             * 如果 dataFormat 属性的值是 URLLoaderDataFormat.VARIABLES，则所接收的数据是一个包含 URL 编码变量的 URLVariables 对象。\n             * @default egret.URLLoaderDataFormat.TEXT\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.dataFormat = egret.URLLoaderDataFormat.TEXT;\n            /**\n             * The data received from the load operation. This property is populated only when the load operation is complete. The format of the data depends on the setting of the dataFormat property:\n             * If the dataFormat property is URLLoaderDataFormat.TEXT, the received data is a string containing the text of the loaded file.\n             * If the dataFormat property is URLLoaderDataFormat.BINARY, the received data is a ByteArray object containing the raw binary data.\n             * If the dataFormat property is URLLoaderDataFormat.TEXTURE, the received data is a Texture object containing the bitmap data.\n             * If the dataFormat property is URLLoaderDataFormat.VARIABLES, the received data is a URLVariables object containing the URL-encoded variables.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 从加载操作接收的数据。只有完成加载操作时，才会填充该属性。该数据的格式取决于 dataFormat 属性的设置：\n             * 如果 dataFormat 属性是 URLLoaderDataFormat.TEXT，则所接收的数据是一个包含已加载文件文本的字符串。\n             * 如果 dataFormat 属性是 URLLoaderDataFormat.BINARY，则所接收的数据是一个包含原始二进制数据的 ByteArray 对象。\n             * 如果 dataFormat 属性是 URLLoaderDataFormat.TEXTURE，则所接收的数据是一个包含位图数据的Texture对象。\n             * 如果 dataFormat 属性是 URLLoaderDataFormat.VARIABLES，则所接收的数据是一个包含 URL 编码变量的 URLVariables 对象。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.data = null;\n            /**\n             * @private\n             */\n            _this._request = null;\n            /**\n             * @private\n             */\n            _this._status = -1;\n            if (request) {\n                _this.load(request);\n            }\n            return _this;\n        }\n        /**\n         * Send and load data from the specified URL. The data can be received as text, raw binary data, or URL-encoded variables, depending on the value you set for the dataFormat property.\n         * Note that the default value of the dataFormat property is text. If you want to send data to the specified URL, you can set the data property in the URLRequest object.\n         * @param request {URLRequest}  A URLRequest object specifies the URL to be downloaded.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从指定的 URL 发送和加载数据。可以以文本、原始二进制数据或 URL 编码变量格式接收数据，这取决于为 dataFormat 属性所设置的值。\n         * 请注意 dataFormat 属性的默认值为文本。如果想将数据发送至指定的 URL，则可以在 URLRequest 对象中设置 data 属性。\n         * @param request {URLRequest}  一个 URLRequest 对象，指定要下载的 URL。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        URLLoader.prototype.load = function (request) {\n            this._request = request;\n            this.data = null;\n            var loader = this;\n            if (loader.dataFormat == egret.URLLoaderDataFormat.TEXTURE) {\n                this.loadTexture(loader);\n                return;\n            }\n            if (loader.dataFormat == egret.URLLoaderDataFormat.SOUND) {\n                this.loadSound(loader);\n                return;\n            }\n            var virtualUrl = $getUrl(request);\n            var httpRequest = new egret.HttpRequest();\n            httpRequest.open(virtualUrl, request.method == egret.URLRequestMethod.POST ? egret.HttpMethod.POST : egret.HttpMethod.GET);\n            var sendData;\n            if (request.method == egret.URLRequestMethod.GET || !request.data) {\n            }\n            else if (request.data instanceof egret.URLVariables) {\n                httpRequest.setRequestHeader(\"Content-Type\", \"application/x-www-form-urlencoded\");\n                var urlVars = request.data;\n                sendData = urlVars.toString();\n            }\n            else {\n                httpRequest.setRequestHeader(\"Content-Type\", \"multipart/form-data\");\n                sendData = request.data;\n            }\n            var length = request.requestHeaders.length;\n            for (var i = 0; i < length; i++) {\n                var urlRequestHeader = request.requestHeaders[i];\n                httpRequest.setRequestHeader(urlRequestHeader.name, urlRequestHeader.value);\n            }\n            httpRequest.addEventListener(egret.Event.COMPLETE, function () {\n                loader.data = httpRequest.response;\n                egret.Event.dispatchEvent(loader, egret.Event.COMPLETE);\n            }, this);\n            httpRequest.addEventListener(egret.IOErrorEvent.IO_ERROR, function () {\n                egret.IOErrorEvent.dispatchIOErrorEvent(loader);\n            }, this);\n            httpRequest.responseType = loader.dataFormat == egret.URLLoaderDataFormat.BINARY ? egret.HttpResponseType.ARRAY_BUFFER : egret.HttpResponseType.TEXT;\n            httpRequest.send(sendData);\n        };\n        URLLoader.prototype.getResponseType = function (dataFormat) {\n            switch (dataFormat) {\n                case egret.URLLoaderDataFormat.TEXT:\n                case egret.URLLoaderDataFormat.VARIABLES:\n                    return egret.URLLoaderDataFormat.TEXT;\n                case egret.URLLoaderDataFormat.BINARY:\n                    return \"arraybuffer\";\n                default:\n                    return dataFormat;\n            }\n        };\n        /**\n         * @private\n         *\n         * @param loader\n         */\n        URLLoader.prototype.loadSound = function (loader) {\n            var self = this;\n            var virtualUrl = loader._request.url;\n            var sound = new egret.Sound();\n            sound.addEventListener(egret.Event.COMPLETE, onLoadComplete, self);\n            sound.addEventListener(egret.IOErrorEvent.IO_ERROR, onError, self);\n            sound.addEventListener(egret.ProgressEvent.PROGRESS, onPostProgress, self);\n            sound.load(virtualUrl);\n            function onPostProgress(event) {\n                loader.dispatchEvent(event);\n            }\n            function onError(event) {\n                removeListeners();\n                loader.dispatchEvent(event);\n            }\n            function onLoadComplete(e) {\n                removeListeners();\n                loader.data = sound;\n                window.setTimeout(function () {\n                    loader.dispatchEventWith(egret.Event.COMPLETE);\n                }, 0);\n            }\n            function removeListeners() {\n                sound.removeEventListener(egret.Event.COMPLETE, onLoadComplete, self);\n                sound.removeEventListener(egret.IOErrorEvent.IO_ERROR, onError, self);\n                sound.removeEventListener(egret.ProgressEvent.PROGRESS, onPostProgress, self);\n            }\n        };\n        /**\n         * @private\n         *\n         * @param loader\n         */\n        URLLoader.prototype.loadTexture = function (loader) {\n            var self = this;\n            var virtualUrl = loader._request.url;\n            var imageLoader = new egret.ImageLoader();\n            imageLoader.addEventListener(egret.Event.COMPLETE, onLoadComplete, self);\n            imageLoader.addEventListener(egret.IOErrorEvent.IO_ERROR, onError, self);\n            imageLoader.addEventListener(egret.ProgressEvent.PROGRESS, onPostProgress, self);\n            imageLoader.load(virtualUrl);\n            function onPostProgress(event) {\n                loader.dispatchEvent(event);\n            }\n            function onError(event) {\n                removeListeners();\n                loader.dispatchEvent(event);\n            }\n            function onLoadComplete(e) {\n                removeListeners();\n                var bitmapData = imageLoader.data;\n                if (bitmapData.source.setAttribute) {\n                    bitmapData.source.setAttribute(\"bitmapSrc\", virtualUrl);\n                }\n                var texture = new egret.Texture();\n                texture._setBitmapData(bitmapData);\n                loader.data = texture;\n                window.setTimeout(function () {\n                    loader.dispatchEventWith(egret.Event.COMPLETE);\n                }, 0);\n            }\n            function removeListeners() {\n                imageLoader.removeEventListener(egret.Event.COMPLETE, onLoadComplete, self);\n                imageLoader.removeEventListener(egret.IOErrorEvent.IO_ERROR, onError, self);\n                imageLoader.removeEventListener(egret.ProgressEvent.PROGRESS, onPostProgress, self);\n            }\n        };\n        /**\n         * @private\n         *\n         */\n        URLLoader.prototype.__recycle = function () {\n            this._request = null;\n            this.data = null;\n        };\n        return URLLoader;\n    }(egret.EventDispatcher));\n    egret.URLLoader = URLLoader;\n    __reflect(URLLoader.prototype, \"egret.URLLoader\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n    * @version Egret 2.4\n    * @platform Web,Native\n    * @includeExample extension/game/display/MovieClip.ts\n    * @language en_US\n    */\n    /**\n     * 影片剪辑，可以通过影片剪辑播放序列帧动画。MovieClip 类从以下类继承而来：DisplayObject 和 EventDispatcher。不同于 DisplayObject 对象，MovieClip 对象拥有一个时间轴。\n     * @extends egret.DisplayObject\n     * @event egret.Event.COMPLETE 动画播放完成。\n     * @event egret.Event.LOOP_COMPLETE 动画循环播放完成。循环最后一次只派发 COMPLETE 事件，不派发 LOOP_COMPLETE 事件。\n     * @see http://edn.egret.com/cn/docs/page/596 MovieClip序列帧动画\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/display/MovieClip.ts\n     * @language zh_CN\n     */\n    var MovieClip = (function (_super) {\n        __extends(MovieClip, _super);\n        //Construct Function\n        /**\n         * 创建新的 MovieClip 实例。创建 MovieClip 之后，调用舞台上的显示对象容器的addElement方法。\n         * @param movieClipData {movieClipData} 被引用的 movieClipData 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function MovieClip(movieClipData) {\n            var _this = _super.call(this) || this;\n            //Render Property\n            _this.$texture = null;\n            //Render Property\n            _this.offsetPoint = egret.Point.create(0, 0);\n            //Data Property\n            _this.$movieClipData = null;\n            /**\n             * @private\n             */\n            _this.frames = null;\n            /**\n             * @private\n             */\n            _this.$totalFrames = 0;\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @private\n             */\n            _this.frameLabels = null;\n            /**\n             * @private\n             */\n            _this.$frameLabelStart = 0;\n            /**\n             * @private\n             */\n            _this.$frameLabelEnd = 0;\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @private\n             */\n            _this.frameEvents = null;\n            /**\n             * @private\n             */\n            _this.frameIntervalTime = 0;\n            /**\n             * @private\n             */\n            _this.$eventPool = null;\n            //Animation Property\n            _this.$isPlaying = false;\n            /**\n             * @private\n             */\n            _this.isStopped = true;\n            /**\n             * @private\n             */\n            _this.playTimes = 0;\n            /**\n             * @private\n             */\n            _this.$currentFrameNum = 0;\n            /**\n             * @private\n             */\n            _this.$nextFrameNum = 1;\n            /**\n             * @private\n             */\n            _this.displayedKeyFrameNum = 0;\n            /**\n             * @private\n             */\n            _this.passedTime = 0;\n            /**\n             * @private\n             */\n            _this.$frameRate = NaN;\n            /**\n             * @private\n             */\n            _this.lastTime = 0;\n            _this.$smoothing = egret.Bitmap.defaultSmoothing;\n            _this.setMovieClipData(movieClipData);\n            if (!egret.nativeRender) {\n                _this.$renderNode = new egret.sys.NormalBitmapNode();\n            }\n            return _this;\n        }\n        MovieClip.prototype.createNativeDisplayObject = function () {\n            this.$nativeDisplayObject = new egret_native.NativeDisplayObject(11 /* BITMAP_TEXT */);\n        };\n        Object.defineProperty(MovieClip.prototype, \"smoothing\", {\n            /**\n             * Whether or not is smoothed when scaled.\n             * @version Egret 3.0\n             * @platform Web\n             * @language en_US\n             */\n            /**\n             * 控制在缩放时是否进行平滑处理。\n             * @version Egret 3.0\n             * @platform Web\n             * @language zh_CN\n             */\n            get: function () {\n                return this.$smoothing;\n            },\n            set: function (value) {\n                if (value == this.$smoothing) {\n                    return;\n                }\n                this.$smoothing = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         */\n        MovieClip.prototype.$init = function () {\n            this.$reset();\n            var movieClipData = this.$movieClipData;\n            if (movieClipData && movieClipData.$isDataValid()) {\n                this.frames = movieClipData.frames;\n                this.$totalFrames = movieClipData.numFrames;\n                this.frameLabels = movieClipData.labels;\n                this.frameEvents = movieClipData.events;\n                this.$frameRate = movieClipData.frameRate;\n                this.frameIntervalTime = 1000 / this.$frameRate;\n                this._initFrame();\n            }\n        };\n        /**\n         * @private\n         *\n         */\n        MovieClip.prototype.$reset = function () {\n            this.frames = null;\n            this.playTimes = 0;\n            this.$isPlaying = false;\n            this.setIsStopped(true);\n            this.$currentFrameNum = 0;\n            this.$nextFrameNum = 1;\n            this.displayedKeyFrameNum = 0;\n            this.passedTime = 0;\n            this.$eventPool = [];\n        };\n        /**\n         * @private\n         *\n         */\n        MovieClip.prototype._initFrame = function () {\n            if (this.$movieClipData.$isTextureValid()) {\n                this.advanceFrame();\n                this.constructFrame();\n            }\n        };\n        /**\n         * @private\n         */\n        MovieClip.prototype.$updateRenderNode = function () {\n            var texture = this.$texture;\n            if (texture) {\n                var offsetX = Math.round(this.offsetPoint.x);\n                var offsetY = Math.round(this.offsetPoint.y);\n                var bitmapWidth = texture.$bitmapWidth;\n                var bitmapHeight = texture.$bitmapHeight;\n                var textureWidth = texture.$getTextureWidth();\n                var textureHeight = texture.$getTextureHeight();\n                var destW = Math.round(texture.$getScaleBitmapWidth());\n                var destH = Math.round(texture.$getScaleBitmapHeight());\n                var sourceWidth = texture.$sourceWidth;\n                var sourceHeight = texture.$sourceHeight;\n                egret.sys.BitmapNode.$updateTextureData(this.$renderNode, texture.$bitmapData, texture.$bitmapX, texture.$bitmapY, bitmapWidth, bitmapHeight, offsetX, offsetY, textureWidth, textureHeight, destW, destH, sourceWidth, sourceHeight, egret.BitmapFillMode.SCALE, this.$smoothing);\n            }\n        };\n        /**\n         * @private\n         */\n        MovieClip.prototype.$measureContentBounds = function (bounds) {\n            var texture = this.$texture;\n            if (texture) {\n                var x = this.offsetPoint.x;\n                var y = this.offsetPoint.y;\n                var w = texture.$getTextureWidth();\n                var h = texture.$getTextureHeight();\n                bounds.setTo(x, y, w, h);\n            }\n            else {\n                bounds.setEmpty();\n            }\n        };\n        /**\n         * @private\n         *\n         * @param stage\n         * @param nestLevel\n         */\n        MovieClip.prototype.$onAddToStage = function (stage, nestLevel) {\n            _super.prototype.$onAddToStage.call(this, stage, nestLevel);\n            if (this.$isPlaying && this.$totalFrames > 1) {\n                this.setIsStopped(false);\n            }\n        };\n        /**\n         * @private\n         *\n         */\n        MovieClip.prototype.$onRemoveFromStage = function () {\n            _super.prototype.$onRemoveFromStage.call(this);\n            this.setIsStopped(true);\n        };\n        //Data Function\n        /**\n         * @private\n         * 返回帧标签为指定字符串的FrameLabel对象\n         * @param labelName {string} 帧标签名\n         * @param ignoreCase {boolean} 是否忽略大小写，可选参数，默认false\n         * @returns {egret.FrameLabel} FrameLabel对象\n         */\n        MovieClip.prototype.getFrameLabelByName = function (labelName, ignoreCase) {\n            if (ignoreCase === void 0) { ignoreCase = false; }\n            if (ignoreCase) {\n                labelName = labelName.toLowerCase();\n            }\n            var frameLabels = this.frameLabels;\n            if (frameLabels) {\n                var outputFramelabel = null;\n                for (var i = 0; i < frameLabels.length; i++) {\n                    outputFramelabel = frameLabels[i];\n                    if (ignoreCase ? outputFramelabel.name.toLowerCase() == labelName : outputFramelabel.name == labelName) {\n                        return outputFramelabel;\n                    }\n                }\n            }\n            return null;\n        };\n        /**\n         * @private\n         * 根据帧标签，设置开始和结束的帧数\n         * @param labelName {string} 帧标签名\n         */\n        MovieClip.prototype.getFrameStartEnd = function (labelName) {\n            var frameLabels = this.frameLabels;\n            if (frameLabels) {\n                var outputFramelabel = null;\n                for (var i = 0; i < frameLabels.length; i++) {\n                    outputFramelabel = frameLabels[i];\n                    if (labelName == outputFramelabel.name) {\n                        this.$frameLabelStart = outputFramelabel.frame;\n                        this.$frameLabelEnd = outputFramelabel.end;\n                        break;\n                    }\n                }\n            }\n        };\n        /**\n         * @private\n         * 返回指定序号的帧的FrameLabel对象\n         * @param frame {number} 帧序号\n         * @returns {egret.FrameLabel} FrameLabel对象\n         */\n        MovieClip.prototype.getFrameLabelByFrame = function (frame) {\n            var frameLabels = this.frameLabels;\n            if (frameLabels) {\n                var outputFramelabel = null;\n                for (var i = 0; i < frameLabels.length; i++) {\n                    outputFramelabel = frameLabels[i];\n                    if (outputFramelabel.frame == frame) {\n                        return outputFramelabel;\n                    }\n                }\n            }\n            return null;\n        };\n        /**\n         * @private\n         * 返回指定序号的帧对应的FrameLabel对象，如果当前帧没有标签，则返回前面最近的有标签的帧的FrameLabel对象\n         * @method egret.MovieClip#getFrameLabelForFrame\n         * @param frame {number} 帧序号\n         * @returns {egret.FrameLabel} FrameLabel对象\n         */\n        MovieClip.prototype.getFrameLabelForFrame = function (frame) {\n            var outputFrameLabel = null;\n            var tempFrameLabel = null;\n            var frameLabels = this.frameLabels;\n            if (frameLabels) {\n                for (var i = 0; i < frameLabels.length; i++) {\n                    tempFrameLabel = frameLabels[i];\n                    if (tempFrameLabel.frame > frame) {\n                        return outputFrameLabel;\n                    }\n                    outputFrameLabel = tempFrameLabel;\n                }\n            }\n            return outputFrameLabel;\n        };\n        //Animation Function\n        /**\n         * 继续播放当前动画\n         * @param playTimes {number} 播放次数。 参数为整数，可选参数，>=1：设定播放次数，<0：循环播放，默认值 0：不改变播放次数(MovieClip初始播放次数设置为1)，\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MovieClip.prototype.play = function (playTimes) {\n            if (playTimes === void 0) { playTimes = 0; }\n            this.lastTime = egret.getTimer();\n            this.passedTime = 0;\n            this.$isPlaying = true;\n            this.setPlayTimes(playTimes);\n            if (this.$totalFrames > 1 && this.$stage) {\n                this.setIsStopped(false);\n            }\n        };\n        /**\n         * 暂停播放动画\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MovieClip.prototype.stop = function () {\n            this.$isPlaying = false;\n            this.setIsStopped(true);\n        };\n        /**\n         * 将播放头移到前一帧并停止\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MovieClip.prototype.prevFrame = function () {\n            this.gotoAndStop(this.$currentFrameNum - 1);\n        };\n        /**\n         * 跳到后一帧并停止\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MovieClip.prototype.nextFrame = function () {\n            this.gotoAndStop(this.$currentFrameNum + 1);\n        };\n        /**\n         * 将播放头移到指定帧并播放\n         * @param frame {any} 指定帧的帧号或帧标签\n         * @param playTimes {number} 播放次数。 参数为整数，可选参数，>=1：设定播放次数，<0：循环播放，默认值 0：不改变播放次数，\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MovieClip.prototype.gotoAndPlay = function (frame, playTimes) {\n            if (playTimes === void 0) { playTimes = 0; }\n            if (arguments.length == 0 || arguments.length > 2) {\n                egret.$error(1022, \"MovieClip.gotoAndPlay()\");\n            }\n            if (typeof frame === \"string\") {\n                this.getFrameStartEnd(frame);\n            }\n            else {\n                this.$frameLabelStart = 0;\n                this.$frameLabelEnd = 0;\n            }\n            this.play(playTimes);\n            this.gotoFrame(frame);\n        };\n        /**\n         * 将播放头移到指定帧并停止\n         * @param frame {any} 指定帧的帧号或帧标签\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MovieClip.prototype.gotoAndStop = function (frame) {\n            if (arguments.length != 1) {\n                egret.$error(1022, \"MovieClip.gotoAndStop()\");\n            }\n            this.stop();\n            this.gotoFrame(frame);\n        };\n        /**\n         * @private\n         *\n         * @param frame\n         */\n        MovieClip.prototype.gotoFrame = function (frame) {\n            var frameNum;\n            if (typeof frame === \"string\") {\n                frameNum = this.getFrameLabelByName(frame).frame;\n            }\n            else {\n                frameNum = parseInt(frame + '', 10);\n                if (frameNum != frame) {\n                    egret.$error(1022, \"Frame Label Not Found\");\n                }\n            }\n            if (frameNum < 1) {\n                frameNum = 1;\n            }\n            else if (frameNum > this.$totalFrames) {\n                frameNum = this.$totalFrames;\n            }\n            if (frameNum == this.$nextFrameNum) {\n                return;\n            }\n            this.$nextFrameNum = frameNum;\n            this.advanceFrame();\n            this.constructFrame();\n            this.handlePendingEvent();\n        };\n        /**\n         * @private\n         *\n         * @param advancedTime\n         * @returns\n         */\n        MovieClip.prototype.advanceTime = function (timeStamp) {\n            var self = this;\n            var advancedTime = timeStamp - self.lastTime;\n            self.lastTime = timeStamp;\n            var frameIntervalTime = self.frameIntervalTime;\n            var currentTime = self.passedTime + advancedTime;\n            self.passedTime = currentTime % frameIntervalTime;\n            var num = currentTime / frameIntervalTime;\n            if (num < 1) {\n                return false;\n            }\n            while (num >= 1) {\n                num--;\n                self.$nextFrameNum++;\n                if (self.$nextFrameNum > self.$totalFrames || (self.$frameLabelStart > 0 && self.$nextFrameNum > self.$frameLabelEnd)) {\n                    if (self.playTimes == -1) {\n                        self.$eventPool.push(egret.Event.LOOP_COMPLETE);\n                        self.$nextFrameNum = 1;\n                    }\n                    else {\n                        self.playTimes--;\n                        if (self.playTimes > 0) {\n                            self.$eventPool.push(egret.Event.LOOP_COMPLETE);\n                            self.$nextFrameNum = 1;\n                        }\n                        else {\n                            self.$nextFrameNum = self.$totalFrames;\n                            self.$eventPool.push(egret.Event.COMPLETE);\n                            self.stop();\n                            break;\n                        }\n                    }\n                }\n                if (self.$currentFrameNum == self.$frameLabelEnd) {\n                    self.$nextFrameNum = self.$frameLabelStart;\n                }\n                self.advanceFrame();\n            }\n            self.constructFrame();\n            self.handlePendingEvent();\n            return false;\n        };\n        /**\n         * @private\n         *\n         */\n        MovieClip.prototype.advanceFrame = function () {\n            this.$currentFrameNum = this.$nextFrameNum;\n            var event = this.frameEvents[this.$nextFrameNum];\n            if (event && event != \"\") {\n                egret.MovieClipEvent.dispatchMovieClipEvent(this, egret.MovieClipEvent.FRAME_LABEL, event);\n            }\n        };\n        /**\n         * @private\n         *\n         */\n        MovieClip.prototype.constructFrame = function () {\n            var self = this;\n            var currentFrameNum = self.$currentFrameNum;\n            if (self.displayedKeyFrameNum == currentFrameNum) {\n                return;\n            }\n            var texture = self.$movieClipData.getTextureByFrame(currentFrameNum);\n            self.$texture = texture;\n            self.$movieClipData.$getOffsetByFrame(currentFrameNum, self.offsetPoint);\n            self.displayedKeyFrameNum = currentFrameNum;\n            self.$renderDirty = true;\n            if (egret.nativeRender) {\n                self.$nativeDisplayObject.setDataToBitmapNode(self.$nativeDisplayObject.id, texture, [texture.$bitmapX, texture.$bitmapY, texture.$bitmapWidth, texture.$bitmapHeight,\n                    self.offsetPoint.x, self.offsetPoint.y, texture.$getScaleBitmapWidth(), texture.$getScaleBitmapHeight(),\n                    texture.$sourceWidth, texture.$sourceHeight]);\n                //todo 负数offsetPoint\n                self.$nativeDisplayObject.setWidth(texture.$getTextureWidth() + self.offsetPoint.x);\n                self.$nativeDisplayObject.setHeight(texture.$getTextureHeight() + self.offsetPoint.y);\n            }\n            else {\n                var p = self.$parent;\n                if (p && !p.$cacheDirty) {\n                    p.$cacheDirty = true;\n                    p.$cacheDirtyUp();\n                }\n                var maskedObject = self.$maskedObject;\n                if (maskedObject && !maskedObject.$cacheDirty) {\n                    maskedObject.$cacheDirty = true;\n                    maskedObject.$cacheDirtyUp();\n                }\n            }\n        };\n        /**\n         * @private\n         *\n         */\n        MovieClip.prototype.$renderFrame = function () {\n            var self = this;\n            self.$texture = self.$movieClipData.getTextureByFrame(self.$currentFrameNum);\n            self.$renderDirty = true;\n            var p = self.$parent;\n            if (p && !p.$cacheDirty) {\n                p.$cacheDirty = true;\n                p.$cacheDirtyUp();\n            }\n            var maskedObject = self.$maskedObject;\n            if (maskedObject && !maskedObject.$cacheDirty) {\n                maskedObject.$cacheDirty = true;\n                maskedObject.$cacheDirtyUp();\n            }\n        };\n        /**\n         * @private\n         *\n         */\n        MovieClip.prototype.handlePendingEvent = function () {\n            if (this.$eventPool.length != 0) {\n                this.$eventPool.reverse();\n                var eventPool = this.$eventPool;\n                var length_3 = eventPool.length;\n                var isComplete = false;\n                var isLoopComplete = false;\n                for (var i = 0; i < length_3; i++) {\n                    var event_1 = eventPool.pop();\n                    if (event_1 == egret.Event.LOOP_COMPLETE) {\n                        isLoopComplete = true;\n                    }\n                    else if (event_1 == egret.Event.COMPLETE) {\n                        isComplete = true;\n                    }\n                    else {\n                        this.dispatchEventWith(event_1);\n                    }\n                }\n                if (isLoopComplete) {\n                    this.dispatchEventWith(egret.Event.LOOP_COMPLETE);\n                }\n                if (isComplete) {\n                    this.dispatchEventWith(egret.Event.COMPLETE);\n                }\n            }\n        };\n        Object.defineProperty(MovieClip.prototype, \"totalFrames\", {\n            //Properties\n            /**\n             * MovieClip 实例中帧的总数\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$totalFrames;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClip.prototype, \"currentFrame\", {\n            /**\n             * MovieClip 实例当前播放的帧的序号\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$currentFrameNum;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClip.prototype, \"currentFrameLabel\", {\n            /**\n             * MovieClip 实例当前播放的帧的标签。如果当前帧没有标签，则 currentFrameLabel返回null。\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                var label = this.getFrameLabelByFrame(this.$currentFrameNum);\n                return label && label.name;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClip.prototype, \"currentLabel\", {\n            /**\n             * 当前播放的帧对应的标签，如果当前帧没有标签，则currentLabel返回包含标签的先前帧的标签。如果当前帧和先前帧都不包含标签，currentLabel返回null。\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                var label = this.getFrameLabelForFrame(this.$currentFrameNum);\n                return label ? label.name : null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClip.prototype, \"frameRate\", {\n            /**\n             * MovieClip 实例的帧频\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$frameRate;\n            },\n            set: function (value) {\n                if (value == this.$frameRate) {\n                    return;\n                }\n                this.$frameRate = value;\n                this.frameIntervalTime = 1000 / this.$frameRate;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClip.prototype, \"isPlaying\", {\n            /**\n             * MovieClip 实例当前是否正在播放\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$isPlaying;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClip.prototype, \"movieClipData\", {\n            /**\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return this.$movieClipData;\n            },\n            /**\n             * MovieClip数据源\n             */\n            set: function (value) {\n                this.setMovieClipData(value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @private\n         *\n         * @param value\n         */\n        MovieClip.prototype.setMovieClipData = function (value) {\n            if (this.$movieClipData == value) {\n                return;\n            }\n            this.$movieClipData = value;\n            this.$init();\n        };\n        /**\n         * @private\n         *\n         * @param value\n         */\n        MovieClip.prototype.setPlayTimes = function (value) {\n            if (value < 0 || value >= 1) {\n                this.playTimes = value < 0 ? -1 : Math.floor(value);\n            }\n        };\n        /**\n         * @private\n         *\n         * @param value\n         */\n        MovieClip.prototype.setIsStopped = function (value) {\n            if (this.isStopped == value) {\n                return;\n            }\n            this.isStopped = value;\n            if (value) {\n                egret.ticker.$stopTick(this.advanceTime, this);\n            }\n            else {\n                this.playTimes = this.playTimes == 0 ? 1 : this.playTimes;\n                this.lastTime = egret.getTimer();\n                egret.ticker.$startTick(this.advanceTime, this);\n            }\n        };\n        return MovieClip;\n    }(egret.DisplayObject));\n    egret.MovieClip = MovieClip;\n    __reflect(MovieClip.prototype, \"egret.MovieClip\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The URLRequest class captures all of the information in a single HTTP request.\n     * @see http://edn.egret.com/cn/index.php/article/index/id/601 Build communication request\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLRequest.ts\n     * @language en_US\n     */\n    /**\n     * URLRequest 类可捕获单个 HTTP 请求中的所有信息。\n     * @see http://edn.egret.com/cn/index.php/article/index/id/601 构建通信请求\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLRequest.ts\n     * @language zh_CN\n     */\n    var URLRequest = (function (_super) {\n        __extends(URLRequest, _super);\n        /**\n         * Create an egret.URLRequest object\n         * @param url {string} Addresses for URL requests\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.URLRequest 对象\n         * @param url {string} 进行网络请求的地址\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function URLRequest(url) {\n            if (url === void 0) { url = null; }\n            var _this = _super.call(this) || this;\n            /**\n             * An object contains data to be transmitted with the URL request.\n             * This property is used in conjunction with the method property.  When the value of method is GET, the value of data is appended to the value of URLRequest.url, using HTTP query-string syntax.\n             * When the method value is POST (or any value other than GET), the value of data is transmitted in the body of the HTTP request.\n             * The URLRequest API offers binary POST support and support for URL-encoded variables, as well as support for strings. The data object can be a ArrayBuffer, URLVariables, or String object.\n             * The way in which the data is used depends on the type of object used:\n             * If the object is a ArrayBuffer object, the binary data of the ArrayBuffer object is used as POST data. For GET, data of ArrayBuffer type is not supported.\n             * If the object is a URLVariables object and the method is POST, then the variables are encoded using x-www-form-urlencoded format and the resulting string is used as POST data.\n             * If the object is a URLVariables object and the method is GET, the URLVariables object will define variables to be sent with the URLRequest object.\n             * Otherwise, the object is converted into a string, and the string is used as the POST or GET data.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 一个对象，它包含将随 URL 请求一起传输的数据。\n             * 该属性与 method 属性配合使用。当 method 值为 GET 时，将使用 HTTP 查询字符串语法将 data 值追加到 URLRequest.url 值。\n             * 当 method 值为 POST（或 GET 之外的任何值）时，将在 HTTP 请求体中传输 data 值。\n             * URLRequest API 支持二进制 POST，并支持 URL 编码变量和字符串。该数据对象可以是 ArrayBuffer、URLVariables 或 String 对象。\n             * 该数据的使用方式取决于所用对象的类型：\n             * 如果该对象为 ArrayBuffer 对象，则 ArrayBuffer 对象的二进制数据用作 POST 数据。对于 GET，不支持 ArrayBuffer 类型的数据。\n             * 如果该对象是 URLVariables 对象，并且该方法是 POST，则使用 x-www-form-urlencoded 格式对变量进行编码，并且生成的字符串会用作 POST 数据。\n             * 如果该对象是 URLVariables 对象，并且该方法是 GET，则 URLVariables 对象将定义要随 URLRequest 对象一起发送的变量。\n             * 否则，该对象会转换为字符串，并且该字符串会用作 POST 或 GET 数据。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.data = null;\n            /**\n             * Request method, valid values are URLRequestMethod.GET or URLRequestMethod.POST.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 请求方式，有效值为URLRequestMethod.GET 或 URLRequestMethod.POST。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.method = egret.URLRequestMethod.GET;\n            /**\n             * The requested URL.\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 所请求的 URL。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.url = \"\";\n            /**\n             * The array of HTTP request headers to be appended to the HTTP request. The array is composed of URLRequestHeader objects.\n             * Each object in the array must be a URLRequestHeader object that contains a name string and a value string.\n             * Because of browser compatibility, this property has not been achieved in html5\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 要追加到 HTTP 请求的 HTTP 请求标头的数组。该数组由 URLRequestHeader 对象组成。\n             * 数组中的每一对象必须是包含一个名称字符串和一个值字符串的 URLRequestHeader 对象。\n             * 由于浏览器兼容性原因，该属性在 html5 中并未实现\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.requestHeaders = [];\n            _this.url = url;\n            return _this;\n        }\n        return URLRequest;\n    }(egret.HashObject));\n    egret.URLRequest = URLRequest;\n    __reflect(URLRequest.prototype, \"egret.URLRequest\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * A URLRequestHeader object encapsulates a single HTTP request header and consists of a name/value pair.  URLRequestHeader objects are used in the requestHeaders property of the URLRequest class.\n     * Note: Because of browser compatibility, this property has not been achieved in html5\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLRequestHeader.ts\n     * @language en_US\n     */\n    /**\n     * URLRequestHeader 对象封装了一个 HTTP 请求标头并由一个名称/值对组成。URLRequestHeader 对象在 URLRequest 类的 requestHeaders 属性中使用。\n     * 注意：由于浏览器兼容性原因，在 html5 中并未实现\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLRequestHeader.ts\n     * @language zh_CN\n     */\n    var URLRequestHeader = (function () {\n        /**\n         * Create an egret.URLRequestHeader object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.URLRequestHeader 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function URLRequestHeader(name, value) {\n            /**\n             * HTTP request header name, such as Content-Type\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * HTTP 请求标头名称，如 Content-Type\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            this.name = \"\";\n            /**\n             * The values associated with the name property (such as text/plain).\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 与 name 属性相关联的值，如 text/plain\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            this.value = \"\";\n            this.name = name;\n            this.value = value;\n        }\n        return URLRequestHeader;\n    }());\n    egret.URLRequestHeader = URLRequestHeader;\n    __reflect(URLRequestHeader.prototype, \"egret.URLRequestHeader\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The URLRequestMethod class provides values that specify whether the\n     * URLRequest object should use the POST method or the GET method when sending data to a server.\n     * @see http://edn.egret.com/cn/docs/page/599 POST与GET\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLRequestMethod.ts\n     * @language en_US\n     */\n    /**\n     * URLRequestMethod 类提供了一些值，这些值可指定在将数据发送到服务器时，\n     * URLRequest 对象应使用 POST 方法还是 GET 方法。\n     * @see http://edn.egret.com/cn/docs/page/599 POST与GET\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLRequestMethod.ts\n     * @language zh_CN\n     */\n    var URLRequestMethod = (function () {\n        function URLRequestMethod() {\n        }\n        /**\n         * Specify that the URLRequest object is a GET.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 URLRequest 对象是一个 GET。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        URLRequestMethod.GET = \"get\";\n        /**\n         * Specify that the URLRequest object is a POST.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 URLRequest 对象是一个 POST。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        URLRequestMethod.POST = \"post\";\n        return URLRequestMethod;\n    }());\n    egret.URLRequestMethod = URLRequestMethod;\n    __reflect(URLRequestMethod.prototype, \"egret.URLRequestMethod\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * The URLVariables class allows you to transfer variables between an application and a server.\n     * Use URLVariables objects with methods of the URLLoader class and the data property of the URLRequest class.\n     * @see http://edn.egret.com/cn/docs/page/598 Send the request with parameters\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLVariables.ts\n     * @language en_US\n     */\n    /**\n     * 使用 URLVariables 类可以在应用程序和服务器之间传输变量。\n     * 将 URLVariables 对象与 URLLoader 类的方法、URLRequest 类的 data 属性一起使用。\n     * @see http://edn.egret.com/cn/docs/page/598 发送带参数的请求\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/net/URLVariables.ts\n     * @language zh_CN\n     */\n    var URLVariables = (function (_super) {\n        __extends(URLVariables, _super);\n        /**\n         * Create an egret.URLVariable object\n         * @param source {String} A URL-encoded string containing name/value pairs.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.URLVariables 对象\n         * @param source {String} 包含名称/值对的 URL 编码的字符串。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function URLVariables(source) {\n            if (source === void 0) { source = null; }\n            var _this = _super.call(this) || this;\n            /**\n             * Key-value pair data object saved in this URLVariables object\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 此 URLVariables 储存的键值对数据对象。\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            _this.variables = null;\n            if (source !== null) {\n                _this.decode(source);\n            }\n            return _this;\n        }\n        /**\n         * Convert the variable string into the property of this URLVariables.variables object.\n         * @param source {string}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将变量字符串转换为此 URLVariables.variables 对象的属性。\n         * @param source {string}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        URLVariables.prototype.decode = function (source) {\n            if (!this.variables) {\n                this.variables = {};\n            }\n            source = source.split(\"+\").join(\" \");\n            var tokens, re = /[?&]?([^=]+)=([^&]*)/g;\n            while (tokens = re.exec(source)) {\n                var key = decodeURIComponent(tokens[1]), val = decodeURIComponent(tokens[2]);\n                //没有重复键值，直接赋值\n                if ((key in this.variables) == false) {\n                    this.variables[key] = val;\n                    continue;\n                }\n                //有重复键值，如果已经存在数组，直接push到数组，否则创建一个新数组\n                var value = this.variables[key];\n                if (value instanceof Array) {\n                    value.push(val);\n                }\n                else {\n                    this.variables[key] = [value, val];\n                }\n            }\n        };\n        /**\n         * Return a string containing all enumerable variables using  the MIME content encoding format : application/x-www-form-urlencoded.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 以 MIME 内容编码格式 application/x-www-form-urlencoded 返回包含所有可枚举变量的字符串。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        URLVariables.prototype.toString = function () {\n            if (!this.variables) {\n                return \"\";\n            }\n            var variables = this.variables;\n            var stringArray = [];\n            for (var key in variables) {\n                stringArray.push(this.encodeValue(key, variables[key]));\n            }\n            return stringArray.join(\"&\");\n        };\n        /**\n         * @private\n         *\n         * @param key\n         * @param value\n         */\n        URLVariables.prototype.encodeValue = function (key, value) {\n            if (value instanceof Array) {\n                return this.encodeArray(key, value);\n            }\n            else {\n                return encodeURIComponent(key) + \"=\" + encodeURIComponent(value);\n            }\n        };\n        /**\n         * @private\n         *\n         * @param key\n         * @param value\n         */\n        URLVariables.prototype.encodeArray = function (key, value) {\n            if (!key)\n                return \"\";\n            if (value.length == 0) {\n                return encodeURIComponent(key) + \"=\";\n            }\n            return value.map(function (v) { return encodeURIComponent(key) + \"=\" + encodeURIComponent(v); }).join(\"&\");\n        };\n        return URLVariables;\n    }(egret.HashObject));\n    egret.URLVariables = URLVariables;\n    __reflect(URLVariables.prototype, \"egret.URLVariables\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n    * @version Egret 2.4\n    * @platform Web,Native\n    * @includeExample extension/game/player/Ticker.ts\n    * @language en_US\n    */\n    /**\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/player/Ticker.ts\n     * @language zh_CN\n     */\n    var Ticker = (function (_super) {\n        __extends(Ticker, _super);\n        /**\n         * @deprecated\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function Ticker() {\n            var _this = _super.call(this) || this;\n            _this._timeScale = 1;\n            _this._paused = false;\n            _this._callIndex = -1;\n            _this._lastTime = 0;\n            _this.callBackList = [];\n            if (Ticker.instance != null) {\n                if (true) {\n                    egret.$error(1033);\n                }\n            }\n            egret.ticker.$startTick(_this.update, _this);\n            _this._lastTime = egret.getTimer();\n            return _this;\n        }\n        Ticker.prototype.update = function (timeStamp) {\n            var advancedTime = timeStamp - this._lastTime;\n            this._lastTime = timeStamp;\n            if (this._paused) {\n                return false;\n            }\n            var frameTime = advancedTime * this._timeScale;\n            this._callList = this.callBackList.concat();\n            this._callIndex = 0;\n            for (; this._callIndex < this._callList.length; this._callIndex++) {\n                var eventBin = this._callList[this._callIndex];\n                eventBin.listener.call(eventBin.thisObject, frameTime);\n            }\n            this._callIndex = -1;\n            this._callList = null;\n            return false;\n        };\n        /**\n         * 注册帧回调事件，同一函数的重复监听会被忽略。推荐使用 egret.startTick 替代此方法。\n         * @method egret.Ticker#register\n         * @param listener {Function} 帧回调函数,参数返回上一帧和这帧的间隔时间。示例：onEnterFrame(frameTime:number):void\n         * @param thisObject {any} 帧回调函数的this对象\n         * @param priority {number} 事件优先级，开发者请勿传递 Number.NEGATIVE_INFINITY 和 Number.POSITIVE_INFINITY\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @deprecated\n         */\n        Ticker.prototype.register = function (listener, thisObject, priority) {\n            if (priority === void 0) { priority = 0; }\n            this.$insertEventBin(this.callBackList, \"\", listener, thisObject, false, priority, false);\n        };\n        /**\n         * 取消侦听enterFrame事件。推荐使用 egret.stopTick 替代此方法。\n         * @method egret.Ticker#unregister\n         * @param listener {Function} 事件侦听函数\n         * @param thisObject {any} 侦听函数的this对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @deprecated\n         */\n        Ticker.prototype.unregister = function (listener, thisObject) {\n            this.$removeEventBin(this.callBackList, listener, thisObject);\n        };\n        /**\n         * @deprecated\n         * @param timeScale {number}\n         * @private\n         */\n        Ticker.prototype.setTimeScale = function (timeScale) {\n            this._timeScale = timeScale;\n        };\n        /**\n         * @deprecated\n         * @method egret.Ticker#getTimeScale\n         * @private\n         */\n        Ticker.prototype.getTimeScale = function () {\n            return this._timeScale;\n        };\n        /**\n         * 暂停\n         * @deprecated\n         * @method egret.Ticker#pause\n         */\n        Ticker.prototype.pause = function () {\n            this._paused = true;\n        };\n        /**\n         * 继续\n         * @deprecated\n         * @method egret.Ticker#resume\n         */\n        Ticker.prototype.resume = function () {\n            this._paused = false;\n        };\n        /**\n         * @method egret.Ticker.getInstance\n         * @returns {Ticker}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @deprecated\n         */\n        Ticker.getInstance = function () {\n            if (Ticker.instance == null) {\n                Ticker.instance = new Ticker();\n            }\n            return Ticker.instance;\n        };\n        return Ticker;\n    }(egret.EventDispatcher));\n    egret.Ticker = Ticker;\n    __reflect(Ticker.prototype, \"egret.Ticker\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * @class egret.MainContext\n     * @classdesc\n     * MainContext是游戏的核心跨平台接口，组合了多个功能Context，并是游戏启动的主入口\n     * @extends egret.EventDispatcher\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    var MainContext = (function (_super) {\n        __extends(MainContext, _super);\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function MainContext() {\n            return _super.call(this) || this;\n        }\n        Object.defineProperty(MainContext.prototype, \"stage\", {\n            /**\n             * 渲染Context\n             * @member egret.MainContext#rendererContext\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            //public rendererContext:RendererContext = null;\n            /**\n             * 触摸Context\n             * @member egret.MainContext#touchContext\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            //public touchContext:TouchContext = null;\n            /**\n             * 设备divice\n             * @member egret.MainContext#deviceContext\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            //public deviceContext:DeviceContext = null;\n            /**\n             * 舞台\n             * @member egret.MainContext#stage\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                return egret.sys.$TempStage;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MainContext, \"instance\", {\n            /**\n             * @method egret.Ticker.getInstance\n             * @returns {Ticker}\n             * @version Egret 2.4\n             * @platform Web,Native\n             */\n            get: function () {\n                if (MainContext._instance == null) {\n                    MainContext._instance = new MainContext();\n                }\n                return MainContext._instance;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MainContext.deviceType = null;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MainContext.DEVICE_PC = \"web\";\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MainContext.DEVICE_MOBILE = \"native\";\n        return MainContext;\n    }(egret.EventDispatcher));\n    egret.MainContext = MainContext;\n    __reflect(MainContext.prototype, \"egret.MainContext\");\n})(egret || (egret = {}));\n/**\n * @private\n */\negret[\"testDeviceType1\"] = function () {\n    if (!window[\"navigator\"] || !navigator) {\n        return true;\n    }\n    var ua = navigator.userAgent.toLowerCase();\n    return (ua.indexOf('mobile') != -1 || ua.indexOf('android') != -1);\n};\negret.MainContext.deviceType = egret[\"testDeviceType1\"]() ? egret.MainContext.DEVICE_MOBILE : egret.MainContext.DEVICE_PC;\ndelete egret[\"testDeviceType1\"];\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Tool class for object cache repeat use, which can be used to construct an object pool. Objects are automatically recycled after a certain duration.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/utils/Recycler.ts\n     * @private\n     * @language en_US\n     */\n    /**\n     * 对象缓存复用工具类，可用于构建对象池，一段时间后会自动回收对象。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/utils/Recycler.ts\n     * @private\n     * @language zh_CN\n     */\n    var Recycler = (function (_super) {\n        __extends(Recycler, _super);\n        /**\n         * Create an egret.Recycler object\n         * @param autoDisposeTime {number} Number of frames when objects are destroyed automatically. Default value: 300\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.Recycler 对象\n         * @param autoDisposeTime {number} 多少帧后自动销毁对象，默认值300\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function Recycler(autoDisposeTime) {\n            if (autoDisposeTime === void 0) { autoDisposeTime = 300; }\n            var _this = _super.call(this) || this;\n            /**\n             * @private\n             */\n            _this.objectPool = [];\n            /**\n             * @private\n             */\n            _this._length = 0;\n            if (autoDisposeTime < 1)\n                autoDisposeTime = 1;\n            _this.autoDisposeTime = autoDisposeTime;\n            _this.frameCount = 0;\n            return _this;\n        }\n        Recycler.$init = function () {\n            egret.ticker.$startTick(Recycler.onUpdate, Recycler);\n        };\n        Recycler.onUpdate = function (timeStamp) {\n            var list = Recycler._callBackList;\n            for (var i = list.length - 1; i >= 0; i--) {\n                list[i].$checkFrame();\n            }\n            return false;\n        };\n        /**\n         * @private\n         *\n         */\n        Recycler.prototype.$checkFrame = function () {\n            this.frameCount--;\n            if (this.frameCount <= 0) {\n                this.dispose();\n            }\n        };\n        Object.defineProperty(Recycler.prototype, \"length\", {\n            /**\n             * Number of cached objects\"\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 缓存的对象数量\n             * @version Egret 2.4\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            get: function () {\n                return this._length;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        /**\n         * Cache an object for repeat use\n         * @param object {any} The object to be cached\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 缓存一个对象以复用\n         * @param object {any} 需要缓存的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Recycler.prototype.push = function (object) {\n            var pool = this.objectPool;\n            if (pool.indexOf(object) == -1) {\n                pool.push(object);\n                if (object.__recycle) {\n                    object.__recycle();\n                }\n                this._length++;\n                if (this.frameCount == 0) {\n                    this.frameCount = this.autoDisposeTime;\n                    Recycler._callBackList.push(this);\n                }\n            }\n        };\n        /**\n         * Obtain a cached object\n         * @returns {any} The obtained cached object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取一个缓存的对象\n         * @returns {any} 获得的缓存对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Recycler.prototype.pop = function () {\n            if (this._length == 0)\n                return null;\n            this._length--;\n            return this.objectPool.pop();\n        };\n        /**\n         * Immediately clear all cached objects.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 立即清空所有缓存的对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Recycler.prototype.dispose = function () {\n            if (this._length > 0) {\n                this.objectPool = [];\n                this._length = 0;\n            }\n            this.frameCount = 0;\n            var list = Recycler._callBackList;\n            var index = list.indexOf(this);\n            if (index != -1) {\n                list.splice(index, 1);\n            }\n        };\n        /**\n         * @private\n         */\n        Recycler._callBackList = [];\n        return Recycler;\n    }(egret.HashObject));\n    egret.Recycler = Recycler;\n    __reflect(Recycler.prototype, \"egret.Recycler\");\n    Recycler.$init();\n})(egret || (egret = {}));\nvar egret;\n(function (egret) {\n    var setIntervalCache = {};\n    var setIntervalIndex = 0;\n    var setIntervalCount = 0;\n    var lastTime = 0;\n    /**\n     * To specify a delay (in milliseconds) calls the function specified interval loop.\n     * @param listener {Function} Listener function\n     * @param thisObject {any} this object\n     * @param delay {number} Delay time, in milliseconds\n     * @param ...args {any} Parameter list\n     * @returns {number} Return index which can be used for clearInterval\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/utils/setInterval.ts\n     * @language en_US\n     */\n    /**\n     * 以指定的延迟（以毫秒为单位）间隔循环调用指定的函数。\n     * @param listener {Function} 侦听函数\n     * @param thisObject {any} this对象\n     * @param delay {number} 延迟时间，以毫秒为单位\n     * @param ...args {any} 参数列表\n     * @returns {number} 返回索引，可以用于 clearInterval\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/utils/setInterval.ts\n     * @language zh_CN\n     */\n    function setInterval(listener, thisObject, delay) {\n        var args = [];\n        for (var _i = 3; _i < arguments.length; _i++) {\n            args[_i - 3] = arguments[_i];\n        }\n        var data = { listener: listener, thisObject: thisObject, delay: delay, originDelay: delay, params: args };\n        setIntervalCount++;\n        if (setIntervalCount == 1) {\n            lastTime = egret.getTimer();\n            egret.ticker.$startTick(intervalUpdate, null);\n        }\n        setIntervalIndex++;\n        setIntervalCache[setIntervalIndex] = data;\n        return setIntervalIndex;\n    }\n    egret.setInterval = setInterval;\n    /**\n     * Clear function to run after a specified delay.\n     * @param key {number} Index that egret.setInterval returns\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/setInterval.ts\n     * @language en_US\n     */\n    /**\n     * 清除指定延迟后运行的函数。\n     * @param key {number} egret.setInterval所返回的索引\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/setInterval.ts\n     * @language zh_CN\n     */\n    function clearInterval(key) {\n        if (setIntervalCache[key]) {\n            setIntervalCount--;\n            delete setIntervalCache[key];\n            if (setIntervalCount == 0) {\n                egret.ticker.$stopTick(intervalUpdate, null);\n            }\n        }\n    }\n    egret.clearInterval = clearInterval;\n    /**\n     * @private\n     *\n     * @param dt\n     */\n    function intervalUpdate(timeStamp) {\n        var dt = timeStamp - lastTime;\n        lastTime = timeStamp;\n        for (var key in setIntervalCache) {\n            var data = setIntervalCache[key];\n            data.delay -= dt;\n            if (data.delay <= 0) {\n                data.delay = data.originDelay;\n                data.listener.apply(data.thisObject, data.params);\n            }\n        }\n        return false;\n    }\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var setTimeoutCache = {};\n    var setTimeoutIndex = 0;\n    var setTimeoutCount = 0;\n    var lastTime = 0;\n    /**\n     * Run the designated function in specified delay (in milliseconds).\n     * @param listener {Function} Listener function\n     * @param thisObject {any} this object\n     * @param delay {number} Delay time, in milliseconds\n     * @param ...args {any} Parameter list\n     * @returns {number} Return index which can be used for clearTimeout\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/utils/setTimeout.ts\n     * @language en_US\n     */\n    /**\n     * 在指定的延迟（以毫秒为单位）后运行指定的函数。\n     * @param listener {Function} 侦听函数\n     * @param thisObject {any} this对象\n     * @param delay {number} 延迟时间，以毫秒为单位\n     * @param ...args {any} 参数列表\n     * @returns {number} 返回索引，可以用于 clearTimeout\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/game/utils/setTimeout.ts\n     * @language zh_CN\n     */\n    function setTimeout(listener, thisObject, delay) {\n        var args = [];\n        for (var _i = 3; _i < arguments.length; _i++) {\n            args[_i - 3] = arguments[_i];\n        }\n        var data = { listener: listener, thisObject: thisObject, delay: delay, params: args };\n        setTimeoutCount++;\n        if (setTimeoutCount == 1 && egret.ticker) {\n            lastTime = egret.getTimer();\n            egret.ticker.$startTick(timeoutUpdate, null);\n        }\n        setTimeoutIndex++;\n        setTimeoutCache[setTimeoutIndex] = data;\n        return setTimeoutIndex;\n    }\n    egret.setTimeout = setTimeout;\n    /**\n     * Function run after the specified delay is cleared.\n     * @param key {number} Index that egret.setTimeout returns\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 清除指定延迟后运行的函数。\n     * @param key {number} egret.setTimeout所返回的索引\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function clearTimeout(key) {\n        if (setTimeoutCache[key]) {\n            setTimeoutCount--;\n            delete setTimeoutCache[key];\n            if (setTimeoutCount == 0 && egret.ticker) {\n                egret.ticker.$stopTick(timeoutUpdate, null);\n            }\n        }\n    }\n    egret.clearTimeout = clearTimeout;\n    /**\n     * @private\n     *\n     * @param dt\n     */\n    function timeoutUpdate(timeStamp) {\n        var dt = timeStamp - lastTime;\n        lastTime = timeStamp;\n        for (var key in setTimeoutCache) {\n            var key2 = key;\n            var data = setTimeoutCache[key2];\n            data.delay -= dt;\n            if (data.delay <= 0) {\n                clearTimeout(key2);\n                data.listener.apply(data.thisObject, data.params);\n            }\n        }\n        return false;\n    }\n})(egret || (egret = {}));\n"
  },
  {
    "path": "demo/libs/modules/promise/promise.js",
    "content": "/*!\n * @overview es6-promise - a tiny implementation of Promises/A+.\n * @copyright Copyright (c) 2014 Yehuda Katz, Tom Dale, Stefan Penner and contributors (Conversion to ES6 API by Jake Archibald)\n * @license   Licensed under MIT license\n *            See https://raw.githubusercontent.com/stefanpenner/es6-promise/master/LICENSE\n * @version   4.0.5\n */\n\n(function (global, factory) {\n    typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n    typeof define === 'function' && define.amd ? define(factory) :\n    (global.ES6Promise = factory());\n}(this, (function () { 'use strict';\n\nfunction objectOrFunction(x) {\n  return typeof x === 'function' || typeof x === 'object' && x !== null;\n}\n\nfunction isFunction(x) {\n  return typeof x === 'function';\n}\n\nvar _isArray = undefined;\nif (!Array.isArray) {\n  _isArray = function (x) {\n    return Object.prototype.toString.call(x) === '[object Array]';\n  };\n} else {\n  _isArray = Array.isArray;\n}\n\nvar isArray = _isArray;\n\nvar len = 0;\nvar vertxNext = undefined;\nvar customSchedulerFn = undefined;\n\nvar asap = function asap(callback, arg) {\n  queue[len] = callback;\n  queue[len + 1] = arg;\n  len += 2;\n  if (len === 2) {\n    // If len is 2, that means that we need to schedule an async flush.\n    // If additional callbacks are queued before the queue is flushed, they\n    // will be processed by this flush that we are scheduling.\n    if (customSchedulerFn) {\n      customSchedulerFn(flush);\n    } else {\n      scheduleFlush();\n    }\n  }\n};\n\nfunction setScheduler(scheduleFn) {\n  customSchedulerFn = scheduleFn;\n}\n\nfunction setAsap(asapFn) {\n  asap = asapFn;\n}\n\nvar browserWindow = typeof window !== 'undefined' ? window : undefined;\nvar browserGlobal = browserWindow || {};\nvar BrowserMutationObserver = browserGlobal.MutationObserver || browserGlobal.WebKitMutationObserver;\nvar isNode = typeof self === 'undefined' && typeof process !== 'undefined' && ({}).toString.call(process) === '[object process]';\n\n// test for web worker but not in IE10\nvar isWorker = typeof Uint8ClampedArray !== 'undefined' && typeof importScripts !== 'undefined' && typeof MessageChannel !== 'undefined';\n\n// node\nfunction useNextTick() {\n  // node version 0.10.x displays a deprecation warning when nextTick is used recursively\n  // see https://github.com/cujojs/when/issues/410 for details\n  return function () {\n    return process.nextTick(flush);\n  };\n}\n\n// vertx\nfunction useVertxTimer() {\n  if (typeof vertxNext !== 'undefined') {\n    return function () {\n      vertxNext(flush);\n    };\n  }\n\n  return useSetTimeout();\n}\n\nfunction useMutationObserver() {\n  var iterations = 0;\n  var observer = new BrowserMutationObserver(flush);\n  var node = document.createTextNode('');\n  observer.observe(node, { characterData: true });\n\n  return function () {\n    node.data = iterations = ++iterations % 2;\n  };\n}\n\n// web worker\nfunction useMessageChannel() {\n  var channel = new MessageChannel();\n  channel.port1.onmessage = flush;\n  return function () {\n    return channel.port2.postMessage(0);\n  };\n}\n\nfunction useSetTimeout() {\n  // Store setTimeout reference so es6-promise will be unaffected by\n  // other code modifying setTimeout (like sinon.useFakeTimers())\n  var globalSetTimeout = setTimeout;\n  return function () {\n    return globalSetTimeout(flush, 1);\n  };\n}\n\nvar queue = new Array(1000);\nfunction flush() {\n  for (var i = 0; i < len; i += 2) {\n    var callback = queue[i];\n    var arg = queue[i + 1];\n\n    callback(arg);\n\n    queue[i] = undefined;\n    queue[i + 1] = undefined;\n  }\n\n  len = 0;\n}\n\nfunction attemptVertx() {\n  try {\n    var r = require;\n    var vertx = r('vertx');\n    vertxNext = vertx.runOnLoop || vertx.runOnContext;\n    return useVertxTimer();\n  } catch (e) {\n    return useSetTimeout();\n  }\n}\n\nvar scheduleFlush = undefined;\n// Decide what async method to use to triggering processing of queued callbacks:\nif (isNode) {\n  scheduleFlush = useNextTick();\n} else if (BrowserMutationObserver) {\n  scheduleFlush = useMutationObserver();\n} else if (isWorker) {\n  scheduleFlush = useMessageChannel();\n} else if (browserWindow === undefined && typeof require === 'function') {\n  scheduleFlush = attemptVertx();\n} else {\n  scheduleFlush = useSetTimeout();\n}\n\nfunction then(onFulfillment, onRejection) {\n  var _arguments = arguments;\n\n  var parent = this;\n\n  var child = new this.constructor(noop);\n\n  if (child[PROMISE_ID] === undefined) {\n    makePromise(child);\n  }\n\n  var _state = parent._state;\n\n  if (_state) {\n    (function () {\n      var callback = _arguments[_state - 1];\n      asap(function () {\n        return invokeCallback(_state, child, callback, parent._result);\n      });\n    })();\n  } else {\n    subscribe(parent, child, onFulfillment, onRejection);\n  }\n\n  return child;\n}\n\n/**\n  `Promise.resolve` returns a promise that will become resolved with the\n  passed `value`. It is shorthand for the following:\n\n  ```javascript\n  let promise = new Promise(function(resolve, reject){\n    resolve(1);\n  });\n\n  promise.then(function(value){\n    // value === 1\n  });\n  ```\n\n  Instead of writing the above, your code now simply becomes the following:\n\n  ```javascript\n  let promise = Promise.resolve(1);\n\n  promise.then(function(value){\n    // value === 1\n  });\n  ```\n\n  @method resolve\n  @static\n  @param {Any} value value that the returned promise will be resolved with\n  Useful for tooling.\n  @return {Promise} a promise that will become fulfilled with the given\n  `value`\n*/\nfunction resolve(object) {\n  /*jshint validthis:true */\n  var Constructor = this;\n\n  if (object && typeof object === 'object' && object.constructor === Constructor) {\n    return object;\n  }\n\n  var promise = new Constructor(noop);\n  _resolve(promise, object);\n  return promise;\n}\n\nvar PROMISE_ID = Math.random().toString(36).substring(16);\n\nfunction noop() {}\n\nvar PENDING = void 0;\nvar FULFILLED = 1;\nvar REJECTED = 2;\n\nvar GET_THEN_ERROR = new ErrorObject();\n\nfunction selfFulfillment() {\n  return new TypeError(\"You cannot resolve a promise with itself\");\n}\n\nfunction cannotReturnOwn() {\n  return new TypeError('A promises callback cannot return that same promise.');\n}\n\nfunction getThen(promise) {\n  try {\n    return promise.then;\n  } catch (error) {\n    GET_THEN_ERROR.error = error;\n    return GET_THEN_ERROR;\n  }\n}\n\nfunction tryThen(then, value, fulfillmentHandler, rejectionHandler) {\n  try {\n    then.call(value, fulfillmentHandler, rejectionHandler);\n  } catch (e) {\n    return e;\n  }\n}\n\nfunction handleForeignThenable(promise, thenable, then) {\n  asap(function (promise) {\n    var sealed = false;\n    var error = tryThen(then, thenable, function (value) {\n      if (sealed) {\n        return;\n      }\n      sealed = true;\n      if (thenable !== value) {\n        _resolve(promise, value);\n      } else {\n        fulfill(promise, value);\n      }\n    }, function (reason) {\n      if (sealed) {\n        return;\n      }\n      sealed = true;\n\n      _reject(promise, reason);\n    }, 'Settle: ' + (promise._label || ' unknown promise'));\n\n    if (!sealed && error) {\n      sealed = true;\n      _reject(promise, error);\n    }\n  }, promise);\n}\n\nfunction handleOwnThenable(promise, thenable) {\n  if (thenable._state === FULFILLED) {\n    fulfill(promise, thenable._result);\n  } else if (thenable._state === REJECTED) {\n    _reject(promise, thenable._result);\n  } else {\n    subscribe(thenable, undefined, function (value) {\n      return _resolve(promise, value);\n    }, function (reason) {\n      return _reject(promise, reason);\n    });\n  }\n}\n\nfunction handleMaybeThenable(promise, maybeThenable, then$$) {\n  if (maybeThenable.constructor === promise.constructor && then$$ === then && maybeThenable.constructor.resolve === resolve) {\n    handleOwnThenable(promise, maybeThenable);\n  } else {\n    if (then$$ === GET_THEN_ERROR) {\n      _reject(promise, GET_THEN_ERROR.error);\n    } else if (then$$ === undefined) {\n      fulfill(promise, maybeThenable);\n    } else if (isFunction(then$$)) {\n      handleForeignThenable(promise, maybeThenable, then$$);\n    } else {\n      fulfill(promise, maybeThenable);\n    }\n  }\n}\n\nfunction _resolve(promise, value) {\n  if (promise === value) {\n    _reject(promise, selfFulfillment());\n  } else if (objectOrFunction(value)) {\n    handleMaybeThenable(promise, value, getThen(value));\n  } else {\n    fulfill(promise, value);\n  }\n}\n\nfunction publishRejection(promise) {\n  if (promise._onerror) {\n    promise._onerror(promise._result);\n  }\n\n  publish(promise);\n}\n\nfunction fulfill(promise, value) {\n  if (promise._state !== PENDING) {\n    return;\n  }\n\n  promise._result = value;\n  promise._state = FULFILLED;\n\n  if (promise._subscribers.length !== 0) {\n    asap(publish, promise);\n  }\n}\n\nfunction _reject(promise, reason) {\n  if (promise._state !== PENDING) {\n    return;\n  }\n  promise._state = REJECTED;\n  promise._result = reason;\n\n  asap(publishRejection, promise);\n}\n\nfunction subscribe(parent, child, onFulfillment, onRejection) {\n  var _subscribers = parent._subscribers;\n  var length = _subscribers.length;\n\n  parent._onerror = null;\n\n  _subscribers[length] = child;\n  _subscribers[length + FULFILLED] = onFulfillment;\n  _subscribers[length + REJECTED] = onRejection;\n\n  if (length === 0 && parent._state) {\n    asap(publish, parent);\n  }\n}\n\nfunction publish(promise) {\n  var subscribers = promise._subscribers;\n  var settled = promise._state;\n\n  if (subscribers.length === 0) {\n    return;\n  }\n\n  var child = undefined,\n      callback = undefined,\n      detail = promise._result;\n\n  for (var i = 0; i < subscribers.length; i += 3) {\n    child = subscribers[i];\n    callback = subscribers[i + settled];\n\n    if (child) {\n      invokeCallback(settled, child, callback, detail);\n    } else {\n      callback(detail);\n    }\n  }\n\n  promise._subscribers.length = 0;\n}\n\nfunction ErrorObject() {\n  this.error = null;\n}\n\nvar TRY_CATCH_ERROR = new ErrorObject();\n\nfunction tryCatch(callback, detail) {\n  try {\n    return callback(detail);\n  } catch (e) {\n    TRY_CATCH_ERROR.error = e;\n    return TRY_CATCH_ERROR;\n  }\n}\n\nfunction invokeCallback(settled, promise, callback, detail) {\n  var hasCallback = isFunction(callback),\n      value = undefined,\n      error = undefined,\n      succeeded = undefined,\n      failed = undefined;\n\n  if (hasCallback) {\n    value = tryCatch(callback, detail);\n\n    if (value === TRY_CATCH_ERROR) {\n      failed = true;\n      error = value.error;\n      value = null;\n    } else {\n      succeeded = true;\n    }\n\n    if (promise === value) {\n      _reject(promise, cannotReturnOwn());\n      return;\n    }\n  } else {\n    value = detail;\n    succeeded = true;\n  }\n\n  if (promise._state !== PENDING) {\n    // noop\n  } else if (hasCallback && succeeded) {\n      _resolve(promise, value);\n    } else if (failed) {\n      _reject(promise, error);\n    } else if (settled === FULFILLED) {\n      fulfill(promise, value);\n    } else if (settled === REJECTED) {\n      _reject(promise, value);\n    }\n}\n\nfunction initializePromise(promise, resolver) {\n  try {\n    resolver(function resolvePromise(value) {\n      _resolve(promise, value);\n    }, function rejectPromise(reason) {\n      _reject(promise, reason);\n    });\n  } catch (e) {\n    _reject(promise, e);\n  }\n}\n\nvar id = 0;\nfunction nextId() {\n  return id++;\n}\n\nfunction makePromise(promise) {\n  promise[PROMISE_ID] = id++;\n  promise._state = undefined;\n  promise._result = undefined;\n  promise._subscribers = [];\n}\n\nfunction Enumerator(Constructor, input) {\n  this._instanceConstructor = Constructor;\n  this.promise = new Constructor(noop);\n\n  if (!this.promise[PROMISE_ID]) {\n    makePromise(this.promise);\n  }\n\n  if (isArray(input)) {\n    this._input = input;\n    this.length = input.length;\n    this._remaining = input.length;\n\n    this._result = new Array(this.length);\n\n    if (this.length === 0) {\n      fulfill(this.promise, this._result);\n    } else {\n      this.length = this.length || 0;\n      this._enumerate();\n      if (this._remaining === 0) {\n        fulfill(this.promise, this._result);\n      }\n    }\n  } else {\n    _reject(this.promise, validationError());\n  }\n}\n\nfunction validationError() {\n  return new Error('Array Methods must be provided an Array');\n};\n\nEnumerator.prototype._enumerate = function () {\n  var length = this.length;\n  var _input = this._input;\n\n  for (var i = 0; this._state === PENDING && i < length; i++) {\n    this._eachEntry(_input[i], i);\n  }\n};\n\nEnumerator.prototype._eachEntry = function (entry, i) {\n  var c = this._instanceConstructor;\n  var resolve$$ = c.resolve;\n\n  if (resolve$$ === resolve) {\n    var _then = getThen(entry);\n\n    if (_then === then && entry._state !== PENDING) {\n      this._settledAt(entry._state, i, entry._result);\n    } else if (typeof _then !== 'function') {\n      this._remaining--;\n      this._result[i] = entry;\n    } else if (c === Promise) {\n      var promise = new c(noop);\n      handleMaybeThenable(promise, entry, _then);\n      this._willSettleAt(promise, i);\n    } else {\n      this._willSettleAt(new c(function (resolve$$) {\n        return resolve$$(entry);\n      }), i);\n    }\n  } else {\n    this._willSettleAt(resolve$$(entry), i);\n  }\n};\n\nEnumerator.prototype._settledAt = function (state, i, value) {\n  var promise = this.promise;\n\n  if (promise._state === PENDING) {\n    this._remaining--;\n\n    if (state === REJECTED) {\n      _reject(promise, value);\n    } else {\n      this._result[i] = value;\n    }\n  }\n\n  if (this._remaining === 0) {\n    fulfill(promise, this._result);\n  }\n};\n\nEnumerator.prototype._willSettleAt = function (promise, i) {\n  var enumerator = this;\n\n  subscribe(promise, undefined, function (value) {\n    return enumerator._settledAt(FULFILLED, i, value);\n  }, function (reason) {\n    return enumerator._settledAt(REJECTED, i, reason);\n  });\n};\n\n/**\n  `Promise.all` accepts an array of promises, and returns a new promise which\n  is fulfilled with an array of fulfillment values for the passed promises, or\n  rejected with the reason of the first passed promise to be rejected. It casts all\n  elements of the passed iterable to promises as it runs this algorithm.\n\n  Example:\n\n  ```javascript\n  let promise1 = resolve(1);\n  let promise2 = resolve(2);\n  let promise3 = resolve(3);\n  let promises = [ promise1, promise2, promise3 ];\n\n  Promise.all(promises).then(function(array){\n    // The array here would be [ 1, 2, 3 ];\n  });\n  ```\n\n  If any of the `promises` given to `all` are rejected, the first promise\n  that is rejected will be given as an argument to the returned promises's\n  rejection handler. For example:\n\n  Example:\n\n  ```javascript\n  let promise1 = resolve(1);\n  let promise2 = reject(new Error(\"2\"));\n  let promise3 = reject(new Error(\"3\"));\n  let promises = [ promise1, promise2, promise3 ];\n\n  Promise.all(promises).then(function(array){\n    // Code here never runs because there are rejected promises!\n  }, function(error) {\n    // error.message === \"2\"\n  });\n  ```\n\n  @method all\n  @static\n  @param {Array} entries array of promises\n  @param {String} label optional string for labeling the promise.\n  Useful for tooling.\n  @return {Promise} promise that is fulfilled when all `promises` have been\n  fulfilled, or rejected if any of them become rejected.\n  @static\n*/\nfunction all(entries) {\n  return new Enumerator(this, entries).promise;\n}\n\n/**\n  `Promise.race` returns a new promise which is settled in the same way as the\n  first passed promise to settle.\n\n  Example:\n\n  ```javascript\n  let promise1 = new Promise(function(resolve, reject){\n    setTimeout(function(){\n      resolve('promise 1');\n    }, 200);\n  });\n\n  let promise2 = new Promise(function(resolve, reject){\n    setTimeout(function(){\n      resolve('promise 2');\n    }, 100);\n  });\n\n  Promise.race([promise1, promise2]).then(function(result){\n    // result === 'promise 2' because it was resolved before promise1\n    // was resolved.\n  });\n  ```\n\n  `Promise.race` is deterministic in that only the state of the first\n  settled promise matters. For example, even if other promises given to the\n  `promises` array argument are resolved, but the first settled promise has\n  become rejected before the other promises became fulfilled, the returned\n  promise will become rejected:\n\n  ```javascript\n  let promise1 = new Promise(function(resolve, reject){\n    setTimeout(function(){\n      resolve('promise 1');\n    }, 200);\n  });\n\n  let promise2 = new Promise(function(resolve, reject){\n    setTimeout(function(){\n      reject(new Error('promise 2'));\n    }, 100);\n  });\n\n  Promise.race([promise1, promise2]).then(function(result){\n    // Code here never runs\n  }, function(reason){\n    // reason.message === 'promise 2' because promise 2 became rejected before\n    // promise 1 became fulfilled\n  });\n  ```\n\n  An example real-world use case is implementing timeouts:\n\n  ```javascript\n  Promise.race([ajax('foo.json'), timeout(5000)])\n  ```\n\n  @method race\n  @static\n  @param {Array} promises array of promises to observe\n  Useful for tooling.\n  @return {Promise} a promise which settles in the same way as the first passed\n  promise to settle.\n*/\nfunction race(entries) {\n  /*jshint validthis:true */\n  var Constructor = this;\n\n  if (!isArray(entries)) {\n    return new Constructor(function (_, reject) {\n      return reject(new TypeError('You must pass an array to race.'));\n    });\n  } else {\n    return new Constructor(function (resolve, reject) {\n      var length = entries.length;\n      for (var i = 0; i < length; i++) {\n        Constructor.resolve(entries[i]).then(resolve, reject);\n      }\n    });\n  }\n}\n\n/**\n  `Promise.reject` returns a promise rejected with the passed `reason`.\n  It is shorthand for the following:\n\n  ```javascript\n  let promise = new Promise(function(resolve, reject){\n    reject(new Error('WHOOPS'));\n  });\n\n  promise.then(function(value){\n    // Code here doesn't run because the promise is rejected!\n  }, function(reason){\n    // reason.message === 'WHOOPS'\n  });\n  ```\n\n  Instead of writing the above, your code now simply becomes the following:\n\n  ```javascript\n  let promise = Promise.reject(new Error('WHOOPS'));\n\n  promise.then(function(value){\n    // Code here doesn't run because the promise is rejected!\n  }, function(reason){\n    // reason.message === 'WHOOPS'\n  });\n  ```\n\n  @method reject\n  @static\n  @param {Any} reason value that the returned promise will be rejected with.\n  Useful for tooling.\n  @return {Promise} a promise rejected with the given `reason`.\n*/\nfunction reject(reason) {\n  /*jshint validthis:true */\n  var Constructor = this;\n  var promise = new Constructor(noop);\n  _reject(promise, reason);\n  return promise;\n}\n\nfunction needsResolver() {\n  throw new TypeError('You must pass a resolver function as the first argument to the promise constructor');\n}\n\nfunction needsNew() {\n  throw new TypeError(\"Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.\");\n}\n\n/**\n  Promise objects represent the eventual result of an asynchronous operation. The\n  primary way of interacting with a promise is through its `then` method, which\n  registers callbacks to receive either a promise's eventual value or the reason\n  why the promise cannot be fulfilled.\n\n  Terminology\n  -----------\n\n  - `promise` is an object or function with a `then` method whose behavior conforms to this specification.\n  - `thenable` is an object or function that defines a `then` method.\n  - `value` is any legal JavaScript value (including undefined, a thenable, or a promise).\n  - `exception` is a value that is thrown using the throw statement.\n  - `reason` is a value that indicates why a promise was rejected.\n  - `settled` the final resting state of a promise, fulfilled or rejected.\n\n  A promise can be in one of three states: pending, fulfilled, or rejected.\n\n  Promises that are fulfilled have a fulfillment value and are in the fulfilled\n  state.  Promises that are rejected have a rejection reason and are in the\n  rejected state.  A fulfillment value is never a thenable.\n\n  Promises can also be said to *resolve* a value.  If this value is also a\n  promise, then the original promise's settled state will match the value's\n  settled state.  So a promise that *resolves* a promise that rejects will\n  itself reject, and a promise that *resolves* a promise that fulfills will\n  itself fulfill.\n\n\n  Basic Usage:\n  ------------\n\n  ```js\n  let promise = new Promise(function(resolve, reject) {\n    // on success\n    resolve(value);\n\n    // on failure\n    reject(reason);\n  });\n\n  promise.then(function(value) {\n    // on fulfillment\n  }, function(reason) {\n    // on rejection\n  });\n  ```\n\n  Advanced Usage:\n  ---------------\n\n  Promises shine when abstracting away asynchronous interactions such as\n  `XMLHttpRequest`s.\n\n  ```js\n  function getJSON(url) {\n    return new Promise(function(resolve, reject){\n      let xhr = new XMLHttpRequest();\n\n      xhr.open('GET', url);\n      xhr.onreadystatechange = handler;\n      xhr.responseType = 'json';\n      xhr.setRequestHeader('Accept', 'application/json');\n      xhr.send();\n\n      function handler() {\n        if (this.readyState === this.DONE) {\n          if (this.status === 200) {\n            resolve(this.response);\n          } else {\n            reject(new Error('getJSON: `' + url + '` failed with status: [' + this.status + ']'));\n          }\n        }\n      };\n    });\n  }\n\n  getJSON('/posts.json').then(function(json) {\n    // on fulfillment\n  }, function(reason) {\n    // on rejection\n  });\n  ```\n\n  Unlike callbacks, promises are great composable primitives.\n\n  ```js\n  Promise.all([\n    getJSON('/posts'),\n    getJSON('/comments')\n  ]).then(function(values){\n    values[0] // => postsJSON\n    values[1] // => commentsJSON\n\n    return values;\n  });\n  ```\n\n  @class Promise\n  @param {function} resolver\n  Useful for tooling.\n  @constructor\n*/\nfunction Promise(resolver) {\n  this[PROMISE_ID] = nextId();\n  this._result = this._state = undefined;\n  this._subscribers = [];\n\n  if (noop !== resolver) {\n    typeof resolver !== 'function' && needsResolver();\n    this instanceof Promise ? initializePromise(this, resolver) : needsNew();\n  }\n}\n\nPromise.all = all;\nPromise.race = race;\nPromise.resolve = resolve;\nPromise.reject = reject;\nPromise._setScheduler = setScheduler;\nPromise._setAsap = setAsap;\nPromise._asap = asap;\n\nPromise.prototype = {\n  constructor: Promise,\n\n  /**\n    The primary way of interacting with a promise is through its `then` method,\n    which registers callbacks to receive either a promise's eventual value or the\n    reason why the promise cannot be fulfilled.\n  \n    ```js\n    findUser().then(function(user){\n      // user is available\n    }, function(reason){\n      // user is unavailable, and you are given the reason why\n    });\n    ```\n  \n    Chaining\n    --------\n  \n    The return value of `then` is itself a promise.  This second, 'downstream'\n    promise is resolved with the return value of the first promise's fulfillment\n    or rejection handler, or rejected if the handler throws an exception.\n  \n    ```js\n    findUser().then(function (user) {\n      return user.name;\n    }, function (reason) {\n      return 'default name';\n    }).then(function (userName) {\n      // If `findUser` fulfilled, `userName` will be the user's name, otherwise it\n      // will be `'default name'`\n    });\n  \n    findUser().then(function (user) {\n      throw new Error('Found user, but still unhappy');\n    }, function (reason) {\n      throw new Error('`findUser` rejected and we're unhappy');\n    }).then(function (value) {\n      // never reached\n    }, function (reason) {\n      // if `findUser` fulfilled, `reason` will be 'Found user, but still unhappy'.\n      // If `findUser` rejected, `reason` will be '`findUser` rejected and we're unhappy'.\n    });\n    ```\n    If the downstream promise does not specify a rejection handler, rejection reasons will be propagated further downstream.\n  \n    ```js\n    findUser().then(function (user) {\n      throw new PedagogicalException('Upstream error');\n    }).then(function (value) {\n      // never reached\n    }).then(function (value) {\n      // never reached\n    }, function (reason) {\n      // The `PedgagocialException` is propagated all the way down to here\n    });\n    ```\n  \n    Assimilation\n    ------------\n  \n    Sometimes the value you want to propagate to a downstream promise can only be\n    retrieved asynchronously. This can be achieved by returning a promise in the\n    fulfillment or rejection handler. The downstream promise will then be pending\n    until the returned promise is settled. This is called *assimilation*.\n  \n    ```js\n    findUser().then(function (user) {\n      return findCommentsByAuthor(user);\n    }).then(function (comments) {\n      // The user's comments are now available\n    });\n    ```\n  \n    If the assimliated promise rejects, then the downstream promise will also reject.\n  \n    ```js\n    findUser().then(function (user) {\n      return findCommentsByAuthor(user);\n    }).then(function (comments) {\n      // If `findCommentsByAuthor` fulfills, we'll have the value here\n    }, function (reason) {\n      // If `findCommentsByAuthor` rejects, we'll have the reason here\n    });\n    ```\n  \n    Simple Example\n    --------------\n  \n    Synchronous Example\n  \n    ```javascript\n    let result;\n  \n    try {\n      result = findResult();\n      // success\n    } catch(reason) {\n      // failure\n    }\n    ```\n  \n    Errback Example\n  \n    ```js\n    findResult(function(result, err){\n      if (err) {\n        // failure\n      } else {\n        // success\n      }\n    });\n    ```\n  \n    Promise Example;\n  \n    ```javascript\n    findResult().then(function(result){\n      // success\n    }, function(reason){\n      // failure\n    });\n    ```\n  \n    Advanced Example\n    --------------\n  \n    Synchronous Example\n  \n    ```javascript\n    let author, books;\n  \n    try {\n      author = findAuthor();\n      books  = findBooksByAuthor(author);\n      // success\n    } catch(reason) {\n      // failure\n    }\n    ```\n  \n    Errback Example\n  \n    ```js\n  \n    function foundBooks(books) {\n  \n    }\n  \n    function failure(reason) {\n  \n    }\n  \n    findAuthor(function(author, err){\n      if (err) {\n        failure(err);\n        // failure\n      } else {\n        try {\n          findBoooksByAuthor(author, function(books, err) {\n            if (err) {\n              failure(err);\n            } else {\n              try {\n                foundBooks(books);\n              } catch(reason) {\n                failure(reason);\n              }\n            }\n          });\n        } catch(error) {\n          failure(err);\n        }\n        // success\n      }\n    });\n    ```\n  \n    Promise Example;\n  \n    ```javascript\n    findAuthor().\n      then(findBooksByAuthor).\n      then(function(books){\n        // found books\n    }).catch(function(reason){\n      // something went wrong\n    });\n    ```\n  \n    @method then\n    @param {Function} onFulfilled\n    @param {Function} onRejected\n    Useful for tooling.\n    @return {Promise}\n  */\n  then: then,\n\n  /**\n    `catch` is simply sugar for `then(undefined, onRejection)` which makes it the same\n    as the catch block of a try/catch statement.\n  \n    ```js\n    function findAuthor(){\n      throw new Error('couldn't find that author');\n    }\n  \n    // synchronous\n    try {\n      findAuthor();\n    } catch(reason) {\n      // something went wrong\n    }\n  \n    // async with promises\n    findAuthor().catch(function(reason){\n      // something went wrong\n    });\n    ```\n  \n    @method catch\n    @param {Function} onRejection\n    Useful for tooling.\n    @return {Promise}\n  */\n  'catch': function _catch(onRejection) {\n    return this.then(null, onRejection);\n  }\n};\n\nfunction polyfill() {\n    var local = undefined;\n\n    if (typeof global !== 'undefined') {\n        local = global;\n    } else if (typeof self !== 'undefined') {\n        local = self;\n    } else {\n        try {\n            local = Function('return this')();\n        } catch (e) {\n            throw new Error('polyfill failed because global object is unavailable in this environment');\n        }\n    }\n\n    var P = local.Promise;    \n    \n    if (typeof egret_native != \"undefined\" && egret_native.capability && !egret_native.capability(\"Promise\")) {\n      P = undefined;\n    }\n\n    if (P) {\n        var promiseToString = null;\n        try {\n            promiseToString = Object.prototype.toString.call(P.resolve());\n        } catch (e) {\n            // silently ignored\n        }\n\n        if (promiseToString === '[object Promise]' && !P.cast) {\n            return;\n        }\n    }\n\n    local.Promise = Promise;\n}\n\n// Strange compat..\nPromise.polyfill = polyfill;\nPromise.Promise = Promise;\n\nreturn Promise;\n\n})));\n\nES6Promise.polyfill();"
  },
  {
    "path": "demo/libs/modules/tween/tween.d.ts",
    "content": "declare namespace egret {\n    /**\n     * Easing function set. Different easing functions are used to make an animation proceed according to the corresponding equation\n     * @see http://edn.egret.com/cn/index.php/article/index/id/53 Easing effect Demo\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 缓动函数集合，使用不同的缓动函数使得动画按照对应的方程进行\n     * @see http://edn.egret.com/cn/index.php/article/index/id/53 缓动效果演示\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class Ease {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor();\n        /**\n         * get.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static get(amount: number): (t: number) => number;\n        /**\n         * get pow in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get pow in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static getPowIn(pow: number): (t: number) => number;\n        /**\n         * get pow out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get pow out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static getPowOut(pow: number): (t: number) => number;\n        /**\n         * get pow in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get pow in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static getPowInOut(pow: number): (t: number) => number;\n        /**\n         * quad in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quad in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static quadIn: (t: number) => number;\n        /**\n         * quad out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quad out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static quadOut: (t: number) => number;\n        /**\n         * quad in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quad in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static quadInOut: (t: number) => number;\n        /**\n         * cubic in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * cubic in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static cubicIn: (t: number) => number;\n        /**\n         * cubic out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * cubic out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static cubicOut: (t: number) => number;\n        /**\n         * cubic in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * cubic in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static cubicInOut: (t: number) => number;\n        /**\n         * quart in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quart in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static quartIn: (t: number) => number;\n        /**\n         * quart out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quart out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static quartOut: (t: number) => number;\n        /**\n         * quart in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quart in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static quartInOut: (t: number) => number;\n        /**\n         * quint in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quint in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static quintIn: (t: number) => number;\n        /**\n         * quint out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quint out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static quintOut: (t: number) => number;\n        /**\n         * quint in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quint in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static quintInOut: (t: number) => number;\n        /**\n         * sine in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * sine in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static sineIn(t: number): number;\n        /**\n         * sine out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * sine out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static sineOut(t: number): number;\n        /**\n         * sine in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * sine in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static sineInOut(t: number): number;\n        /**\n         * get back in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get back in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static getBackIn(amount: number): (t: number) => number;\n        /**\n         * back in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * back in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static backIn: (t: number) => number;\n        /**\n         * get back out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get back out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static getBackOut(amount: number): (t: any) => number;\n        /**\n         * back out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * back out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static backOut: (t: any) => number;\n        /**\n         * get back in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get back in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static getBackInOut(amount: number): (t: number) => number;\n        /**\n         * back in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * back in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static backInOut: (t: number) => number;\n        /**\n         * circ in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * circ in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static circIn(t: number): number;\n        /**\n         * circ out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * circ out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static circOut(t: number): number;\n        /**\n         * circ in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * circ in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static circInOut(t: number): number;\n        /**\n         * bounce in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * bounce in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static bounceIn(t: number): number;\n        /**\n         * bounce out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * bounce out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static bounceOut(t: number): number;\n        /**\n         * bounce in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * bounce in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static bounceInOut(t: number): number;\n        /**\n         * get elastic in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get elastic in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static getElasticIn(amplitude: number, period: number): (t: number) => number;\n        /**\n         * elastic in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * elastic in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static elasticIn: (t: number) => number;\n        /**\n         * get elastic out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get elastic out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static getElasticOut(amplitude: number, period: number): (t: number) => number;\n        /**\n         * elastic out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * elastic out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static elasticOut: (t: number) => number;\n        /**\n         * get elastic in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get elastic in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static getElasticInOut(amplitude: number, period: number): (t: number) => number;\n        /**\n         * elastic in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * elastic in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static elasticInOut: (t: number) => number;\n    }\n}\ndeclare namespace egret {\n    /**\n     * Tween is the animation easing class of Egret\n     * @see http://edn.egret.com/cn/docs/page/576 Tween ease animation\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/tween/Tween.ts\n     * @language en_US\n     */\n    /**\n     * Tween是Egret的动画缓动类\n     * @see http://edn.egret.com/cn/docs/page/576 Tween缓动动画\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/tween/Tween.ts\n     * @language zh_CN\n     */\n    class Tween extends EventDispatcher {\n        /**\n         * 不做特殊处理\n         * @constant {number} egret.Tween.NONE\n         * @private\n         */\n        private static NONE;\n        /**\n         * 循环\n         * @constant {number} egret.Tween.LOOP\n         * @private\n         */\n        private static LOOP;\n        /**\n         * 倒序\n         * @constant {number} egret.Tween.REVERSE\n         * @private\n         */\n        private static REVERSE;\n        /**\n         * @private\n         */\n        private static _tweens;\n        /**\n         * @private\n         */\n        private static IGNORE;\n        /**\n         * @private\n         */\n        private static _plugins;\n        /**\n         * @private\n         */\n        private static _inited;\n        /**\n         * @private\n         */\n        private _target;\n        /**\n         * @private\n         */\n        private _useTicks;\n        /**\n         * @private\n         */\n        private ignoreGlobalPause;\n        /**\n         * @private\n         */\n        private loop;\n        /**\n         * @private\n         */\n        private pluginData;\n        /**\n         * @private\n         */\n        private _curQueueProps;\n        /**\n         * @private\n         */\n        private _initQueueProps;\n        /**\n         * @private\n         */\n        private _steps;\n        /**\n         * @private\n         */\n        private paused;\n        /**\n         * @private\n         */\n        private duration;\n        /**\n         * @private\n         */\n        private _prevPos;\n        /**\n         * @private\n         */\n        private position;\n        /**\n         * @private\n         */\n        private _prevPosition;\n        /**\n         * @private\n         */\n        private _stepPosition;\n        /**\n         * @private\n         */\n        private passive;\n        /**\n         * Activate an object and add a Tween animation to the object\n         * @param target {any} The object to be activated\n         * @param props {any} Parameters, support loop onChange onChangeObj\n         * @param pluginData {any} Write realized\n         * @param override {boolean} Whether to remove the object before adding a tween, the default value false\n         * Not recommended, you can use Tween.removeTweens(target) instead.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 激活一个对象，对其添加 Tween 动画\n         * @param target {any} 要激活 Tween 的对象\n         * @param props {any} 参数，支持loop(循环播放) onChange(变化函数) onChangeObj(变化函数作用域)\n         * @param pluginData {any} 暂未实现\n         * @param override {boolean} 是否移除对象之前添加的tween，默认值false。\n         * 不建议使用，可使用 Tween.removeTweens(target) 代替。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static get(target: any, props?: {\n            loop?: boolean;\n            onChange?: Function;\n            onChangeObj?: any;\n        }, pluginData?: any, override?: boolean): Tween;\n        /**\n         * Delete all Tween animations from an object\n         * @param target The object whose Tween to be deleted\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 删除一个对象上的全部 Tween 动画\n         * @param target  需要移除 Tween 的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static removeTweens(target: any): void;\n        /**\n         * Pause all Tween animations of a certain object\n         * @param target The object whose Tween to be paused\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 暂停某个对象的所有 Tween\n         * @param target 要暂停 Tween 的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static pauseTweens(target: any): void;\n        /**\n         * Resume playing all easing of a certain object\n         * @param target The object whose Tween to be resumed\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 继续播放某个对象的所有缓动\n         * @param target 要继续播放 Tween 的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static resumeTweens(target: any): void;\n        /**\n         * @private\n         *\n         * @param delta\n         * @param paused\n         */\n        private static tick(timeStamp, paused?);\n        private static _lastTime;\n        /**\n         * @private\n         *\n         * @param tween\n         * @param value\n         */\n        private static _register(tween, value);\n        /**\n         * Delete all Tween\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 删除所有 Tween\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static removeAllTweens(): void;\n        /**\n         * 创建一个 egret.Tween 对象\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor(target: any, props: any, pluginData: any);\n        /**\n         * @private\n         *\n         * @param target\n         * @param props\n         * @param pluginData\n         */\n        private initialize(target, props, pluginData);\n        /**\n         * @private\n         *\n         * @param value\n         * @param actionsMode\n         * @returns\n         */\n        setPosition(value: number, actionsMode?: number): boolean;\n        /**\n         * @private\n         *\n         * @param startPos\n         * @param endPos\n         * @param includeStart\n         */\n        private _runAction(action, startPos, endPos, includeStart?);\n        /**\n         * @private\n         *\n         * @param step\n         * @param ratio\n         */\n        private _updateTargetProps(step, ratio);\n        /**\n         * Whether setting is paused\n         * @param value {boolean} Whether to pause\n         * @returns Tween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置是否暂停\n         * @param value {boolean} 是否暂停\n         * @returns Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setPaused(value: boolean): Tween;\n        /**\n         * @private\n         *\n         * @param props\n         * @returns\n         */\n        private _cloneProps(props);\n        /**\n         * @private\n         *\n         * @param o\n         * @returns\n         */\n        private _addStep(o);\n        /**\n         * @private\n         *\n         * @param o\n         * @returns\n         */\n        private _appendQueueProps(o);\n        /**\n         * @private\n         *\n         * @param o\n         * @returns\n         */\n        private _addAction(o);\n        /**\n         * @private\n         *\n         * @param props\n         * @param o\n         */\n        private _set(props, o);\n        /**\n         * Wait the specified milliseconds before the execution of the next animation\n         * @param duration {number} Waiting time, in milliseconds\n         * @param passive {boolean} Whether properties are updated during the waiting time\n         * @returns Tween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等待指定毫秒后执行下一个动画\n         * @param duration {number} 要等待的时间，以毫秒为单位\n         * @param passive {boolean} 等待期间属性是否会更新\n         * @returns Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        wait(duration: number, passive?: boolean): Tween;\n        /**\n         * Modify the property of the specified object to a specified value\n         * @param props {Object} Property set of an object\n         * @param duration {number} Duration\n         * @param ease {egret.Ease} Easing algorithm\n         * @returns {egret.Tween} Tween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将指定对象的属性修改为指定值\n         * @param props {Object} 对象的属性集合\n         * @param duration {number} 持续时间\n         * @param ease {egret.Ease} 缓动算法\n         * @returns {egret.Tween} Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        to(props: any, duration?: number, ease?: Function): Tween;\n        /**\n         * Execute callback function\n         * @param callback {Function} Callback method\n         * @param thisObj {any} this action scope of the callback method\n         * @param params {any[]} Parameter of the callback method\n         * @returns {egret.Tween} Tween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @example\n         * <pre>\n         *  egret.Tween.get(display).call(function (a:number, b:string) {\n         *      console.log(\"a: \" + a); // the first parameter passed 233\n         *      console.log(\"b: \" + b); // the second parameter passed “hello”\n         *  }, this, [233, \"hello\"]);\n         * </pre>\n         * @language en_US\n         */\n        /**\n         * 执行回调函数\n         * @param callback {Function} 回调方法\n         * @param thisObj {any} 回调方法this作用域\n         * @param params {any[]} 回调方法参数\n         * @returns {egret.Tween} Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @example\n         * <pre>\n         *  egret.Tween.get(display).call(function (a:number, b:string) {\n         *      console.log(\"a: \" + a); //对应传入的第一个参数 233\n         *      console.log(\"b: \" + b); //对应传入的第二个参数 “hello”\n         *  }, this, [233, \"hello\"]);\n         * </pre>\n         * @language zh_CN\n         */\n        call(callback: Function, thisObj?: any, params?: any[]): Tween;\n        /**\n         * Now modify the properties of the specified object to the specified value\n         * @param props {Object} Property set of an object\n         * @param target The object whose Tween to be resumed\n         * @returns {egret.Tween} Tween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * 立即将指定对象的属性修改为指定值\n         * @param props {Object} 对象的属性集合\n         * @param target 要继续播放 Tween 的对象\n         * @returns {egret.Tween} Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        set(props: any, target?: any): Tween;\n        /**\n         * Execute\n         * @param tween {egret.Tween} The Tween object to be operated. Default: this\n         * @returns {egret.Tween} Tween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 执行\n         * @param tween {egret.Tween} 需要操作的 Tween 对象，默认this\n         * @returns {egret.Tween} Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        play(tween?: Tween): Tween;\n        /**\n         * Pause\n         * @param tween {egret.Tween} The Tween object to be operated. Default: this\n         * @returns {egret.Tween} Tween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 暂停\n         * @param tween {egret.Tween} 需要操作的 Tween 对象，默认this\n         * @returns {egret.Tween} Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        pause(tween?: Tween): Tween;\n        /**\n         * @method egret.Tween#tick\n         * @param delta {number}\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        $tick(delta: number): void;\n    }\n}\ndeclare namespace egret.tween {\n    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';\n    /**\n     * Abstract class, Indicate the base action.\n     * @version Egret 3.1.8\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 抽象类，表示一个基本动作\n     * @version Egret 3.1.8\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    abstract class BasePath extends EventDispatcher {\n        /**\n         * the name of this action.\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 动作的名称\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        name: string;\n    }\n    /**\n     * Indicate the to action. See <code>Tween.to</code>\n     * @version Egret 3.1.8\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 表示一个to动作，参见<code>Tween.to</code>\n     * @version Egret 3.1.8\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class To extends BasePath {\n        /**\n         * Property set of an object\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 对象的属性集合\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        props: Object;\n        /**\n         * Duration\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 持续时间\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        duration: number;\n        /**\n         * Easing algorithm\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 缓动算法\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ease: EaseType | Function;\n    }\n    /**\n     * Indicate the wait action. See <code>Tween.wait</code>\n     * @version Egret 3.1.8\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 表示一个wait动作，参见<code>Tween.wait</code>\n     * @version Egret 3.1.8\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class Wait extends BasePath {\n        /**\n         * Duration\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 持续时间\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        duration: number;\n        /**\n         * Whether properties are updated during the waiting time\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等待期间属性是否会更新\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        passive: boolean;\n    }\n    /**\n     * Indicate the set action. See <code>Tween.set</code>\n     * @version Egret 3.1.8\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 表示一个set动作，参见<code>Tween.set</code>\n     * @version Egret 3.1.8\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class Set extends BasePath {\n        /**\n         * Property set of an object\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 对象的属性集合\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        props: Object;\n    }\n    /**\n     * Indicate the tick action. See <code>Tween.tick</code>\n     * @version Egret 3.1.8\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 表示一个tick动作，参见<code>Tween.tick</code>\n     * @version Egret 3.1.8\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class Tick extends BasePath {\n        /**\n         * Delta time\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 增加的时间\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        delta: number;\n    }\n    /**\n     * TweenItem is a wrapper for Tween, which can set the behavior of Tween by setting attributes and adding Path.\n     *\n     * @event pathComplete Dispatched when some Path has complete.\n     * @event complete Dispatched when all Paths has complete.\n     *\n     * @defaultProperty props\n     * @version Egret 3.1.8\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * TweenItem是对Tween的包装器，能通过设置属性和添加Path的方式设置Tween的行为。\n     * 通常用于使用在EXML中定义组件的动画。\n     *\n     * @event pathComplete 当某个Path执行完毕时会派发此事件。\n     * @event complete 当所有Path执行完毕时会派发此事件。\n     *\n     * @defaultProperty props\n     * @version Egret 3.1.8\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    /**\n     * Use in exml:\n     * ```\n     * \t<tween:TweenItem target=\"{this.button}\">\n     * \t\t<tween:props>\n     * \t\t\t<e:Object loop=\"{true}\"/>\n     * \t\t</tween:props>\n     * \t\t<tween:paths>\n     * \t\t\t<e:Array>\n     * \t\t\t\t<tween:To duration=\"500\">\n     * \t\t\t\t\t<tween:props>\n     * \t\t\t\t\t\t<e:Object x=\"{100}\" y=\"{200}\" />\n     * \t\t\t\t\t</tween:props>\n     * \t\t\t\t</tween:To>\n     * \t\t\t\t<tween:Wait duration=\"1000\" />\n     * \t\t\t\t<tween:To duration=\"1000\">\n     * \t\t\t\t\t<tween:props>\n     * \t\t\t\t\t\t<e:Object x=\"{200}\" y=\"{100}\" />\n     * \t\t\t\t\t</tween:props>\n     * \t\t\t\t</tween:To>\n     * \t\t\t</e:Array>\n     * \t\t</tween:paths>\n     * \t</tween:TweenItem>\n     * ```\n     */\n    class TweenItem extends EventDispatcher {\n        private tween;\n        constructor();\n        /**\n         * @private\n         */\n        private _props;\n        /**\n         * The Tween's props.\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * Tween的props参数。\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        props: any;\n        /**\n         * @private\n         */\n        private _target;\n        /**\n         * The Tween's target.\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * Tween的target参数。\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        target: any;\n        /**\n         * @private\n         */\n        private _paths;\n        /**\n         * The Actions in Tween.\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * TweenItem中添加的行为。\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        paths: BasePath[];\n        /**\n         * Play the Tween\n         * @position The starting position, the default is from the last position to play\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 播放Tween\n         * @position 播放的起始位置, 默认为从上次位置继续播放\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        play(position?: number): void;\n        /**\n         * Pause the Tween\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 暂停Tween\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        pause(): void;\n        private isStop;\n        /**\n         * Stop the Tween\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 停止Tween\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        stop(): void;\n        private createTween(position);\n        private applyPaths();\n        private applyPath(path);\n        private pathComplete(path);\n    }\n    /**\n     * TweenGroup is a collection of TweenItem that can be played in parallel with each Item\n     *\n     * @event itemComplete Dispatched when some TweenItem has complete.\n     * @event complete Dispatched when all TweenItems has complete.\n     *\n     * @version Egret 3.1.8\n     * @platform Web,Native\n     * @includeExample extension/tween/TweenWrapper.ts\n     * @language en_US\n     */\n    /**\n     * TweenGroup是TweenItem的集合，可以并行播放每一个Item\n     * @version Egret 3.1.8\n     * @platform Web,Native\n     * @includeExample extension/tween/TweenWrapper.ts\n     * @language zh_CN\n     */\n    class TweenGroup extends EventDispatcher {\n        private completeCount;\n        constructor();\n        /**\n         * @private\n         */\n        private _items;\n        /**\n         * The Array that TweenItems in TweenGroup.\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * TweenGroup要控制的TweenItem集合。\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        items: TweenItem[];\n        private registerEvent(add);\n        /**\n         * Play the all TweenItems\n         * @time The starting position, the default is from the last position to play。If use 0, the group will play from the start position.\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 播放所有的TweenItem\n         * @time 播放的起始位置, 默认为从上次位置继续播放。如果为0，则从起始位置开始播放。\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        play(time?: number): void;\n        /**\n         * Pause the all TweenItems\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 暂停播放所有的TweenItem\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        pause(): void;\n        /**\n         * Stop the all TweenItems\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 停止所有的TweenItem\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        stop(): void;\n        private itemComplete(e);\n    }\n}\n"
  },
  {
    "path": "demo/libs/modules/tween/tween.js",
    "content": "var __reflect = (this && this.__reflect) || function (p, c, t) {\n    p.__class__ = c, t ? t.push(c) : t = [c], p.__types__ = p.__types__ ? t.concat(p.__types__) : t;\n};\nvar __extends = this && this.__extends || function __extends(t, e) { \n function r() { \n this.constructor = t;\n}\nfor (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);\nr.prototype = e.prototype, t.prototype = new r();\n};\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Easing function set. Different easing functions are used to make an animation proceed according to the corresponding equation\n     * @see http://edn.egret.com/cn/index.php/article/index/id/53 Easing effect Demo\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 缓动函数集合，使用不同的缓动函数使得动画按照对应的方程进行\n     * @see http://edn.egret.com/cn/index.php/article/index/id/53 缓动效果演示\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    var Ease = (function () {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function Ease() {\n            egret.$error(1014);\n        }\n        /**\n         * get.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.get = function (amount) {\n            if (amount < -1) {\n                amount = -1;\n            }\n            if (amount > 1) {\n                amount = 1;\n            }\n            return function (t) {\n                if (amount == 0) {\n                    return t;\n                }\n                if (amount < 0) {\n                    return t * (t * -amount + 1 + amount);\n                }\n                return t * ((2 - t) * amount + (1 - amount));\n            };\n        };\n        /**\n         * get pow in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get pow in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.getPowIn = function (pow) {\n            return function (t) {\n                return Math.pow(t, pow);\n            };\n        };\n        /**\n         * get pow out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get pow out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.getPowOut = function (pow) {\n            return function (t) {\n                return 1 - Math.pow(1 - t, pow);\n            };\n        };\n        /**\n         * get pow in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get pow in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.getPowInOut = function (pow) {\n            return function (t) {\n                if ((t *= 2) < 1)\n                    return 0.5 * Math.pow(t, pow);\n                return 1 - 0.5 * Math.abs(Math.pow(2 - t, pow));\n            };\n        };\n        /**\n         * sine in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * sine in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.sineIn = function (t) {\n            return 1 - Math.cos(t * Math.PI / 2);\n        };\n        /**\n         * sine out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * sine out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.sineOut = function (t) {\n            return Math.sin(t * Math.PI / 2);\n        };\n        /**\n         * sine in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * sine in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.sineInOut = function (t) {\n            return -0.5 * (Math.cos(Math.PI * t) - 1);\n        };\n        /**\n         * get back in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get back in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.getBackIn = function (amount) {\n            return function (t) {\n                return t * t * ((amount + 1) * t - amount);\n            };\n        };\n        /**\n         * get back out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get back out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.getBackOut = function (amount) {\n            return function (t) {\n                return (--t * t * ((amount + 1) * t + amount) + 1);\n            };\n        };\n        /**\n         * get back in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get back in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.getBackInOut = function (amount) {\n            amount *= 1.525;\n            return function (t) {\n                if ((t *= 2) < 1)\n                    return 0.5 * (t * t * ((amount + 1) * t - amount));\n                return 0.5 * ((t -= 2) * t * ((amount + 1) * t + amount) + 2);\n            };\n        };\n        /**\n         * circ in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * circ in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.circIn = function (t) {\n            return -(Math.sqrt(1 - t * t) - 1);\n        };\n        /**\n         * circ out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * circ out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.circOut = function (t) {\n            return Math.sqrt(1 - (--t) * t);\n        };\n        /**\n         * circ in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * circ in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.circInOut = function (t) {\n            if ((t *= 2) < 1) {\n                return -0.5 * (Math.sqrt(1 - t * t) - 1);\n            }\n            return 0.5 * (Math.sqrt(1 - (t -= 2) * t) + 1);\n        };\n        /**\n         * bounce in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * bounce in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.bounceIn = function (t) {\n            return 1 - Ease.bounceOut(1 - t);\n        };\n        /**\n         * bounce out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * bounce out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.bounceOut = function (t) {\n            if (t < 1 / 2.75) {\n                return (7.5625 * t * t);\n            }\n            else if (t < 2 / 2.75) {\n                return (7.5625 * (t -= 1.5 / 2.75) * t + 0.75);\n            }\n            else if (t < 2.5 / 2.75) {\n                return (7.5625 * (t -= 2.25 / 2.75) * t + 0.9375);\n            }\n            else {\n                return (7.5625 * (t -= 2.625 / 2.75) * t + 0.984375);\n            }\n        };\n        /**\n         * bounce in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * bounce in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.bounceInOut = function (t) {\n            if (t < 0.5)\n                return Ease.bounceIn(t * 2) * .5;\n            return Ease.bounceOut(t * 2 - 1) * 0.5 + 0.5;\n        };\n        /**\n         * get elastic in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get elastic in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.getElasticIn = function (amplitude, period) {\n            var pi2 = Math.PI * 2;\n            return function (t) {\n                if (t == 0 || t == 1)\n                    return t;\n                var s = period / pi2 * Math.asin(1 / amplitude);\n                return -(amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period));\n            };\n        };\n        /**\n         * get elastic out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get elastic out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.getElasticOut = function (amplitude, period) {\n            var pi2 = Math.PI * 2;\n            return function (t) {\n                if (t == 0 || t == 1)\n                    return t;\n                var s = period / pi2 * Math.asin(1 / amplitude);\n                return (amplitude * Math.pow(2, -10 * t) * Math.sin((t - s) * pi2 / period) + 1);\n            };\n        };\n        /**\n         * get elastic in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * get elastic in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.getElasticInOut = function (amplitude, period) {\n            var pi2 = Math.PI * 2;\n            return function (t) {\n                var s = period / pi2 * Math.asin(1 / amplitude);\n                if ((t *= 2) < 1)\n                    return -0.5 * (amplitude * Math.pow(2, 10 * (t -= 1)) * Math.sin((t - s) * pi2 / period));\n                return amplitude * Math.pow(2, -10 * (t -= 1)) * Math.sin((t - s) * pi2 / period) * 0.5 + 1;\n            };\n        };\n        /**\n         * quad in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quad in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.quadIn = Ease.getPowIn(2);\n        /**\n         * quad out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quad out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.quadOut = Ease.getPowOut(2);\n        /**\n         * quad in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quad in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.quadInOut = Ease.getPowInOut(2);\n        /**\n         * cubic in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * cubic in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.cubicIn = Ease.getPowIn(3);\n        /**\n         * cubic out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * cubic out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.cubicOut = Ease.getPowOut(3);\n        /**\n         * cubic in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * cubic in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.cubicInOut = Ease.getPowInOut(3);\n        /**\n         * quart in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quart in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.quartIn = Ease.getPowIn(4);\n        /**\n         * quart out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quart out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.quartOut = Ease.getPowOut(4);\n        /**\n         * quart in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quart in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.quartInOut = Ease.getPowInOut(4);\n        /**\n         * quint in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quint in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.quintIn = Ease.getPowIn(5);\n        /**\n         * quint out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quint out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.quintOut = Ease.getPowOut(5);\n        /**\n         * quint in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * quint in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.quintInOut = Ease.getPowInOut(5);\n        /**\n         * back in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * back in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.backIn = Ease.getBackIn(1.7);\n        /**\n         * back out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * back out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.backOut = Ease.getBackOut(1.7);\n        /**\n         * back in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * back in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.backInOut = Ease.getBackInOut(1.7);\n        /**\n         * elastic in.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * elastic in。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.elasticIn = Ease.getElasticIn(1, 0.3);\n        /**\n         * elastic out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * elastic out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.elasticOut = Ease.getElasticOut(1, 0.3);\n        /**\n         * elastic in out.See example.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * elastic in out。请查看示例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Ease.elasticInOut = Ease.getElasticInOut(1, 0.3 * 1.5);\n        return Ease;\n    }());\n    egret.Ease = Ease;\n    __reflect(Ease.prototype, \"egret.Ease\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    /**\n     * Tween is the animation easing class of Egret\n     * @see http://edn.egret.com/cn/docs/page/576 Tween ease animation\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/tween/Tween.ts\n     * @language en_US\n     */\n    /**\n     * Tween是Egret的动画缓动类\n     * @see http://edn.egret.com/cn/docs/page/576 Tween缓动动画\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/tween/Tween.ts\n     * @language zh_CN\n     */\n    var Tween = (function (_super) {\n        __extends(Tween, _super);\n        /**\n         * 创建一个 egret.Tween 对象\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        function Tween(target, props, pluginData) {\n            var _this = _super.call(this) || this;\n            /**\n             * @private\n             */\n            _this._target = null;\n            /**\n             * @private\n             */\n            _this._useTicks = false;\n            /**\n             * @private\n             */\n            _this.ignoreGlobalPause = false;\n            /**\n             * @private\n             */\n            _this.loop = false;\n            /**\n             * @private\n             */\n            _this.pluginData = null;\n            /**\n             * @private\n             */\n            _this._steps = null;\n            /**\n             * @private\n             */\n            _this.paused = false;\n            /**\n             * @private\n             */\n            _this.duration = 0;\n            /**\n             * @private\n             */\n            _this._prevPos = -1;\n            /**\n             * @private\n             */\n            _this.position = null;\n            /**\n             * @private\n             */\n            _this._prevPosition = 0;\n            /**\n             * @private\n             */\n            _this._stepPosition = 0;\n            /**\n             * @private\n             */\n            _this.passive = false;\n            _this.initialize(target, props, pluginData);\n            return _this;\n        }\n        /**\n         * Activate an object and add a Tween animation to the object\n         * @param target {any} The object to be activated\n         * @param props {any} Parameters, support loop onChange onChangeObj\n         * @param pluginData {any} Write realized\n         * @param override {boolean} Whether to remove the object before adding a tween, the default value false\n         * Not recommended, you can use Tween.removeTweens(target) instead.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 激活一个对象，对其添加 Tween 动画\n         * @param target {any} 要激活 Tween 的对象\n         * @param props {any} 参数，支持loop(循环播放) onChange(变化函数) onChangeObj(变化函数作用域)\n         * @param pluginData {any} 暂未实现\n         * @param override {boolean} 是否移除对象之前添加的tween，默认值false。\n         * 不建议使用，可使用 Tween.removeTweens(target) 代替。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Tween.get = function (target, props, pluginData, override) {\n            if (pluginData === void 0) { pluginData = null; }\n            if (override === void 0) { override = false; }\n            if (override) {\n                Tween.removeTweens(target);\n            }\n            return new Tween(target, props, pluginData);\n        };\n        /**\n         * Delete all Tween animations from an object\n         * @param target The object whose Tween to be deleted\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 删除一个对象上的全部 Tween 动画\n         * @param target  需要移除 Tween 的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Tween.removeTweens = function (target) {\n            if (!target.tween_count) {\n                return;\n            }\n            var tweens = Tween._tweens;\n            for (var i = tweens.length - 1; i >= 0; i--) {\n                if (tweens[i]._target == target) {\n                    tweens[i].paused = true;\n                    tweens.splice(i, 1);\n                }\n            }\n            target.tween_count = 0;\n        };\n        /**\n         * Pause all Tween animations of a certain object\n         * @param target The object whose Tween to be paused\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 暂停某个对象的所有 Tween\n         * @param target 要暂停 Tween 的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Tween.pauseTweens = function (target) {\n            if (!target.tween_count) {\n                return;\n            }\n            var tweens = egret.Tween._tweens;\n            for (var i = tweens.length - 1; i >= 0; i--) {\n                if (tweens[i]._target == target) {\n                    tweens[i].paused = true;\n                }\n            }\n        };\n        /**\n         * Resume playing all easing of a certain object\n         * @param target The object whose Tween to be resumed\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 继续播放某个对象的所有缓动\n         * @param target 要继续播放 Tween 的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Tween.resumeTweens = function (target) {\n            if (!target.tween_count) {\n                return;\n            }\n            var tweens = egret.Tween._tweens;\n            for (var i = tweens.length - 1; i >= 0; i--) {\n                if (tweens[i]._target == target) {\n                    tweens[i].paused = false;\n                }\n            }\n        };\n        /**\n         * @private\n         *\n         * @param delta\n         * @param paused\n         */\n        Tween.tick = function (timeStamp, paused) {\n            if (paused === void 0) { paused = false; }\n            var delta = timeStamp - Tween._lastTime;\n            Tween._lastTime = timeStamp;\n            var tweens = Tween._tweens.concat();\n            for (var i = tweens.length - 1; i >= 0; i--) {\n                var tween_1 = tweens[i];\n                if ((paused && !tween_1.ignoreGlobalPause) || tween_1.paused) {\n                    continue;\n                }\n                tween_1.$tick(tween_1._useTicks ? 1 : delta);\n            }\n            return false;\n        };\n        /**\n         * @private\n         *\n         * @param tween\n         * @param value\n         */\n        Tween._register = function (tween, value) {\n            var target = tween._target;\n            var tweens = Tween._tweens;\n            if (value) {\n                if (target) {\n                    target.tween_count = target.tween_count > 0 ? target.tween_count + 1 : 1;\n                }\n                tweens.push(tween);\n                if (!Tween._inited) {\n                    Tween._lastTime = egret.getTimer();\n                    egret.ticker.$startTick(Tween.tick, null);\n                    Tween._inited = true;\n                }\n            }\n            else {\n                if (target) {\n                    target.tween_count--;\n                }\n                var i = tweens.length;\n                while (i--) {\n                    if (tweens[i] == tween) {\n                        tweens.splice(i, 1);\n                        return;\n                    }\n                }\n            }\n        };\n        /**\n         * Delete all Tween\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 删除所有 Tween\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Tween.removeAllTweens = function () {\n            var tweens = Tween._tweens;\n            for (var i = 0, l = tweens.length; i < l; i++) {\n                var tween_2 = tweens[i];\n                tween_2.paused = true;\n                tween_2._target.tween_count = 0;\n            }\n            tweens.length = 0;\n        };\n        /**\n         * @private\n         *\n         * @param target\n         * @param props\n         * @param pluginData\n         */\n        Tween.prototype.initialize = function (target, props, pluginData) {\n            this._target = target;\n            if (props) {\n                this._useTicks = props.useTicks;\n                this.ignoreGlobalPause = props.ignoreGlobalPause;\n                this.loop = props.loop;\n                props.onChange && this.addEventListener(\"change\", props.onChange, props.onChangeObj);\n                if (props.override) {\n                    Tween.removeTweens(target);\n                }\n            }\n            this.pluginData = pluginData || {};\n            this._curQueueProps = {};\n            this._initQueueProps = {};\n            this._steps = [];\n            if (props && props.paused) {\n                this.paused = true;\n            }\n            else {\n                Tween._register(this, true);\n            }\n            if (props && props.position != null) {\n                this.setPosition(props.position, Tween.NONE);\n            }\n        };\n        /**\n         * @private\n         *\n         * @param value\n         * @param actionsMode\n         * @returns\n         */\n        Tween.prototype.setPosition = function (value, actionsMode) {\n            if (actionsMode === void 0) { actionsMode = 1; }\n            if (value < 0) {\n                value = 0;\n            }\n            //正常化位置\n            var t = value;\n            var end = false;\n            if (t >= this.duration) {\n                if (this.loop) {\n                    var newTime = t % this.duration;\n                    if (t > 0 && newTime === 0) {\n                        t = this.duration;\n                    }\n                    else {\n                        t = newTime;\n                    }\n                }\n                else {\n                    t = this.duration;\n                    end = true;\n                }\n            }\n            if (t == this._prevPos) {\n                return end;\n            }\n            if (end) {\n                this.setPaused(true);\n            }\n            var prevPos = this._prevPos;\n            this.position = this._prevPos = t;\n            this._prevPosition = value;\n            if (this._target) {\n                if (this._steps.length > 0) {\n                    // 找到新的tween\n                    var l = this._steps.length;\n                    var stepIndex = -1;\n                    for (var i = 0; i < l; i++) {\n                        if (this._steps[i].type == \"step\") {\n                            stepIndex = i;\n                            if (this._steps[i].t <= t && this._steps[i].t + this._steps[i].d >= t) {\n                                break;\n                            }\n                        }\n                    }\n                    for (var i = 0; i < l; i++) {\n                        if (this._steps[i].type == \"action\") {\n                            //执行actions\n                            if (actionsMode != 0) {\n                                if (this._useTicks) {\n                                    this._runAction(this._steps[i], t, t);\n                                }\n                                else if (actionsMode == 1 && t < prevPos) {\n                                    if (prevPos != this.duration) {\n                                        this._runAction(this._steps[i], prevPos, this.duration);\n                                    }\n                                    this._runAction(this._steps[i], 0, t, true);\n                                }\n                                else {\n                                    this._runAction(this._steps[i], prevPos, t);\n                                }\n                            }\n                        }\n                        else if (this._steps[i].type == \"step\") {\n                            if (stepIndex == i) {\n                                var step = this._steps[stepIndex];\n                                this._updateTargetProps(step, Math.min((this._stepPosition = t - step.t) / step.d, 1));\n                            }\n                        }\n                    }\n                }\n            }\n            this.dispatchEventWith(\"change\");\n            return end;\n        };\n        /**\n         * @private\n         *\n         * @param startPos\n         * @param endPos\n         * @param includeStart\n         */\n        Tween.prototype._runAction = function (action, startPos, endPos, includeStart) {\n            if (includeStart === void 0) { includeStart = false; }\n            var sPos = startPos;\n            var ePos = endPos;\n            if (startPos > endPos) {\n                //把所有的倒置\n                sPos = endPos;\n                ePos = startPos;\n            }\n            var pos = action.t;\n            if (pos == ePos || (pos > sPos && pos < ePos) || (includeStart && pos == startPos)) {\n                action.f.apply(action.o, action.p);\n            }\n        };\n        /**\n         * @private\n         *\n         * @param step\n         * @param ratio\n         */\n        Tween.prototype._updateTargetProps = function (step, ratio) {\n            var p0, p1, v, v0, v1, arr;\n            if (!step && ratio == 1) {\n                this.passive = false;\n                p0 = p1 = this._curQueueProps;\n            }\n            else {\n                this.passive = !!step.v;\n                //不更新props.\n                if (this.passive) {\n                    return;\n                }\n                //使用ease\n                if (step.e) {\n                    ratio = step.e(ratio, 0, 1, 1);\n                }\n                p0 = step.p0;\n                p1 = step.p1;\n            }\n            for (var n in this._initQueueProps) {\n                if ((v0 = p0[n]) == null) {\n                    p0[n] = v0 = this._initQueueProps[n];\n                }\n                if ((v1 = p1[n]) == null) {\n                    p1[n] = v1 = v0;\n                }\n                if (v0 == v1 || ratio == 0 || ratio == 1 || (typeof (v0) != \"number\")) {\n                    v = ratio == 1 ? v1 : v0;\n                }\n                else {\n                    v = v0 + (v1 - v0) * ratio;\n                }\n                var ignore = false;\n                if (arr = Tween._plugins[n]) {\n                    for (var i = 0, l = arr.length; i < l; i++) {\n                        var v2 = arr[i].tween(this, n, v, p0, p1, ratio, !!step && p0 == p1, !step);\n                        if (v2 == Tween.IGNORE) {\n                            ignore = true;\n                        }\n                        else {\n                            v = v2;\n                        }\n                    }\n                }\n                if (!ignore) {\n                    this._target[n] = v;\n                }\n            }\n        };\n        /**\n         * Whether setting is paused\n         * @param value {boolean} Whether to pause\n         * @returns Tween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置是否暂停\n         * @param value {boolean} 是否暂停\n         * @returns Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Tween.prototype.setPaused = function (value) {\n            if (this.paused == value) {\n                return this;\n            }\n            this.paused = value;\n            Tween._register(this, !value);\n            return this;\n        };\n        /**\n         * @private\n         *\n         * @param props\n         * @returns\n         */\n        Tween.prototype._cloneProps = function (props) {\n            var o = {};\n            for (var n in props) {\n                o[n] = props[n];\n            }\n            return o;\n        };\n        /**\n         * @private\n         *\n         * @param o\n         * @returns\n         */\n        Tween.prototype._addStep = function (o) {\n            if (o.d > 0) {\n                o.type = \"step\";\n                this._steps.push(o);\n                o.t = this.duration;\n                this.duration += o.d;\n            }\n            return this;\n        };\n        /**\n         * @private\n         *\n         * @param o\n         * @returns\n         */\n        Tween.prototype._appendQueueProps = function (o) {\n            var arr, oldValue, i, l, injectProps;\n            for (var n in o) {\n                if (this._initQueueProps[n] === undefined) {\n                    oldValue = this._target[n];\n                    //设置plugins\n                    if (arr = Tween._plugins[n]) {\n                        for (i = 0, l = arr.length; i < l; i++) {\n                            oldValue = arr[i].init(this, n, oldValue);\n                        }\n                    }\n                    this._initQueueProps[n] = this._curQueueProps[n] = (oldValue === undefined) ? null : oldValue;\n                }\n                else {\n                    oldValue = this._curQueueProps[n];\n                }\n            }\n            for (var n in o) {\n                oldValue = this._curQueueProps[n];\n                if (arr = Tween._plugins[n]) {\n                    injectProps = injectProps || {};\n                    for (i = 0, l = arr.length; i < l; i++) {\n                        if (arr[i].step) {\n                            arr[i].step(this, n, oldValue, o[n], injectProps);\n                        }\n                    }\n                }\n                this._curQueueProps[n] = o[n];\n            }\n            if (injectProps) {\n                this._appendQueueProps(injectProps);\n            }\n            return this._curQueueProps;\n        };\n        /**\n         * @private\n         *\n         * @param o\n         * @returns\n         */\n        Tween.prototype._addAction = function (o) {\n            o.t = this.duration;\n            o.type = \"action\";\n            this._steps.push(o);\n            return this;\n        };\n        /**\n         * @private\n         *\n         * @param props\n         * @param o\n         */\n        Tween.prototype._set = function (props, o) {\n            for (var n in props) {\n                o[n] = props[n];\n            }\n        };\n        /**\n         * Wait the specified milliseconds before the execution of the next animation\n         * @param duration {number} Waiting time, in milliseconds\n         * @param passive {boolean} Whether properties are updated during the waiting time\n         * @returns Tween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等待指定毫秒后执行下一个动画\n         * @param duration {number} 要等待的时间，以毫秒为单位\n         * @param passive {boolean} 等待期间属性是否会更新\n         * @returns Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Tween.prototype.wait = function (duration, passive) {\n            if (duration == null || duration <= 0) {\n                return this;\n            }\n            var o = this._cloneProps(this._curQueueProps);\n            return this._addStep({ d: duration, p0: o, p1: o, v: passive });\n        };\n        /**\n         * Modify the property of the specified object to a specified value\n         * @param props {Object} Property set of an object\n         * @param duration {number} Duration\n         * @param ease {egret.Ease} Easing algorithm\n         * @returns {egret.Tween} Tween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将指定对象的属性修改为指定值\n         * @param props {Object} 对象的属性集合\n         * @param duration {number} 持续时间\n         * @param ease {egret.Ease} 缓动算法\n         * @returns {egret.Tween} Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Tween.prototype.to = function (props, duration, ease) {\n            if (ease === void 0) { ease = undefined; }\n            if (isNaN(duration) || duration < 0) {\n                duration = 0;\n            }\n            this._addStep({ d: duration || 0, p0: this._cloneProps(this._curQueueProps), e: ease, p1: this._cloneProps(this._appendQueueProps(props)) });\n            //加入一步set，防止游戏极其卡顿时候，to后面的call取到的属性值不对\n            return this.set(props);\n        };\n        /**\n         * Execute callback function\n         * @param callback {Function} Callback method\n         * @param thisObj {any} this action scope of the callback method\n         * @param params {any[]} Parameter of the callback method\n         * @returns {egret.Tween} Tween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @example\n         * <pre>\n         *  egret.Tween.get(display).call(function (a:number, b:string) {\n         *      console.log(\"a: \" + a); // the first parameter passed 233\n         *      console.log(\"b: \" + b); // the second parameter passed “hello”\n         *  }, this, [233, \"hello\"]);\n         * </pre>\n         * @language en_US\n         */\n        /**\n         * 执行回调函数\n         * @param callback {Function} 回调方法\n         * @param thisObj {any} 回调方法this作用域\n         * @param params {any[]} 回调方法参数\n         * @returns {egret.Tween} Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @example\n         * <pre>\n         *  egret.Tween.get(display).call(function (a:number, b:string) {\n         *      console.log(\"a: \" + a); //对应传入的第一个参数 233\n         *      console.log(\"b: \" + b); //对应传入的第二个参数 “hello”\n         *  }, this, [233, \"hello\"]);\n         * </pre>\n         * @language zh_CN\n         */\n        Tween.prototype.call = function (callback, thisObj, params) {\n            if (thisObj === void 0) { thisObj = undefined; }\n            if (params === void 0) { params = undefined; }\n            return this._addAction({ f: callback, p: params ? params : [], o: thisObj ? thisObj : this._target });\n        };\n        /**\n         * Now modify the properties of the specified object to the specified value\n         * @param props {Object} Property set of an object\n         * @param target The object whose Tween to be resumed\n         * @returns {egret.Tween} Tween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * 立即将指定对象的属性修改为指定值\n         * @param props {Object} 对象的属性集合\n         * @param target 要继续播放 Tween 的对象\n         * @returns {egret.Tween} Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        Tween.prototype.set = function (props, target) {\n            if (target === void 0) { target = null; }\n            //更新当前数据，保证缓动流畅性\n            this._appendQueueProps(props);\n            return this._addAction({ f: this._set, o: this, p: [props, target ? target : this._target] });\n        };\n        /**\n         * Execute\n         * @param tween {egret.Tween} The Tween object to be operated. Default: this\n         * @returns {egret.Tween} Tween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 执行\n         * @param tween {egret.Tween} 需要操作的 Tween 对象，默认this\n         * @returns {egret.Tween} Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Tween.prototype.play = function (tween) {\n            if (!tween) {\n                tween = this;\n            }\n            return this.call(tween.setPaused, tween, [false]);\n        };\n        /**\n         * Pause\n         * @param tween {egret.Tween} The Tween object to be operated. Default: this\n         * @returns {egret.Tween} Tween object itself\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 暂停\n         * @param tween {egret.Tween} 需要操作的 Tween 对象，默认this\n         * @returns {egret.Tween} Tween对象本身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        Tween.prototype.pause = function (tween) {\n            if (!tween) {\n                tween = this;\n            }\n            return this.call(tween.setPaused, tween, [true]);\n        };\n        /**\n         * @method egret.Tween#tick\n         * @param delta {number}\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        Tween.prototype.$tick = function (delta) {\n            if (this.paused) {\n                return;\n            }\n            this.setPosition(this._prevPosition + delta);\n        };\n        /**\n         * 不做特殊处理\n         * @constant {number} egret.Tween.NONE\n         * @private\n         */\n        Tween.NONE = 0;\n        /**\n         * 循环\n         * @constant {number} egret.Tween.LOOP\n         * @private\n         */\n        Tween.LOOP = 1;\n        /**\n         * 倒序\n         * @constant {number} egret.Tween.REVERSE\n         * @private\n         */\n        Tween.REVERSE = 2;\n        /**\n         * @private\n         */\n        Tween._tweens = [];\n        /**\n         * @private\n         */\n        Tween.IGNORE = {};\n        /**\n         * @private\n         */\n        Tween._plugins = {};\n        /**\n         * @private\n         */\n        Tween._inited = false;\n        Tween._lastTime = 0;\n        return Tween;\n    }(egret.EventDispatcher));\n    egret.Tween = Tween;\n    __reflect(Tween.prototype, \"egret.Tween\");\n})(egret || (egret = {}));\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\nvar egret;\n(function (egret) {\n    var tween;\n    (function (tween) {\n        /**\n         * Abstract class, Indicate the base action.\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 抽象类，表示一个基本动作\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        var BasePath = (function (_super) {\n            __extends(BasePath, _super);\n            function BasePath() {\n                var _this = _super !== null && _super.apply(this, arguments) || this;\n                /**\n                 * the name of this action.\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language en_US\n                 */\n                /**\n                 * 动作的名称\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language zh_CN\n                 */\n                _this.name = \"\";\n                return _this;\n            }\n            return BasePath;\n        }(egret.EventDispatcher));\n        tween.BasePath = BasePath;\n        __reflect(BasePath.prototype, \"egret.tween.BasePath\");\n        /**\n         * Indicate the to action. See <code>Tween.to</code>\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示一个to动作，参见<code>Tween.to</code>\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        var To = (function (_super) {\n            __extends(To, _super);\n            function To() {\n                var _this = _super !== null && _super.apply(this, arguments) || this;\n                /**\n                 * Property set of an object\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language en_US\n                 */\n                /**\n                 * 对象的属性集合\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language zh_CN\n                 */\n                _this.props = undefined;\n                /**\n                 * Duration\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language en_US\n                 */\n                /**\n                 * 持续时间\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language zh_CN\n                 */\n                _this.duration = 500;\n                /**\n                 * Easing algorithm\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language en_US\n                 */\n                /**\n                 * 缓动算法\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language zh_CN\n                 */\n                _this.ease = undefined;\n                return _this;\n            }\n            return To;\n        }(BasePath));\n        tween.To = To;\n        __reflect(To.prototype, \"egret.tween.To\");\n        /**\n         * Indicate the wait action. See <code>Tween.wait</code>\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示一个wait动作，参见<code>Tween.wait</code>\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        var Wait = (function (_super) {\n            __extends(Wait, _super);\n            function Wait() {\n                var _this = _super !== null && _super.apply(this, arguments) || this;\n                /**\n                 * Duration\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language en_US\n                 */\n                /**\n                 * 持续时间\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language zh_CN\n                 */\n                _this.duration = 500;\n                /**\n                 * Whether properties are updated during the waiting time\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language en_US\n                 */\n                /**\n                 * 等待期间属性是否会更新\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language zh_CN\n                 */\n                _this.passive = undefined;\n                return _this;\n            }\n            return Wait;\n        }(BasePath));\n        tween.Wait = Wait;\n        __reflect(Wait.prototype, \"egret.tween.Wait\");\n        /**\n         * Indicate the set action. See <code>Tween.set</code>\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示一个set动作，参见<code>Tween.set</code>\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        var Set = (function (_super) {\n            __extends(Set, _super);\n            function Set() {\n                var _this = _super !== null && _super.apply(this, arguments) || this;\n                /**\n                 * Property set of an object\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language en_US\n                 */\n                /**\n                 * 对象的属性集合\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language zh_CN\n                 */\n                _this.props = undefined;\n                return _this;\n            }\n            return Set;\n        }(BasePath));\n        tween.Set = Set;\n        __reflect(Set.prototype, \"egret.tween.Set\");\n        /**\n         * Indicate the tick action. See <code>Tween.tick</code>\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示一个tick动作，参见<code>Tween.tick</code>\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        var Tick = (function (_super) {\n            __extends(Tick, _super);\n            function Tick() {\n                var _this = _super !== null && _super.apply(this, arguments) || this;\n                /**\n                 * Delta time\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language en_US\n                 */\n                /**\n                 * 增加的时间\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language zh_CN\n                 */\n                _this.delta = 0;\n                return _this;\n            }\n            return Tick;\n        }(BasePath));\n        tween.Tick = Tick;\n        __reflect(Tick.prototype, \"egret.tween.Tick\");\n        function convertEase(ease) {\n            if (typeof ease === 'function') {\n                return ease;\n            }\n            else {\n                var func = egret.Ease[ease];\n                if (typeof func === 'function') {\n                    return func;\n                }\n            }\n            return null;\n        }\n        /**\n         * TweenItem is a wrapper for Tween, which can set the behavior of Tween by setting attributes and adding Path.\n         *\n         * @event pathComplete Dispatched when some Path has complete.\n         * @event complete Dispatched when all Paths has complete.\n         *\n         * @defaultProperty props\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * TweenItem是对Tween的包装器，能通过设置属性和添加Path的方式设置Tween的行为。\n         * 通常用于使用在EXML中定义组件的动画。\n         *\n         * @event pathComplete 当某个Path执行完毕时会派发此事件。\n         * @event complete 当所有Path执行完毕时会派发此事件。\n         *\n         * @defaultProperty props\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        /**\n         * Use in exml:\n         * ```\n         * \t<tween:TweenItem target=\"{this.button}\">\n         * \t\t<tween:props>\n         * \t\t\t<e:Object loop=\"{true}\"/>\n         * \t\t</tween:props>\n         * \t\t<tween:paths>\n         * \t\t\t<e:Array>\n         * \t\t\t\t<tween:To duration=\"500\">\n         * \t\t\t\t\t<tween:props>\n         * \t\t\t\t\t\t<e:Object x=\"{100}\" y=\"{200}\" />\n         * \t\t\t\t\t</tween:props>\n         * \t\t\t\t</tween:To>\n         * \t\t\t\t<tween:Wait duration=\"1000\" />\n         * \t\t\t\t<tween:To duration=\"1000\">\n         * \t\t\t\t\t<tween:props>\n         * \t\t\t\t\t\t<e:Object x=\"{200}\" y=\"{100}\" />\n         * \t\t\t\t\t</tween:props>\n         * \t\t\t\t</tween:To>\n         * \t\t\t</e:Array>\n         * \t\t</tween:paths>\n         * \t</tween:TweenItem>\n         * ```\n         */\n        var TweenItem = (function (_super) {\n            __extends(TweenItem, _super);\n            function TweenItem() {\n                var _this = _super.call(this) || this;\n                _this.isStop = false;\n                return _this;\n            }\n            Object.defineProperty(TweenItem.prototype, \"props\", {\n                /**\n                 * The Tween's props.\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language en_US\n                 */\n                /**\n                 * Tween的props参数。\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language zh_CN\n                 */\n                get: function () {\n                    return this._props;\n                },\n                set: function (value) {\n                    this._props = value;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(TweenItem.prototype, \"target\", {\n                /**\n                 * The Tween's target.\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language en_US\n                 */\n                /**\n                 * Tween的target参数。\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language zh_CN\n                 */\n                get: function () {\n                    return this._target;\n                },\n                set: function (value) {\n                    this._target = value;\n                },\n                enumerable: true,\n                configurable: true\n            });\n            Object.defineProperty(TweenItem.prototype, \"paths\", {\n                /**\n                 * The Actions in Tween.\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language en_US\n                 */\n                /**\n                 * TweenItem中添加的行为。\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language zh_CN\n                 */\n                get: function () {\n                    return this._paths;\n                },\n                set: function (value) {\n                    this._paths = value || [];\n                },\n                enumerable: true,\n                configurable: true\n            });\n            /**\n             * Play the Tween\n             * @position The starting position, the default is from the last position to play\n             * @version Egret 3.1.8\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 播放Tween\n             * @position 播放的起始位置, 默认为从上次位置继续播放\n             * @version Egret 3.1.8\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            TweenItem.prototype.play = function (position) {\n                if (!this.tween) {\n                    this.createTween(position);\n                }\n                else {\n                    this.tween.setPaused(false);\n                    if (this.isStop && position == undefined) {\n                        position = 0;\n                        this.isStop = false;\n                    }\n                    if (position !== undefined && position !== null) {\n                        this.tween.setPosition(position);\n                    }\n                }\n            };\n            /**\n             * Pause the Tween\n             * @version Egret 3.1.8\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 暂停Tween\n             * @version Egret 3.1.8\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            TweenItem.prototype.pause = function () {\n                if (this.tween) {\n                    this.tween.setPaused(true);\n                }\n            };\n            /**\n             * Stop the Tween\n             * @version Egret 3.1.8\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 停止Tween\n             * @version Egret 3.1.8\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            TweenItem.prototype.stop = function () {\n                this.pause();\n                this.isStop = true;\n            };\n            TweenItem.prototype.createTween = function (position) {\n                this.tween = egret.Tween.get(this._target, this._props);\n                if (this._paths) {\n                    this.applyPaths();\n                }\n                if (position !== undefined && position !== null) {\n                    this.tween.setPosition(position);\n                }\n            };\n            TweenItem.prototype.applyPaths = function () {\n                for (var i = 0; i < this._paths.length; i++) {\n                    var path = this._paths[i];\n                    this.applyPath(path);\n                }\n            };\n            TweenItem.prototype.applyPath = function (path) {\n                var _this = this;\n                if (path instanceof To) {\n                    this.tween.to(path.props, path.duration, convertEase(path.ease));\n                }\n                else if (path instanceof Wait) {\n                    this.tween.wait(path.duration, path.passive);\n                }\n                else if (path instanceof Set) {\n                    this.tween.set(path.props);\n                }\n                else if (path instanceof Tick) {\n                    this.tween.$tick(path.delta);\n                }\n                this.tween.call(function () { return _this.pathComplete(path); });\n            };\n            TweenItem.prototype.pathComplete = function (path) {\n                path.dispatchEventWith('complete');\n                this.dispatchEventWith('pathComplete', false, path);\n                var index = this._paths.indexOf(path);\n                if (index >= 0 && index === this._paths.length - 1) {\n                    this.dispatchEventWith('complete');\n                }\n            };\n            return TweenItem;\n        }(egret.EventDispatcher));\n        tween.TweenItem = TweenItem;\n        __reflect(TweenItem.prototype, \"egret.tween.TweenItem\");\n        registerProperty(TweenItem, 'paths', 'Array', true);\n        /**\n         * TweenGroup is a collection of TweenItem that can be played in parallel with each Item\n         *\n         * @event itemComplete Dispatched when some TweenItem has complete.\n         * @event complete Dispatched when all TweenItems has complete.\n         *\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @includeExample extension/tween/TweenWrapper.ts\n         * @language en_US\n         */\n        /**\n         * TweenGroup是TweenItem的集合，可以并行播放每一个Item\n         * @version Egret 3.1.8\n         * @platform Web,Native\n         * @includeExample extension/tween/TweenWrapper.ts\n         * @language zh_CN\n         */\n        var TweenGroup = (function (_super) {\n            __extends(TweenGroup, _super);\n            function TweenGroup() {\n                var _this = _super.call(this) || this;\n                _this.completeCount = 0;\n                return _this;\n            }\n            Object.defineProperty(TweenGroup.prototype, \"items\", {\n                /**\n                 * The Array that TweenItems in TweenGroup.\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language en_US\n                 */\n                /**\n                 * TweenGroup要控制的TweenItem集合。\n                 * @version Egret 3.1.8\n                 * @platform Web,Native\n                 * @language zh_CN\n                 */\n                get: function () {\n                    return this._items;\n                },\n                set: function (value) {\n                    this.completeCount = 0;\n                    this.registerEvent(false);\n                    this._items = value;\n                    this.registerEvent(true);\n                },\n                enumerable: true,\n                configurable: true\n            });\n            TweenGroup.prototype.registerEvent = function (add) {\n                var _this = this;\n                this._items && this._items.forEach(function (item) {\n                    if (add) {\n                        item.addEventListener('complete', _this.itemComplete, _this);\n                    }\n                    else {\n                        item.removeEventListener('complete', _this.itemComplete, _this);\n                    }\n                });\n            };\n            /**\n             * Play the all TweenItems\n             * @time The starting position, the default is from the last position to play。If use 0, the group will play from the start position.\n             * @version Egret 3.1.8\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 播放所有的TweenItem\n             * @time 播放的起始位置, 默认为从上次位置继续播放。如果为0，则从起始位置开始播放。\n             * @version Egret 3.1.8\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            TweenGroup.prototype.play = function (time) {\n                if (!this._items) {\n                    return;\n                }\n                for (var i = 0; i < this._items.length; i++) {\n                    var item = this._items[i];\n                    item.play(time);\n                }\n            };\n            /**\n             * Pause the all TweenItems\n             * @version Egret 3.1.8\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 暂停播放所有的TweenItem\n             * @version Egret 3.1.8\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            TweenGroup.prototype.pause = function () {\n                if (!this._items) {\n                    return;\n                }\n                for (var i = 0; i < this._items.length; i++) {\n                    var item = this._items[i];\n                    item.pause();\n                }\n            };\n            /**\n             * Stop the all TweenItems\n             * @version Egret 3.1.8\n             * @platform Web,Native\n             * @language en_US\n             */\n            /**\n             * 停止所有的TweenItem\n             * @version Egret 3.1.8\n             * @platform Web,Native\n             * @language zh_CN\n             */\n            TweenGroup.prototype.stop = function () {\n                if (!this._items) {\n                    return;\n                }\n                for (var i = 0; i < this._items.length; i++) {\n                    var item = this._items[i];\n                    item.stop();\n                }\n            };\n            TweenGroup.prototype.itemComplete = function (e) {\n                var item = e.currentTarget;\n                this.completeCount++;\n                this.dispatchEventWith('itemComplete', false, item);\n                if (this.completeCount === this.items.length) {\n                    this.dispatchEventWith('complete');\n                    this.completeCount = 0;\n                }\n            };\n            return TweenGroup;\n        }(egret.EventDispatcher));\n        tween.TweenGroup = TweenGroup;\n        __reflect(TweenGroup.prototype, \"egret.tween.TweenGroup\");\n        registerProperty(TweenGroup, 'items', 'Array', true);\n        function registerProperty(classDefinition, property, type, asDefault) {\n            var prototype = classDefinition.prototype;\n            prototype.__meta__ = prototype.__meta__ || {};\n            prototype.__meta__[property] = type;\n            if (asDefault) {\n                prototype.__defaultProperty__ = property;\n            }\n        }\n    })(tween = egret.tween || (egret.tween = {}));\n})(egret || (egret = {}));\n"
  },
  {
    "path": "demo/libs/rawinflate/rawinflate.d.ts",
    "content": "declare module Zlib {\r\n    class RawInflate {\r\n    \tconstructor(input: any, opt_params?: any);\r\n    \tdecompress():any;\r\n    }\r\n}"
  },
  {
    "path": "demo/libs/rawinflate/rawinflate.js",
    "content": "/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */(function() {var l=this;\n    function p(b, e) {\n        var a = b.split(\".\"),c = l;\n        for(var i=0; i<a.length; i++){\n            var item = a[i];\n            if(!c[item]){\n                c[item] = {};\n            }\n            if(i==a.length-1){\n                c[item] = e;\n            }\n            c = c[item];\n        }\n    };\n\n\n    var q=\"undefined\"!==typeof Uint8Array&&\"undefined\"!==typeof Uint16Array&&\"undefined\"!==typeof Uint32Array&&\"undefined\"!==typeof DataView;function t(b){var e=b.length,a=0,c=Number.POSITIVE_INFINITY,d,f,g,h,k,m,r,n,s,J;for(n=0;n<e;++n)b[n]>a&&(a=b[n]),b[n]<c&&(c=b[n]);d=1<<a;f=new (q?Uint32Array:Array)(d);g=1;h=0;for(k=2;g<=a;){for(n=0;n<e;++n)if(b[n]===g){m=0;r=h;for(s=0;s<g;++s)m=m<<1|r&1,r>>=1;J=g<<16|n;for(s=m;s<d;s+=k)f[s]=J;++h}++g;h<<=1;k<<=1}return[f,a,c]};function u(b,e){this.g=[];this.h=32768;this.c=this.f=this.d=this.k=0;this.input=q?new Uint8Array(b):b;this.l=!1;this.i=v;this.q=!1;if(e||!(e={}))e.index&&(this.d=e.index),e.bufferSize&&(this.h=e.bufferSize),e.bufferType&&(this.i=e.bufferType),e.resize&&(this.q=e.resize);switch(this.i){case w:this.a=32768;this.b=new (q?Uint8Array:Array)(32768+this.h+258);break;case v:this.a=0;this.b=new (q?Uint8Array:Array)(this.h);this.e=this.v;this.m=this.s;this.j=this.t;break;default:throw Error(\"invalid inflate mode\");\n    }}var w=0,v=1;\n    u.prototype.u=function(){for(;!this.l;){var b=x(this,3);b&1&&(this.l=!0);b>>>=1;switch(b){case 0:var e=this.input,a=this.d,c=this.b,d=this.a,f=e.length,g=void 0,h=void 0,k=c.length,m=void 0;this.c=this.f=0;if(a+1>=f)throw Error(\"invalid uncompressed block header: LEN\");g=e[a++]|e[a++]<<8;if(a+1>=f)throw Error(\"invalid uncompressed block header: NLEN\");h=e[a++]|e[a++]<<8;if(g===~h)throw Error(\"invalid uncompressed block header: length verify\");if(a+g>e.length)throw Error(\"input buffer is broken\");switch(this.i){case w:for(;d+\n                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    g>c.length;){m=k-d;g-=m;if(q)c.set(e.subarray(a,a+m),d),d+=m,a+=m;else for(;m--;)c[d++]=e[a++];this.a=d;c=this.e();d=this.a}break;case v:for(;d+g>c.length;)c=this.e({o:2});break;default:throw Error(\"invalid inflate mode\");}if(q)c.set(e.subarray(a,a+g),d),d+=g,a+=g;else for(;g--;)c[d++]=e[a++];this.d=a;this.a=d;this.b=c;break;case 1:this.j(y,z);break;case 2:A(this);break;default:throw Error(\"unknown BTYPE: \"+b);}}return this.m()};\n    var B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],C=q?new Uint16Array(B):B,D=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],E=q?new Uint16Array(D):D,F=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],G=q?new Uint8Array(F):F,H=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],I=q?new Uint16Array(H):H,K=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,\n        13],L=q?new Uint8Array(K):K,M=new (q?Uint8Array:Array)(288),N,O;N=0;for(O=M.length;N<O;++N)M[N]=143>=N?8:255>=N?9:279>=N?7:8;var y=t(M),P=new (q?Uint8Array:Array)(30),Q,R;Q=0;for(R=P.length;Q<R;++Q)P[Q]=5;var z=t(P);function x(b,e){for(var a=b.f,c=b.c,d=b.input,f=b.d,g=d.length,h;c<e;){if(f>=g)throw Error(\"input buffer is broken\");a|=d[f++]<<c;c+=8}h=a&(1<<e)-1;b.f=a>>>e;b.c=c-e;b.d=f;return h}\n    function S(b,e){for(var a=b.f,c=b.c,d=b.input,f=b.d,g=d.length,h=e[0],k=e[1],m,r;c<k&&!(f>=g);)a|=d[f++]<<c,c+=8;m=h[a&(1<<k)-1];r=m>>>16;b.f=a>>r;b.c=c-r;b.d=f;return m&65535}\n    function A(b){function e(a,b,c){var e,d=this.p,f,g;for(g=0;g<a;)switch(e=S(this,b),e){case 16:for(f=3+x(this,2);f--;)c[g++]=d;break;case 17:for(f=3+x(this,3);f--;)c[g++]=0;d=0;break;case 18:for(f=11+x(this,7);f--;)c[g++]=0;d=0;break;default:d=c[g++]=e}this.p=d;return c}var a=x(b,5)+257,c=x(b,5)+1,d=x(b,4)+4,f=new (q?Uint8Array:Array)(C.length),g,h,k,m;for(m=0;m<d;++m)f[C[m]]=x(b,3);if(!q){m=d;for(d=f.length;m<d;++m)f[C[m]]=0}g=t(f);h=new (q?Uint8Array:Array)(a);k=new (q?Uint8Array:Array)(c);b.p=0;\n        b.j(t(e.call(b,a,g,h)),t(e.call(b,c,g,k)))}u.prototype.j=function(b,e){var a=this.b,c=this.a;this.n=b;for(var d=a.length-258,f,g,h,k;256!==(f=S(this,b));)if(256>f)c>=d&&(this.a=c,a=this.e(),c=this.a),a[c++]=f;else{g=f-257;k=E[g];0<G[g]&&(k+=x(this,G[g]));f=S(this,e);h=I[f];0<L[f]&&(h+=x(this,L[f]));c>=d&&(this.a=c,a=this.e(),c=this.a);for(;k--;)a[c]=a[c++-h]}for(;8<=this.c;)this.c-=8,this.d--;this.a=c};\n    u.prototype.t=function(b,e){var a=this.b,c=this.a;this.n=b;for(var d=a.length,f,g,h,k;256!==(f=S(this,b));)if(256>f)c>=d&&(a=this.e(),d=a.length),a[c++]=f;else{g=f-257;k=E[g];0<G[g]&&(k+=x(this,G[g]));f=S(this,e);h=I[f];0<L[f]&&(h+=x(this,L[f]));c+k>d&&(a=this.e(),d=a.length);for(;k--;)a[c]=a[c++-h]}for(;8<=this.c;)this.c-=8,this.d--;this.a=c};\n    u.prototype.e=function(){var b=new (q?Uint8Array:Array)(this.a-32768),e=this.a-32768,a,c,d=this.b;if(q)b.set(d.subarray(32768,b.length));else{a=0;for(c=b.length;a<c;++a)b[a]=d[a+32768]}this.g.push(b);this.k+=b.length;if(q)d.set(d.subarray(e,e+32768));else for(a=0;32768>a;++a)d[a]=d[e+a];this.a=32768;return d};\n    u.prototype.v=function(b){var e,a=this.input.length/this.d+1|0,c,d,f,g=this.input,h=this.b;b&&(\"number\"===typeof b.o&&(a=b.o),\"number\"===typeof b.r&&(a+=b.r));2>a?(c=(g.length-this.d)/this.n[2],f=258*(c/2)|0,d=f<h.length?h.length+f:h.length<<1):d=h.length*a;q?(e=new Uint8Array(d),e.set(h)):e=h;return this.b=e};\n    u.prototype.m=function(){var b=0,e=this.b,a=this.g,c,d=new (q?Uint8Array:Array)(this.k+(this.a-32768)),f,g,h,k;if(0===a.length)return q?this.b.subarray(32768,this.a):this.b.slice(32768,this.a);f=0;for(g=a.length;f<g;++f){c=a[f];h=0;for(k=c.length;h<k;++h)d[b++]=c[h]}f=32768;for(g=this.a;f<g;++f)d[b++]=e[f];this.g=[];return this.buffer=d};\n    u.prototype.s=function(){var b,e=this.a;q?this.q?(b=new Uint8Array(e),b.set(this.b.subarray(0,e))):b=this.b.subarray(0,e):(this.b.length>e&&(this.b.length=e),b=this.b);return this.buffer=b};p(\"Zlib.RawInflate\",u);p(\"Zlib.RawInflate.prototype.decompress\",u.prototype.u);var T={ADAPTIVE:v,BLOCK:w},U,V,W,X;if(Object.keys)U=Object.keys(T);else for(V in U=[],W=0,T)U[W++]=V;W=0;for(X=U.length;W<X;++W)V=U[W],p(\"Zlib.RawInflate.BufferType.\"+V,T[V]);}).call(this);\n\n"
  },
  {
    "path": "demo/manifest.json",
    "content": "{\n\t\"initial\": [\n\t\t\"libs/modules/egret/egret.js\",\n\t\t\"libs/modules/egret/egret.web.js\",\n\t\t\"libs/modules/assetsmanager/assetsmanager.js\",\n\t\t\"libs/modules/game/game.js\",\n\t\t\"libs/modules/tween/tween.js\",\n\t\t\"libs/modules/promise/promise.js\",\n\t\t\"libs/rawinflate/rawinflate.js\",\n\t\t\"libs/fairygui/fairygui.js\"\n\t],\n\t\"game\": [\n\t\t\"bin-debug/demo/JoystickModule.js\",\n\t\t\"bin-debug/LoadingUI.js\",\n\t\t\"bin-debug/Platform.js\",\n\t\t\"bin-debug/demo/BagDemo.js\",\n\t\t\"bin-debug/demo/BasicsDemo.js\",\n\t\t\"bin-debug/demo/ChatDemo.js\",\n\t\t\"bin-debug/demo/CooldownDemo.js\",\n\t\t\"bin-debug/demo/DemoEntry.js\",\n\t\t\"bin-debug/demo/EmojiParser.js\",\n\t\t\"bin-debug/demo/GuideDemo.js\",\n\t\t\"bin-debug/demo/HitTestDemo.js\",\n\t\t\"bin-debug/demo/JoystickDemo.js\",\n\t\t\"bin-debug/Main.js\",\n\t\t\"bin-debug/demo/ListEffectDemo.js\",\n\t\t\"bin-debug/demo/LoopListDemo.js\",\n\t\t\"bin-debug/demo/MailItem.js\",\n\t\t\"bin-debug/demo/MainMenu.js\",\n\t\t\"bin-debug/demo/ModalWaitingDemo.js\",\n\t\t\"bin-debug/demo/PullToRefreshDemo.js\",\n\t\t\"bin-debug/demo/ScrollPaneDemo.js\",\n\t\t\"bin-debug/demo/ScrollPaneHeader.js\",\n\t\t\"bin-debug/demo/TestWin.js\",\n\t\t\"bin-debug/demo/TransitionDemo.js\",\n\t\t\"bin-debug/demo/TreeViewDemo.js\",\n\t\t\"bin-debug/demo/VirtualListDemo.js\"\n\t]\n}"
  },
  {
    "path": "demo/resource/config/description.json",
    "content": "[\n    \"<font color=0x00ff0c>Open-source</font>,<font color=0x00ff0c>Free</font>,<font color=0x00ff0c>Multi-platform</font>\",\n    \"Push <font color=0x00ff0c>Game </font>Forward\",\n    \"<font color=0x00ff0c>HTML5 </font>Game Engine\"\n]"
  },
  {
    "path": "demo/resource/default.res.json",
    "content": "{\n\t\"groups\": [\n\t\t{\n\t\t\t\"keys\": \"MainMenu,MainMenu_atlas0\",\n\t\t\t\"name\": \"preload\"\n\t\t}\n\t],\n\t\"resources\": [\n\t\t{\n\t\t\t\"name\": \"Bag\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"url\": \"assets/UI/Bag.fui\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Bag_atlas0\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"url\": \"assets/UI/Bag_atlas0.png\"\n\t\t},\n\n\t\t{\n\t\t\t\"url\": \"assets/UI/Basics_atlas0.png\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"name\": \"Basics_atlas0\"\n\t\t},\n\t\t{\n\t\t\t\"url\": \"assets/UI/Basics_gojg7u.wav\",\n\t\t\t\"type\": \"sound\",\n\t\t\t\"name\": \"Basics_gojg7u\"\n\t\t},\n\t\t{\n\t\t\t\"url\": \"assets/UI/Basics_o4lt7w.wav\",\n\t\t\t\"type\": \"sound\",\n\t\t\t\"name\": \"Basics_o4lt7w\"\n\t\t},\n\t\t{\n\t\t\t\"url\": \"assets/UI/Basics.fui\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"name\": \"Basics\"\n\t\t},\n\n\t\t{\n\t\t\t\"name\": \"Chat\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"url\": \"assets/UI/Chat.fui\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Chat_atlas0\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"url\": \"assets/UI/Chat_atlas0.png\"\n\t\t},\n\n\t\t{\n\t\t\t\"name\": \"Cooldown\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"url\": \"assets/UI/Cooldown.fui\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Cooldown_atlas0\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"url\": \"assets/UI/Cooldown_atlas0.png\"\n\t\t},\n\n\t\t{\n\t\t\t\"name\": \"Guide\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"url\": \"assets/UI/Guide.fui\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Guide_atlas0\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"url\": \"assets/UI/Guide_atlas0.png\"\n\t\t},\n\n\t\t{\n\t\t\t\"name\": \"HitTest\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"url\": \"assets/UI/HitTest.fui\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"HitTest_atlas0\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"url\": \"assets/UI/HitTest_atlas0.png\"\n\t\t},\n\n\t\t{\n\t\t\t\"name\": \"Joystick\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"url\": \"assets/UI/Joystick.fui\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"Joystick_atlas0\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"url\": \"assets/UI/Joystick_atlas0.png\"\n\t\t},\n\n\t\t{\n\t\t\t\"name\": \"ListEffect\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"url\": \"assets/UI/ListEffect.fui\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"ListEffect_atlas0\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"url\": \"assets/UI/ListEffect_atlas0.png\"\n\t\t},\n\n\t\t{\n\t\t\t\"name\": \"LoopList\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"url\": \"assets/UI/LoopList.fui\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"LoopList_atlas0\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"url\": \"assets/UI/LoopList_atlas0.png\"\n\t\t},\n\n\t\t{\n\t\t\t\"name\": \"MainMenu\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"url\": \"assets/UI/MainMenu.fui\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"MainMenu_atlas0\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"url\": \"assets/UI/MainMenu_atlas0.png\"\n\t\t},\n\n\t\t{\n\t\t\t\"name\": \"ModalWaiting\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"url\": \"assets/UI/ModalWaiting.fui\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"ModalWaiting_atlas0\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"url\": \"assets/UI/ModalWaiting_atlas0.png\"\n\t\t},\n\n\t\t{\n\t\t\t\"url\": \"assets/UI/PullToRefresh.fui\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"name\": \"PullToRefresh\"\n\t\t},\n\t\t{\n\t\t\t\"url\": \"assets/UI/PullToRefresh_atlas0.png\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"name\": \"PullToRefresh_atlas0\"\n\t\t},\n\n\t\t{\n\t\t\t\"url\": \"assets/UI/ScrollPane.fui\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"name\": \"ScrollPane\"\n\t\t},\n\t\t{\n\t\t\t\"url\": \"assets/UI/ScrollPane_atlas0.png\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"name\": \"ScrollPane_atlas0\"\n\t\t},\n\n\t\t{\n\t\t\t\"url\": \"assets/UI/Transition.fui\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"name\": \"Transition\"\n\t\t},\n\t\t{\n\t\t\t\"url\": \"assets/UI/Transition_atlas0.png\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"name\": \"Transition_atlas0\"\n\t\t},\n\t\t{\n\t\t\t\"url\": \"assets/UI/Transition_lvxrs.mp3\",\n\t\t\t\"type\": \"sound\",\n\t\t\t\"name\": \"Transition_lvxrs\",\n\t\t\t\"soundType\": \"effect\"\n\t\t},\n\n\t\t{\n\t\t\t\"name\": \"TreeView\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"url\": \"assets/UI/TreeView.fui\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"TreeView_atlas0\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"url\": \"assets/UI/TreeView_atlas0.png\"\n\t\t},\n\n\t\t{\n\t\t\t\"name\": \"VirtualList\",\n\t\t\t\"type\": \"bin\",\n\t\t\t\"url\": \"assets/UI/VirtualList.fui\"\n\t\t},\n\t\t{\n\t\t\t\"name\": \"VirtualList_atlas0\",\n\t\t\t\"type\": \"image\",\n\t\t\t\"url\": \"assets/UI/VirtualList_atlas0.png\"\n\t\t}\n\t]\n}"
  },
  {
    "path": "demo/scripts/api.d.ts",
    "content": "\n/**\n * ResourceManager 配置文件\n */\ntype ResourceManagerConfig = {\n    /**\n     * 构建与发布配置\n     */\n    buildConfig: (param: BuildConfigParam) => UserConfig,\n    /**\n     * 设置资源类型\n     */\n    typeSelector: (path: string) => (string | null | undefined)\n    /**\n     * 设置资源的合并策略\n     */\n    mergeSelector?: (path: string) => (string | null | undefined),\n    /**\n     * 设置资源的命名策略\n     * beta 功能，请勿随意使用\n     */\n    nameSelector?: (path: string) => (string | null | undefined)\n}\n/**\n * 构建配置\n */\ntype UserConfig = {\n    /**\n     * 输出路径\n     */\n    outputDir: string,\n    /**\n     * 插件\n     */\n    commands: (string | plugins.Command)[]\n}\n\ntype BuildConfigParam = {\n\n\n    /**\n     * 当前命令，build 或者 command\n     */\n    readonly command: string;\n\n    /**\n     * 发布平台\n     */\n    readonly target: string;\n\n    /**\n     * 开发者指定的版本号\n     */\n    readonly version: string;\n\n    /**\n     * 项目名称\n     */\n    readonly projectName: string;\n\n    /**\n     * 项目路径\n     */\n    readonly projectRoot: string;\n\n    /**\n     * 项目配置\n     */\n    readonly projectConfig: ProjectConfig;\n}\n\ntype ProjectConfig = {\n    entryClassName: string;\n    orientation: string;\n    frameRate: number;\n    scaleMode: string;\n    contentWidth: number;\n    contentHeight: number;\n    showFPS: boolean;\n    fpsStyles: string;\n    showLog: boolean;\n    maxTouches: number;\n}\n/**\n   * 匹配机制，将满足 from 的文件输出为 to 格式的文件\n   * from 采用 glob 表达式 , to 包含 [path][name][hash][ext]四个变量\n   * 示例：{ from:\"resource/**.*\" , to:\"[path][name]_[hash].[ext]\" }\n   */\ntype Matcher = {\n\n    from: string,\n\n    to: string\n\n}\n\n\ndeclare namespace plugins {\n\n    interface CommandContext {\n\n        /**\n         * 可以用此接口进行文件创建\n         */\n        createFile(relativeFilePath: string, contents: Buffer);\n\n        /**\n         * 构建配置\n         */\n        buildConfig: BuildConfigParam;\n\n        /** \n         * 项目绝对路径\n         */\n        projectRoot: string;\n\n        /** \n         * 项目输出绝对路径\n         */\n        outputDir: string;\n\n    }\n\n    /**\n     * 构建管线命令\n     */\n    interface Command {\n\n        /**\n         * 项目中的每个文件都会执行此函数，返回 file 表示保留此文件，返回 null 表示将此文件从构建管线中删除，即不会发布\n         */\n        onFile?(file: File): Promise<File | null>\n\n        /**\n         * 项目中所有文件均执行完后，最终会执行此函数。\n         * 这个函数主要被用于创建新文件\n         */\n        onFinish?(pluginContext?: CommandContext): Promise<void>\n\n        [options: string]: any;\n    }\n\n    interface File {\n\n        /**\n         * 文件内容的二进制流，如果开发者需要修改文件内容，请修改此属性\n         */\n        contents: Buffer;\n\n\n        /**\n         * 文件绝对路径，如果开发者需要对文件进行重命名，请修改此属性\n         */\n        path: string;\n\n        /**\n         * 文件所在的项目的项目路径\n         */\n        readonly base: string;\n\n        /**\n         * 文件的相对于 base 属性的相对路径\n         */\n        readonly relative: string;\n\n\n        /**\n         * 文件变更历史，history[0] 即 origin 属性\n         */\n        readonly history: ReadonlyArray<string>;\n\n\n        /**\n         * 文件所在的文件夹的绝对路径\n         */\n        readonly dirname: string;\n\n        /**\n         * 文件的文件名\n         */\n        readonly basename: string;\n\n\n        /**\n         * 文件的扩展名\n         */\n        readonly extname: string;\n\n        /**\n         * 文件的初始文件名\n         */\n        readonly origin: string;\n\n        /**\n         * 其他自定义属性\n         */\n        [customProperty: string]: any;\n\n    }\n\n}\n\n\n\n\n\n\n\n\n\n\ndeclare module 'built-in' {\n\n    /**\n     * 混淆插件参数，设置源代码和目标代码\n     */\n    type UglifyPluginOption = { sources: string[], target: string };\n\n    type UglifyPluginOptions = UglifyPluginOption[];\n\n    /**\n     * 混淆插件\n     */\n    export class UglifyPlugin implements plugins.Command {\n\n        constructor(mergeSelector: UglifyPluginOptions);\n\n    }\n\n\n    type LibraryType = \"debug\" | \"release\";\n\n    type CompilePluginOptions = { libraryType: LibraryType, defines?: any };\n    /**\n     * 编译命令\n     */\n    export class CompilePlugin implements plugins.Command {\n\n        constructor(options: CompilePluginOptions);\n    }\n\n    /**\n     * EXML 插件，用于发布 EXML 文件\n     */\n    export class ExmlPlugin implements plugins.Command {\n\n        constructor(publishPolicy: EXML_Publish_Policy);\n\n    }\n\n    /**\n     * 发布策略\n     * * debug : 默认策略，用于开发环境\n     * * contents : 将 EXML 的内容写入到主题文件中\n     * * gjs : 将生成的JS文件写入到主题文件中\n     * * commonjs : 将EXML合并为一个 CommonJS 风格的文件\n     * * commonjs2 : 将EXML合并为一个含有解析方法和皮肤定义的文件，且皮肤抽离为一份配置\n     * * json : 将每个EXML文件生成一份配置\n     */\n    type EXML_Publish_Policy = \"debug\" | \"contents\" | \"gjs\" | \"commonjs\" | \"commonjs2\" | \"json\"\n\n\n\n\n    /**\n     * 生成 manifest 文件，这个文件会被用于记录 JavaScript 文件的版本号\n     */\n    export class ManifestPlugin implements plugins.Command {\n        constructor(options?: ManifestPluginOptions)\n    }\n\n    /**\n     * 生成文件的文件名\n     * 支持 json 与 js 两种格式\n     */\n    type ManifestPluginOptions = {\n\n        output: string,\n\n        hash?: \"crc32\",\n\n        /**\n         * 是否输出转换过程\n         */\n        verbose?: boolean,\n        /**\n         * 其他传递的消息参数\n         */\n        info?:any\n        /**\n         * use wechat engine plugin\n         */\n        useWxPlugin?: boolean\n    }\n\n    /** \n     * EmitResConfigFilePlugin 的参数\n     * * output: 生成路径，可以指定生成为 *.res.js 文件或者 *.res.json 文件\n     * * typeSelector: 根据文件路径决定文件类型\n     * * nameSelector: 根据文件路径决定文件的资源名\n     * * groupSelector: 根据文件路径决定资源所述的资源组 \n     */\n    type EmitResConfigFilePluginOptions = {\n        output: string,\n        typeSelector: (path: string) => string | null | undefined,\n        nameSelector: (path: string) => string | null | undefined,\n        groupSelector: (path: string) => string | null | undefined,\n    }\n\n\n    /** \n     * 生成 res.json 文件或者 res.js 文件\n     */\n    export class EmitResConfigFilePlugin implements plugins.Command {\n\n        constructor(options: EmitResConfigFilePluginOptions)\n\n    }\n\n    export type ConvertResourceConfigPluginOption = {\n\n        resourceConfigFiles: { filename: string, root: string }[];\n\n        nameSelector: (url: string) => string;\n\n        TM_Verbose: boolean;\n    }\n\n    export class ConvertResConfigFilePlugin implements plugins.Command {\n\n        constructor(options: ConvertResourceConfigPluginOption);\n    }\n\n\n    /**\n     * 增量编译\n     * 这个插件生成的 JavaScript 代码不会被添加到构建管线中，后续其他插件无法获取生成的 js 文件\n     * 这个功能将会在未来被 watch 模式代替掉\n     */\n    export class IncrementCompilePlugin implements plugins.Command {\n\n    }\n\n    type TextureMergerOptions = {\n        textureMergerRoot: string[];\n    }\n\n    /**\n     * 使用 TextureMerger 实现纹理自动合并，依赖 TextureMerger 1.7 以上的版本\n     */\n    export class TextureMergerPlugin implements plugins.Command {\n\n        constructor(options: TextureMergerOptions);\n\n    }\n\n    type CleanPluginOptions = {\n\n        matchers: string[]\n    }\n\n\n    export class CleanPlugin implements plugins.Command {\n        constructor(options: CleanPluginOptions);\n    }\n\n\n    type RenamePluginOptions = {\n\n        /**\n         * 是否输出日志\n         * Whether to output the log\n         */\n        verbose?: boolean\n\n        /**\n         * 采用何种 hash 算法，目前暂时只支持 crc32\n         * What hash algorithm is used, currently only crc32 is supported\n         */\n        hash?: \"crc32\"\n\n\n        /**\n         * 设置匹配规则，将指定文件进行改名\n         * 该参数是个数组，允许设置多个匹配规则\n         * Set up matching rules to copy specified files to other folders\n         * This parameter is an array that allows multiple matching rules to be set\n         */\n        matchers: Matcher[]\n\n        /**\n         * 回调函数，返回值里包括文件的一些信息\n         * The callback function, return value includes some information about the file\n         */\n        callback?: Function\n    }\n\n\n    /**\n     * 修改文件名插件\n     */\n    export class RenamePlugin implements plugins.Command {\n        constructor(options: RenamePluginOptions);\n    }\n\n    type ResSplitPluginOptions = {\n\n        /**\n         * 是否输出日志\n         * Whether to output the log\n         */\n        verbose?: boolean\n\n        /**\n         * 设置匹配规则，将指定文件拷贝至其他文件夹\n         * 该参数是个数组，允许设置多个匹配规则\n         * Set up matching rules to copy specified files to other folders\n         * This parameter is an array that allows multiple matching rules to be set\n         */\n        matchers: Matcher[]\n    }\n\n    export class ResSplitPlugin implements plugins.Command {\n        constructor(options: ResSplitPluginOptions);\n    }\n\n\n    type ZipPluginOptions = {\n\n        mergeSelector: (p: string) => string\n    }\n\n    export class ZipPlugin implements plugins.Command {\n\n        constructor(option: ZipPluginOptions);\n    }\n\n    type MergeEuiJsonPluginOptions = {\n\n        mergeSelector?: (p: string) => string | null,\n\n        createConfig?: boolean\n    }\n    export class MergeEuiJsonPlugin implements plugins.Command {\n\n        constructor(option?: MergeEuiJsonPluginOptions);\n    }\n}\n"
  },
  {
    "path": "demo/scripts/baidugame/baidugame.ts",
    "content": "import * as fs from 'fs';\nimport * as path from 'path';\nexport class BaidugamePlugin implements plugins.Command {\n\n    constructor() {\n    }\n    async onFile(file: plugins.File) {\n        if (file.extname == '.js') {\n            const filename = file.origin;\n            if (filename == \"libs/modules/promise/promise.js\" || filename == 'libs/modules/promise/promise.min.js') {\n                return null;\n            }\n            if (filename == 'libs/modules/egret/egret.js' || filename == 'libs/modules/egret/egret.min.js') {\n                let content = file.contents.toString();\n                content += `;window.egret = egret;`;\n                content = content.replace(/definition = __global/, \"definition = window\");\n                file.contents = new Buffer(content);\n            }\n            else {\n                let content = file.contents.toString();\n                if (\n                    filename == \"libs/modules/res/res.js\" ||\n                    filename == 'libs/modules/res/res.min.js' ||\n                    filename == 'libs/modules/assetsmanager/assetsmanager.min.js' ||\n                    filename == 'libs/modules/assetsmanager/assetsmanager.js'\n                ) {\n                    content += \";window.RES = RES;\"\n                }\n                if (filename == \"libs/modules/eui/eui.js\" || filename == 'libs/modules/eui/eui.min.js') {\n                    content += \";window.eui = eui;\"\n                }\n                if (filename == 'libs/modules/dragonBones/dragonBones.js' || filename == 'libs/modules/dragonBones/dragonBones.min.js') {\n                    content += ';window.dragonBones = dragonBones';\n                }\n                content = \"var egret = window.egret;\" + content;\n                if (filename == 'main.js') {\n                    content += \"\\n;window.Main = Main;\"\n                }\n                file.contents = new Buffer(content);\n            }\n        }\n        return file;\n    }\n    async onFinish(pluginContext: plugins.CommandContext) {\n        //同步 index.html 配置到 game.js\n        const gameJSPath = path.join(pluginContext.outputDir, \"game.js\");\n        if(!fs.existsSync(gameJSPath)) {\n            console.log(`${gameJSPath}不存在，请先使用 Launcher 发布百度小游戏`);\n            return;\n        }\n        let gameJSContent = fs.readFileSync(gameJSPath, { encoding: \"utf8\" });\n        const projectConfig = pluginContext.buildConfig.projectConfig;\n        const optionStr =\n            `entryClassName: ${projectConfig.entryClassName},\\n\\t\\t` +\n            `orientation: ${projectConfig.orientation},\\n\\t\\t` +\n            `frameRate: ${projectConfig.frameRate},\\n\\t\\t` +\n            `scaleMode: ${projectConfig.scaleMode},\\n\\t\\t` +\n            `contentWidth: ${projectConfig.contentWidth},\\n\\t\\t` +\n            `contentHeight: ${projectConfig.contentHeight},\\n\\t\\t` +\n            `showFPS: ${projectConfig.showFPS},\\n\\t\\t` +\n            `fpsStyles: ${projectConfig.fpsStyles},\\n\\t\\t` +\n            `showLog: ${projectConfig.showLog},\\n\\t\\t` +\n            `maxTouches: ${projectConfig.maxTouches},`;\n        const reg = /\\/\\/----auto option start----[\\s\\S]*\\/\\/----auto option end----/;\n        const replaceStr = '\\/\\/----auto option start----\\n\\t\\t' + optionStr + '\\n\\t\\t\\/\\/----auto option end----';\n        gameJSContent = gameJSContent.replace(reg, replaceStr);\n        fs.writeFileSync(gameJSPath, gameJSContent);\n\n        //修改横竖屏\n        let orientation;\n        if (projectConfig.orientation == '\"landscape\"') {\n            orientation = \"landscape\";\n        }\n        else {\n            orientation = \"portrait\";\n        }\n        const gameJSONPath = path.join(pluginContext.outputDir, \"game.json\");\n        let gameJSONContent = JSON.parse(fs.readFileSync(gameJSONPath, { encoding: \"utf8\" }));\n        gameJSONContent.deviceOrientation = orientation;\n        fs.writeFileSync(gameJSONPath, JSON.stringify(gameJSONContent, null, \"\\t\"));\n    }\n}"
  },
  {
    "path": "demo/scripts/bricks/bricks.ts",
    "content": "import * as fs from 'fs';\nimport * as path from 'path';\n\n\ntype ManifestConfig = {\n\n    initial: string[],\n\n    game: string[]\n\n}\n\nexport class BricksPlugin implements plugins.Command {\n\n    constructor() {\n    }\n    async onFile(file: plugins.File) {\n        const filename = file.basename;\n        if (filename == 'manifest.json') {\n            const contents = file.contents.toString();\n            const jsonData: ManifestConfig = JSON.parse(contents);\n\n            let content = '';\n            content += `BK.Script.loadlib(\"GameRes://js/promise.js\");\\n`;\n            for (let item of jsonData.initial) {\n                if (item != 'js/promise.js' && item != 'js/promise.min.js') {\n                    content += `BK.Script.loadlib(\"GameRes://${item}\");\\n`\n                }\n            }\n            for (let item of jsonData.game) {\n                content += `BK.Script.loadlib(\"GameRes://${item}\");\\n`\n            }\n            content += `BK.Script.loadlib(\"GameRes://egret.bricks.js\");\\n`\n            file.path = file.dirname + '/manifest.js'\n            file.contents = new Buffer(content);\n        } else if (filename == 'main.js') {\n            const content = file.contents.toString();\n            let result = content.replace(/RES\\.loadConfig\\(\"resource\\/default\\.res\\.json\", \"resource\\/\"\\)/gm, 'RES.loadConfig(\"GameRes://resource/default.res.json\", \"GameRes://resource/\")');\n            result = result.replace(/eui\\.Theme\\(\"resource\\/default\\.thm\\.json\", _this\\.stage\\)/gm, 'eui.Theme(\"GameRes://resource/default.thm.json\", _this.stage)');\n            result += \";global.Main = Main;\";\n            file.path = file.dirname + '/main.js'\n            file.contents = new Buffer(result);\n        } else if (filename == 'promise.js') {\n            return null;\n        }\n        return file;\n    }\n    async onFinish(pluginContext: plugins.CommandContext) {\n        //同步index.html 配置到main.js\n        let mainJSPath = path.join(pluginContext.outputDir, 'main.js');\n        let mainJSContent = fs.readFileSync(mainJSPath, { encoding: \"utf8\" });\n        let projectConfig = pluginContext.buildConfig.projectConfig;\n\n        mainJSContent = mainJSContent.replace(/frameRate: 30/gm, `frameRate: ${projectConfig.frameRate}`);\n        mainJSContent = mainJSContent.replace(/contentWidth: 640/gm, `contentWidth: ${projectConfig.contentWidth}`);\n        mainJSContent = mainJSContent.replace(/contentHeight: 1136/gm, `contentHeight: ${projectConfig.contentHeight}`);\n        mainJSContent = mainJSContent.replace(/entryClassName: \"Main\"/gm, `entryClassName: ${projectConfig.entryClassName}`);\n        mainJSContent = mainJSContent.replace(/scaleMode: \"showAll\"/gm, `scaleMode: ${projectConfig.scaleMode}`);\n        mainJSContent = mainJSContent.replace(/orientation: \"auto\"/gm, `orientation: ${projectConfig.orientation}`);\n        fs.writeFileSync(mainJSPath, mainJSContent);\n    }\n}\n\ndeclare var egret;"
  },
  {
    "path": "demo/scripts/config.android.ts",
    "content": "/// 阅读 api.d.ts 查看文档\n///<reference path=\"api.d.ts\"/>\n\nimport * as path from 'path';\nimport { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';\nimport * as defaultConfig from './config';\n\nconst config: ResourceManagerConfig = {\n\n    buildConfig: (params) => {\n        const { target, command, projectName, version } = params;\n        const outputDir = `../${projectName}_android/assets/game`;\n        if (command == 'build') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"debug\", defines: { DEBUG: true, RELEASE: false } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new ManifestPlugin({ output: 'manifest.json' })\n                ]\n            }\n        }\n        else if (command == 'publish') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"release\", defines: { DEBUG: false, RELEASE: true } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new UglifyPlugin([{\n                        sources: [\"main.js\"],\n                        target: \"main.min.js\"\n                    }\n                    ]),\n                    new ManifestPlugin({ output: 'manifest.json' })\n                ]\n            }\n        }\n        else {\n            throw `unknown command : ${params.command}`;\n        }\n    },\n\n    mergeSelector: defaultConfig.mergeSelector,\n\n    typeSelector: defaultConfig.typeSelector\n}\n\n\n\nexport = config;\n"
  },
  {
    "path": "demo/scripts/config.baidugame.ts",
    "content": "/// 阅读 api.d.ts 查看文档\n///<reference path=\"api.d.ts\"/>\n\nimport * as path from 'path';\nimport { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';\nimport { BaidugamePlugin } from './baidugame/baidugame';\nimport { CustomPlugin } from './myplugin';\nimport * as defaultConfig from './config';\n\nconst config: ResourceManagerConfig = {\n\n    buildConfig: (params) => {\n\n        const { target, command, projectName, version } = params;\n        const outputDir = `../${projectName}_baidugame`;\n        if (command == 'build') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"debug\", defines: { DEBUG: true, RELEASE: false } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new BaidugamePlugin(),\n                    new ManifestPlugin({ output: 'manifest.js' })\n                ]\n            }\n        }\n        else if (command == 'publish') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"release\", defines: { DEBUG: false, RELEASE: true } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new BaidugamePlugin(),\n                    new UglifyPlugin([{\n                        sources: [\"resource/default.thm.js\"],\n                        target: \"default.thm.min.js\"\n                    }, {\n                        sources: [\"main.js\"],\n                        target: \"main.min.js\"\n                    }\n                    ]),\n                    new ManifestPlugin({ output: 'manifest.js' })\n                ]\n            }\n        }\n        else {\n            throw `unknown command : ${params.command}`;\n        }\n    },\n\n    mergeSelector: defaultConfig.mergeSelector,\n\n    typeSelector: defaultConfig.typeSelector\n}\n\n\n\nexport = config;\n"
  },
  {
    "path": "demo/scripts/config.bricks.ts",
    "content": "/// 阅读 api.d.ts 查看文档\n///<reference path=\"api.d.ts\"/>\n\nimport * as path from 'path';\nimport { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';\nimport { BricksPlugin } from './bricks/bricks';\nimport { CustomPlugin } from './myplugin';\nimport * as defaultConfig from './config';\n\nconst config: ResourceManagerConfig = {\n\n    buildConfig: (params) => {\n\n        const { target, command, projectName, version } = params;\n        const outputDir = `../${projectName}_bricks/PublicBrickEngineGame/Res`;\n        if (command == 'build') {\n            return {\n                outputDir,\n                commands: [\n                    new CompilePlugin({ libraryType: \"debug\", defines: { DEBUG: true, RELEASE: false } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new ManifestPlugin({ output: 'manifest.json' }),\n                    new BricksPlugin()\n                ]\n            }\n        }\n        else if (command == 'publish') {\n            console.log('执行publish')\n            return {\n                outputDir,\n                commands: [\n                    new CompilePlugin({ libraryType: \"debug\", defines: { DEBUG: true, RELEASE: false } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new ManifestPlugin({ output: 'manifest.json' }),\n                    new UglifyPlugin([{\n                        sources: [\"main.js\"],\n                        target: \"js/main.min.js\"\n                    }\n                    ]),\n                    new BricksPlugin(),\n                ]\n            }\n        } else {\n            throw `unknown command : ${params.command}`;\n        }\n    },\n\n    mergeSelector: defaultConfig.mergeSelector,\n\n    typeSelector: defaultConfig.typeSelector\n}\n\n\n\nexport = config;\n"
  },
  {
    "path": "demo/scripts/config.ios.ts",
    "content": "/// 阅读 api.d.ts 查看文档\n///<reference path=\"api.d.ts\"/>\n\nimport * as path from 'path';\nimport { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';\nimport * as defaultConfig from './config';\n\nconst config: ResourceManagerConfig = {\n\n    buildConfig: (params) => {\n        const { target, command, projectName, version } = params;\n        const outputDir = `../${projectName}_ios/assets/game`;\n        if (command == 'build') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"debug\", defines: { DEBUG: true, RELEASE: false } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new ManifestPlugin({ output: 'manifest.json' })\n                ]\n            }\n        }\n        else if (command == 'publish') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"release\", defines: { DEBUG: false, RELEASE: true } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new UglifyPlugin([{\n                        sources: [\"main.js\"],\n                        target: \"main.min.js\"\n                    }\n                    ]),\n                    new ManifestPlugin({ output: 'manifest.json' })\n                ]\n            }\n        }\n        else {\n            throw `unknown command : ${params.command}`;\n        }\n    },\n\n    mergeSelector: defaultConfig.mergeSelector,\n\n    typeSelector: defaultConfig.typeSelector\n}\n\n\n\nexport = config;\n"
  },
  {
    "path": "demo/scripts/config.oppogame.ts",
    "content": "/// 阅读 api.d.ts 查看文档\n///<reference path=\"api.d.ts\"/>\n\nimport * as path from 'path';\nimport { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, ResSplitPlugin, CleanPlugin } from 'built-in';\nimport { OppogamePlugin } from './oppogame/oppogame';\nimport * as defaultConfig from './config';\n\nconst config: ResourceManagerConfig = {\n\n    buildConfig: (params) => {\n\n        const { target, command, projectName, version } = params;\n        const outputDir = `../${projectName}_oppogame`;\n        if (command == 'build') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"debug\", defines: { DEBUG: true, RELEASE: false } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new OppogamePlugin(),\n                    new ManifestPlugin({ output: 'manifest.js' })\n                ]\n            }\n        }\n        else if (command == 'publish') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"release\", defines: { DEBUG: false, RELEASE: true } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new OppogamePlugin(),\n                    new UglifyPlugin([{\n                        sources: [\"resource/default.thm.js\"],\n                        target: \"default.thm.min.js\"\n                    }, {\n                        sources: [\"main.js\"],\n                        target: \"main.min.js\"\n                    }\n                    ]),\n                    new ManifestPlugin({ output: 'manifest.js' })\n                ]\n            }\n        }\n        else {\n            throw `unknown command : ${params.command}`;\n        }\n    },\n\n    mergeSelector: defaultConfig.mergeSelector,\n\n    typeSelector: defaultConfig.typeSelector\n}\n\n\n\nexport = config;\n"
  },
  {
    "path": "demo/scripts/config.qgame.ts",
    "content": "/// 阅读 api.d.ts 查看文档\n///<reference path=\"api.d.ts\"/>\n\nimport * as path from 'path';\nimport { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, ResSplitPlugin, CleanPlugin } from 'built-in';\nimport { MiqgamePlugin } from './qgame/qgame';\nimport * as defaultConfig from './config';\n\nconst config: ResourceManagerConfig = {\n\n    buildConfig: (params) => {\n\n        const { target, command, projectName, version } = params;\n        const outputDir = `../${projectName}_qgame`;\n        if (command == 'build') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"debug\", defines: { DEBUG: true, RELEASE: false } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new MiqgamePlugin(),\n                    new ManifestPlugin({ output: 'manifest.js' })\n                ]\n            }\n        }\n        else if (command == 'publish') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"release\", defines: { DEBUG: false, RELEASE: true } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new MiqgamePlugin(),\n                    new UglifyPlugin([{\n                        sources: [\"resource/default.thm.js\"],\n                        target: \"default.thm.min.js\"\n                    }, {\n                        sources: [\"main.js\"],\n                        target: \"main.min.js\"\n                    }\n                    ]),\n                    new ManifestPlugin({ output: 'manifest.js' })\n                ]\n            }\n        }\n        else {\n            throw `unknown command : ${params.command}`;\n        }\n    },\n\n    mergeSelector: defaultConfig.mergeSelector,\n\n    typeSelector: defaultConfig.typeSelector\n}\n\n\n\nexport = config;\n"
  },
  {
    "path": "demo/scripts/config.qqgame.ts",
    "content": "/// 阅读 api.d.ts 查看文档\n///<reference path=\"api.d.ts\"/>\n\nimport * as path from 'path';\nimport { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';\nimport { QQgamePlugin } from './qqgame/qqgame';\nimport { CustomPlugin } from './myplugin';\nimport * as defaultConfig from './config';\n\nconst config: ResourceManagerConfig = {\n\n    buildConfig: (params) => {\n\n        const { target, command, projectName, version } = params;\n        const outputDir = `../${projectName}_qqgame`;\n        if (command == 'build') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"debug\", defines: { DEBUG: true, RELEASE: false } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new QQgamePlugin(),\n                    new ManifestPlugin({ output: 'manifest.js' })\n                ]\n            }\n        }\n        else if (command == 'publish') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"release\", defines: { DEBUG: false, RELEASE: true } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new QQgamePlugin(),\n                    new UglifyPlugin([{\n                        sources: [\"resource/default.thm.js\"],\n                        target: \"default.thm.min.js\"\n                    }, {\n                        sources: [\"main.js\"],\n                        target: \"main.min.js\"\n                    }\n                    ]),\n                    new ManifestPlugin({ output: 'manifest.js' })\n                ]\n            }\n        }\n        else {\n            throw `unknown command : ${params.command}`;\n        }\n    },\n\n    mergeSelector: defaultConfig.mergeSelector,\n\n    typeSelector: defaultConfig.typeSelector\n}\n\n\n\nexport = config;\n"
  },
  {
    "path": "demo/scripts/config.ts",
    "content": "/// 阅读 api.d.ts 查看文档\n///<reference path=\"api.d.ts\"/>\n\nimport * as path from 'path';\nimport { UglifyPlugin, IncrementCompilePlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, RenamePlugin } from 'built-in';\nimport { WxgamePlugin } from './wxgame/wxgame';\nimport { BricksPlugin } from './bricks/bricks';\nimport { CustomPlugin } from './myplugin';\n\nconst config: ResourceManagerConfig = {\n\n\n    buildConfig: (params) => {\n\n        const { target, command, projectName, version } = params;\n\n        if (command == 'build') {\n            const outputDir = '.';\n            return {\n                outputDir,\n                commands: [\n                    // new EmitResConfigFilePlugin({\n                    //     output: \"resource/default.res.json\",\n                    //     typeSelector: config.typeSelector,\n                    //     nameSelector: p => path.basename(p).replace(/\\./gi, \"_\"),\n                    //     groupSelector: p => \"preload\"\n                    // }),\n                    new ExmlPlugin('debug'), // 非 EUI 项目关闭此设置\n                    new IncrementCompilePlugin(),\n                ]\n            }\n        }\n        else if (command == 'publish') {\n            const outputDir = `bin-release/web/${version}`;\n            return {\n                outputDir,\n                commands: [\n                    new CustomPlugin(),\n                    new CompilePlugin({ libraryType: \"release\", defines: { DEBUG: false, RELEASE: true } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new UglifyPlugin([{\n                        sources: [\"main.js\"],\n                        target: \"main.min.js\"\n                    }]),\n                    new RenamePlugin({\n                        verbose: true, hash: 'crc32', matchers: [\n                            { from: \"**/*.js\", to: \"[path][name]_[hash].[ext]\" }\n                        ]\n                    }),\n                    new ManifestPlugin({ output: \"manifest.json\" })\n                ]\n            }\n        }\n        else {\n            throw `unknown command : ${params.command}`\n        }\n    },\n\n    mergeSelector: (path) => {\n        if (path.indexOf(\"assets/bitmap/\") >= 0) {\n            return \"assets/bitmap/sheet.sheet\"\n        }\n        else if (path.indexOf(\"armature\") >= 0 && path.indexOf(\".json\") >= 0) {\n            return \"assets/armature/1.zip\";\n        }\n    },\n\n    typeSelector: (path) => {\n        const ext = path.substr(path.lastIndexOf(\".\") + 1);\n        const typeMap = {\n            \"jpg\": \"image\",\n            \"png\": \"image\",\n            \"webp\": \"image\",\n            \"json\": \"json\",\n            \"fnt\": \"font\",\n            \"pvr\": \"pvr\",\n            \"mp3\": \"sound\",\n            \"zip\": \"zip\",\n            \"sheet\": \"sheet\",\n            \"exml\": \"text\"\n        }\n        let type = typeMap[ext];\n        if (type == \"json\") {\n            if (path.indexOf(\"sheet\") >= 0) {\n                type = \"sheet\";\n            } else if (path.indexOf(\"movieclip\") >= 0) {\n                type = \"movieclip\";\n            };\n        }\n        return type;\n    }\n}\n\n\nexport = config;\n"
  },
  {
    "path": "demo/scripts/config.vivogame.ts",
    "content": "/// 阅读 api.d.ts 查看文档\n///<reference path=\"api.d.ts\"/>\n\nimport * as path from 'path';\nimport { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, ResSplitPlugin, CleanPlugin } from 'built-in';\nimport { VivogamePlugin } from './vivogame/vivogame';\nimport * as defaultConfig from './config';\n\nconst config: ResourceManagerConfig = {\n\n    buildConfig: (params) => {\n\n        const { target, command, projectName, version } = params;\n        const outputDir = `../${projectName}_vivogame/src`;\n        if (command == 'build') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"../engine/js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"debug\", defines: { DEBUG: true, RELEASE: false } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new VivogamePlugin(),\n                    new ManifestPlugin({ output: 'manifest.js', info: { target: 'vivogame' } })\n                ]\n            }\n        }\n        else if (command == 'publish') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"../engine/js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"release\", defines: { DEBUG: false, RELEASE: true } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new VivogamePlugin(),\n                    new UglifyPlugin([{\n                        sources: [\"resource/default.thm.js\"],\n                        target: \"default.thm.min.js\"\n                    }, {\n                        sources: [\"main.js\"],\n                        target: \"main.min.js\"\n                    }\n                    ]),\n                    new ManifestPlugin({ output: 'manifest.js', info: { target: 'vivogame' } })\n                ]\n            }\n        }\n        else {\n            throw `unknown command : ${params.command}`;\n        }\n    },\n\n    mergeSelector: defaultConfig.mergeSelector,\n\n    typeSelector: defaultConfig.typeSelector\n}\n\n\n\nexport = config;\n"
  },
  {
    "path": "demo/scripts/config.wxgame.ts",
    "content": "/// 阅读 api.d.ts 查看文档\n///<reference path=\"api.d.ts\"/>\n\nimport * as path from 'path';\nimport { UglifyPlugin, CompilePlugin, ManifestPlugin, ExmlPlugin, EmitResConfigFilePlugin, TextureMergerPlugin, CleanPlugin } from 'built-in';\nimport { WxgamePlugin } from './wxgame/wxgame';\nimport { CustomPlugin } from './myplugin';\nimport * as defaultConfig from './config';\n\nconst config: ResourceManagerConfig = {\n\n    buildConfig: (params) => {\n\n        const { target, command, projectName, version } = params;\n        const outputDir = `../${projectName}_wxgame`;\n        if (command == 'build') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"debug\", defines: { DEBUG: true, RELEASE: false } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new WxgamePlugin(),\n                    new ManifestPlugin({ output: 'manifest.js' })\n                ]\n            }\n        }\n        else if (command == 'publish') {\n            return {\n                outputDir,\n                commands: [\n                    new CleanPlugin({ matchers: [\"js\", \"resource\"] }),\n                    new CompilePlugin({ libraryType: \"release\", defines: { DEBUG: false, RELEASE: true } }),\n                    new ExmlPlugin('commonjs'), // 非 EUI 项目关闭此设置\n                    new WxgamePlugin(),\n                    new UglifyPlugin([{\n                        sources: [\"resource/default.thm.js\"],\n                        target: \"default.thm.min.js\"\n                    }, {\n                        sources: [\"main.js\"],\n                        target: \"main.min.js\"\n                    }\n                    ]),\n                    new ManifestPlugin({ output: 'manifest.js' })\n                ]\n            }\n        }\n        else {\n            throw `unknown command : ${params.command}`;\n        }\n    },\n\n    mergeSelector: defaultConfig.mergeSelector,\n\n    typeSelector: defaultConfig.typeSelector\n}\n\n\n\nexport = config;\n"
  },
  {
    "path": "demo/scripts/myplugin.ts",
    "content": "/**\n * 示例自定义插件，您可以查阅 http://developer.egret.com/cn/github/egret-docs/Engine2D/projectConfig/cmdExtensionPlugin/index.html\n * 了解如何开发一个自定义插件\n */\nexport class CustomPlugin implements plugins.Command {\n\n    constructor() {\n    }\n\n    async onFile(file: plugins.File) {\n        return file;\n    }\n\n    async onFinish(commandContext: plugins.CommandContext) {\n\n    }\n}"
  },
  {
    "path": "demo/scripts/node.d.ts",
    "content": "// Generated by typings\n// Source: https://raw.githubusercontent.com/DefinitelyTyped/DefinitelyTyped/a4a912a0cd1849fa7df0e5d909c8625fba04e49d/node/index.d.ts\ninterface Console {\n    Console: NodeJS.ConsoleConstructor;\n    assert(value: any, message?: string, ...optionalParams: any[]): void;\n    dir(obj: any, options?: {showHidden?: boolean, depth?: number, colors?: boolean}): void;\n    error(message?: any, ...optionalParams: any[]): void;\n    info(message?: any, ...optionalParams: any[]): void;\n    log(message?: any, ...optionalParams: any[]): void;\n    time(label: string): void;\n    timeEnd(label: string): void;\n    trace(message?: any, ...optionalParams: any[]): void;\n    warn(message?: any, ...optionalParams: any[]): void;\n}\n\ninterface Error {\n    stack?: string;\n}\n\ninterface ErrorConstructor {\n    captureStackTrace(targetObject: Object, constructorOpt?: Function): void;\n    stackTraceLimit: number;\n}\n\n// compat for TypeScript 1.8\n// if you use with --target es3 or --target es5 and use below definitions,\n// use the lib.es6.d.ts that is bundled with TypeScript 1.8.\ninterface MapConstructor { }\ninterface WeakMapConstructor { }\ninterface SetConstructor { }\ninterface WeakSetConstructor { }\n\n// Forward-declare needed types from lib.es2015.d.ts (in case users are using `--lib es5`)\ninterface Iterable<T> {}\ninterface Iterator<T> {\n    next(value?: any): IteratorResult<T>;\n}\ninterface IteratorResult<T> {}\ninterface SymbolConstructor {\n    readonly iterator: symbol;\n}\ndeclare var Symbol: SymbolConstructor;\n\n/************************************************\n*                                               *\n*                   GLOBAL                      *\n*                                               *\n************************************************/\ndeclare var process: NodeJS.Process;\ndeclare var global: NodeJS.Global;\ndeclare var console: Console;\n\ndeclare var __filename: string;\ndeclare var __dirname: string;\n\ndeclare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;\ndeclare function clearTimeout(timeoutId: NodeJS.Timer): void;\ndeclare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;\ndeclare function clearInterval(intervalId: NodeJS.Timer): void;\ndeclare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;\ndeclare function clearImmediate(immediateId: any): void;\n\ninterface NodeRequireFunction {\n    (id: string): any;\n}\n\ninterface NodeRequire extends NodeRequireFunction {\n    resolve(id: string): string;\n    cache: any;\n    extensions: any;\n    main: NodeModule | undefined;\n}\n\ndeclare var require: NodeRequire;\n\ninterface NodeModule {\n    exports: any;\n    require: NodeRequireFunction;\n    id: string;\n    filename: string;\n    loaded: boolean;\n    parent: NodeModule | null;\n    children: NodeModule[];\n}\n\ndeclare var module: NodeModule;\n\n// Same as module.exports\ndeclare var exports: any;\ndeclare var SlowBuffer: {\n    new (str: string, encoding?: string): Buffer;\n    new (size: number): Buffer;\n    new (size: Uint8Array): Buffer;\n    new (array: any[]): Buffer;\n    prototype: Buffer;\n    isBuffer(obj: any): boolean;\n    byteLength(string: string, encoding?: string): number;\n    concat(list: Buffer[], totalLength?: number): Buffer;\n};\n\n\n// Buffer class\ntype BufferEncoding = \"ascii\" | \"utf8\" | \"utf16le\" | \"ucs2\" | \"binary\" | \"hex\";\ninterface Buffer extends NodeBuffer { }\n\n/**\n * Raw data is stored in instances of the Buffer class.\n * A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap.  A Buffer cannot be resized.\n * Valid string encodings: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'\n */\ndeclare var Buffer: {\n    /**\n     * Allocates a new buffer containing the given {str}.\n     *\n     * @param str String to store in buffer.\n     * @param encoding encoding to use, optional.  Default is 'utf8'\n     */\n    new (str: string, encoding?: string): Buffer;\n    /**\n     * Allocates a new buffer of {size} octets.\n     *\n     * @param size count of octets to allocate.\n     */\n    new (size: number): Buffer;\n    /**\n     * Allocates a new buffer containing the given {array} of octets.\n     *\n     * @param array The octets to store.\n     */\n    new (array: Uint8Array): Buffer;\n    /**\n     * Produces a Buffer backed by the same allocated memory as\n     * the given {ArrayBuffer}.\n     *\n     *\n     * @param arrayBuffer The ArrayBuffer with which to share memory.\n     */\n    new (arrayBuffer: ArrayBuffer): Buffer;\n    /**\n     * Allocates a new buffer containing the given {array} of octets.\n     *\n     * @param array The octets to store.\n     */\n    new (array: any[]): Buffer;\n    /**\n     * Copies the passed {buffer} data onto a new {Buffer} instance.\n     *\n     * @param buffer The buffer to copy.\n     */\n    new (buffer: Buffer): Buffer;\n    prototype: Buffer;\n    /**\n     * Allocates a new Buffer using an {array} of octets.\n     *\n     * @param array\n     */\n    from(array: any[]): Buffer;\n    /**\n     * When passed a reference to the .buffer property of a TypedArray instance,\n     * the newly created Buffer will share the same allocated memory as the TypedArray.\n     * The optional {byteOffset} and {length} arguments specify a memory range\n     * within the {arrayBuffer} that will be shared by the Buffer.\n     *\n     * @param arrayBuffer The .buffer property of a TypedArray or a new ArrayBuffer()\n     * @param byteOffset\n     * @param length\n     */\n    from(arrayBuffer: ArrayBuffer, byteOffset?: number, length?: number): Buffer;\n    /**\n     * Copies the passed {buffer} data onto a new Buffer instance.\n     *\n     * @param buffer\n     */\n    from(buffer: Buffer): Buffer;\n    /**\n     * Creates a new Buffer containing the given JavaScript string {str}.\n     * If provided, the {encoding} parameter identifies the character encoding.\n     * If not provided, {encoding} defaults to 'utf8'.\n     *\n     * @param str\n     */\n    from(str: string, encoding?: string): Buffer;\n    /**\n     * Returns true if {obj} is a Buffer\n     *\n     * @param obj object to test.\n     */\n    isBuffer(obj: any): obj is Buffer;\n    /**\n     * Returns true if {encoding} is a valid encoding argument.\n     * Valid string encodings in Node 0.12: 'ascii'|'utf8'|'utf16le'|'ucs2'(alias of 'utf16le')|'base64'|'binary'(deprecated)|'hex'\n     *\n     * @param encoding string to test.\n     */\n    isEncoding(encoding: string): boolean;\n    /**\n     * Gives the actual byte length of a string. encoding defaults to 'utf8'.\n     * This is not the same as String.prototype.length since that returns the number of characters in a string.\n     *\n     * @param string string to test.\n     * @param encoding encoding used to evaluate (defaults to 'utf8')\n     */\n    byteLength(string: string, encoding?: string): number;\n    /**\n     * Returns a buffer which is the result of concatenating all the buffers in the list together.\n     *\n     * If the list has no items, or if the totalLength is 0, then it returns a zero-length buffer.\n     * If the list has exactly one item, then the first item of the list is returned.\n     * If the list has more than one item, then a new Buffer is created.\n     *\n     * @param list An array of Buffer objects to concatenate\n     * @param totalLength Total length of the buffers when concatenated.\n     *   If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.\n     */\n    concat(list: Buffer[], totalLength?: number): Buffer;\n    /**\n     * The same as buf1.compare(buf2).\n     */\n    compare(buf1: Buffer, buf2: Buffer): number;\n    /**\n     * Allocates a new buffer of {size} octets.\n     *\n     * @param size count of octets to allocate.\n     * @param fill if specified, buffer will be initialized by calling buf.fill(fill).\n     *    If parameter is omitted, buffer will be filled with zeros.\n     * @param encoding encoding used for call to buf.fill while initalizing\n     */\n    alloc(size: number, fill?: string | Buffer | number, encoding?: string): Buffer;\n    /**\n     * Allocates a new buffer of {size} octets, leaving memory not initialized, so the contents\n     * of the newly created Buffer are unknown and may contain sensitive data.\n     *\n     * @param size count of octets to allocate\n     */\n    allocUnsafe(size: number): Buffer;\n    /**\n     * Allocates a new non-pooled buffer of {size} octets, leaving memory not initialized, so the contents\n     * of the newly created Buffer are unknown and may contain sensitive data.\n     *\n     * @param size count of octets to allocate\n     */\n    allocUnsafeSlow(size: number): Buffer;\n};\n\n/************************************************\n*                                               *\n*               GLOBAL INTERFACES               *\n*                                               *\n************************************************/\ndeclare namespace NodeJS {\n    export interface ConsoleConstructor {\n        prototype: Console;\n        new(stdout: WritableStream, stderr?: WritableStream): Console;\n    }\n\n    export interface ErrnoException extends Error {\n        errno?: number;\n        code?: string;\n        path?: string;\n        syscall?: string;\n        stack?: string;\n    }\n\n    export class EventEmitter {\n        addListener(event: string | symbol, listener: Function): this;\n        on(event: string | symbol, listener: Function): this;\n        once(event: string | symbol, listener: Function): this;\n        removeListener(event: string | symbol, listener: Function): this;\n        removeAllListeners(event?: string | symbol): this;\n        setMaxListeners(n: number): this;\n        getMaxListeners(): number;\n        listeners(event: string | symbol): Function[];\n        emit(event: string | symbol, ...args: any[]): boolean;\n        listenerCount(type: string | symbol): number;\n        // Added in Node 6...\n        prependListener(event: string | symbol, listener: Function): this;\n        prependOnceListener(event: string | symbol, listener: Function): this;\n        eventNames(): (string | symbol)[];\n    }\n\n    export interface ReadableStream extends EventEmitter {\n        readable: boolean;\n        isTTY?: boolean;\n        read(size?: number): string | Buffer;\n        setEncoding(encoding: string | null): this;\n        pause(): this;\n        resume(): this;\n        isPaused(): boolean;\n        pipe<T extends WritableStream>(destination: T, options?: { end?: boolean; }): T;\n        unpipe<T extends WritableStream>(destination?: T): this;\n        unshift(chunk: string): void;\n        unshift(chunk: Buffer): void;\n        wrap(oldStream: ReadableStream): ReadableStream;\n    }\n\n    export interface WritableStream extends EventEmitter {\n        writable: boolean;\n        isTTY?: boolean;\n        write(buffer: Buffer | string, cb?: Function): boolean;\n        write(str: string, encoding?: string, cb?: Function): boolean;\n        end(): void;\n        end(buffer: Buffer, cb?: Function): void;\n        end(str: string, cb?: Function): void;\n        end(str: string, encoding?: string, cb?: Function): void;\n    }\n\n    export interface ReadWriteStream extends ReadableStream, WritableStream { }\n\n    export interface Events extends EventEmitter { }\n\n    export interface Domain extends Events {\n        run(fn: Function): void;\n        add(emitter: Events): void;\n        remove(emitter: Events): void;\n        bind(cb: (err: Error, data: any) => any): any;\n        intercept(cb: (data: any) => any): any;\n        dispose(): void;\n\n        addListener(event: string, listener: Function): this;\n        on(event: string, listener: Function): this;\n        once(event: string, listener: Function): this;\n        removeListener(event: string, listener: Function): this;\n        removeAllListeners(event?: string): this;\n    }\n\n    export interface MemoryUsage {\n        rss: number;\n        heapTotal: number;\n        heapUsed: number;\n    }\n\n    export interface CpuUsage {\n        user: number;\n        system: number;\n    }\n\n    export interface ProcessVersions {\n        http_parser: string;\n        node: string;\n        v8: string;\n        ares: string;\n        uv: string;\n        zlib: string;\n        modules: string;\n        openssl: string;\n    }\n\n    type Platform = 'aix'\n                  | 'android'\n                  | 'darwin'\n                  | 'freebsd'\n                  | 'linux'\n                  | 'openbsd'\n                  | 'sunos'\n                  | 'win32';\n\n    export interface Process extends EventEmitter {\n        stdout: WritableStream;\n        stderr: WritableStream;\n        stdin: ReadableStream;\n        argv: string[];\n        argv0: string;\n        execArgv: string[];\n        execPath: string;\n        abort(): void;\n        chdir(directory: string): void;\n        cwd(): string;\n        env: any;\n        exit(code?: number): void;\n        exitCode: number;\n        getgid(): number;\n        setgid(id: number): void;\n        setgid(id: string): void;\n        getuid(): number;\n        setuid(id: number): void;\n        setuid(id: string): void;\n        version: string;\n        versions: ProcessVersions;\n        config: {\n            target_defaults: {\n                cflags: any[];\n                default_configuration: string;\n                defines: string[];\n                include_dirs: string[];\n                libraries: string[];\n            };\n            variables: {\n                clang: number;\n                host_arch: string;\n                node_install_npm: boolean;\n                node_install_waf: boolean;\n                node_prefix: string;\n                node_shared_openssl: boolean;\n                node_shared_v8: boolean;\n                node_shared_zlib: boolean;\n                node_use_dtrace: boolean;\n                node_use_etw: boolean;\n                node_use_openssl: boolean;\n                target_arch: string;\n                v8_no_strict_aliasing: number;\n                v8_use_snapshot: boolean;\n                visibility: string;\n            };\n        };\n        kill(pid: number, signal?: string | number): void;\n        pid: number;\n        title: string;\n        arch: string;\n        platform: Platform;\n        mainModule?: NodeModule;\n        memoryUsage(): MemoryUsage;\n        cpuUsage(previousValue?: CpuUsage): CpuUsage;\n        nextTick(callback: Function, ...args: any[]): void;\n        umask(mask?: number): number;\n        uptime(): number;\n        hrtime(time?: [number, number]): [number, number];\n        domain: Domain;\n\n        // Worker\n        send?(message: any, sendHandle?: any): void;\n        disconnect(): void;\n        connected: boolean;\n    }\n\n    export interface Global {\n        Array: typeof Array;\n        ArrayBuffer: typeof ArrayBuffer;\n        Boolean: typeof Boolean;\n        Buffer: typeof Buffer;\n        DataView: typeof DataView;\n        Date: typeof Date;\n        Error: typeof Error;\n        EvalError: typeof EvalError;\n        Float32Array: typeof Float32Array;\n        Float64Array: typeof Float64Array;\n        Function: typeof Function;\n        GLOBAL: Global;\n        Infinity: typeof Infinity;\n        Int16Array: typeof Int16Array;\n        Int32Array: typeof Int32Array;\n        Int8Array: typeof Int8Array;\n        Intl: typeof Intl;\n        JSON: typeof JSON;\n        Map: MapConstructor;\n        Math: typeof Math;\n        NaN: typeof NaN;\n        Number: typeof Number;\n        Object: typeof Object;\n        Promise: Function;\n        RangeError: typeof RangeError;\n        ReferenceError: typeof ReferenceError;\n        RegExp: typeof RegExp;\n        Set: SetConstructor;\n        String: typeof String;\n        Symbol: Function;\n        SyntaxError: typeof SyntaxError;\n        TypeError: typeof TypeError;\n        URIError: typeof URIError;\n        Uint16Array: typeof Uint16Array;\n        Uint32Array: typeof Uint32Array;\n        Uint8Array: typeof Uint8Array;\n        Uint8ClampedArray: Function;\n        WeakMap: WeakMapConstructor;\n        WeakSet: WeakSetConstructor;\n        clearImmediate: (immediateId: any) => void;\n        clearInterval: (intervalId: NodeJS.Timer) => void;\n        clearTimeout: (timeoutId: NodeJS.Timer) => void;\n        console: typeof console;\n        decodeURI: typeof decodeURI;\n        decodeURIComponent: typeof decodeURIComponent;\n        encodeURI: typeof encodeURI;\n        encodeURIComponent: typeof encodeURIComponent;\n        escape: (str: string) => string;\n        eval: typeof eval;\n        global: Global;\n        isFinite: typeof isFinite;\n        isNaN: typeof isNaN;\n        parseFloat: typeof parseFloat;\n        parseInt: typeof parseInt;\n        process: Process;\n        root: Global;\n        setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => any;\n        setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer;\n        setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => NodeJS.Timer;\n        undefined: typeof undefined;\n        unescape: (str: string) => string;\n        gc: () => void;\n        v8debug?: any;\n    }\n\n    export interface Timer {\n        ref(): void;\n        unref(): void;\n    }\n}\n\ninterface IterableIterator<T> { }\n\n/**\n * @deprecated\n */\ninterface NodeBuffer extends Uint8Array {\n    write(string: string, offset?: number, length?: number, encoding?: string): number;\n    toString(encoding?: string, start?: number, end?: number): string;\n    toJSON(): { type: 'Buffer', data: any[] };\n    equals(otherBuffer: Buffer): boolean;\n    compare(otherBuffer: Buffer, targetStart?: number, targetEnd?: number, sourceStart?: number, sourceEnd?: number): number;\n    copy(targetBuffer: Buffer, targetStart?: number, sourceStart?: number, sourceEnd?: number): number;\n    slice(start?: number, end?: number): Buffer;\n    writeUIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;\n    writeUIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;\n    writeIntLE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;\n    writeIntBE(value: number, offset: number, byteLength: number, noAssert?: boolean): number;\n    readUIntLE(offset: number, byteLength: number, noAssert?: boolean): number;\n    readUIntBE(offset: number, byteLength: number, noAssert?: boolean): number;\n    readIntLE(offset: number, byteLength: number, noAssert?: boolean): number;\n    readIntBE(offset: number, byteLength: number, noAssert?: boolean): number;\n    readUInt8(offset: number, noAssert?: boolean): number;\n    readUInt16LE(offset: number, noAssert?: boolean): number;\n    readUInt16BE(offset: number, noAssert?: boolean): number;\n    readUInt32LE(offset: number, noAssert?: boolean): number;\n    readUInt32BE(offset: number, noAssert?: boolean): number;\n    readInt8(offset: number, noAssert?: boolean): number;\n    readInt16LE(offset: number, noAssert?: boolean): number;\n    readInt16BE(offset: number, noAssert?: boolean): number;\n    readInt32LE(offset: number, noAssert?: boolean): number;\n    readInt32BE(offset: number, noAssert?: boolean): number;\n    readFloatLE(offset: number, noAssert?: boolean): number;\n    readFloatBE(offset: number, noAssert?: boolean): number;\n    readDoubleLE(offset: number, noAssert?: boolean): number;\n    readDoubleBE(offset: number, noAssert?: boolean): number;\n    swap16(): Buffer;\n    swap32(): Buffer;\n    swap64(): Buffer;\n    writeUInt8(value: number, offset: number, noAssert?: boolean): number;\n    writeUInt16LE(value: number, offset: number, noAssert?: boolean): number;\n    writeUInt16BE(value: number, offset: number, noAssert?: boolean): number;\n    writeUInt32LE(value: number, offset: number, noAssert?: boolean): number;\n    writeUInt32BE(value: number, offset: number, noAssert?: boolean): number;\n    writeInt8(value: number, offset: number, noAssert?: boolean): number;\n    writeInt16LE(value: number, offset: number, noAssert?: boolean): number;\n    writeInt16BE(value: number, offset: number, noAssert?: boolean): number;\n    writeInt32LE(value: number, offset: number, noAssert?: boolean): number;\n    writeInt32BE(value: number, offset: number, noAssert?: boolean): number;\n    writeFloatLE(value: number, offset: number, noAssert?: boolean): number;\n    writeFloatBE(value: number, offset: number, noAssert?: boolean): number;\n    writeDoubleLE(value: number, offset: number, noAssert?: boolean): number;\n    writeDoubleBE(value: number, offset: number, noAssert?: boolean): number;\n    fill(value: any, offset?: number, end?: number): this;\n    indexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;\n    lastIndexOf(value: string | number | Buffer, byteOffset?: number, encoding?: string): number;\n    entries(): IterableIterator<[number, number]>;\n    includes(value: string | number | Buffer, byteOffset?: number, encoding?: string): boolean;\n    keys(): IterableIterator<number>;\n    values(): IterableIterator<number>;\n}\n\n/************************************************\n*                                               *\n*                   MODULES                     *\n*                                               *\n************************************************/\ndeclare module \"buffer\" {\n    export var INSPECT_MAX_BYTES: number;\n    var BuffType: typeof Buffer;\n    var SlowBuffType: typeof SlowBuffer;\n    export { BuffType as Buffer, SlowBuffType as SlowBuffer };\n}\n\ndeclare module \"querystring\" {\n    export interface StringifyOptions {\n        encodeURIComponent?: Function;\n    }\n\n    export interface ParseOptions {\n        maxKeys?: number;\n        decodeURIComponent?: Function;\n    }\n\n    export function stringify<T>(obj: T, sep?: string, eq?: string, options?: StringifyOptions): string;\n    export function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): any;\n    export function parse<T extends {}>(str: string, sep?: string, eq?: string, options?: ParseOptions): T;\n    export function escape(str: string): string;\n    export function unescape(str: string): string;\n}\n\ndeclare module \"events\" {\n    class internal extends NodeJS.EventEmitter { }\n\n    namespace internal {\n        export class EventEmitter extends internal {\n            static listenerCount(emitter: EventEmitter, event: string | symbol): number; // deprecated\n            static defaultMaxListeners: number;\n\n            addListener(event: string | symbol, listener: Function): this;\n            on(event: string | symbol, listener: Function): this;\n            once(event: string | symbol, listener: Function): this;\n            prependListener(event: string | symbol, listener: Function): this;\n            prependOnceListener(event: string | symbol, listener: Function): this;\n            removeListener(event: string | symbol, listener: Function): this;\n            removeAllListeners(event?: string | symbol): this;\n            setMaxListeners(n: number): this;\n            getMaxListeners(): number;\n            listeners(event: string | symbol): Function[];\n            emit(event: string | symbol, ...args: any[]): boolean;\n            eventNames(): (string | symbol)[];\n            listenerCount(type: string | symbol): number;\n        }\n    }\n\n    export = internal;\n}\n\ndeclare module \"http\" {\n    import * as events from \"events\";\n    import * as net from \"net\";\n    import * as stream from \"stream\";\n\n    export interface RequestOptions {\n        protocol?: string;\n        host?: string;\n        hostname?: string;\n        family?: number;\n        port?: number;\n        localAddress?: string;\n        socketPath?: string;\n        method?: string;\n        path?: string;\n        headers?: { [key: string]: any };\n        auth?: string;\n        agent?: Agent | boolean;\n        timeout?: number;\n    }\n\n    export interface Server extends net.Server {\n        setTimeout(msecs: number, callback: Function): void;\n        maxHeadersCount: number;\n        timeout: number;\n        listening: boolean;\n    }\n    /**\n     * @deprecated Use IncomingMessage\n     */\n    export interface ServerRequest extends IncomingMessage {\n        connection: net.Socket;\n    }\n    export interface ServerResponse extends stream.Writable {\n        // Extended base methods\n        write(buffer: Buffer): boolean;\n        write(buffer: Buffer, cb?: Function): boolean;\n        write(str: string, cb?: Function): boolean;\n        write(str: string, encoding?: string, cb?: Function): boolean;\n        write(str: string, encoding?: string, fd?: string): boolean;\n\n        writeContinue(): void;\n        writeHead(statusCode: number, reasonPhrase?: string, headers?: any): void;\n        writeHead(statusCode: number, headers?: any): void;\n        statusCode: number;\n        statusMessage: string;\n        headersSent: boolean;\n        setHeader(name: string, value: string | string[]): void;\n        setTimeout(msecs: number, callback: Function): ServerResponse;\n        sendDate: boolean;\n        getHeader(name: string): string;\n        removeHeader(name: string): void;\n        write(chunk: any, encoding?: string): any;\n        addTrailers(headers: any): void;\n        finished: boolean;\n\n        // Extended base methods\n        end(): void;\n        end(buffer: Buffer, cb?: Function): void;\n        end(str: string, cb?: Function): void;\n        end(str: string, encoding?: string, cb?: Function): void;\n        end(data?: any, encoding?: string): void;\n    }\n    export interface ClientRequest extends stream.Writable {\n        // Extended base methods\n        write(buffer: Buffer): boolean;\n        write(buffer: Buffer, cb?: Function): boolean;\n        write(str: string, cb?: Function): boolean;\n        write(str: string, encoding?: string, cb?: Function): boolean;\n        write(str: string, encoding?: string, fd?: string): boolean;\n\n        write(chunk: any, encoding?: string): void;\n        abort(): void;\n        setTimeout(timeout: number, callback?: Function): void;\n        setNoDelay(noDelay?: boolean): void;\n        setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;\n\n        setHeader(name: string, value: string | string[]): void;\n        getHeader(name: string): string;\n        removeHeader(name: string): void;\n        addTrailers(headers: any): void;\n\n        // Extended base methods\n        end(): void;\n        end(buffer: Buffer, cb?: Function): void;\n        end(str: string, cb?: Function): void;\n        end(str: string, encoding?: string, cb?: Function): void;\n        end(data?: any, encoding?: string): void;\n    }\n    export interface IncomingMessage extends stream.Readable {\n        httpVersion: string;\n        httpVersionMajor: number;\n        httpVersionMinor: number;\n        connection: net.Socket;\n        headers: any;\n        rawHeaders: string[];\n        trailers: any;\n        rawTrailers: any;\n        setTimeout(msecs: number, callback: Function): NodeJS.Timer;\n        /**\n         * Only valid for request obtained from http.Server.\n         */\n        method?: string;\n        /**\n         * Only valid for request obtained from http.Server.\n         */\n        url?: string;\n        /**\n         * Only valid for response obtained from http.ClientRequest.\n         */\n        statusCode?: number;\n        /**\n         * Only valid for response obtained from http.ClientRequest.\n         */\n        statusMessage?: string;\n        socket: net.Socket;\n        destroy(error?: Error): void;\n    }\n    /**\n     * @deprecated Use IncomingMessage\n     */\n    export interface ClientResponse extends IncomingMessage { }\n\n    export interface AgentOptions {\n        /**\n         * Keep sockets around in a pool to be used by other requests in the future. Default = false\n         */\n        keepAlive?: boolean;\n        /**\n         * When using HTTP KeepAlive, how often to send TCP KeepAlive packets over sockets being kept alive. Default = 1000.\n         * Only relevant if keepAlive is set to true.\n         */\n        keepAliveMsecs?: number;\n        /**\n         * Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity\n         */\n        maxSockets?: number;\n        /**\n         * Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.\n         */\n        maxFreeSockets?: number;\n    }\n\n    export class Agent {\n        maxSockets: number;\n        sockets: any;\n        requests: any;\n\n        constructor(opts?: AgentOptions);\n\n        /**\n         * Destroy any sockets that are currently in use by the agent.\n         * It is usually not necessary to do this. However, if you are using an agent with KeepAlive enabled,\n         * then it is best to explicitly shut down the agent when you know that it will no longer be used. Otherwise,\n         * sockets may hang open for quite a long time before the server terminates them.\n         */\n        destroy(): void;\n    }\n\n    export var METHODS: string[];\n\n    export var STATUS_CODES: {\n        [errorCode: number]: string;\n        [errorCode: string]: string;\n    };\n    export function createServer(requestListener?: (request: IncomingMessage, response: ServerResponse) => void): Server;\n    export function createClient(port?: number, host?: string): any;\n    export function request(options: RequestOptions, callback?: (res: IncomingMessage) => void): ClientRequest;\n    export function get(options: any, callback?: (res: IncomingMessage) => void): ClientRequest;\n    export var globalAgent: Agent;\n}\n\ndeclare module \"cluster\" {\n    import * as child from \"child_process\";\n    import * as events from \"events\";\n    import * as net from \"net\";\n\n    // interfaces\n    export interface ClusterSettings {\n        execArgv?: string[]; // default: process.execArgv\n        exec?: string;\n        args?: string[];\n        silent?: boolean;\n        stdio?: any[];\n        uid?: number;\n        gid?: number;\n    }\n\n    export interface ClusterSetupMasterSettings {\n        exec?: string;  // default: process.argv[1]\n        args?: string[];  // default: process.argv.slice(2)\n        silent?: boolean;  // default: false\n        stdio?: any[];\n    }\n\n    export interface Address {\n        address: string;\n        port: number;\n        addressType: number | \"udp4\" | \"udp6\";  // 4, 6, -1, \"udp4\", \"udp6\"\n    }\n\n    export class Worker extends events.EventEmitter {\n        id: string;\n        process: child.ChildProcess;\n        suicide: boolean;\n        send(message: any, sendHandle?: any): boolean;\n        kill(signal?: string): void;\n        destroy(signal?: string): void;\n        disconnect(): void;\n        isConnected(): boolean;\n        isDead(): boolean;\n        exitedAfterDisconnect: boolean;\n\n        /**\n         * events.EventEmitter\n         *   1. disconnect\n         *   2. error\n         *   3. exit\n         *   4. listening\n         *   5. message\n         *   6. online\n         */\n        addListener(event: string, listener: Function): this;\n        addListener(event: \"disconnect\", listener: () => void): this;\n        addListener(event: \"error\", listener: (code: number, signal: string) => void): this;\n        addListener(event: \"exit\", listener: (code: number, signal: string) => void): this;\n        addListener(event: \"listening\", listener: (address: Address) => void): this;\n        addListener(event: \"message\", listener: (message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.\n        addListener(event: \"online\", listener: () => void): this;\n\n        emit(event: string, listener: Function): boolean\n        emit(event: \"disconnect\", listener: () => void): boolean\n        emit(event: \"error\", listener: (code: number, signal: string) => void): boolean\n        emit(event: \"exit\", listener: (code: number, signal: string) => void): boolean\n        emit(event: \"listening\", listener: (address: Address) => void): boolean\n        emit(event: \"message\", listener: (message: any, handle: net.Socket | net.Server) => void): boolean\n        emit(event: \"online\", listener: () => void): boolean\n\n        on(event: string, listener: Function): this;\n        on(event: \"disconnect\", listener: () => void): this;\n        on(event: \"error\", listener: (code: number, signal: string) => void): this;\n        on(event: \"exit\", listener: (code: number, signal: string) => void): this;\n        on(event: \"listening\", listener: (address: Address) => void): this;\n        on(event: \"message\", listener: (message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.\n        on(event: \"online\", listener: () => void): this;\n\n        once(event: string, listener: Function): this;\n        once(event: \"disconnect\", listener: () => void): this;\n        once(event: \"error\", listener: (code: number, signal: string) => void): this;\n        once(event: \"exit\", listener: (code: number, signal: string) => void): this;\n        once(event: \"listening\", listener: (address: Address) => void): this;\n        once(event: \"message\", listener: (message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.\n        once(event: \"online\", listener: () => void): this;\n\n        prependListener(event: string, listener: Function): this;\n        prependListener(event: \"disconnect\", listener: () => void): this;\n        prependListener(event: \"error\", listener: (code: number, signal: string) => void): this;\n        prependListener(event: \"exit\", listener: (code: number, signal: string) => void): this;\n        prependListener(event: \"listening\", listener: (address: Address) => void): this;\n        prependListener(event: \"message\", listener: (message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.\n        prependListener(event: \"online\", listener: () => void): this;\n\n        prependOnceListener(event: string, listener: Function): this;\n        prependOnceListener(event: \"disconnect\", listener: () => void): this;\n        prependOnceListener(event: \"error\", listener: (code: number, signal: string) => void): this;\n        prependOnceListener(event: \"exit\", listener: (code: number, signal: string) => void): this;\n        prependOnceListener(event: \"listening\", listener: (address: Address) => void): this;\n        prependOnceListener(event: \"message\", listener: (message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.\n        prependOnceListener(event: \"online\", listener: () => void): this;\n    }\n\n    export interface Cluster extends events.EventEmitter {\n        Worker: Worker;\n        disconnect(callback?: Function): void;\n        fork(env?: any): Worker;\n        isMaster: boolean;\n        isWorker: boolean;\n        // TODO: cluster.schedulingPolicy\n        settings: ClusterSettings;\n        setupMaster(settings?: ClusterSetupMasterSettings): void;\n        worker: Worker;\n        workers: {\n            [index: string]: Worker\n        };\n\n        /**\n         * events.EventEmitter\n         *   1. disconnect\n         *   2. exit\n         *   3. fork\n         *   4. listening\n         *   5. message\n         *   6. online\n         *   7. setup\n         */\n        addListener(event: string, listener: Function): this;\n        addListener(event: \"disconnect\", listener: (worker: Worker) => void): this;\n        addListener(event: \"exit\", listener: (worker: Worker, code: number, signal: string) => void): this;\n        addListener(event: \"fork\", listener: (worker: Worker) => void): this;\n        addListener(event: \"listening\", listener: (worker: Worker, address: Address) => void): this;\n        addListener(event: \"message\", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.\n        addListener(event: \"online\", listener: (worker: Worker) => void): this;\n        addListener(event: \"setup\", listener: (settings: any) => void): this;\n\n        emit(event: string, listener: Function): boolean;\n        emit(event: \"disconnect\", listener: (worker: Worker) => void): boolean;\n        emit(event: \"exit\", listener: (worker: Worker, code: number, signal: string) => void): boolean;\n        emit(event: \"fork\", listener: (worker: Worker) => void): boolean;\n        emit(event: \"listening\", listener: (worker: Worker, address: Address) => void): boolean;\n        emit(event: \"message\", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): boolean;\n        emit(event: \"online\", listener: (worker: Worker) => void): boolean;\n        emit(event: \"setup\", listener: (settings: any) => void): boolean;\n\n        on(event: string, listener: Function): this;\n        on(event: \"disconnect\", listener: (worker: Worker) => void): this;\n        on(event: \"exit\", listener: (worker: Worker, code: number, signal: string) => void): this;\n        on(event: \"fork\", listener: (worker: Worker) => void): this;\n        on(event: \"listening\", listener: (worker: Worker, address: Address) => void): this;\n        on(event: \"message\", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.\n        on(event: \"online\", listener: (worker: Worker) => void): this;\n        on(event: \"setup\", listener: (settings: any) => void): this;\n\n        once(event: string, listener: Function): this;\n        once(event: \"disconnect\", listener: (worker: Worker) => void): this;\n        once(event: \"exit\", listener: (worker: Worker, code: number, signal: string) => void): this;\n        once(event: \"fork\", listener: (worker: Worker) => void): this;\n        once(event: \"listening\", listener: (worker: Worker, address: Address) => void): this;\n        once(event: \"message\", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.\n        once(event: \"online\", listener: (worker: Worker) => void): this;\n        once(event: \"setup\", listener: (settings: any) => void): this;\n\n        prependListener(event: string, listener: Function): this;\n        prependListener(event: \"disconnect\", listener: (worker: Worker) => void): this;\n        prependListener(event: \"exit\", listener: (worker: Worker, code: number, signal: string) => void): this;\n        prependListener(event: \"fork\", listener: (worker: Worker) => void): this;\n        prependListener(event: \"listening\", listener: (worker: Worker, address: Address) => void): this;\n        prependListener(event: \"message\", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.\n        prependListener(event: \"online\", listener: (worker: Worker) => void): this;\n        prependListener(event: \"setup\", listener: (settings: any) => void): this;\n\n        prependOnceListener(event: string, listener: Function): this;\n        prependOnceListener(event: \"disconnect\", listener: (worker: Worker) => void): this;\n        prependOnceListener(event: \"exit\", listener: (worker: Worker, code: number, signal: string) => void): this;\n        prependOnceListener(event: \"fork\", listener: (worker: Worker) => void): this;\n        prependOnceListener(event: \"listening\", listener: (worker: Worker, address: Address) => void): this;\n        prependOnceListener(event: \"message\", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this;  // the handle is a net.Socket or net.Server object, or undefined.\n        prependOnceListener(event: \"online\", listener: (worker: Worker) => void): this;\n        prependOnceListener(event: \"setup\", listener: (settings: any) => void): this;\n\n    }\n\n    export function disconnect(callback?: Function): void;\n    export function fork(env?: any): Worker;\n    export var isMaster: boolean;\n    export var isWorker: boolean;\n    // TODO: cluster.schedulingPolicy\n    export var settings: ClusterSettings;\n    export function setupMaster(settings?: ClusterSetupMasterSettings): void;\n    export var worker: Worker;\n    export var workers: {\n        [index: string]: Worker\n    };\n\n    /**\n     * events.EventEmitter\n     *   1. disconnect\n     *   2. exit\n     *   3. fork\n     *   4. listening\n     *   5. message\n     *   6. online\n     *   7. setup\n     */\n    export function addListener(event: string, listener: Function): Cluster;\n    export function addListener(event: \"disconnect\", listener: (worker: Worker) => void): Cluster;\n    export function addListener(event: \"exit\", listener: (worker: Worker, code: number, signal: string) => void): Cluster;\n    export function addListener(event: \"fork\", listener: (worker: Worker) => void): Cluster;\n    export function addListener(event: \"listening\", listener: (worker: Worker, address: Address) => void): Cluster;\n    export function addListener(event: \"message\", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;  // the handle is a net.Socket or net.Server object, or undefined.\n    export function addListener(event: \"online\", listener: (worker: Worker) => void): Cluster;\n    export function addListener(event: \"setup\", listener: (settings: any) => void): Cluster;\n\n    export function emit(event: string, listener: Function): boolean;\n    export function emit(event: \"disconnect\", listener: (worker: Worker) => void): boolean;\n    export function emit(event: \"exit\", listener: (worker: Worker, code: number, signal: string) => void): boolean;\n    export function emit(event: \"fork\", listener: (worker: Worker) => void): boolean;\n    export function emit(event: \"listening\", listener: (worker: Worker, address: Address) => void): boolean;\n    export function emit(event: \"message\", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): boolean;\n    export function emit(event: \"online\", listener: (worker: Worker) => void): boolean;\n    export function emit(event: \"setup\", listener: (settings: any) => void): boolean;\n\n    export function on(event: string, listener: Function): Cluster;\n    export function on(event: \"disconnect\", listener: (worker: Worker) => void): Cluster;\n    export function on(event: \"exit\", listener: (worker: Worker, code: number, signal: string) => void): Cluster;\n    export function on(event: \"fork\", listener: (worker: Worker) => void): Cluster;\n    export function on(event: \"listening\", listener: (worker: Worker, address: Address) => void): Cluster;\n    export function on(event: \"message\", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;  // the handle is a net.Socket or net.Server object, or undefined.\n    export function on(event: \"online\", listener: (worker: Worker) => void): Cluster;\n    export function on(event: \"setup\", listener: (settings: any) => void): Cluster;\n\n    export function once(event: string, listener: Function): Cluster;\n    export function once(event: \"disconnect\", listener: (worker: Worker) => void): Cluster;\n    export function once(event: \"exit\", listener: (worker: Worker, code: number, signal: string) => void): Cluster;\n    export function once(event: \"fork\", listener: (worker: Worker) => void): Cluster;\n    export function once(event: \"listening\", listener: (worker: Worker, address: Address) => void): Cluster;\n    export function once(event: \"message\", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;  // the handle is a net.Socket or net.Server object, or undefined.\n    export function once(event: \"online\", listener: (worker: Worker) => void): Cluster;\n    export function once(event: \"setup\", listener: (settings: any) => void): Cluster;\n\n    export function removeListener(event: string, listener: Function): Cluster;\n    export function removeAllListeners(event?: string): Cluster;\n    export function setMaxListeners(n: number): Cluster;\n    export function getMaxListeners(): number;\n    export function listeners(event: string): Function[];\n    export function listenerCount(type: string): number;\n\n    export function prependListener(event: string, listener: Function): Cluster;\n    export function prependListener(event: \"disconnect\", listener: (worker: Worker) => void): Cluster;\n    export function prependListener(event: \"exit\", listener: (worker: Worker, code: number, signal: string) => void): Cluster;\n    export function prependListener(event: \"fork\", listener: (worker: Worker) => void): Cluster;\n    export function prependListener(event: \"listening\", listener: (worker: Worker, address: Address) => void): Cluster;\n    export function prependListener(event: \"message\", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;  // the handle is a net.Socket or net.Server object, or undefined.\n    export function prependListener(event: \"online\", listener: (worker: Worker) => void): Cluster;\n    export function prependListener(event: \"setup\", listener: (settings: any) => void): Cluster;\n\n    export function prependOnceListener(event: string, listener: Function): Cluster;\n    export function prependOnceListener(event: \"disconnect\", listener: (worker: Worker) => void): Cluster;\n    export function prependOnceListener(event: \"exit\", listener: (worker: Worker, code: number, signal: string) => void): Cluster;\n    export function prependOnceListener(event: \"fork\", listener: (worker: Worker) => void): Cluster;\n    export function prependOnceListener(event: \"listening\", listener: (worker: Worker, address: Address) => void): Cluster;\n    export function prependOnceListener(event: \"message\", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): Cluster;  // the handle is a net.Socket or net.Server object, or undefined.\n    export function prependOnceListener(event: \"online\", listener: (worker: Worker) => void): Cluster;\n    export function prependOnceListener(event: \"setup\", listener: (settings: any) => void): Cluster;\n\n    export function eventNames(): string[];\n}\n\ndeclare module \"zlib\" {\n    import * as stream from \"stream\";\n\n    export interface ZlibOptions {\n      flush?: number; // default: zlib.constants.Z_NO_FLUSH\n      finishFlush?: number; // default: zlib.constants.Z_FINISH\n      chunkSize?: number; // default: 16*1024\n      windowBits?: number;\n      level?: number; // compression only\n      memLevel?: number; // compression only\n      strategy?: number; // compression only\n      dictionary?: any; // deflate/inflate only, empty dictionary by default\n    }\n\n    export interface Gzip extends stream.Transform { }\n    export interface Gunzip extends stream.Transform { }\n    export interface Deflate extends stream.Transform { }\n    export interface Inflate extends stream.Transform { }\n    export interface DeflateRaw extends stream.Transform { }\n    export interface InflateRaw extends stream.Transform { }\n    export interface Unzip extends stream.Transform { }\n\n    export function createGzip(options?: ZlibOptions): Gzip;\n    export function createGunzip(options?: ZlibOptions): Gunzip;\n    export function createDeflate(options?: ZlibOptions): Deflate;\n    export function createInflate(options?: ZlibOptions): Inflate;\n    export function createDeflateRaw(options?: ZlibOptions): DeflateRaw;\n    export function createInflateRaw(options?: ZlibOptions): InflateRaw;\n    export function createUnzip(options?: ZlibOptions): Unzip;\n\n    export function deflate(buf: Buffer | string, callback: (error: Error, result: Buffer) => void): void;\n    export function deflateSync(buf: Buffer | string, options?: ZlibOptions): Buffer;\n    export function deflateRaw(buf: Buffer | string, callback: (error: Error, result: Buffer) => void): void;\n    export function deflateRawSync(buf: Buffer | string, options?: ZlibOptions): Buffer;\n    export function gzip(buf: Buffer, callback: (error: Error, result: Buffer) => void): void;\n    export function gzipSync(buf: Buffer, options?: ZlibOptions): Buffer;\n    export function gunzip(buf: Buffer, callback: (error: Error, result: Buffer) => void): void;\n    export function gunzipSync(buf: Buffer, options?: ZlibOptions): Buffer;\n    export function inflate(buf: Buffer, callback: (error: Error, result: Buffer) => void): void;\n    export function inflateSync(buf: Buffer, options?: ZlibOptions): Buffer;\n    export function inflateRaw(buf: Buffer, callback: (error: Error, result: Buffer) => void): void;\n    export function inflateRawSync(buf: Buffer, options?: ZlibOptions): Buffer;\n    export function unzip(buf: Buffer, callback: (error: Error, result: Buffer) => void): void;\n    export function unzipSync(buf: Buffer, options?: ZlibOptions): Buffer;\n\n    export namespace constants {\n        // Allowed flush values.\n\n        export const Z_NO_FLUSH: number;\n        export const Z_PARTIAL_FLUSH: number;\n        export const Z_SYNC_FLUSH: number;\n        export const Z_FULL_FLUSH: number;\n        export const Z_FINISH: number;\n        export const Z_BLOCK: number;\n        export const Z_TREES: number;\n\n        // Return codes for the compression/decompression functions. Negative values are errors, positive values are used for special but normal events.\n\n        export const Z_OK: number;\n        export const Z_STREAM_END: number;\n        export const Z_NEED_DICT: number;\n        export const Z_ERRNO: number;\n        export const Z_STREAM_ERROR: number;\n        export const Z_DATA_ERROR: number;\n        export const Z_MEM_ERROR: number;\n        export const Z_BUF_ERROR: number;\n        export const Z_VERSION_ERROR: number;\n\n        // Compression levels.\n\n        export const Z_NO_COMPRESSION: number;\n        export const Z_BEST_SPEED: number;\n        export const Z_BEST_COMPRESSION: number;\n        export const Z_DEFAULT_COMPRESSION: number;\n\n        // Compression strategy.\n\n        export const Z_FILTERED: number;\n        export const Z_HUFFMAN_ONLY: number;\n        export const Z_RLE: number;\n        export const Z_FIXED: number;\n        export const Z_DEFAULT_STRATEGY: number;\n    }\n\n    // Constants\n    export var Z_NO_FLUSH: number;\n    export var Z_PARTIAL_FLUSH: number;\n    export var Z_SYNC_FLUSH: number;\n    export var Z_FULL_FLUSH: number;\n    export var Z_FINISH: number;\n    export var Z_BLOCK: number;\n    export var Z_TREES: number;\n    export var Z_OK: number;\n    export var Z_STREAM_END: number;\n    export var Z_NEED_DICT: number;\n    export var Z_ERRNO: number;\n    export var Z_STREAM_ERROR: number;\n    export var Z_DATA_ERROR: number;\n    export var Z_MEM_ERROR: number;\n    export var Z_BUF_ERROR: number;\n    export var Z_VERSION_ERROR: number;\n    export var Z_NO_COMPRESSION: number;\n    export var Z_BEST_SPEED: number;\n    export var Z_BEST_COMPRESSION: number;\n    export var Z_DEFAULT_COMPRESSION: number;\n    export var Z_FILTERED: number;\n    export var Z_HUFFMAN_ONLY: number;\n    export var Z_RLE: number;\n    export var Z_FIXED: number;\n    export var Z_DEFAULT_STRATEGY: number;\n    export var Z_BINARY: number;\n    export var Z_TEXT: number;\n    export var Z_ASCII: number;\n    export var Z_UNKNOWN: number;\n    export var Z_DEFLATED: number;\n}\n\ndeclare module \"os\" {\n    export interface CpuInfo {\n        model: string;\n        speed: number;\n        times: {\n            user: number;\n            nice: number;\n            sys: number;\n            idle: number;\n            irq: number;\n        };\n    }\n\n    export interface NetworkInterfaceInfo {\n        address: string;\n        netmask: string;\n        family: string;\n        mac: string;\n        internal: boolean;\n    }\n\n    export function hostname(): string;\n    export function loadavg(): number[];\n    export function uptime(): number;\n    export function freemem(): number;\n    export function totalmem(): number;\n    export function cpus(): CpuInfo[];\n    export function type(): string;\n    export function release(): string;\n    export function networkInterfaces(): { [index: string]: NetworkInterfaceInfo[] };\n    export function homedir(): string;\n    export function userInfo(options?: { encoding: string }): { username: string, uid: number, gid: number, shell: any, homedir: string }\n    export var constants: {\n        UV_UDP_REUSEADDR: number,\n        errno: {\n            SIGHUP: number;\n            SIGINT: number;\n            SIGQUIT: number;\n            SIGILL: number;\n            SIGTRAP: number;\n            SIGABRT: number;\n            SIGIOT: number;\n            SIGBUS: number;\n            SIGFPE: number;\n            SIGKILL: number;\n            SIGUSR1: number;\n            SIGSEGV: number;\n            SIGUSR2: number;\n            SIGPIPE: number;\n            SIGALRM: number;\n            SIGTERM: number;\n            SIGCHLD: number;\n            SIGSTKFLT: number;\n            SIGCONT: number;\n            SIGSTOP: number;\n            SIGTSTP: number;\n            SIGTTIN: number;\n            SIGTTOU: number;\n            SIGURG: number;\n            SIGXCPU: number;\n            SIGXFSZ: number;\n            SIGVTALRM: number;\n            SIGPROF: number;\n            SIGWINCH: number;\n            SIGIO: number;\n            SIGPOLL: number;\n            SIGPWR: number;\n            SIGSYS: number;\n            SIGUNUSED: number;\n        },\n        signals: {\n            E2BIG: number;\n            EACCES: number;\n            EADDRINUSE: number;\n            EADDRNOTAVAIL: number;\n            EAFNOSUPPORT: number;\n            EAGAIN: number;\n            EALREADY: number;\n            EBADF: number;\n            EBADMSG: number;\n            EBUSY: number;\n            ECANCELED: number;\n            ECHILD: number;\n            ECONNABORTED: number;\n            ECONNREFUSED: number;\n            ECONNRESET: number;\n            EDEADLK: number;\n            EDESTADDRREQ: number;\n            EDOM: number;\n            EDQUOT: number;\n            EEXIST: number;\n            EFAULT: number;\n            EFBIG: number;\n            EHOSTUNREACH: number;\n            EIDRM: number;\n            EILSEQ: number;\n            EINPROGRESS: number;\n            EINTR: number;\n            EINVAL: number;\n            EIO: number;\n            EISCONN: number;\n            EISDIR: number;\n            ELOOP: number;\n            EMFILE: number;\n            EMLINK: number;\n            EMSGSIZE: number;\n            EMULTIHOP: number;\n            ENAMETOOLONG: number;\n            ENETDOWN: number;\n            ENETRESET: number;\n            ENETUNREACH: number;\n            ENFILE: number;\n            ENOBUFS: number;\n            ENODATA: number;\n            ENODEV: number;\n            ENOENT: number;\n            ENOEXEC: number;\n            ENOLCK: number;\n            ENOLINK: number;\n            ENOMEM: number;\n            ENOMSG: number;\n            ENOPROTOOPT: number;\n            ENOSPC: number;\n            ENOSR: number;\n            ENOSTR: number;\n            ENOSYS: number;\n            ENOTCONN: number;\n            ENOTDIR: number;\n            ENOTEMPTY: number;\n            ENOTSOCK: number;\n            ENOTSUP: number;\n            ENOTTY: number;\n            ENXIO: number;\n            EOPNOTSUPP: number;\n            EOVERFLOW: number;\n            EPERM: number;\n            EPIPE: number;\n            EPROTO: number;\n            EPROTONOSUPPORT: number;\n            EPROTOTYPE: number;\n            ERANGE: number;\n            EROFS: number;\n            ESPIPE: number;\n            ESRCH: number;\n            ESTALE: number;\n            ETIME: number;\n            ETIMEDOUT: number;\n            ETXTBSY: number;\n            EWOULDBLOCK: number;\n            EXDEV: number;\n        },\n    };\n    export function arch(): string;\n    export function platform(): NodeJS.Platform;\n    export function tmpdir(): string;\n    export var EOL: string;\n    export function endianness(): \"BE\" | \"LE\";\n}\n\ndeclare module \"https\" {\n    import * as tls from \"tls\";\n    import * as events from \"events\";\n    import * as http from \"http\";\n\n    export interface ServerOptions {\n        pfx?: any;\n        key?: any;\n        passphrase?: string;\n        cert?: any;\n        ca?: any;\n        crl?: any;\n        ciphers?: string;\n        honorCipherOrder?: boolean;\n        requestCert?: boolean;\n        rejectUnauthorized?: boolean;\n        NPNProtocols?: any;\n        SNICallback?: (servername: string, cb: (err: Error, ctx: tls.SecureContext) => any) => any;\n    }\n\n    export interface RequestOptions extends http.RequestOptions {\n        pfx?: any;\n        key?: any;\n        passphrase?: string;\n        cert?: any;\n        ca?: any;\n        ciphers?: string;\n        rejectUnauthorized?: boolean;\n        secureProtocol?: string;\n    }\n\n    export interface Agent extends http.Agent { }\n\n    export interface AgentOptions extends http.AgentOptions {\n        pfx?: any;\n        key?: any;\n        passphrase?: string;\n        cert?: any;\n        ca?: any;\n        ciphers?: string;\n        rejectUnauthorized?: boolean;\n        secureProtocol?: string;\n        maxCachedSessions?: number;\n    }\n\n    export var Agent: {\n        new (options?: AgentOptions): Agent;\n    };\n    export interface Server extends tls.Server { }\n    export function createServer(options: ServerOptions, requestListener?: Function): Server;\n    export function request(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;\n    export function get(options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;\n    export var globalAgent: Agent;\n}\n\ndeclare module \"punycode\" {\n    export function decode(string: string): string;\n    export function encode(string: string): string;\n    export function toUnicode(domain: string): string;\n    export function toASCII(domain: string): string;\n    export var ucs2: ucs2;\n    interface ucs2 {\n        decode(string: string): number[];\n        encode(codePoints: number[]): string;\n    }\n    export var version: any;\n}\n\ndeclare module \"repl\" {\n    import * as stream from \"stream\";\n    import * as readline from \"readline\";\n\n    export interface ReplOptions {\n        prompt?: string;\n        input?: NodeJS.ReadableStream;\n        output?: NodeJS.WritableStream;\n        terminal?: boolean;\n        eval?: Function;\n        useColors?: boolean;\n        useGlobal?: boolean;\n        ignoreUndefined?: boolean;\n        writer?: Function;\n        completer?: Function;\n        replMode?: any;\n        breakEvalOnSigint?: any;\n    }\n\n    export interface REPLServer extends readline.ReadLine {\n        defineCommand(keyword: string, cmd: Function | { help: string, action: Function }): void;\n        displayPrompt(preserveCursor?: boolean): void;\n\n        /**\n         * events.EventEmitter\n         * 1. exit\n         * 2. reset\n         **/\n\n        addListener(event: string, listener: Function): this;\n        addListener(event: \"exit\", listener: () => void): this;\n        addListener(event: \"reset\", listener: Function): this;\n\n        emit(event: string, ...args: any[]): boolean;\n        emit(event: \"exit\"): boolean;\n        emit(event: \"reset\", context: any): boolean;\n\n        on(event: string, listener: Function): this;\n        on(event: \"exit\", listener: () => void): this;\n        on(event: \"reset\", listener: Function): this;\n\n        once(event: string, listener: Function): this;\n        once(event: \"exit\", listener: () => void): this;\n        once(event: \"reset\", listener: Function): this;\n\n        prependListener(event: string, listener: Function): this;\n        prependListener(event: \"exit\", listener: () => void): this;\n        prependListener(event: \"reset\", listener: Function): this;\n\n        prependOnceListener(event: string, listener: Function): this;\n        prependOnceListener(event: \"exit\", listener: () => void): this;\n        prependOnceListener(event: \"reset\", listener: Function): this;\n    }\n\n    export function start(options: ReplOptions): REPLServer;\n}\n\ndeclare module \"readline\" {\n    import * as events from \"events\";\n    import * as stream from \"stream\";\n\n    export interface Key {\n        sequence?: string;\n        name?: string;\n        ctrl?: boolean;\n        meta?: boolean;\n        shift?: boolean;\n    }\n\n    export interface ReadLine extends events.EventEmitter {\n        setPrompt(prompt: string): void;\n        prompt(preserveCursor?: boolean): void;\n        question(query: string, callback: (answer: string) => void): void;\n        pause(): ReadLine;\n        resume(): ReadLine;\n        close(): void;\n        write(data: string | Buffer, key?: Key): void;\n\n        /**\n         * events.EventEmitter\n         * 1. close\n         * 2. line\n         * 3. pause\n         * 4. resume\n         * 5. SIGCONT\n         * 6. SIGINT\n         * 7. SIGTSTP\n         **/\n\n        addListener(event: string, listener: Function): this;\n        addListener(event: \"close\", listener: () => void): this;\n        addListener(event: \"line\", listener: (input: any) => void): this;\n        addListener(event: \"pause\", listener: () => void): this;\n        addListener(event: \"resume\", listener: () => void): this;\n        addListener(event: \"SIGCONT\", listener: () => void): this;\n        addListener(event: \"SIGINT\", listener: () => void): this;\n        addListener(event: \"SIGTSTP\", listener: () => void): this;\n\n        emit(event: string, ...args: any[]): boolean;\n        emit(event: \"close\"): boolean;\n        emit(event: \"line\", input: any): boolean;\n        emit(event: \"pause\"): boolean;\n        emit(event: \"resume\"): boolean;\n        emit(event: \"SIGCONT\"): boolean;\n        emit(event: \"SIGINT\"): boolean;\n        emit(event: \"SIGTSTP\"): boolean;\n\n        on(event: string, listener: Function): this;\n        on(event: \"close\", listener: () => void): this;\n        on(event: \"line\", listener: (input: any) => void): this;\n        on(event: \"pause\", listener: () => void): this;\n        on(event: \"resume\", listener: () => void): this;\n        on(event: \"SIGCONT\", listener: () => void): this;\n        on(event: \"SIGINT\", listener: () => void): this;\n        on(event: \"SIGTSTP\", listener: () => void): this;\n\n        once(event: string, listener: Function): this;\n        once(event: \"close\", listener: () => void): this;\n        once(event: \"line\", listener: (input: any) => void): this;\n        once(event: \"pause\", listener: () => void): this;\n        once(event: \"resume\", listener: () => void): this;\n        once(event: \"SIGCONT\", listener: () => void): this;\n        once(event: \"SIGINT\", listener: () => void): this;\n        once(event: \"SIGTSTP\", listener: () => void): this;\n\n        prependListener(event: string, listener: Function): this;\n        prependListener(event: \"close\", listener: () => void): this;\n        prependListener(event: \"line\", listener: (input: any) => void): this;\n        prependListener(event: \"pause\", listener: () => void): this;\n        prependListener(event: \"resume\", listener: () => void): this;\n        prependListener(event: \"SIGCONT\", listener: () => void): this;\n        prependListener(event: \"SIGINT\", listener: () => void): this;\n        prependListener(event: \"SIGTSTP\", listener: () => void): this;\n\n        prependOnceListener(event: string, listener: Function): this;\n        prependOnceListener(event: \"close\", listener: () => void): this;\n        prependOnceListener(event: \"line\", listener: (input: any) => void): this;\n        prependOnceListener(event: \"pause\", listener: () => void): this;\n        prependOnceListener(event: \"resume\", listener: () => void): this;\n        prependOnceListener(event: \"SIGCONT\", listener: () => void): this;\n        prependOnceListener(event: \"SIGINT\", listener: () => void): this;\n        prependOnceListener(event: \"SIGTSTP\", listener: () => void): this;\n    }\n\n    type Completer = (line: string) => CompleterResult;\n    type AsyncCompleter = (line: string, callback: (err: any, result: CompleterResult) => void) => any;\n\n    export type CompleterResult = [string[], string];\n\n    export interface ReadLineOptions {\n        input: NodeJS.ReadableStream;\n        output?: NodeJS.WritableStream;\n        completer?: Completer | AsyncCompleter;\n        terminal?: boolean;\n        historySize?: number;\n    }\n\n    export function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): ReadLine;\n    export function createInterface(options: ReadLineOptions): ReadLine;\n\n    export function cursorTo(stream: NodeJS.WritableStream, x: number, y: number): void;\n    export function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void;\n    export function clearLine(stream: NodeJS.WritableStream, dir: number): void;\n    export function clearScreenDown(stream: NodeJS.WritableStream): void;\n}\n\ndeclare module \"vm\" {\n    export interface Context { }\n    export interface ScriptOptions {\n        filename?: string;\n        lineOffset?: number;\n        columnOffset?: number;\n        displayErrors?: boolean;\n        timeout?: number;\n        cachedData?: Buffer;\n        produceCachedData?: boolean;\n    }\n    export interface RunningScriptOptions {\n        filename?: string;\n        lineOffset?: number;\n        columnOffset?: number;\n        displayErrors?: boolean;\n        timeout?: number;\n    }\n    export class Script {\n        constructor(code: string, options?: ScriptOptions);\n        runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any;\n        runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;\n        runInThisContext(options?: RunningScriptOptions): any;\n    }\n    export function createContext(sandbox?: Context): Context;\n    export function isContext(sandbox: Context): boolean;\n    export function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions): any;\n    export function runInDebugContext(code: string): any;\n    export function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions): any;\n    export function runInThisContext(code: string, options?: RunningScriptOptions): any;\n}\n\ndeclare module \"child_process\" {\n    import * as events from \"events\";\n    import * as stream from \"stream\";\n    import * as net from \"net\";\n\n    export interface ChildProcess extends events.EventEmitter {\n        stdin: stream.Writable;\n        stdout: stream.Readable;\n        stderr: stream.Readable;\n        stdio: [stream.Writable, stream.Readable, stream.Readable];\n        pid: number;\n        kill(signal?: string): void;\n        send(message: any, sendHandle?: any): boolean;\n        connected: boolean;\n        disconnect(): void;\n        unref(): void;\n        ref(): void;\n\n        /**\n         * events.EventEmitter\n         * 1. close\n         * 2. disconnet\n         * 3. error\n         * 4. exit\n         * 5. message\n         **/\n\n        addListener(event: string, listener: Function): this;\n        addListener(event: \"close\", listener: (code: number, signal: string) => void): this;\n        addListener(event: \"disconnet\", listener: () => void): this;\n        addListener(event: \"error\", listener: (err: Error) => void): this;\n        addListener(event: \"exit\", listener: (code: number, signal: string) => void): this;\n        addListener(event: \"message\", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;\n\n        emit(event: string, ...args: any[]): boolean;\n        emit(event: \"close\", code: number, signal: string): boolean;\n        emit(event: \"disconnet\"): boolean;\n        emit(event: \"error\", err: Error): boolean;\n        emit(event: \"exit\", code: number, signal: string): boolean;\n        emit(event: \"message\", message: any, sendHandle: net.Socket | net.Server): boolean;\n\n        on(event: string, listener: Function): this;\n        on(event: \"close\", listener: (code: number, signal: string) => void): this;\n        on(event: \"disconnet\", listener: () => void): this;\n        on(event: \"error\", listener: (err: Error) => void): this;\n        on(event: \"exit\", listener: (code: number, signal: string) => void): this;\n        on(event: \"message\", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;\n\n        once(event: string, listener: Function): this;\n        once(event: \"close\", listener: (code: number, signal: string) => void): this;\n        once(event: \"disconnet\", listener: () => void): this;\n        once(event: \"error\", listener: (err: Error) => void): this;\n        once(event: \"exit\", listener: (code: number, signal: string) => void): this;\n        once(event: \"message\", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;\n\n        prependListener(event: string, listener: Function): this;\n        prependListener(event: \"close\", listener: (code: number, signal: string) => void): this;\n        prependListener(event: \"disconnet\", listener: () => void): this;\n        prependListener(event: \"error\", listener: (err: Error) => void): this;\n        prependListener(event: \"exit\", listener: (code: number, signal: string) => void): this;\n        prependListener(event: \"message\", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;\n\n        prependOnceListener(event: string, listener: Function): this;\n        prependOnceListener(event: \"close\", listener: (code: number, signal: string) => void): this;\n        prependOnceListener(event: \"disconnet\", listener: () => void): this;\n        prependOnceListener(event: \"error\", listener: (err: Error) => void): this;\n        prependOnceListener(event: \"exit\", listener: (code: number, signal: string) => void): this;\n        prependOnceListener(event: \"message\", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;\n    }\n\n    export interface SpawnOptions {\n        cwd?: string;\n        env?: any;\n        stdio?: any;\n        detached?: boolean;\n        uid?: number;\n        gid?: number;\n        shell?: boolean | string;\n    }\n    export function spawn(command: string, args?: string[], options?: SpawnOptions): ChildProcess;\n\n    export interface ExecOptions {\n        cwd?: string;\n        env?: any;\n        shell?: string;\n        timeout?: number;\n        maxBuffer?: number;\n        killSignal?: string;\n        uid?: number;\n        gid?: number;\n    }\n    export interface ExecOptionsWithStringEncoding extends ExecOptions {\n        encoding: BufferEncoding;\n    }\n    export interface ExecOptionsWithBufferEncoding extends ExecOptions {\n        encoding: string; // specify `null`.\n    }\n    export function exec(command: string, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;\n    export function exec(command: string, options: ExecOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;\n    // usage. child_process.exec(\"tsc\", {encoding: null as string}, (err, stdout, stderr) => {});\n    export function exec(command: string, options: ExecOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess;\n    export function exec(command: string, options: ExecOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;\n\n    export interface ExecFileOptions {\n        cwd?: string;\n        env?: any;\n        timeout?: number;\n        maxBuffer?: number;\n        killSignal?: string;\n        uid?: number;\n        gid?: number;\n    }\n    export interface ExecFileOptionsWithStringEncoding extends ExecFileOptions {\n        encoding: BufferEncoding;\n    }\n    export interface ExecFileOptionsWithBufferEncoding extends ExecFileOptions {\n        encoding: string; // specify `null`.\n    }\n    export function execFile(file: string, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;\n    export function execFile(file: string, options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;\n    // usage. child_process.execFile(\"file.sh\", {encoding: null as string}, (err, stdout, stderr) => {});\n    export function execFile(file: string, options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess;\n    export function execFile(file: string, options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;\n    export function execFile(file: string, args?: string[], callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;\n    export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithStringEncoding, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;\n    // usage. child_process.execFile(\"file.sh\", [\"foo\"], {encoding: null as string}, (err, stdout, stderr) => {});\n    export function execFile(file: string, args?: string[], options?: ExecFileOptionsWithBufferEncoding, callback?: (error: Error, stdout: Buffer, stderr: Buffer) => void): ChildProcess;\n    export function execFile(file: string, args?: string[], options?: ExecFileOptions, callback?: (error: Error, stdout: string, stderr: string) => void): ChildProcess;\n\n    export interface ForkOptions {\n        cwd?: string;\n        env?: any;\n        execPath?: string;\n        execArgv?: string[];\n        silent?: boolean;\n        uid?: number;\n        gid?: number;\n    }\n    export function fork(modulePath: string, args?: string[], options?: ForkOptions): ChildProcess;\n\n    export interface SpawnSyncOptions {\n        cwd?: string;\n        input?: string | Buffer;\n        stdio?: any;\n        env?: any;\n        uid?: number;\n        gid?: number;\n        timeout?: number;\n        killSignal?: string;\n        maxBuffer?: number;\n        encoding?: string;\n        shell?: boolean | string;\n    }\n    export interface SpawnSyncOptionsWithStringEncoding extends SpawnSyncOptions {\n        encoding: BufferEncoding;\n    }\n    export interface SpawnSyncOptionsWithBufferEncoding extends SpawnSyncOptions {\n        encoding: string; // specify `null`.\n    }\n    export interface SpawnSyncReturns<T> {\n        pid: number;\n        output: string[];\n        stdout: T;\n        stderr: T;\n        status: number;\n        signal: string;\n        error: Error;\n    }\n    export function spawnSync(command: string): SpawnSyncReturns<Buffer>;\n    export function spawnSync(command: string, options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;\n    export function spawnSync(command: string, options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;\n    export function spawnSync(command: string, options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;\n    export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithStringEncoding): SpawnSyncReturns<string>;\n    export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptionsWithBufferEncoding): SpawnSyncReturns<Buffer>;\n    export function spawnSync(command: string, args?: string[], options?: SpawnSyncOptions): SpawnSyncReturns<Buffer>;\n\n    export interface ExecSyncOptions {\n        cwd?: string;\n        input?: string | Buffer;\n        stdio?: any;\n        env?: any;\n        shell?: string;\n        uid?: number;\n        gid?: number;\n        timeout?: number;\n        killSignal?: string;\n        maxBuffer?: number;\n        encoding?: string;\n    }\n    export interface ExecSyncOptionsWithStringEncoding extends ExecSyncOptions {\n        encoding: BufferEncoding;\n    }\n    export interface ExecSyncOptionsWithBufferEncoding extends ExecSyncOptions {\n        encoding: string; // specify `null`.\n    }\n    export function execSync(command: string): Buffer;\n    export function execSync(command: string, options?: ExecSyncOptionsWithStringEncoding): string;\n    export function execSync(command: string, options?: ExecSyncOptionsWithBufferEncoding): Buffer;\n    export function execSync(command: string, options?: ExecSyncOptions): Buffer;\n\n    export interface ExecFileSyncOptions {\n        cwd?: string;\n        input?: string | Buffer;\n        stdio?: any;\n        env?: any;\n        uid?: number;\n        gid?: number;\n        timeout?: number;\n        killSignal?: string;\n        maxBuffer?: number;\n        encoding?: string;\n    }\n    export interface ExecFileSyncOptionsWithStringEncoding extends ExecFileSyncOptions {\n        encoding: BufferEncoding;\n    }\n    export interface ExecFileSyncOptionsWithBufferEncoding extends ExecFileSyncOptions {\n        encoding: string; // specify `null`.\n    }\n    export function execFileSync(command: string): Buffer;\n    export function execFileSync(command: string, options?: ExecFileSyncOptionsWithStringEncoding): string;\n    export function execFileSync(command: string, options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;\n    export function execFileSync(command: string, options?: ExecFileSyncOptions): Buffer;\n    export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithStringEncoding): string;\n    export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptionsWithBufferEncoding): Buffer;\n    export function execFileSync(command: string, args?: string[], options?: ExecFileSyncOptions): Buffer;\n}\n\ndeclare module \"url\" {\n    export interface Url {\n        href?: string;\n        protocol?: string;\n        auth?: string;\n        hostname?: string;\n        port?: string;\n        host?: string;\n        pathname?: string;\n        search?: string;\n        query?: string | any;\n        slashes?: boolean;\n        hash?: string;\n        path?: string;\n    }\n\n    export function parse(urlStr: string, parseQueryString?: boolean, slashesDenoteHost?: boolean): Url;\n    export function format(url: Url): string;\n    export function resolve(from: string, to: string): string;\n\n    export class URLSearchParams implements Iterable<string[]> {\n        constructor(init?: URLSearchParams | string);\n        append(name: string, value: string): void;\n        delete(name: string): void;\n        entries(): Iterator<string[]>;\n        forEach(callback: (value: string, name: string) => void): void;\n        get(name: string): string | null;\n        getAll(name: string): string[];\n        has(name: string): boolean;\n        keys(): Iterator<string>;\n        set(name: string, value: string): void;\n        sort(): void;\n        toString(): string;\n        values(): Iterator<string>;\n        [Symbol.iterator](): Iterator<string[]>;\n    }\n\n    export class URL {\n        constructor(input: string, base?: string | URL);\n        hash: string;\n        host: string;\n        hostname: string;\n        href: string;\n        readonly origin: string;\n        password: string;\n        pathname: string;\n        port: string;\n        protocol: string;\n        search: string;\n        readonly searchParams: URLSearchParams;\n        username: string;\n        toString(): string;\n        toJSON(): string;\n    }\n}\n\ndeclare module \"dns\" {\n    export interface MxRecord {\n        exchange: string,\n        priority: number\n    }\n\n    export function lookup(domain: string, family: number, callback: (err: Error, address: string, family: number) => void): string;\n    export function lookup(domain: string, callback: (err: Error, address: string, family: number) => void): string;\n    export function resolve(domain: string, rrtype: string, callback: (err: Error, addresses: string[]) => void): string[];\n    export function resolve(domain: string, callback: (err: Error, addresses: string[]) => void): string[];\n    export function resolve4(domain: string, callback: (err: Error, addresses: string[]) => void): string[];\n    export function resolve6(domain: string, callback: (err: Error, addresses: string[]) => void): string[];\n    export function resolveMx(domain: string, callback: (err: Error, addresses: MxRecord[]) => void): string[];\n    export function resolveTxt(domain: string, callback: (err: Error, addresses: string[][]) => void): string[][];\n    export function resolveSrv(domain: string, callback: (err: Error, addresses: string[]) => void): string[];\n    export function resolveNs(domain: string, callback: (err: Error, addresses: string[]) => void): string[];\n    export function resolveCname(domain: string, callback: (err: Error, addresses: string[]) => void): string[];\n    export function reverse(ip: string, callback: (err: Error, domains: string[]) => void): string[];\n    export function setServers(servers: string[]): void;\n\n    //Error codes\n    export var NODATA: string;\n    export var FORMERR: string;\n    export var SERVFAIL: string;\n    export var NOTFOUND: string;\n    export var NOTIMP: string;\n    export var REFUSED: string;\n    export var BADQUERY: string;\n    export var BADNAME: string;\n    export var BADFAMILY: string;\n    export var BADRESP: string;\n    export var CONNREFUSED: string;\n    export var TIMEOUT: string;\n    export var EOF: string;\n    export var FILE: string;\n    export var NOMEM: string;\n    export var DESTRUCTION: string;\n    export var BADSTR: string;\n    export var BADFLAGS: string;\n    export var NONAME: string;\n    export var BADHINTS: string;\n    export var NOTINITIALIZED: string;\n    export var LOADIPHLPAPI: string;\n    export var ADDRGETNETWORKPARAMS: string;\n    export var CANCELLED: string;\n}\n\ndeclare module \"net\" {\n    import * as stream from \"stream\";\n    import * as events from \"events\";\n\n    export interface Socket extends stream.Duplex {\n        // Extended base methods\n        write(buffer: Buffer): boolean;\n        write(buffer: Buffer, cb?: Function): boolean;\n        write(str: string, cb?: Function): boolean;\n        write(str: string, encoding?: string, cb?: Function): boolean;\n        write(str: string, encoding?: string, fd?: string): boolean;\n\n        connect(port: number, host?: string, connectionListener?: Function): void;\n        connect(path: string, connectionListener?: Function): void;\n        bufferSize: number;\n        setEncoding(encoding?: string): this;\n        write(data: any, encoding?: string, callback?: Function): void;\n        destroy(err?: any): void;\n        pause(): this;\n        resume(): this;\n        setTimeout(timeout: number, callback?: Function): void;\n        setNoDelay(noDelay?: boolean): void;\n        setKeepAlive(enable?: boolean, initialDelay?: number): void;\n        address(): { port: number; family: string; address: string; };\n        unref(): void;\n        ref(): void;\n\n        remoteAddress: string;\n        remoteFamily: string;\n        remotePort: number;\n        localAddress: string;\n        localPort: number;\n        bytesRead: number;\n        bytesWritten: number;\n        destroyed: boolean;\n\n        // Extended base methods\n        end(): void;\n        end(buffer: Buffer, cb?: Function): void;\n        end(str: string, cb?: Function): void;\n        end(str: string, encoding?: string, cb?: Function): void;\n        end(data?: any, encoding?: string): void;\n\n        /**\n         * events.EventEmitter\n         *   1. close\n         *   2. connect\n         *   3. data\n         *   4. drain\n         *   5. end\n         *   6. error\n         *   7. lookup\n         *   8. timeout\n         */\n        addListener(event: string, listener: Function): this;\n        addListener(event: \"close\", listener: (had_error: boolean) => void): this;\n        addListener(event: \"connect\", listener: () => void): this;\n        addListener(event: \"data\", listener: (data: Buffer) => void): this;\n        addListener(event: \"drain\", listener: () => void): this;\n        addListener(event: \"end\", listener: () => void): this;\n        addListener(event: \"error\", listener: (err: Error) => void): this;\n        addListener(event: \"lookup\", listener: (err: Error, address: string, family: string | number, host: string) => void): this;\n        addListener(event: \"timeout\", listener: () => void): this;\n\n        emit(event: string, ...args: any[]): boolean;\n        emit(event: \"close\", had_error: boolean): boolean;\n        emit(event: \"connect\"): boolean;\n        emit(event: \"data\", data: Buffer): boolean;\n        emit(event: \"drain\"): boolean;\n        emit(event: \"end\"): boolean;\n        emit(event: \"error\", err: Error): boolean;\n        emit(event: \"lookup\", err: Error, address: string, family: string | number, host: string): boolean;\n        emit(event: \"timeout\"): boolean;\n\n        on(event: string, listener: Function): this;\n        on(event: \"close\", listener: (had_error: boolean) => void): this;\n        on(event: \"connect\", listener: () => void): this;\n        on(event: \"data\", listener: (data: Buffer) => void): this;\n        on(event: \"drain\", listener: () => void): this;\n        on(event: \"end\", listener: () => void): this;\n        on(event: \"error\", listener: (err: Error) => void): this;\n        on(event: \"lookup\", listener: (err: Error, address: string, family: string | number, host: string) => void): this;\n        on(event: \"timeout\", listener: () => void): this;\n\n        once(event: string, listener: Function): this;\n        once(event: \"close\", listener: (had_error: boolean) => void): this;\n        once(event: \"connect\", listener: () => void): this;\n        once(event: \"data\", listener: (data: Buffer) => void): this;\n        once(event: \"drain\", listener: () => void): this;\n        once(event: \"end\", listener: () => void): this;\n        once(event: \"error\", listener: (err: Error) => void): this;\n        once(event: \"lookup\", listener: (err: Error, address: string, family: string | number, host: string) => void): this;\n        once(event: \"timeout\", listener: () => void): this;\n\n        prependListener(event: string, listener: Function): this;\n        prependListener(event: \"close\", listener: (had_error: boolean) => void): this;\n        prependListener(event: \"connect\", listener: () => void): this;\n        prependListener(event: \"data\", listener: (data: Buffer) => void): this;\n        prependListener(event: \"drain\", listener: () => void): this;\n        prependListener(event: \"end\", listener: () => void): this;\n        prependListener(event: \"error\", listener: (err: Error) => void): this;\n        prependListener(event: \"lookup\", listener: (err: Error, address: string, family: string | number, host: string) => void): this;\n        prependListener(event: \"timeout\", listener: () => void): this;\n\n        prependOnceListener(event: string, listener: Function): this;\n        prependOnceListener(event: \"close\", listener: (had_error: boolean) => void): this;\n        prependOnceListener(event: \"connect\", listener: () => void): this;\n        prependOnceListener(event: \"data\", listener: (data: Buffer) => void): this;\n        prependOnceListener(event: \"drain\", listener: () => void): this;\n        prependOnceListener(event: \"end\", listener: () => void): this;\n        prependOnceListener(event: \"error\", listener: (err: Error) => void): this;\n        prependOnceListener(event: \"lookup\", listener: (err: Error, address: string, family: string | number, host: string) => void): this;\n        prependOnceListener(event: \"timeout\", listener: () => void): this;\n    }\n\n    export var Socket: {\n        new (options?: { fd?: string; type?: string; allowHalfOpen?: boolean; }): Socket;\n    };\n\n    export interface ListenOptions {\n        port?: number;\n        host?: string;\n        backlog?: number;\n        path?: string;\n        exclusive?: boolean;\n    }\n\n    export interface Server extends events.EventEmitter {\n        listen(port: number, hostname?: string, backlog?: number, listeningListener?: Function): Server;\n        listen(port: number, hostname?: string, listeningListener?: Function): Server;\n        listen(port: number, backlog?: number, listeningListener?: Function): Server;\n        listen(port: number, listeningListener?: Function): Server;\n        listen(path: string, backlog?: number, listeningListener?: Function): Server;\n        listen(path: string, listeningListener?: Function): Server;\n        listen(options: ListenOptions, listeningListener?: Function): Server;\n        listen(handle: any, backlog?: number, listeningListener?: Function): Server;\n        listen(handle: any, listeningListener?: Function): Server;\n        close(callback?: Function): Server;\n        address(): { port: number; family: string; address: string; };\n        getConnections(cb: (error: Error, count: number) => void): void;\n        ref(): Server;\n        unref(): Server;\n        maxConnections: number;\n        connections: number;\n        listening: boolean;\n\n        /**\n         * events.EventEmitter\n         *   1. close\n         *   2. connection\n         *   3. error\n         *   4. listening\n         */\n        addListener(event: string, listener: Function): this;\n        addListener(event: \"close\", listener: () => void): this;\n        addListener(event: \"connection\", listener: (socket: Socket) => void): this;\n        addListener(event: \"error\", listener: (err: Error) => void): this;\n        addListener(event: \"listening\", listener: () => void): this;\n\n        emit(event: string, ...args: any[]): boolean;\n        emit(event: \"close\"): boolean;\n        emit(event: \"connection\", socket: Socket): boolean;\n        emit(event: \"error\", err: Error): boolean;\n        emit(event: \"listening\"): boolean;\n\n        on(event: string, listener: Function): this;\n        on(event: \"close\", listener: () => void): this;\n        on(event: \"connection\", listener: (socket: Socket) => void): this;\n        on(event: \"error\", listener: (err: Error) => void): this;\n        on(event: \"listening\", listener: () => void): this;\n\n        once(event: string, listener: Function): this;\n        once(event: \"close\", listener: () => void): this;\n        once(event: \"connection\", listener: (socket: Socket) => void): this;\n        once(event: \"error\", listener: (err: Error) => void): this;\n        once(event: \"listening\", listener: () => void): this;\n\n        prependListener(event: string, listener: Function): this;\n        prependListener(event: \"close\", listener: () => void): this;\n        prependListener(event: \"connection\", listener: (socket: Socket) => void): this;\n        prependListener(event: \"error\", listener: (err: Error) => void): this;\n        prependListener(event: \"listening\", listener: () => void): this;\n\n        prependOnceListener(event: string, listener: Function): this;\n        prependOnceListener(event: \"close\", listener: () => void): this;\n        prependOnceListener(event: \"connection\", listener: (socket: Socket) => void): this;\n        prependOnceListener(event: \"error\", listener: (err: Error) => void): this;\n        prependOnceListener(event: \"listening\", listener: () => void): this;\n    }\n    export function createServer(connectionListener?: (socket: Socket) => void): Server;\n    export function createServer(options?: { allowHalfOpen?: boolean; }, connectionListener?: (socket: Socket) => void): Server;\n    export function connect(options: { port: number, host?: string, localAddress?: string, localPort?: string, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket;\n    export function connect(port: number, host?: string, connectionListener?: Function): Socket;\n    export function connect(path: string, connectionListener?: Function): Socket;\n    export function createConnection(options: { port: number, host?: string, localAddress?: string, localPort?: string, family?: number, allowHalfOpen?: boolean; }, connectionListener?: Function): Socket;\n    export function createConnection(port: number, host?: string, connectionListener?: Function): Socket;\n    export function createConnection(path: string, connectionListener?: Function): Socket;\n    export function isIP(input: string): number;\n    export function isIPv4(input: string): boolean;\n    export function isIPv6(input: string): boolean;\n}\n\ndeclare module \"dgram\" {\n    import * as events from \"events\";\n\n    interface RemoteInfo {\n        address: string;\n        family: string;\n        port: number;\n    }\n\n    interface AddressInfo {\n        address: string;\n        family: string;\n        port: number;\n    }\n\n    interface BindOptions {\n        port: number;\n        address?: string;\n        exclusive?: boolean;\n    }\n\n    interface SocketOptions {\n        type: \"udp4\" | \"udp6\";\n        reuseAddr?: boolean;\n    }\n\n    export function createSocket(type: string, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;\n    export function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;\n\n    export interface Socket extends events.EventEmitter {\n        send(msg: Buffer | String | any[], port: number, address: string, callback?: (error: Error, bytes: number) => void): void;\n        send(msg: Buffer | String | any[], offset: number, length: number, port: number, address: string, callback?: (error: Error, bytes: number) => void): void;\n        bind(port?: number, address?: string, callback?: () => void): void;\n        bind(options: BindOptions, callback?: Function): void;\n        close(callback?: () => void): void;\n        address(): AddressInfo;\n        setBroadcast(flag: boolean): void;\n        setTTL(ttl: number): void;\n        setMulticastTTL(ttl: number): void;\n        setMulticastLoopback(flag: boolean): void;\n        addMembership(multicastAddress: string, multicastInterface?: string): void;\n        dropMembership(multicastAddress: string, multicastInterface?: string): void;\n        ref(): this;\n        unref(): this;\n\n        /**\n         * events.EventEmitter\n         * 1. close\n         * 2. error\n         * 3. listening\n         * 4. message\n         **/\n        addListener(event: string, listener: Function): this;\n        addListener(event: \"close\", listener: () => void): this;\n        addListener(event: \"error\", listener: (err: Error) => void): this;\n        addListener(event: \"listening\", listener: () => void): this;\n        addListener(event: \"message\", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;\n\n        emit(event: string, ...args: any[]): boolean;\n        emit(event: \"close\"): boolean;\n        emit(event: \"error\", err: Error): boolean;\n        emit(event: \"listening\"): boolean;\n        emit(event: \"message\", msg: Buffer, rinfo: AddressInfo): boolean;\n\n        on(event: string, listener: Function): this;\n        on(event: \"close\", listener: () => void): this;\n        on(event: \"error\", listener: (err: Error) => void): this;\n        on(event: \"listening\", listener: () => void): this;\n        on(event: \"message\", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;\n\n        once(event: string, listener: Function): this;\n        once(event: \"close\", listener: () => void): this;\n        once(event: \"error\", listener: (err: Error) => void): this;\n        once(event: \"listening\", listener: () => void): this;\n        once(event: \"message\", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;\n\n        prependListener(event: string, listener: Function): this;\n        prependListener(event: \"close\", listener: () => void): this;\n        prependListener(event: \"error\", listener: (err: Error) => void): this;\n        prependListener(event: \"listening\", listener: () => void): this;\n        prependListener(event: \"message\", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;\n\n        prependOnceListener(event: string, listener: Function): this;\n        prependOnceListener(event: \"close\", listener: () => void): this;\n        prependOnceListener(event: \"error\", listener: (err: Error) => void): this;\n        prependOnceListener(event: \"listening\", listener: () => void): this;\n        prependOnceListener(event: \"message\", listener: (msg: Buffer, rinfo: AddressInfo) => void): this;\n    }\n}\n\ndeclare module \"fs\" {\n    import * as stream from \"stream\";\n    import * as events from \"events\";\n\n    interface Stats {\n        isFile(): boolean;\n        isDirectory(): boolean;\n        isBlockDevice(): boolean;\n        isCharacterDevice(): boolean;\n        isSymbolicLink(): boolean;\n        isFIFO(): boolean;\n        isSocket(): boolean;\n        dev: number;\n        ino: number;\n        mode: number;\n        nlink: number;\n        uid: number;\n        gid: number;\n        rdev: number;\n        size: number;\n        blksize: number;\n        blocks: number;\n        atime: Date;\n        mtime: Date;\n        ctime: Date;\n        birthtime: Date;\n    }\n\n    interface FSWatcher extends events.EventEmitter {\n        close(): void;\n\n        /**\n         * events.EventEmitter\n         *   1. change\n         *   2. error\n         */\n        addListener(event: string, listener: Function): this;\n        addListener(event: \"change\", listener: (eventType: string, filename: string | Buffer) => void): this;\n        addListener(event: \"error\", listener: (code: number, signal: string) => void): this;\n\n        on(event: string, listener: Function): this;\n        on(event: \"change\", listener: (eventType: string, filename: string | Buffer) => void): this;\n        on(event: \"error\", listener: (code: number, signal: string) => void): this;\n\n        once(event: string, listener: Function): this;\n        once(event: \"change\", listener: (eventType: string, filename: string | Buffer) => void): this;\n        once(event: \"error\", listener: (code: number, signal: string) => void): this;\n\n        prependListener(event: string, listener: Function): this;\n        prependListener(event: \"change\", listener: (eventType: string, filename: string | Buffer) => void): this;\n        prependListener(event: \"error\", listener: (code: number, signal: string) => void): this;\n\n        prependOnceListener(event: string, listener: Function): this;\n        prependOnceListener(event: \"change\", listener: (eventType: string, filename: string | Buffer) => void): this;\n        prependOnceListener(event: \"error\", listener: (code: number, signal: string) => void): this;\n    }\n\n    export interface ReadStream extends stream.Readable {\n        close(): void;\n        destroy(): void;\n        bytesRead: number;\n        path: string | Buffer;\n\n        /**\n         * events.EventEmitter\n         *   1. open\n         *   2. close\n         */\n        addListener(event: string, listener: Function): this;\n        addListener(event: \"open\", listener: (fd: number) => void): this;\n        addListener(event: \"close\", listener: () => void): this;\n\n        on(event: string, listener: Function): this;\n        on(event: \"open\", listener: (fd: number) => void): this;\n        on(event: \"close\", listener: () => void): this;\n\n        once(event: string, listener: Function): this;\n        once(event: \"open\", listener: (fd: number) => void): this;\n        once(event: \"close\", listener: () => void): this;\n\n        prependListener(event: string, listener: Function): this;\n        prependListener(event: \"open\", listener: (fd: number) => void): this;\n        prependListener(event: \"close\", listener: () => void): this;\n\n        prependOnceListener(event: string, listener: Function): this;\n        prependOnceListener(event: \"open\", listener: (fd: number) => void): this;\n        prependOnceListener(event: \"close\", listener: () => void): this;\n    }\n\n    export interface WriteStream extends stream.Writable {\n        close(): void;\n        bytesWritten: number;\n        path: string | Buffer;\n\n        /**\n         * events.EventEmitter\n         *   1. open\n         *   2. close\n         */\n        addListener(event: string, listener: Function): this;\n        addListener(event: \"open\", listener: (fd: number) => void): this;\n        addListener(event: \"close\", listener: () => void): this;\n\n        on(event: string, listener: Function): this;\n        on(event: \"open\", listener: (fd: number) => void): this;\n        on(event: \"close\", listener: () => void): this;\n\n        once(event: string, listener: Function): this;\n        once(event: \"open\", listener: (fd: number) => void): this;\n        once(event: \"close\", listener: () => void): this;\n\n        prependListener(event: string, listener: Function): this;\n        prependListener(event: \"open\", listener: (fd: number) => void): this;\n        prependListener(event: \"close\", listener: () => void): this;\n\n        prependOnceListener(event: string, listener: Function): this;\n        prependOnceListener(event: \"open\", listener: (fd: number) => void): this;\n        prependOnceListener(event: \"close\", listener: () => void): this;\n    }\n\n    /**\n     * Asynchronous rename.\n     * @param oldPath\n     * @param newPath\n     * @param callback No arguments other than a possible exception are given to the completion callback.\n     */\n    export function rename(oldPath: string, newPath: string, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    /**\n     * Synchronous rename\n     * @param oldPath\n     * @param newPath\n     */\n    export function renameSync(oldPath: string, newPath: string): void;\n    export function truncate(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function truncate(path: string | Buffer, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function truncateSync(path: string | Buffer, len?: number): void;\n    export function ftruncate(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function ftruncate(fd: number, len: number, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function ftruncateSync(fd: number, len?: number): void;\n    export function chown(path: string | Buffer, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function chownSync(path: string | Buffer, uid: number, gid: number): void;\n    export function fchown(fd: number, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function fchownSync(fd: number, uid: number, gid: number): void;\n    export function lchown(path: string | Buffer, uid: number, gid: number, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function lchownSync(path: string | Buffer, uid: number, gid: number): void;\n    export function chmod(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function chmod(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function chmodSync(path: string | Buffer, mode: number): void;\n    export function chmodSync(path: string | Buffer, mode: string): void;\n    export function fchmod(fd: number, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function fchmod(fd: number, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function fchmodSync(fd: number, mode: number): void;\n    export function fchmodSync(fd: number, mode: string): void;\n    export function lchmod(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function lchmod(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function lchmodSync(path: string | Buffer, mode: number): void;\n    export function lchmodSync(path: string | Buffer, mode: string): void;\n    export function stat(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void;\n    export function lstat(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void;\n    export function fstat(fd: number, callback?: (err: NodeJS.ErrnoException, stats: Stats) => any): void;\n    export function statSync(path: string | Buffer): Stats;\n    export function lstatSync(path: string | Buffer): Stats;\n    export function fstatSync(fd: number): Stats;\n    export function link(srcpath: string | Buffer, dstpath: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function linkSync(srcpath: string | Buffer, dstpath: string | Buffer): void;\n    export function symlink(srcpath: string | Buffer, dstpath: string | Buffer, type?: string, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function symlinkSync(srcpath: string | Buffer, dstpath: string | Buffer, type?: string): void;\n    export function readlink(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, linkString: string) => any): void;\n    export function readlinkSync(path: string | Buffer): string;\n    export function realpath(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;\n    export function realpath(path: string | Buffer, cache: { [path: string]: string }, callback: (err: NodeJS.ErrnoException, resolvedPath: string) => any): void;\n    export function realpathSync(path: string | Buffer, cache?: { [path: string]: string }): string;\n    /**\n     * Asynchronous unlink - deletes the file specified in {path}\n     *\n     * @param path\n     * @param callback No arguments other than a possible exception are given to the completion callback.\n     */\n    export function unlink(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    /**\n     * Synchronous unlink - deletes the file specified in {path}\n     *\n     * @param path\n     */\n    export function unlinkSync(path: string | Buffer): void;\n    /**\n     * Asynchronous rmdir - removes the directory specified in {path}\n     *\n     * @param path\n     * @param callback No arguments other than a possible exception are given to the completion callback.\n     */\n    export function rmdir(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    /**\n     * Synchronous rmdir - removes the directory specified in {path}\n     *\n     * @param path\n     */\n    export function rmdirSync(path: string | Buffer): void;\n    /**\n     * Asynchronous mkdir - creates the directory specified in {path}.  Parameter {mode} defaults to 0777.\n     *\n     * @param path\n     * @param callback No arguments other than a possible exception are given to the completion callback.\n     */\n    export function mkdir(path: string | Buffer, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    /**\n     * Asynchronous mkdir - creates the directory specified in {path}.  Parameter {mode} defaults to 0777.\n     *\n     * @param path\n     * @param mode\n     * @param callback No arguments other than a possible exception are given to the completion callback.\n     */\n    export function mkdir(path: string | Buffer, mode: number, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    /**\n     * Asynchronous mkdir - creates the directory specified in {path}.  Parameter {mode} defaults to 0777.\n     *\n     * @param path\n     * @param mode\n     * @param callback No arguments other than a possible exception are given to the completion callback.\n     */\n    export function mkdir(path: string | Buffer, mode: string, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    /**\n     * Synchronous mkdir - creates the directory specified in {path}.  Parameter {mode} defaults to 0777.\n     *\n     * @param path\n     * @param mode\n     * @param callback No arguments other than a possible exception are given to the completion callback.\n     */\n    export function mkdirSync(path: string | Buffer, mode?: number): void;\n    /**\n     * Synchronous mkdir - creates the directory specified in {path}.  Parameter {mode} defaults to 0777.\n     *\n     * @param path\n     * @param mode\n     * @param callback No arguments other than a possible exception are given to the completion callback.\n     */\n    export function mkdirSync(path: string | Buffer, mode?: string): void;\n    /**\n     * Asynchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.\n     *\n     * @param prefix\n     * @param callback The created folder path is passed as a string to the callback's second parameter.\n     */\n    export function mkdtemp(prefix: string, callback?: (err: NodeJS.ErrnoException, folder: string) => void): void;\n    /**\n     * Synchronous mkdtemp - Creates a unique temporary directory. Generates six random characters to be appended behind a required prefix to create a unique temporary directory.\n     *\n     * @param prefix\n     * @returns Returns the created folder path.\n     */\n    export function mkdtempSync(prefix: string): string;\n    export function readdir(path: string | Buffer, callback?: (err: NodeJS.ErrnoException, files: string[]) => void): void;\n    export function readdirSync(path: string | Buffer): string[];\n    export function close(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function closeSync(fd: number): void;\n    export function open(path: string | Buffer, flags: string | number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void;\n    export function open(path: string | Buffer, flags: string | number, mode: number, callback: (err: NodeJS.ErrnoException, fd: number) => void): void;\n    export function openSync(path: string | Buffer, flags: string | number, mode?: number): number;\n    export function utimes(path: string | Buffer, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function utimes(path: string | Buffer, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function utimesSync(path: string | Buffer, atime: number, mtime: number): void;\n    export function utimesSync(path: string | Buffer, atime: Date, mtime: Date): void;\n    export function futimes(fd: number, atime: number, mtime: number, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function futimes(fd: number, atime: Date, mtime: Date, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function futimesSync(fd: number, atime: number, mtime: number): void;\n    export function futimesSync(fd: number, atime: Date, mtime: Date): void;\n    export function fsync(fd: number, callback?: (err?: NodeJS.ErrnoException) => void): void;\n    export function fsyncSync(fd: number): void;\n    export function write(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void;\n    export function write(fd: number, buffer: Buffer, offset: number, length: number, callback?: (err: NodeJS.ErrnoException, written: number, buffer: Buffer) => void): void;\n    export function write(fd: number, data: any, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;\n    export function write(fd: number, data: any, offset: number, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;\n    export function write(fd: number, data: any, offset: number, encoding: string, callback?: (err: NodeJS.ErrnoException, written: number, str: string) => void): void;\n    export function writeSync(fd: number, buffer: Buffer, offset: number, length: number, position?: number): number;\n    export function writeSync(fd: number, data: any, position?: number, enconding?: string): number;\n    export function read(fd: number, buffer: Buffer, offset: number, length: number, position: number, callback?: (err: NodeJS.ErrnoException, bytesRead: number, buffer: Buffer) => void): void;\n    export function readSync(fd: number, buffer: Buffer, offset: number, length: number, position: number): number;\n    /**\n     * Asynchronous readFile - Asynchronously reads the entire contents of a file.\n     *\n     * @param fileName\n     * @param encoding\n     * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.\n     */\n    export function readFile(filename: string, encoding: string, callback: (err: NodeJS.ErrnoException, data: string) => void): void;\n    /**\n     * Asynchronous readFile - Asynchronously reads the entire contents of a file.\n     *\n     * @param fileName\n     * @param options An object with optional {encoding} and {flag} properties.  If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer.\n     * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.\n     */\n    export function readFile(filename: string, options: { encoding: string; flag?: string; }, callback: (err: NodeJS.ErrnoException, data: string) => void): void;\n    /**\n     * Asynchronous readFile - Asynchronously reads the entire contents of a file.\n     *\n     * @param fileName\n     * @param options An object with optional {encoding} and {flag} properties.  If {encoding} is specified, readFile returns a string; otherwise it returns a Buffer.\n     * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.\n     */\n    export function readFile(filename: string, options: { flag?: string; }, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;\n    /**\n     * Asynchronous readFile - Asynchronously reads the entire contents of a file.\n     *\n     * @param fileName\n     * @param callback - The callback is passed two arguments (err, data), where data is the contents of the file.\n     */\n    export function readFile(filename: string, callback: (err: NodeJS.ErrnoException, data: Buffer) => void): void;\n    /**\n     * Synchronous readFile - Synchronously reads the entire contents of a file.\n     *\n     * @param fileName\n     * @param encoding\n     */\n    export function readFileSync(filename: string, encoding: string): string;\n    /**\n     * Synchronous readFile - Synchronously reads the entire contents of a file.\n     *\n     * @param fileName\n     * @param options An object with optional {encoding} and {flag} properties.  If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer.\n     */\n    export function readFileSync(filename: string, options: { encoding: string; flag?: string; }): string;\n    /**\n     * Synchronous readFile - Synchronously reads the entire contents of a file.\n     *\n     * @param fileName\n     * @param options An object with optional {encoding} and {flag} properties.  If {encoding} is specified, readFileSync returns a string; otherwise it returns a Buffer.\n     */\n    export function readFileSync(filename: string, options?: { flag?: string; }): Buffer;\n    export function writeFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void;\n    export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;\n    export function writeFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;\n    export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;\n    export function writeFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;\n    export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: number; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;\n    export function appendFile(filename: string, data: any, options: { encoding?: string; mode?: string; flag?: string; }, callback?: (err: NodeJS.ErrnoException) => void): void;\n    export function appendFile(filename: string, data: any, callback?: (err: NodeJS.ErrnoException) => void): void;\n    export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: number; flag?: string; }): void;\n    export function appendFileSync(filename: string, data: any, options?: { encoding?: string; mode?: string; flag?: string; }): void;\n    export function watchFile(filename: string, listener: (curr: Stats, prev: Stats) => void): void;\n    export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: (curr: Stats, prev: Stats) => void): void;\n    export function unwatchFile(filename: string, listener?: (curr: Stats, prev: Stats) => void): void;\n    export function watch(filename: string, listener?: (event: string, filename: string) => any): FSWatcher;\n    export function watch(filename: string, encoding: string, listener?: (event: string, filename: string | Buffer) => any): FSWatcher;\n    export function watch(filename: string, options: { persistent?: boolean; recursive?: boolean; encoding?: string }, listener?: (event: string, filename: string | Buffer) => any): FSWatcher;\n    export function exists(path: string | Buffer, callback?: (exists: boolean) => void): void;\n    export function existsSync(path: string | Buffer): boolean;\n\n    export namespace constants {\n        // File Access Constants\n\n        /** Constant for fs.access(). File is visible to the calling process. */\n        export const F_OK: number;\n\n        /** Constant for fs.access(). File can be read by the calling process. */\n        export const R_OK: number;\n\n        /** Constant for fs.access(). File can be written by the calling process. */\n        export const W_OK: number;\n\n        /** Constant for fs.access(). File can be executed by the calling process. */\n        export const X_OK: number;\n\n        // File Open Constants\n\n        /** Constant for fs.open(). Flag indicating to open a file for read-only access. */\n        export const O_RDONLY: number;\n\n        /** Constant for fs.open(). Flag indicating to open a file for write-only access. */\n        export const O_WRONLY: number;\n\n        /** Constant for fs.open(). Flag indicating to open a file for read-write access. */\n        export const O_RDWR: number;\n\n        /** Constant for fs.open(). Flag indicating to create the file if it does not already exist. */\n        export const O_CREAT: number;\n\n        /** Constant for fs.open(). Flag indicating that opening a file should fail if the O_CREAT flag is set and the file already exists. */\n        export const O_EXCL: number;\n\n        /** Constant for fs.open(). Flag indicating that if path identifies a terminal device, opening the path shall not cause that terminal to become the controlling terminal for the process (if the process does not already have one). */\n        export const O_NOCTTY: number;\n\n        /** Constant for fs.open(). Flag indicating that if the file exists and is a regular file, and the file is opened successfully for write access, its length shall be truncated to zero. */\n        export const O_TRUNC: number;\n\n        /** Constant for fs.open(). Flag indicating that data will be appended to the end of the file. */\n        export const O_APPEND: number;\n\n        /** Constant for fs.open(). Flag indicating that the open should fail if the path is not a directory. */\n        export const O_DIRECTORY: number;\n\n        /** Constant for fs.open(). Flag indicating reading accesses to the file system will no longer result in an update to the atime information associated with the file. This flag is available on Linux operating systems only. */\n        export const O_NOATIME: number;\n\n        /** Constant for fs.open(). Flag indicating that the open should fail if the path is a symbolic link. */\n        export const O_NOFOLLOW: number;\n\n        /** Constant for fs.open(). Flag indicating that the file is opened for synchronous I/O. */\n        export const O_SYNC: number;\n\n        /** Constant for fs.open(). Flag indicating to open the symbolic link itself rather than the resource it is pointing to. */\n        export const O_SYMLINK: number;\n\n        /** Constant for fs.open(). When set, an attempt will be made to minimize caching effects of file I/O. */\n        export const O_DIRECT: number;\n\n        /** Constant for fs.open(). Flag indicating to open the file in nonblocking mode when possible. */\n        export const O_NONBLOCK: number;\n\n        // File Type Constants\n\n        /** Constant for fs.Stats mode property for determining a file's type. Bit mask used to extract the file type code. */\n        export const S_IFMT: number;\n\n        /** Constant for fs.Stats mode property for determining a file's type. File type constant for a regular file. */\n        export const S_IFREG: number;\n\n        /** Constant for fs.Stats mode property for determining a file's type. File type constant for a directory. */\n        export const S_IFDIR: number;\n\n        /** Constant for fs.Stats mode property for determining a file's type. File type constant for a character-oriented device file. */\n        export const S_IFCHR: number;\n\n        /** Constant for fs.Stats mode property for determining a file's type. File type constant for a block-oriented device file. */\n        export const S_IFBLK: number;\n\n        /** Constant for fs.Stats mode property for determining a file's type. File type constant for a FIFO/pipe. */\n        export const S_IFIFO: number;\n\n        /** Constant for fs.Stats mode property for determining a file's type. File type constant for a symbolic link. */\n        export const S_IFLNK: number;\n\n        /** Constant for fs.Stats mode property for determining a file's type. File type constant for a socket. */\n        export const S_IFSOCK: number;\n\n        // File Mode Constants\n\n        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by owner. */\n        export const S_IRWXU: number;\n\n        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by owner. */\n        export const S_IRUSR: number;\n\n        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by owner. */\n        export const S_IWUSR: number;\n\n        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by owner. */\n        export const S_IXUSR: number;\n\n        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by group. */\n        export const S_IRWXG: number;\n\n        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by group. */\n        export const S_IRGRP: number;\n\n        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by group. */\n        export const S_IWGRP: number;\n\n        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by group. */\n        export const S_IXGRP: number;\n\n        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable, writable and executable by others. */\n        export const S_IRWXO: number;\n\n        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating readable by others. */\n        export const S_IROTH: number;\n\n        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating writable by others. */\n        export const S_IWOTH: number;\n\n        /** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */\n        export const S_IXOTH: number;\n    }\n\n    /** Tests a user's permissions for the file specified by path. */\n    export function access(path: string | Buffer, callback: (err: NodeJS.ErrnoException) => void): void;\n    export function access(path: string | Buffer, mode: number, callback: (err: NodeJS.ErrnoException) => void): void;\n    /** Synchronous version of fs.access. This throws if any accessibility checks fail, and does nothing otherwise. */\n    export function accessSync(path: string | Buffer, mode?: number): void;\n    export function createReadStream(path: string | Buffer, options?: {\n        flags?: string;\n        encoding?: string;\n        fd?: number;\n        mode?: number;\n        autoClose?: boolean;\n        start?: number;\n        end?: number;\n    }): ReadStream;\n    export function createWriteStream(path: string | Buffer, options?: {\n        flags?: string;\n        encoding?: string;\n        fd?: number;\n        mode?: number;\n        autoClose?: boolean;\n        start?: number;\n    }): WriteStream;\n    export function fdatasync(fd: number, callback: Function): void;\n    export function fdatasyncSync(fd: number): void;\n}\n\ndeclare module \"path\" {\n\n    /**\n     * A parsed path object generated by path.parse() or consumed by path.format().\n     */\n    export interface ParsedPath {\n        /**\n         * The root of the path such as '/' or 'c:\\'\n         */\n        root: string;\n        /**\n         * The full directory path such as '/home/user/dir' or 'c:\\path\\dir'\n         */\n        dir: string;\n        /**\n         * The file name including extension (if any) such as 'index.html'\n         */\n        base: string;\n        /**\n         * The file extension (if any) such as '.html'\n         */\n        ext: string;\n        /**\n         * The file name without extension (if any) such as 'index'\n         */\n        name: string;\n    }\n\n    /**\n     * Normalize a string path, reducing '..' and '.' parts.\n     * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.\n     *\n     * @param p string path to normalize.\n     */\n    export function normalize(p: string): string;\n    /**\n     * Join all arguments together and normalize the resulting path.\n     * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.\n     *\n     * @param paths paths to join.\n     */\n    export function join(...paths: string[]): string;\n    /**\n     * The right-most parameter is considered {to}.  Other parameters are considered an array of {from}.\n     *\n     * Starting from leftmost {from} paramter, resolves {to} to an absolute path.\n     *\n     * If {to} isn't already absolute, {from} arguments are prepended in right to left order, until an absolute path is found. If after using all {from} paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path gets resolved to the root directory.\n     *\n     * @param pathSegments string paths to join.  Non-string arguments are ignored.\n     */\n    export function resolve(...pathSegments: any[]): string;\n    /**\n     * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.\n     *\n     * @param path path to test.\n     */\n    export function isAbsolute(path: string): boolean;\n    /**\n     * Solve the relative path from {from} to {to}.\n     * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.\n     *\n     * @param from\n     * @param to\n     */\n    export function relative(from: string, to: string): string;\n    /**\n     * Return the directory name of a path. Similar to the Unix dirname command.\n     *\n     * @param p the path to evaluate.\n     */\n    export function dirname(p: string): string;\n    /**\n     * Return the last portion of a path. Similar to the Unix basename command.\n     * Often used to extract the file name from a fully qualified path.\n     *\n     * @param p the path to evaluate.\n     * @param ext optionally, an extension to remove from the result.\n     */\n    export function basename(p: string, ext?: string): string;\n    /**\n     * Return the extension of the path, from the last '.' to end of string in the last portion of the path.\n     * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string\n     *\n     * @param p the path to evaluate.\n     */\n    export function extname(p: string): string;\n    /**\n     * The platform-specific file separator. '\\\\' or '/'.\n     */\n    export var sep: string;\n    /**\n     * The platform-specific file delimiter. ';' or ':'.\n     */\n    export var delimiter: string;\n    /**\n     * Returns an object from a path string - the opposite of format().\n     *\n     * @param pathString path to evaluate.\n     */\n    export function parse(pathString: string): ParsedPath;\n    /**\n     * Returns a path string from an object - the opposite of parse().\n     *\n     * @param pathString path to evaluate.\n     */\n    export function format(pathObject: ParsedPath): string;\n\n    export module posix {\n        export function normalize(p: string): string;\n        export function join(...paths: any[]): string;\n        export function resolve(...pathSegments: any[]): string;\n        export function isAbsolute(p: string): boolean;\n        export function relative(from: string, to: string): string;\n        export function dirname(p: string): string;\n        export function basename(p: string, ext?: string): string;\n        export function extname(p: string): string;\n        export var sep: string;\n        export var delimiter: string;\n        export function parse(p: string): ParsedPath;\n        export function format(pP: ParsedPath): string;\n    }\n\n    export module win32 {\n        export function normalize(p: string): string;\n        export function join(...paths: any[]): string;\n        export function resolve(...pathSegments: any[]): string;\n        export function isAbsolute(p: string): boolean;\n        export function relative(from: string, to: string): string;\n        export function dirname(p: string): string;\n        export function basename(p: string, ext?: string): string;\n        export function extname(p: string): string;\n        export var sep: string;\n        export var delimiter: string;\n        export function parse(p: string): ParsedPath;\n        export function format(pP: ParsedPath): string;\n    }\n}\n\ndeclare module \"string_decoder\" {\n    export interface NodeStringDecoder {\n        write(buffer: Buffer): string;\n        end(buffer?: Buffer): string;\n    }\n    export var StringDecoder: {\n        new (encoding?: string): NodeStringDecoder;\n    };\n}\n\ndeclare module \"tls\" {\n    import * as crypto from \"crypto\";\n    import * as net from \"net\";\n    import * as stream from \"stream\";\n\n    var CLIENT_RENEG_LIMIT: number;\n    var CLIENT_RENEG_WINDOW: number;\n\n    export interface Certificate {\n        /**\n         * Country code.\n         */\n        C: string;\n        /**\n         * Street.\n         */\n        ST: string;\n        /**\n         * Locality.\n         */\n        L: string;\n        /**\n         * Organization.\n         */\n        O: string;\n        /**\n         * Organizational unit.\n         */\n        OU: string;\n        /**\n         * Common name.\n         */\n        CN: string;\n    }\n\n    export interface CipherNameAndProtocol {\n        /**\n         * The cipher name.\n         */\n        name: string;\n        /**\n         * SSL/TLS protocol version.\n         */\n        version: string;\n    }\n\n    export class TLSSocket extends net.Socket {\n        /**\n         * Construct a new tls.TLSSocket object from an existing TCP socket.\n         */\n        constructor(socket:net.Socket, options?: {\n          /**\n           * An optional TLS context object from tls.createSecureContext()\n           */\n          secureContext?: SecureContext,\n          /**\n           * If true the TLS socket will be instantiated in server-mode.\n           * Defaults to false.\n           */\n          isServer?: boolean,\n          /**\n           * An optional net.Server instance.\n           */\n          server?: net.Server,\n          /**\n           * If true the server will request a certificate from clients that\n           * connect and attempt to verify that certificate. Defaults to\n           * false.\n           */\n          requestCert?: boolean,\n          /**\n           * If true the server will reject any connection which is not\n           * authorized with the list of supplied CAs. This option only has an\n           * effect if requestCert is true. Defaults to false.\n           */\n          rejectUnauthorized?: boolean,\n          /**\n           * An array of strings or a Buffer naming possible NPN protocols.\n           * (Protocols should be ordered by their priority.)\n           */\n          NPNProtocols?: string[] | Buffer,\n          /**\n           * An array of strings or a Buffer naming possible ALPN protocols.\n           * (Protocols should be ordered by their priority.) When the server\n           * receives both NPN and ALPN extensions from the client, ALPN takes\n           * precedence over NPN and the server does not send an NPN extension\n           * to the client.\n           */\n          ALPNProtocols?: string[] | Buffer,\n          /**\n           * SNICallback(servername, cb) <Function> A function that will be\n           * called if the client supports SNI TLS extension. Two arguments\n           * will be passed when called: servername and cb. SNICallback should\n           * invoke cb(null, ctx), where ctx is a SecureContext instance.\n           * (tls.createSecureContext(...) can be used to get a proper\n           * SecureContext.) If SNICallback wasn't provided the default callback\n           * with high-level API will be used (see below).\n           */\n          SNICallback?: Function,\n          /**\n           * An optional Buffer instance containing a TLS session.\n           */\n          session?: Buffer,\n          /**\n           * If true, specifies that the OCSP status request extension will be\n           * added to the client hello and an 'OCSPResponse' event will be\n           * emitted on the socket before establishing a secure communication\n           */\n          requestOCSP?: boolean\n        });\n        /**\n         * Returns the bound address, the address family name and port of the underlying socket as reported by\n         * the operating system.\n         * @returns {any} - An object with three properties, e.g. { port: 12346, family: 'IPv4', address: '127.0.0.1' }.\n         */\n        address(): { port: number; family: string; address: string };\n        /**\n         * A boolean that is true if the peer certificate was signed by one of the specified CAs, otherwise false.\n         */\n        authorized: boolean;\n        /**\n         * The reason why the peer's certificate has not been verified.\n         * This property becomes available only when tlsSocket.authorized === false.\n         */\n        authorizationError: Error;\n        /**\n         * Static boolean value, always true.\n         * May be used to distinguish TLS sockets from regular ones.\n         */\n        encrypted: boolean;\n        /**\n         * Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection.\n         * @returns {CipherNameAndProtocol} - Returns an object representing the cipher name\n         * and the SSL/TLS protocol version of the current connection.\n         */\n        getCipher(): CipherNameAndProtocol;\n        /**\n         * Returns an object representing the peer's certificate.\n         * The returned object has some properties corresponding to the field of the certificate.\n         * If detailed argument is true the full chain with issuer property will be returned,\n         * if false only the top certificate without issuer property.\n         * If the peer does not provide a certificate, it returns null or an empty object.\n         * @param {boolean} detailed - If true; the full chain with issuer property will be returned.\n         * @returns {any} - An object representing the peer's certificate.\n         */\n        getPeerCertificate(detailed?: boolean): {\n            subject: Certificate;\n            issuerInfo: Certificate;\n            issuer: Certificate;\n            raw: any;\n            valid_from: string;\n            valid_to: string;\n            fingerprint: string;\n            serialNumber: string;\n        };\n        /**\n         * Could be used to speed up handshake establishment when reconnecting to the server.\n         * @returns {any} - ASN.1 encoded TLS session or undefined if none was negotiated.\n         */\n        getSession(): any;\n        /**\n         * NOTE: Works only with client TLS sockets.\n         * Useful only for debugging, for session reuse provide session option to tls.connect().\n         * @returns {any} - TLS session ticket or undefined if none was negotiated.\n         */\n        getTLSTicket(): any;\n        /**\n         * The string representation of the local IP address.\n         */\n        localAddress: string;\n        /**\n         * The numeric representation of the local port.\n         */\n        localPort: number;\n        /**\n         * The string representation of the remote IP address.\n         * For example, '74.125.127.100' or '2001:4860:a005::68'.\n         */\n        remoteAddress: string;\n        /**\n         * The string representation of the remote IP family. 'IPv4' or 'IPv6'.\n         */\n        remoteFamily: string;\n        /**\n         * The numeric representation of the remote port. For example, 443.\n         */\n        remotePort: number;\n        /**\n         * Initiate TLS renegotiation process.\n         *\n         * NOTE: Can be used to request peer's certificate after the secure connection has been established.\n         * ANOTHER NOTE: When running as the server, socket will be destroyed with an error after handshakeTimeout timeout.\n         * @param {TlsOptions} options - The options may contain the following fields: rejectUnauthorized,\n         * requestCert (See tls.createServer() for details).\n         * @param {Function} callback - callback(err) will be executed with null as err, once the renegotiation\n         * is successfully completed.\n         */\n        renegotiate(options: TlsOptions, callback: (err: Error) => any): any;\n        /**\n         * Set maximum TLS fragment size (default and maximum value is: 16384, minimum is: 512).\n         * Smaller fragment size decreases buffering latency on the client: large fragments are buffered by\n         * the TLS layer until the entire fragment is received and its integrity is verified;\n         * large fragments can span multiple roundtrips, and their processing can be delayed due to packet\n         * loss or reordering. However, smaller fragments add extra TLS framing bytes and CPU overhead,\n         * which may decrease overall server throughput.\n         * @param {number} size - TLS fragment size (default and maximum value is: 16384, minimum is: 512).\n         * @returns {boolean} - Returns true on success, false otherwise.\n         */\n        setMaxSendFragment(size: number): boolean;\n\n        /**\n         * events.EventEmitter\n         * 1. OCSPResponse\n         * 2. secureConnect\n         **/\n        addListener(event: string, listener: Function): this;\n        addListener(event: \"OCSPResponse\", listener: (response: Buffer) => void): this;\n        addListener(event: \"secureConnect\", listener: () => void): this;\n\n        emit(event: string, ...args: any[]): boolean;\n        emit(event: \"OCSPResponse\", response: Buffer): boolean;\n        emit(event: \"secureConnect\"): boolean;\n\n        on(event: string, listener: Function): this;\n        on(event: \"OCSPResponse\", listener: (response: Buffer) => void): this;\n        on(event: \"secureConnect\", listener: () => void): this;\n\n        once(event: string, listener: Function): this;\n        once(event: \"OCSPResponse\", listener: (response: Buffer) => void): this;\n        once(event: \"secureConnect\", listener: () => void): this;\n\n        prependListener(event: string, listener: Function): this;\n        prependListener(event: \"OCSPResponse\", listener: (response: Buffer) => void): this;\n        prependListener(event: \"secureConnect\", listener: () => void): this;\n\n        prependOnceListener(event: string, listener: Function): this;\n        prependOnceListener(event: \"OCSPResponse\", listener: (response: Buffer) => void): this;\n        prependOnceListener(event: \"secureConnect\", listener: () => void): this;\n    }\n\n    export interface TlsOptions {\n        host?: string;\n        port?: number;\n        pfx?: string | Buffer[];\n        key?: string | string[] | Buffer | any[];\n        passphrase?: string;\n        cert?: string | string[] | Buffer | Buffer[];\n        ca?: string | string[] | Buffer | Buffer[];\n        crl?: string | string[];\n        ciphers?: string;\n        honorCipherOrder?: boolean;\n        requestCert?: boolean;\n        rejectUnauthorized?: boolean;\n        NPNProtocols?: string[] | Buffer;\n        SNICallback?: (servername: string, cb: (err: Error, ctx: SecureContext) => any) => any;\n        ecdhCurve?: string;\n        dhparam?: string | Buffer;\n        handshakeTimeout?: number;\n        ALPNProtocols?: string[] | Buffer;\n        sessionTimeout?: number;\n        ticketKeys?: any;\n        sessionIdContext?: string;\n        secureProtocol?: string;\n    }\n\n    export interface ConnectionOptions {\n        host?: string;\n        port?: number;\n        socket?: net.Socket;\n        pfx?: string | Buffer\n        key?: string | string[] | Buffer | Buffer[];\n        passphrase?: string;\n        cert?: string | string[] | Buffer | Buffer[];\n        ca?: string | Buffer | (string | Buffer)[];\n        rejectUnauthorized?: boolean;\n        NPNProtocols?: (string | Buffer)[];\n        servername?: string;\n        path?: string;\n        ALPNProtocols?: (string | Buffer)[];\n        checkServerIdentity?: (servername: string, cert: string | Buffer | (string | Buffer)[]) => any;\n        secureProtocol?: string;\n        secureContext?: Object;\n        session?: Buffer;\n        minDHSize?: number;\n    }\n\n    export interface Server extends net.Server {\n        close(callback?: Function): Server;\n        address(): { port: number; family: string; address: string; };\n        addContext(hostName: string, credentials: {\n            key: string;\n            cert: string;\n            ca: string;\n        }): void;\n        maxConnections: number;\n        connections: number;\n\n        /**\n         * events.EventEmitter\n         * 1. tlsClientError\n         * 2. newSession\n         * 3. OCSPRequest\n         * 4. resumeSession\n         * 5. secureConnection\n         **/\n        addListener(event: string, listener: Function): this;\n        addListener(event: \"tlsClientError\", listener: (err: Error, tlsSocket: TLSSocket) => void): this;\n        addListener(event: \"newSession\", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;\n        addListener(event: \"OCSPRequest\", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;\n        addListener(event: \"resumeSession\", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;\n        addListener(event: \"secureConnection\", listener: (tlsSocket: TLSSocket) => void): this;\n\n        emit(event: string, ...args: any[]): boolean;\n        emit(event: \"tlsClientError\", err: Error, tlsSocket: TLSSocket): boolean;\n        emit(event: \"newSession\", sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void): boolean;\n        emit(event: \"OCSPRequest\", certificate: Buffer, issuer: Buffer, callback: Function): boolean;\n        emit(event: \"resumeSession\", sessionId: any, callback: (err: Error, sessionData: any) => void): boolean;\n        emit(event: \"secureConnection\", tlsSocket: TLSSocket): boolean;\n\n        on(event: string, listener: Function): this;\n        on(event: \"tlsClientError\", listener: (err: Error, tlsSocket: TLSSocket) => void): this;\n        on(event: \"newSession\", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;\n        on(event: \"OCSPRequest\", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;\n        on(event: \"resumeSession\", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;\n        on(event: \"secureConnection\", listener: (tlsSocket: TLSSocket) => void): this;\n\n        once(event: string, listener: Function): this;\n        once(event: \"tlsClientError\", listener: (err: Error, tlsSocket: TLSSocket) => void): this;\n        once(event: \"newSession\", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;\n        once(event: \"OCSPRequest\", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;\n        once(event: \"resumeSession\", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;\n        once(event: \"secureConnection\", listener: (tlsSocket: TLSSocket) => void): this;\n\n        prependListener(event: string, listener: Function): this;\n        prependListener(event: \"tlsClientError\", listener: (err: Error, tlsSocket: TLSSocket) => void): this;\n        prependListener(event: \"newSession\", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;\n        prependListener(event: \"OCSPRequest\", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;\n        prependListener(event: \"resumeSession\", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;\n        prependListener(event: \"secureConnection\", listener: (tlsSocket: TLSSocket) => void): this;\n\n        prependOnceListener(event: string, listener: Function): this;\n        prependOnceListener(event: \"tlsClientError\", listener: (err: Error, tlsSocket: TLSSocket) => void): this;\n        prependOnceListener(event: \"newSession\", listener: (sessionId: any, sessionData: any, callback: (err: Error, resp: Buffer) => void) => void): this;\n        prependOnceListener(event: \"OCSPRequest\", listener: (certificate: Buffer, issuer: Buffer, callback: Function) => void): this;\n        prependOnceListener(event: \"resumeSession\", listener: (sessionId: any, callback: (err: Error, sessionData: any) => void) => void): this;\n        prependOnceListener(event: \"secureConnection\", listener: (tlsSocket: TLSSocket) => void): this;\n    }\n\n    export interface ClearTextStream extends stream.Duplex {\n        authorized: boolean;\n        authorizationError: Error;\n        getPeerCertificate(): any;\n        getCipher: {\n            name: string;\n            version: string;\n        };\n        address: {\n            port: number;\n            family: string;\n            address: string;\n        };\n        remoteAddress: string;\n        remotePort: number;\n    }\n\n    export interface SecurePair {\n        encrypted: any;\n        cleartext: any;\n    }\n\n    export interface SecureContextOptions {\n        pfx?: string | Buffer;\n        key?: string | Buffer;\n        passphrase?: string;\n        cert?: string | Buffer;\n        ca?: string | Buffer;\n        crl?: string | string[]\n        ciphers?: string;\n        honorCipherOrder?: boolean;\n    }\n\n    export interface SecureContext {\n        context: any;\n    }\n\n    export function createServer(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void): Server;\n    export function connect(options: ConnectionOptions, secureConnectionListener?: () => void): TLSSocket;\n    export function connect(port: number, host?: string, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;\n    export function connect(port: number, options?: ConnectionOptions, secureConnectListener?: () => void): TLSSocket;\n    export function createSecurePair(credentials?: crypto.Credentials, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;\n    export function createSecureContext(details: SecureContextOptions): SecureContext;\n}\n\ndeclare module \"crypto\" {\n    export interface Certificate {\n        exportChallenge(spkac: string | Buffer): Buffer;\n        exportPublicKey(spkac: string | Buffer): Buffer;\n        verifySpkac(spkac: Buffer): boolean;\n    }\n    export var Certificate: {\n        new (): Certificate;\n        (): Certificate;\n    }\n\n    export var fips: boolean;\n\n    export interface CredentialDetails {\n        pfx: string;\n        key: string;\n        passphrase: string;\n        cert: string;\n        ca: string | string[];\n        crl: string | string[];\n        ciphers: string;\n    }\n    export interface Credentials { context?: any; }\n    export function createCredentials(details: CredentialDetails): Credentials;\n    export function createHash(algorithm: string): Hash;\n    export function createHmac(algorithm: string, key: string | Buffer): Hmac;\n\n    type Utf8AsciiLatin1Encoding = \"utf8\" | \"ascii\" | \"latin1\";\n    type HexBase64Latin1Encoding = \"latin1\" | \"hex\" | \"base64\";\n    type Utf8AsciiBinaryEncoding = \"utf8\" | \"ascii\" | \"binary\";\n    type HexBase64BinaryEncoding = \"binary\" | \"base64\" | \"hex\";\n    type ECDHKeyFormat = \"compressed\" | \"uncompressed\" | \"hybrid\";\n\n    export interface Hash extends NodeJS.ReadWriteStream {\n        update(data: string | Buffer): Hash;\n        update(data: string | Buffer, input_encoding: Utf8AsciiLatin1Encoding): Hash;\n        digest(): Buffer;\n        digest(encoding: HexBase64Latin1Encoding): string;\n    }\n    export interface Hmac extends NodeJS.ReadWriteStream {\n        update(data: string | Buffer): Hmac;\n        update(data: string | Buffer, input_encoding: Utf8AsciiLatin1Encoding): Hmac;\n        digest(): Buffer;\n        digest(encoding: HexBase64Latin1Encoding): string;\n    }\n    export function createCipher(algorithm: string, password: any): Cipher;\n    export function createCipheriv(algorithm: string, key: any, iv: any): Cipher;\n    export interface Cipher extends NodeJS.ReadWriteStream {\n        update(data: Buffer): Buffer;\n        update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;\n        update(data: Buffer, input_encoding: any, output_encoding: HexBase64BinaryEncoding): string;\n        update(data: string, input_encoding: Utf8AsciiBinaryEncoding, output_encoding: HexBase64BinaryEncoding): string;\n        final(): Buffer;\n        final(output_encoding: string): string;\n        setAutoPadding(auto_padding?: boolean): void;\n        getAuthTag(): Buffer;\n        setAAD(buffer: Buffer): void;\n    }\n    export function createDecipher(algorithm: string, password: any): Decipher;\n    export function createDecipheriv(algorithm: string, key: any, iv: any): Decipher;\n    export interface Decipher extends NodeJS.ReadWriteStream {\n        update(data: Buffer): Buffer;\n        update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;\n        update(data: Buffer, input_encoding: any, output_encoding: Utf8AsciiBinaryEncoding): string;\n        update(data: string, input_encoding: HexBase64BinaryEncoding, output_encoding: Utf8AsciiBinaryEncoding): string;\n        final(): Buffer;\n        final(output_encoding: string): string;\n        setAutoPadding(auto_padding?: boolean): void;\n        setAuthTag(tag: Buffer): void;\n        setAAD(buffer: Buffer): void;\n    }\n    export function createSign(algorithm: string): Signer;\n    export interface Signer extends NodeJS.WritableStream {\n        update(data: string | Buffer): Signer;\n        update(data: string | Buffer, input_encoding: Utf8AsciiLatin1Encoding): Signer;\n        sign(private_key: string | { key: string; passphrase: string }): Buffer;\n        sign(private_key: string | { key: string; passphrase: string }, output_format: HexBase64Latin1Encoding): string;\n    }\n    export function createVerify(algorith: string): Verify;\n    export interface Verify extends NodeJS.WritableStream {\n        update(data: string | Buffer): Verify;\n        update(data: string | Buffer, input_encoding: Utf8AsciiLatin1Encoding): Verify;\n        verify(object: string, signature: Buffer): boolean;\n        verify(object: string, signature: string, signature_format: HexBase64Latin1Encoding): boolean;\n    }\n    export function createDiffieHellman(prime_length: number, generator?: number): DiffieHellman;\n    export function createDiffieHellman(prime: Buffer): DiffieHellman;\n    export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman;\n    export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | Buffer): DiffieHellman;\n    export function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman;\n    export interface DiffieHellman {\n        generateKeys(): Buffer;\n        generateKeys(encoding: HexBase64Latin1Encoding): string;\n        computeSecret(other_public_key: Buffer): Buffer;\n        computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;\n        computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;\n        getPrime(): Buffer;\n        getPrime(encoding: HexBase64Latin1Encoding): string;\n        getGenerator(): Buffer;\n        getGenerator(encoding: HexBase64Latin1Encoding): string;\n        getPublicKey(): Buffer;\n        getPublicKey(encoding: HexBase64Latin1Encoding): string;\n        getPrivateKey(): Buffer;\n        getPrivateKey(encoding: HexBase64Latin1Encoding): string;\n        setPublicKey(public_key: Buffer): void;\n        setPublicKey(public_key: string, encoding: string): void;\n        setPrivateKey(private_key: Buffer): void;\n        setPrivateKey(private_key: string, encoding: string): void;\n        verifyError: number;\n    }\n    export function getDiffieHellman(group_name: string): DiffieHellman;\n    export function pbkdf2(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string, callback: (err: Error, derivedKey: Buffer) => any): void;\n    export function pbkdf2Sync(password: string | Buffer, salt: string | Buffer, iterations: number, keylen: number, digest: string): Buffer;\n    export function randomBytes(size: number): Buffer;\n    export function randomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void;\n    export function pseudoRandomBytes(size: number): Buffer;\n    export function pseudoRandomBytes(size: number, callback: (err: Error, buf: Buffer) => void): void;\n    export interface RsaPublicKey {\n        key: string;\n        padding?: number;\n    }\n    export interface RsaPrivateKey {\n        key: string;\n        passphrase?: string,\n        padding?: number;\n    }\n    export function publicEncrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer\n    export function privateDecrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer\n    export function privateEncrypt(private_key: string | RsaPrivateKey, buffer: Buffer): Buffer\n    export function publicDecrypt(public_key: string | RsaPublicKey, buffer: Buffer): Buffer\n    export function getCiphers(): string[];\n    export function getCurves(): string[];\n    export function getHashes(): string[];\n    export interface ECDH {\n        generateKeys(): Buffer;\n        generateKeys(encoding: HexBase64Latin1Encoding): string;\n        generateKeys(encoding: HexBase64Latin1Encoding, format: ECDHKeyFormat): string;\n        computeSecret(other_public_key: Buffer): Buffer;\n        computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;\n        computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;\n        getPrivateKey(): Buffer;\n        getPrivateKey(encoding: HexBase64Latin1Encoding): string;\n        getPublicKey(): Buffer;\n        getPublicKey(encoding: HexBase64Latin1Encoding): string;\n        getPublicKey(encoding: HexBase64Latin1Encoding, format: ECDHKeyFormat): string;\n        setPrivateKey(private_key: Buffer): void;\n        setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void;\n    }\n    export function createECDH(curve_name: string): ECDH;\n    export function timingSafeEqual(a: Buffer, b: Buffer): boolean;\n    export var DEFAULT_ENCODING: string;\n}\n\ndeclare module \"stream\" {\n    import * as events from \"events\";\n\n    class internal extends events.EventEmitter {\n        pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;\n    }\n    namespace internal {\n\n        export class Stream extends internal { }\n\n        export interface ReadableOptions {\n            highWaterMark?: number;\n            encoding?: string;\n            objectMode?: boolean;\n            read?: (size?: number) => any;\n        }\n\n        export class Readable extends events.EventEmitter implements NodeJS.ReadableStream {\n            readable: boolean;\n            constructor(opts?: ReadableOptions);\n            protected _read(size: number): void;\n            read(size?: number): any;\n            setEncoding(encoding: string): this;\n            pause(): this;\n            resume(): this;\n            isPaused(): boolean;\n            pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;\n            unpipe<T extends NodeJS.WritableStream>(destination?: T): this;\n            unshift(chunk: any): void;\n            wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream;\n            push(chunk: any, encoding?: string): boolean;\n\n            /**\n             * Event emitter\n             * The defined events on documents including:\n             *   1. close\n             *   2. data\n             *   3. end\n             *   4. readable\n             *   5. error\n             **/\n            addListener(event: string, listener: Function): this;\n            addListener(event: string, listener: Function): this;\n            addListener(event: \"close\", listener: () => void): this;\n            addListener(event: \"data\", listener: (chunk: Buffer | string) => void): this;\n            addListener(event: \"end\", listener: () => void): this;\n            addListener(event: \"readable\", listener: () => void): this;\n            addListener(event: \"error\", listener: (err: Error) => void): this;\n\n            emit(event: string, ...args: any[]): boolean;\n            emit(event: \"close\"): boolean;\n            emit(event: \"data\", chunk: Buffer | string): boolean;\n            emit(event: \"end\"): boolean;\n            emit(event: \"readable\"): boolean;\n            emit(event: \"error\", err: Error): boolean;\n\n            on(event: string, listener: Function): this;\n            on(event: \"close\", listener: () => void): this;\n            on(event: \"data\", listener: (chunk: Buffer | string) => void): this;\n            on(event: \"end\", listener: () => void): this;\n            on(event: \"readable\", listener: () => void): this;\n            on(event: \"error\", listener: (err: Error) => void): this;\n\n            once(event: string, listener: Function): this;\n            once(event: \"close\", listener: () => void): this;\n            once(event: \"data\", listener: (chunk: Buffer | string) => void): this;\n            once(event: \"end\", listener: () => void): this;\n            once(event: \"readable\", listener: () => void): this;\n            once(event: \"error\", listener: (err: Error) => void): this;\n\n            prependListener(event: string, listener: Function): this;\n            prependListener(event: \"close\", listener: () => void): this;\n            prependListener(event: \"data\", listener: (chunk: Buffer | string) => void): this;\n            prependListener(event: \"end\", listener: () => void): this;\n            prependListener(event: \"readable\", listener: () => void): this;\n            prependListener(event: \"error\", listener: (err: Error) => void): this;\n\n            prependOnceListener(event: string, listener: Function): this;\n            prependOnceListener(event: \"close\", listener: () => void): this;\n            prependOnceListener(event: \"data\", listener: (chunk: Buffer | string) => void): this;\n            prependOnceListener(event: \"end\", listener: () => void): this;\n            prependOnceListener(event: \"readable\", listener: () => void): this;\n            prependOnceListener(event: \"error\", listener: (err: Error) => void): this;\n\n            removeListener(event: string, listener: Function): this;\n            removeListener(event: \"close\", listener: () => void): this;\n            removeListener(event: \"data\", listener: (chunk: Buffer | string) => void): this;\n            removeListener(event: \"end\", listener: () => void): this;\n            removeListener(event: \"readable\", listener: () => void): this;\n            removeListener(event: \"error\", listener: (err: Error) => void): this;\n        }\n\n        export interface WritableOptions {\n            highWaterMark?: number;\n            decodeStrings?: boolean;\n            objectMode?: boolean;\n            write?: (chunk: string | Buffer, encoding: string, callback: Function) => any;\n            writev?: (chunks: { chunk: string | Buffer, encoding: string }[], callback: Function) => any;\n        }\n\n        export class Writable extends events.EventEmitter implements NodeJS.WritableStream {\n            writable: boolean;\n            constructor(opts?: WritableOptions);\n            protected _write(chunk: any, encoding: string, callback: Function): void;\n            write(chunk: any, cb?: Function): boolean;\n            write(chunk: any, encoding?: string, cb?: Function): boolean;\n            end(): void;\n            end(chunk: any, cb?: Function): void;\n            end(chunk: any, encoding?: string, cb?: Function): void;\n\n            /**\n             * Event emitter\n             * The defined events on documents including:\n             *   1. close\n             *   2. drain\n             *   3. error\n             *   4. finish\n             *   5. pipe\n             *   6. unpipe\n             **/\n            addListener(event: string, listener: Function): this;\n            addListener(event: \"close\", listener: () => void): this;\n            addListener(event: \"drain\", listener: () => void): this;\n            addListener(event: \"error\", listener: (err: Error) => void): this;\n            addListener(event: \"finish\", listener: () => void): this;\n            addListener(event: \"pipe\", listener: (src: Readable) => void): this;\n            addListener(event: \"unpipe\", listener: (src: Readable) => void): this;\n\n            emit(event: string, ...args: any[]): boolean;\n            emit(event: \"close\"): boolean;\n            emit(event: \"drain\", chunk: Buffer | string): boolean;\n            emit(event: \"error\", err: Error): boolean;\n            emit(event: \"finish\"): boolean;\n            emit(event: \"pipe\", src: Readable): boolean;\n            emit(event: \"unpipe\", src: Readable): boolean;\n\n            on(event: string, listener: Function): this;\n            on(event: \"close\", listener: () => void): this;\n            on(event: \"drain\", listener: () => void): this;\n            on(event: \"error\", listener: (err: Error) => void): this;\n            on(event: \"finish\", listener: () => void): this;\n            on(event: \"pipe\", listener: (src: Readable) => void): this;\n            on(event: \"unpipe\", listener: (src: Readable) => void): this;\n\n            once(event: string, listener: Function): this;\n            once(event: \"close\", listener: () => void): this;\n            once(event: \"drain\", listener: () => void): this;\n            once(event: \"error\", listener: (err: Error) => void): this;\n            once(event: \"finish\", listener: () => void): this;\n            once(event: \"pipe\", listener: (src: Readable) => void): this;\n            once(event: \"unpipe\", listener: (src: Readable) => void): this;\n\n            prependListener(event: string, listener: Function): this;\n            prependListener(event: \"close\", listener: () => void): this;\n            prependListener(event: \"drain\", listener: () => void): this;\n            prependListener(event: \"error\", listener: (err: Error) => void): this;\n            prependListener(event: \"finish\", listener: () => void): this;\n            prependListener(event: \"pipe\", listener: (src: Readable) => void): this;\n            prependListener(event: \"unpipe\", listener: (src: Readable) => void): this;\n\n            prependOnceListener(event: string, listener: Function): this;\n            prependOnceListener(event: \"close\", listener: () => void): this;\n            prependOnceListener(event: \"drain\", listener: () => void): this;\n            prependOnceListener(event: \"error\", listener: (err: Error) => void): this;\n            prependOnceListener(event: \"finish\", listener: () => void): this;\n            prependOnceListener(event: \"pipe\", listener: (src: Readable) => void): this;\n            prependOnceListener(event: \"unpipe\", listener: (src: Readable) => void): this;\n\n            removeListener(event: string, listener: Function): this;\n            removeListener(event: \"close\", listener: () => void): this;\n            removeListener(event: \"drain\", listener: () => void): this;\n            removeListener(event: \"error\", listener: (err: Error) => void): this;\n            removeListener(event: \"finish\", listener: () => void): this;\n            removeListener(event: \"pipe\", listener: (src: Readable) => void): this;\n            removeListener(event: \"unpipe\", listener: (src: Readable) => void): this;\n        }\n\n        export interface DuplexOptions extends ReadableOptions, WritableOptions {\n            allowHalfOpen?: boolean;\n            readableObjectMode?: boolean;\n            writableObjectMode?: boolean;\n        }\n\n        // Note: Duplex extends both Readable and Writable.\n        export class Duplex extends Readable implements NodeJS.ReadWriteStream {\n            // Readable\n            pause(): this;\n            resume(): this;\n            // Writeable\n            writable: boolean;\n            constructor(opts?: DuplexOptions);\n            protected _write(chunk: any, encoding: string, callback: Function): void;\n            write(chunk: any, cb?: Function): boolean;\n            write(chunk: any, encoding?: string, cb?: Function): boolean;\n            end(): void;\n            end(chunk: any, cb?: Function): void;\n            end(chunk: any, encoding?: string, cb?: Function): void;\n        }\n\n        export interface TransformOptions extends DuplexOptions {\n            transform?: (chunk: string | Buffer, encoding: string, callback: Function) => any;\n            flush?: (callback: Function) => any;\n        }\n\n        // Note: Transform lacks the _read and _write methods of Readable/Writable.\n        export class Transform extends events.EventEmitter implements NodeJS.ReadWriteStream {\n            readable: boolean;\n            writable: boolean;\n            constructor(opts?: TransformOptions);\n            protected _transform(chunk: any, encoding: string, callback: Function): void;\n            protected _flush(callback: Function): void;\n            read(size?: number): any;\n            setEncoding(encoding: string): this;\n            pause(): this;\n            resume(): this;\n            isPaused(): boolean;\n            pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;\n            unpipe<T extends NodeJS.WritableStream>(destination?: T): this;\n            unshift(chunk: any): void;\n            wrap(oldStream: NodeJS.ReadableStream): NodeJS.ReadableStream;\n            push(chunk: any, encoding?: string): boolean;\n            write(chunk: any, cb?: Function): boolean;\n            write(chunk: any, encoding?: string, cb?: Function): boolean;\n            end(): void;\n            end(chunk: any, cb?: Function): void;\n            end(chunk: any, encoding?: string, cb?: Function): void;\n        }\n\n        export class PassThrough extends Transform { }\n    }\n\n    export = internal;\n}\n\ndeclare module \"util\" {\n    export interface InspectOptions {\n        showHidden?: boolean;\n        depth?: number;\n        colors?: boolean;\n        customInspect?: boolean;\n    }\n\n    export function format(format: any, ...param: any[]): string;\n    export function debug(string: string): void;\n    export function error(...param: any[]): void;\n    export function puts(...param: any[]): void;\n    export function print(...param: any[]): void;\n    export function log(string: string): void;\n    export function inspect(object: any, showHidden?: boolean, depth?: number, color?: boolean): string;\n    export function inspect(object: any, options: InspectOptions): string;\n    export function isArray(object: any): boolean;\n    export function isRegExp(object: any): boolean;\n    export function isDate(object: any): boolean;\n    export function isError(object: any): boolean;\n    export function inherits(constructor: any, superConstructor: any): void;\n    export function debuglog(key: string): (msg: string, ...param: any[]) => void;\n    export function isBoolean(object: any): boolean;\n    export function isBuffer(object: any): boolean;\n    export function isFunction(object: any): boolean;\n    export function isNull(object: any): boolean;\n    export function isNullOrUndefined(object: any): boolean;\n    export function isNumber(object: any): boolean;\n    export function isObject(object: any): boolean;\n    export function isPrimitive(object: any): boolean;\n    export function isString(object: any): boolean;\n    export function isSymbol(object: any): boolean;\n    export function isUndefined(object: any): boolean;\n    export function deprecate(fn: Function, message: string): Function;\n}\n\ndeclare module \"assert\" {\n    function internal(value: any, message?: string): void;\n    namespace internal {\n        export class AssertionError implements Error {\n            name: string;\n            message: string;\n            actual: any;\n            expected: any;\n            operator: string;\n            generatedMessage: boolean;\n\n            constructor(options?: {\n                message?: string; actual?: any; expected?: any;\n                operator?: string; stackStartFunction?: Function\n            });\n        }\n\n        export function fail(actual: any, expected: any, message: string, operator: string): void;\n        export function ok(value: any, message?: string): void;\n        export function equal(actual: any, expected: any, message?: string): void;\n        export function notEqual(actual: any, expected: any, message?: string): void;\n        export function deepEqual(actual: any, expected: any, message?: string): void;\n        export function notDeepEqual(acutal: any, expected: any, message?: string): void;\n        export function strictEqual(actual: any, expected: any, message?: string): void;\n        export function notStrictEqual(actual: any, expected: any, message?: string): void;\n        export function deepStrictEqual(actual: any, expected: any, message?: string): void;\n        export function notDeepStrictEqual(actual: any, expected: any, message?: string): void;\n        export var throws: {\n            (block: Function, message?: string): void;\n            (block: Function, error: Function, message?: string): void;\n            (block: Function, error: RegExp, message?: string): void;\n            (block: Function, error: (err: any) => boolean, message?: string): void;\n        };\n\n        export var doesNotThrow: {\n            (block: Function, message?: string): void;\n            (block: Function, error: Function, message?: string): void;\n            (block: Function, error: RegExp, message?: string): void;\n            (block: Function, error: (err: any) => boolean, message?: string): void;\n        };\n\n        export function ifError(value: any): void;\n    }\n\n    export = internal;\n}\n\ndeclare module \"tty\" {\n    import * as net from \"net\";\n\n    export function isatty(fd: number): boolean;\n    export interface ReadStream extends net.Socket {\n        isRaw: boolean;\n        setRawMode(mode: boolean): void;\n        isTTY: boolean;\n    }\n    export interface WriteStream extends net.Socket {\n        columns: number;\n        rows: number;\n        isTTY: boolean;\n    }\n}\n\ndeclare module \"domain\" {\n    import * as events from \"events\";\n\n    export class Domain extends events.EventEmitter implements NodeJS.Domain {\n        run(fn: Function): void;\n        add(emitter: events.EventEmitter): void;\n        remove(emitter: events.EventEmitter): void;\n        bind(cb: (err: Error, data: any) => any): any;\n        intercept(cb: (data: any) => any): any;\n        dispose(): void;\n        members: any[];\n        enter(): void;\n        exit(): void;\n    }\n\n    export function create(): Domain;\n}\n\ndeclare module \"constants\" {\n    export var E2BIG: number;\n    export var EACCES: number;\n    export var EADDRINUSE: number;\n    export var EADDRNOTAVAIL: number;\n    export var EAFNOSUPPORT: number;\n    export var EAGAIN: number;\n    export var EALREADY: number;\n    export var EBADF: number;\n    export var EBADMSG: number;\n    export var EBUSY: number;\n    export var ECANCELED: number;\n    export var ECHILD: number;\n    export var ECONNABORTED: number;\n    export var ECONNREFUSED: number;\n    export var ECONNRESET: number;\n    export var EDEADLK: number;\n    export var EDESTADDRREQ: number;\n    export var EDOM: number;\n    export var EEXIST: number;\n    export var EFAULT: number;\n    export var EFBIG: number;\n    export var EHOSTUNREACH: number;\n    export var EIDRM: number;\n    export var EILSEQ: number;\n    export var EINPROGRESS: number;\n    export var EINTR: number;\n    export var EINVAL: number;\n    export var EIO: number;\n    export var EISCONN: number;\n    export var EISDIR: number;\n    export var ELOOP: number;\n    export var EMFILE: number;\n    export var EMLINK: number;\n    export var EMSGSIZE: number;\n    export var ENAMETOOLONG: number;\n    export var ENETDOWN: number;\n    export var ENETRESET: number;\n    export var ENETUNREACH: number;\n    export var ENFILE: number;\n    export var ENOBUFS: number;\n    export var ENODATA: number;\n    export var ENODEV: number;\n    export var ENOENT: number;\n    export var ENOEXEC: number;\n    export var ENOLCK: number;\n    export var ENOLINK: number;\n    export var ENOMEM: number;\n    export var ENOMSG: number;\n    export var ENOPROTOOPT: number;\n    export var ENOSPC: number;\n    export var ENOSR: number;\n    export var ENOSTR: number;\n    export var ENOSYS: number;\n    export var ENOTCONN: number;\n    export var ENOTDIR: number;\n    export var ENOTEMPTY: number;\n    export var ENOTSOCK: number;\n    export var ENOTSUP: number;\n    export var ENOTTY: number;\n    export var ENXIO: number;\n    export var EOPNOTSUPP: number;\n    export var EOVERFLOW: number;\n    export var EPERM: number;\n    export var EPIPE: number;\n    export var EPROTO: number;\n    export var EPROTONOSUPPORT: number;\n    export var EPROTOTYPE: number;\n    export var ERANGE: number;\n    export var EROFS: number;\n    export var ESPIPE: number;\n    export var ESRCH: number;\n    export var ETIME: number;\n    export var ETIMEDOUT: number;\n    export var ETXTBSY: number;\n    export var EWOULDBLOCK: number;\n    export var EXDEV: number;\n    export var WSAEINTR: number;\n    export var WSAEBADF: number;\n    export var WSAEACCES: number;\n    export var WSAEFAULT: number;\n    export var WSAEINVAL: number;\n    export var WSAEMFILE: number;\n    export var WSAEWOULDBLOCK: number;\n    export var WSAEINPROGRESS: number;\n    export var WSAEALREADY: number;\n    export var WSAENOTSOCK: number;\n    export var WSAEDESTADDRREQ: number;\n    export var WSAEMSGSIZE: number;\n    export var WSAEPROTOTYPE: number;\n    export var WSAENOPROTOOPT: number;\n    export var WSAEPROTONOSUPPORT: number;\n    export var WSAESOCKTNOSUPPORT: number;\n    export var WSAEOPNOTSUPP: number;\n    export var WSAEPFNOSUPPORT: number;\n    export var WSAEAFNOSUPPORT: number;\n    export var WSAEADDRINUSE: number;\n    export var WSAEADDRNOTAVAIL: number;\n    export var WSAENETDOWN: number;\n    export var WSAENETUNREACH: number;\n    export var WSAENETRESET: number;\n    export var WSAECONNABORTED: number;\n    export var WSAECONNRESET: number;\n    export var WSAENOBUFS: number;\n    export var WSAEISCONN: number;\n    export var WSAENOTCONN: number;\n    export var WSAESHUTDOWN: number;\n    export var WSAETOOMANYREFS: number;\n    export var WSAETIMEDOUT: number;\n    export var WSAECONNREFUSED: number;\n    export var WSAELOOP: number;\n    export var WSAENAMETOOLONG: number;\n    export var WSAEHOSTDOWN: number;\n    export var WSAEHOSTUNREACH: number;\n    export var WSAENOTEMPTY: number;\n    export var WSAEPROCLIM: number;\n    export var WSAEUSERS: number;\n    export var WSAEDQUOT: number;\n    export var WSAESTALE: number;\n    export var WSAEREMOTE: number;\n    export var WSASYSNOTREADY: number;\n    export var WSAVERNOTSUPPORTED: number;\n    export var WSANOTINITIALISED: number;\n    export var WSAEDISCON: number;\n    export var WSAENOMORE: number;\n    export var WSAECANCELLED: number;\n    export var WSAEINVALIDPROCTABLE: number;\n    export var WSAEINVALIDPROVIDER: number;\n    export var WSAEPROVIDERFAILEDINIT: number;\n    export var WSASYSCALLFAILURE: number;\n    export var WSASERVICE_NOT_FOUND: number;\n    export var WSATYPE_NOT_FOUND: number;\n    export var WSA_E_NO_MORE: number;\n    export var WSA_E_CANCELLED: number;\n    export var WSAEREFUSED: number;\n    export var SIGHUP: number;\n    export var SIGINT: number;\n    export var SIGILL: number;\n    export var SIGABRT: number;\n    export var SIGFPE: number;\n    export var SIGKILL: number;\n    export var SIGSEGV: number;\n    export var SIGTERM: number;\n    export var SIGBREAK: number;\n    export var SIGWINCH: number;\n    export var SSL_OP_ALL: number;\n    export var SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;\n    export var SSL_OP_CIPHER_SERVER_PREFERENCE: number;\n    export var SSL_OP_CISCO_ANYCONNECT: number;\n    export var SSL_OP_COOKIE_EXCHANGE: number;\n    export var SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;\n    export var SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;\n    export var SSL_OP_EPHEMERAL_RSA: number;\n    export var SSL_OP_LEGACY_SERVER_CONNECT: number;\n    export var SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number;\n    export var SSL_OP_MICROSOFT_SESS_ID_BUG: number;\n    export var SSL_OP_MSIE_SSLV2_RSA_PADDING: number;\n    export var SSL_OP_NETSCAPE_CA_DN_BUG: number;\n    export var SSL_OP_NETSCAPE_CHALLENGE_BUG: number;\n    export var SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number;\n    export var SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number;\n    export var SSL_OP_NO_COMPRESSION: number;\n    export var SSL_OP_NO_QUERY_MTU: number;\n    export var SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;\n    export var SSL_OP_NO_SSLv2: number;\n    export var SSL_OP_NO_SSLv3: number;\n    export var SSL_OP_NO_TICKET: number;\n    export var SSL_OP_NO_TLSv1: number;\n    export var SSL_OP_NO_TLSv1_1: number;\n    export var SSL_OP_NO_TLSv1_2: number;\n    export var SSL_OP_PKCS1_CHECK_1: number;\n    export var SSL_OP_PKCS1_CHECK_2: number;\n    export var SSL_OP_SINGLE_DH_USE: number;\n    export var SSL_OP_SINGLE_ECDH_USE: number;\n    export var SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number;\n    export var SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number;\n    export var SSL_OP_TLS_BLOCK_PADDING_BUG: number;\n    export var SSL_OP_TLS_D5_BUG: number;\n    export var SSL_OP_TLS_ROLLBACK_BUG: number;\n    export var ENGINE_METHOD_DSA: number;\n    export var ENGINE_METHOD_DH: number;\n    export var ENGINE_METHOD_RAND: number;\n    export var ENGINE_METHOD_ECDH: number;\n    export var ENGINE_METHOD_ECDSA: number;\n    export var ENGINE_METHOD_CIPHERS: number;\n    export var ENGINE_METHOD_DIGESTS: number;\n    export var ENGINE_METHOD_STORE: number;\n    export var ENGINE_METHOD_PKEY_METHS: number;\n    export var ENGINE_METHOD_PKEY_ASN1_METHS: number;\n    export var ENGINE_METHOD_ALL: number;\n    export var ENGINE_METHOD_NONE: number;\n    export var DH_CHECK_P_NOT_SAFE_PRIME: number;\n    export var DH_CHECK_P_NOT_PRIME: number;\n    export var DH_UNABLE_TO_CHECK_GENERATOR: number;\n    export var DH_NOT_SUITABLE_GENERATOR: number;\n    export var NPN_ENABLED: number;\n    export var RSA_PKCS1_PADDING: number;\n    export var RSA_SSLV23_PADDING: number;\n    export var RSA_NO_PADDING: number;\n    export var RSA_PKCS1_OAEP_PADDING: number;\n    export var RSA_X931_PADDING: number;\n    export var RSA_PKCS1_PSS_PADDING: number;\n    export var POINT_CONVERSION_COMPRESSED: number;\n    export var POINT_CONVERSION_UNCOMPRESSED: number;\n    export var POINT_CONVERSION_HYBRID: number;\n    export var O_RDONLY: number;\n    export var O_WRONLY: number;\n    export var O_RDWR: number;\n    export var S_IFMT: number;\n    export var S_IFREG: number;\n    export var S_IFDIR: number;\n    export var S_IFCHR: number;\n    export var S_IFBLK: number;\n    export var S_IFIFO: number;\n    export var S_IFSOCK: number;\n    export var S_IRWXU: number;\n    export var S_IRUSR: number;\n    export var S_IWUSR: number;\n    export var S_IXUSR: number;\n    export var S_IRWXG: number;\n    export var S_IRGRP: number;\n    export var S_IWGRP: number;\n    export var S_IXGRP: number;\n    export var S_IRWXO: number;\n    export var S_IROTH: number;\n    export var S_IWOTH: number;\n    export var S_IXOTH: number;\n    export var S_IFLNK: number;\n    export var O_CREAT: number;\n    export var O_EXCL: number;\n    export var O_NOCTTY: number;\n    export var O_DIRECTORY: number;\n    export var O_NOATIME: number;\n    export var O_NOFOLLOW: number;\n    export var O_SYNC: number;\n    export var O_SYMLINK: number;\n    export var O_DIRECT: number;\n    export var O_NONBLOCK: number;\n    export var O_TRUNC: number;\n    export var O_APPEND: number;\n    export var F_OK: number;\n    export var R_OK: number;\n    export var W_OK: number;\n    export var X_OK: number;\n    export var UV_UDP_REUSEADDR: number;\n    export var SIGQUIT: number;\n    export var SIGTRAP: number;\n    export var SIGIOT: number;\n    export var SIGBUS: number;\n    export var SIGUSR1: number;\n    export var SIGUSR2: number;\n    export var SIGPIPE: number;\n    export var SIGALRM: number;\n    export var SIGCHLD: number;\n    export var SIGSTKFLT: number;\n    export var SIGCONT: number;\n    export var SIGSTOP: number;\n    export var SIGTSTP: number;\n    export var SIGTTIN: number;\n    export var SIGTTOU: number;\n    export var SIGURG: number;\n    export var SIGXCPU: number;\n    export var SIGXFSZ: number;\n    export var SIGVTALRM: number;\n    export var SIGPROF: number;\n    export var SIGIO: number;\n    export var SIGPOLL: number;\n    export var SIGPWR: number;\n    export var SIGSYS: number;\n    export var SIGUNUSED: number;\n    export var defaultCoreCipherList: string;\n    export var defaultCipherList: string;\n    export var ENGINE_METHOD_RSA: number;\n    export var ALPN_ENABLED: number;\n}\n\ndeclare module \"process\" {\n    export = process;\n}\n\ndeclare module \"v8\" {\n    interface HeapSpaceInfo {\n        space_name: string;\n        space_size: number;\n        space_used_size: number;\n        space_available_size: number;\n        physical_space_size: number;\n    }\n\n    //** Signifies if the --zap_code_space option is enabled or not.  1 == enabled, 0 == disabled. */\n    type DoesZapCodeSpaceFlag = 0 | 1;\n\n    interface HeapInfo {\n        total_heap_size: number;\n        total_heap_size_executable: number;\n        total_physical_size: number;\n        total_available_size: number;\n        used_heap_size: number;\n        heap_size_limit: number;\n        malloced_memory: number;\n        peak_malloced_memory: number;\n        does_zap_garbage: DoesZapCodeSpaceFlag;\n    }\n\n    export function getHeapStatistics(): HeapInfo;\n    export function getHeapSpaceStatistics(): HeapSpaceInfo[];\n    export function setFlagsFromString(flags: string): void;\n}\n\ndeclare module \"timers\" {\n    export function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;\n    export function clearTimeout(timeoutId: NodeJS.Timer): void;\n    export function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timer;\n    export function clearInterval(intervalId: NodeJS.Timer): void;\n    export function setImmediate(callback: (...args: any[]) => void, ...args: any[]): any;\n    export function clearImmediate(immediateId: any): void;\n}\n\ndeclare module \"console\" {\n    export = console;\n}\n\n/**\n * _debugger module is not documented.\n * Source code is at https://github.com/nodejs/node/blob/master/lib/_debugger.js\n */\ndeclare module \"_debugger\" {\n    export interface Packet {\n        raw: string;\n        headers: string[];\n        body: Message;\n    }\n\n    export interface Message {\n        seq: number;\n        type: string;\n    }\n\n    export interface RequestInfo {\n        command: string;\n        arguments: any;\n    }\n\n    export interface Request extends Message, RequestInfo {\n    }\n\n    export interface Event extends Message {\n        event: string;\n        body?: any;\n    }\n\n    export interface Response extends Message {\n        request_seq: number;\n        success: boolean;\n        /** Contains error message if success === false. */\n        message?: string;\n        /** Contains message body if success === true. */\n        body?: any;\n    }\n\n    export interface BreakpointMessageBody {\n        type: string;\n        target: number;\n        line: number;\n    }\n\n    export class Protocol {\n        res: Packet;\n        state: string;\n        execute(data: string): void;\n        serialize(rq: Request): string;\n        onResponse: (pkt: Packet) => void;\n    }\n\n    export var NO_FRAME: number;\n    export var port: number;\n\n    export interface ScriptDesc {\n        name: string;\n        id: number;\n        isNative?: boolean;\n        handle?: number;\n        type: string;\n        lineOffset?: number;\n        columnOffset?: number;\n        lineCount?: number;\n    }\n\n    export interface Breakpoint {\n        id: number;\n        scriptId: number;\n        script: ScriptDesc;\n        line: number;\n        condition?: string;\n        scriptReq?: string;\n    }\n\n    export interface RequestHandler {\n        (err: boolean, body: Message, res: Packet): void;\n        request_seq?: number;\n    }\n\n    export interface ResponseBodyHandler {\n        (err: boolean, body?: any): void;\n        request_seq?: number;\n    }\n\n    export interface ExceptionInfo {\n        text: string;\n    }\n\n    export interface BreakResponse {\n        script?: ScriptDesc;\n        exception?: ExceptionInfo;\n        sourceLine: number;\n        sourceLineText: string;\n        sourceColumn: number;\n    }\n\n    export function SourceInfo(body: BreakResponse): string;\n\n    export interface ClientInstance extends NodeJS.EventEmitter {\n        protocol: Protocol;\n        scripts: ScriptDesc[];\n        handles: ScriptDesc[];\n        breakpoints: Breakpoint[];\n        currentSourceLine: number;\n        currentSourceColumn: number;\n        currentSourceLineText: string;\n        currentFrame: number;\n        currentScript: string;\n\n        connect(port: number, host: string): void;\n        req(req: any, cb: RequestHandler): void;\n        reqFrameEval(code: string, frame: number, cb: RequestHandler): void;\n        mirrorObject(obj: any, depth: number, cb: ResponseBodyHandler): void;\n        setBreakpoint(rq: BreakpointMessageBody, cb: RequestHandler): void;\n        clearBreakpoint(rq: Request, cb: RequestHandler): void;\n        listbreakpoints(cb: RequestHandler): void;\n        reqSource(from: number, to: number, cb: RequestHandler): void;\n        reqScripts(cb: any): void;\n        reqContinue(cb: RequestHandler): void;\n    }\n\n    export var Client : {\n        new (): ClientInstance\n    }\n}\n"
  },
  {
    "path": "demo/scripts/oppogame/oppogame.ts",
    "content": "import * as fs from 'fs';\nimport * as path from 'path';\nexport class OppogamePlugin implements plugins.Command {\n\n    constructor() {\n    }\n    async onFile(file: plugins.File) {\n        if (file.extname == '.js') {\n            const filename = file.origin;\n            if (filename == \"libs/modules/promise/promise.js\" || filename == 'libs/modules/promise/promise.min.js') {\n                return null;\n            }\n            if (filename == 'libs/modules/egret/egret.js' || filename == 'libs/modules/egret/egret.min.js') {\n                let content = file.contents.toString();\n                content += `;window.egret = egret;`;\n                content = content.replace(/definition = __global/, \"definition = window\");\n                file.contents = new Buffer(content);\n            }\n            else {\n                let content = file.contents.toString();\n                if (\n                    filename == \"libs/modules/res/res.js\" ||\n                    filename == 'libs/modules/res/res.min.js' ||\n                    filename == 'libs/modules/assetsmanager/assetsmanager.min.js' ||\n                    filename == 'libs/modules/assetsmanager/assetsmanager.js'\n                ) {\n                    content += \";window.RES = RES;\"\n                }\n                if (filename == \"libs/modules/eui/eui.js\" || filename == 'libs/modules/eui/eui.min.js') {\n                    content += \";window.eui = eui;\"\n                    if(filename == \"libs/modules/eui/eui.js\"){\n                        content = content.replace(\"function getRepeatedIds\",\"window.getRepeatedIds=function getRepeatedIds\");\n                        content = content.replace(\"function getIds\",\"window.getIds=function getIds\");\n                        content = content.replace(\"function toXMLString\",\"window.toXMLString=function toXMLString\");\n                        content = content.replace(\"function checkDeclarations\",\"window.checkDeclarations=function checkDeclarations\");\n                        content = content.replace(\"function getPropertyStr\",\"window.getPropertyStr=function getPropertyStr\");\n                    }\n                }\n                if (filename == 'libs/modules/dragonBones/dragonBones.js' || filename == 'libs/modules/dragonBones/dragonBones.min.js') {\n                    content += ';window.dragonBones = dragonBones';\n                }\n                content = \"var egret = window.egret;\" + content;\n                \n                if (filename == 'main.js') {\n                    content += \"\\n;window.Main = Main;\"\n                }\n                file.contents = new Buffer(content);\n            }\n        }\n        return file;\n    }\n    async onFinish(pluginContext: plugins.CommandContext) {\n        //同步 index.html 配置到 game.js\n        const gameJSPath = path.join(pluginContext.outputDir, \"main.js\");\n        if(!fs.existsSync(gameJSPath)) {\n            console.log(`${gameJSPath}不存在，请先使用 Launcher 发布Oppo快游戏`);\n            return;\n        }\n        let gameJSContent = fs.readFileSync(gameJSPath, { encoding: \"utf8\" });\n        const projectConfig = pluginContext.buildConfig.projectConfig;\n        const optionStr =\n            `entryClassName: ${projectConfig.entryClassName},\\n\\t\\t` +\n            `orientation: ${projectConfig.orientation},\\n\\t\\t` +\n            `frameRate: ${projectConfig.frameRate},\\n\\t\\t` +\n            `scaleMode: ${projectConfig.scaleMode},\\n\\t\\t` +\n            `contentWidth: ${projectConfig.contentWidth},\\n\\t\\t` +\n            `contentHeight: ${projectConfig.contentHeight},\\n\\t\\t` +\n            `showFPS: ${projectConfig.showFPS},\\n\\t\\t` +\n            `fpsStyles: ${projectConfig.fpsStyles},\\n\\t\\t` +\n            `showLog: ${projectConfig.showLog},\\n\\t\\t` +\n            `maxTouches: ${projectConfig.maxTouches},`;\n        const reg = /\\/\\/----auto option start----[\\s\\S]*\\/\\/----auto option end----/;\n        const replaceStr = '\\/\\/----auto option start----\\n\\t\\t' + optionStr + '\\n\\t\\t\\/\\/----auto option end----';\n        gameJSContent = gameJSContent.replace(reg, replaceStr);\n        fs.writeFileSync(gameJSPath, gameJSContent);\n\n        //修改横竖屏\n        let orientation;\n        if (projectConfig.orientation == '\"landscape\"') {\n            orientation = \"landscape\";\n        }\n        else {\n            orientation = \"portrait\";\n        }\n        const gameJSONPath = path.join(pluginContext.outputDir, \"manifest.json\");\n        let gameJSONContent = JSON.parse(fs.readFileSync(gameJSONPath, { encoding: \"utf8\" }));\n        gameJSONContent.orientation = orientation;\n        fs.writeFileSync(gameJSONPath, JSON.stringify(gameJSONContent, null, \"\\t\"));\n    }\n}\n"
  },
  {
    "path": "demo/scripts/qgame/qgame.ts",
    "content": "import * as fs from 'fs';\nimport * as path from 'path';\nexport class MiqgamePlugin implements plugins.Command {\n\n    constructor() {\n    }\n    async onFile(file: plugins.File) {\n        if (file.extname == '.js') {\n            const filename = file.origin;\n            if (filename == \"libs/modules/promise/promise.js\" || filename == 'libs/modules/promise/promise.min.js') {\n                return null;\n            }\n            if (filename == 'libs/modules/egret/egret.js' || filename == 'libs/modules/egret/egret.min.js') {\n                let content = file.contents.toString();\n                content += `;window.egret = egret;`;\n                content = content.replace(/definition = __global/, \"definition = window\");\n                file.contents = new Buffer(content);\n            }\n            else {\n                let content = file.contents.toString();\n                if (\n                    filename == \"libs/modules/res/res.js\" ||\n                    filename == 'libs/modules/res/res.min.js' ||\n                    filename == 'libs/modules/assetsmanager/assetsmanager.min.js' ||\n                    filename == 'libs/modules/assetsmanager/assetsmanager.js'\n                ) {\n                    content += \";window.RES = RES;\"\n                }\n                if (filename == \"libs/modules/eui/eui.js\" || filename == 'libs/modules/eui/eui.min.js') {\n                    content += \";window.eui = eui;\"\n                    if(filename == \"libs/modules/eui/eui.js\"){\n                        content = content.replace(\"function getRepeatedIds\",\"window.getRepeatedIds=function getRepeatedIds\");\n                        content = content.replace(\"function getIds\",\"window.getIds=function getIds\");\n                        content = content.replace(\"function toXMLString\",\"window.toXMLString=function toXMLString\");\n                        content = content.replace(\"function checkDeclarations\",\"window.checkDeclarations=function checkDeclarations\");\n                        content = content.replace(\"function getPropertyStr\",\"window.getPropertyStr=function getPropertyStr\");\n                    }\n                }\n                if (filename == 'libs/modules/dragonBones/dragonBones.js' || filename == 'libs/modules/dragonBones/dragonBones.min.js') {\n                    content += ';window.dragonBones = dragonBones';\n                }\n                content = \"var egret = window.egret;\" + content;\n                \n                if (filename == 'main.js') {\n                    content += \"\\n;window.Main = Main;\"\n                }\n                file.contents = new Buffer(content);\n            }\n        }\n        return file;\n    }\n    async onFinish(pluginContext: plugins.CommandContext) {\n        //同步 index.html 配置到 game.js\n        const gameJSPath = path.join(pluginContext.outputDir, \"main.js\");\n        if(!fs.existsSync(gameJSPath)) {\n            console.log(`${gameJSPath}不存在，请先使用 Launcher 发布小米快游戏`);\n            return;\n        }\n        let gameJSContent = fs.readFileSync(gameJSPath, { encoding: \"utf8\" });\n        const projectConfig = pluginContext.buildConfig.projectConfig;\n        const optionStr =\n            `entryClassName: ${projectConfig.entryClassName},\\n\\t\\t` +\n            `orientation: ${projectConfig.orientation},\\n\\t\\t` +\n            `frameRate: ${projectConfig.frameRate},\\n\\t\\t` +\n            `scaleMode: ${projectConfig.scaleMode},\\n\\t\\t` +\n            `contentWidth: ${projectConfig.contentWidth},\\n\\t\\t` +\n            `contentHeight: ${projectConfig.contentHeight},\\n\\t\\t` +\n            `showFPS: ${projectConfig.showFPS},\\n\\t\\t` +\n            `fpsStyles: ${projectConfig.fpsStyles},\\n\\t\\t` +\n            `showLog: ${projectConfig.showLog},\\n\\t\\t` +\n            `maxTouches: ${projectConfig.maxTouches},`;\n        const reg = /\\/\\/----auto option start----[\\s\\S]*\\/\\/----auto option end----/;\n        const replaceStr = '\\/\\/----auto option start----\\n\\t\\t' + optionStr + '\\n\\t\\t\\/\\/----auto option end----';\n        gameJSContent = gameJSContent.replace(reg, replaceStr);\n        fs.writeFileSync(gameJSPath, gameJSContent);\n\n        //修改横竖屏\n        let orientation;\n        if (projectConfig.orientation == '\"landscape\"') {\n            orientation = \"landscape\";\n        }\n        else {\n            orientation = \"portrait\";\n        }\n        const gameJSONPath = path.join(pluginContext.outputDir, \"manifest.json\");\n        let gameJSONContent = JSON.parse(fs.readFileSync(gameJSONPath, { encoding: \"utf8\" }));\n        gameJSONContent.orientation = orientation;\n        fs.writeFileSync(gameJSONPath, JSON.stringify(gameJSONContent, null, \"\\t\"));\n    }\n}\n"
  },
  {
    "path": "demo/scripts/qqgame/qqgame.ts",
    "content": "import * as fs from 'fs';\nimport * as path from 'path';\nexport class QQgamePlugin implements plugins.Command {\n\n    constructor() {\n    }\n    async onFile(file: plugins.File) {\n        if (file.extname == '.js') {\n            const filename = file.origin;\n            if (filename == \"libs/modules/promise/promise.js\" || filename == 'libs/modules/promise/promise.min.js') {\n                return null;\n            }\n            if (filename == 'libs/modules/egret/egret.js' || filename == 'libs/modules/egret/egret.min.js') {\n                let content = file.contents.toString();\n                content += `;window.egret = egret;`;\n                content = content.replace(/definition = __global/, \"definition = window\");\n                file.contents = new Buffer(content);\n            }\n            else {\n                let content = file.contents.toString();\n                if (\n                    filename == \"libs/modules/res/res.js\" ||\n                    filename == 'libs/modules/res/res.min.js' ||\n                    filename == 'libs/modules/assetsmanager/assetsmanager.min.js' ||\n                    filename == 'libs/modules/assetsmanager/assetsmanager.js'\n                ) {\n                    content += \";window.RES = RES;\"\n                }\n                if (filename == \"libs/modules/eui/eui.js\" || filename == 'libs/modules/eui/eui.min.js') {\n                    content += \";window.eui = eui;\"\n                }\n                if (filename == 'libs/modules/dragonBones/dragonBones.js' || filename == 'libs/modules/dragonBones/dragonBones.min.js') {\n                    content += ';window.dragonBones = dragonBones';\n                }\n                content = \"var egret = window.egret;\" + content;\n                if (filename == 'main.js') {\n                    content += \"\\n;window.Main = Main;\"\n                }\n                file.contents = new Buffer(content);\n            }\n        }\n        return file;\n    }\n    async onFinish(pluginContext: plugins.CommandContext) {\n        //同步 index.html 配置到 game.js\n        const gameJSPath = path.join(pluginContext.outputDir, \"game.js\");\n        if(!fs.existsSync(gameJSPath)) {\n            console.log(`${gameJSPath}不存在，请先使用 Launcher 发布QQ小游戏`);\n            return;\n        }\n        let gameJSContent = fs.readFileSync(gameJSPath, { encoding: \"utf8\" });\n        const projectConfig = pluginContext.buildConfig.projectConfig;\n        const optionStr =\n            `entryClassName: ${projectConfig.entryClassName},\\n\\t\\t` +\n            `orientation: ${projectConfig.orientation},\\n\\t\\t` +\n            `frameRate: ${projectConfig.frameRate},\\n\\t\\t` +\n            `scaleMode: ${projectConfig.scaleMode},\\n\\t\\t` +\n            `contentWidth: ${projectConfig.contentWidth},\\n\\t\\t` +\n            `contentHeight: ${projectConfig.contentHeight},\\n\\t\\t` +\n            `showFPS: ${projectConfig.showFPS},\\n\\t\\t` +\n            `fpsStyles: ${projectConfig.fpsStyles},\\n\\t\\t` +\n            `showLog: ${projectConfig.showLog},\\n\\t\\t` +\n            `maxTouches: ${projectConfig.maxTouches},`;\n        const reg = /\\/\\/----auto option start----[\\s\\S]*\\/\\/----auto option end----/;\n        const replaceStr = '\\/\\/----auto option start----\\n\\t\\t' + optionStr + '\\n\\t\\t\\/\\/----auto option end----';\n        gameJSContent = gameJSContent.replace(reg, replaceStr);\n        fs.writeFileSync(gameJSPath, gameJSContent);\n\n        //修改横竖屏\n        let orientation;\n        if (projectConfig.orientation == '\"landscape\"') {\n            orientation = \"landscape\";\n        }\n        else {\n            orientation = \"portrait\";\n        }\n        const gameJSONPath = path.join(pluginContext.outputDir, \"game.json\");\n        let gameJSONContent = JSON.parse(fs.readFileSync(gameJSONPath, { encoding: \"utf8\" }));\n        gameJSONContent.deviceOrientation = orientation;\n        fs.writeFileSync(gameJSONPath, JSON.stringify(gameJSONContent, null, \"\\t\"));\n    }\n}"
  },
  {
    "path": "demo/scripts/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        /* Basic Options */\n        \"target\": \"es5\", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', or 'ESNEXT'. */\n        \"module\": \"commonjs\", /* Specify module code generation: 'commonjs', 'amd', 'system', 'umd' or 'es2015'. */\n        \"lib\": [\n            \"es5\",\n            \"es2015.promise\"\n        ], /* Specify library files to be included in the compilation:  */\n        \"allowJs\": true, /* Allow javascript files to be compiled. */\n        // \"checkJs\": true,                       /* Report errors in .js files. */\n        // \"jsx\": \"preserve\",                     /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */\n        // \"declaration\": true,                   /* Generates corresponding '.d.ts' file. */\n        // \"sourceMap\": true,                     /* Generates corresponding '.map' file. */\n        // \"outFile\": \"./\",                       /* Concatenate and emit output to single file. */\n        // \"outDir\": \"./\",                        /* Redirect output structure to the directory. */\n        // \"rootDir\": \"./\",                       /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */\n        // \"removeComments\": true,                /* Do not emit comments to output. */\n        // \"noEmit\": true,                        /* Do not emit outputs. */\n        // \"importHelpers\": true,                 /* Import emit helpers from 'tslib'. */\n        // \"downlevelIteration\": true,            /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */\n        // \"isolatedModules\": true,               /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */\n        /* Strict Type-Checking Options */\n        \"strict\": true, /* Enable all strict type-checking options. */\n        \"noImplicitAny\": false /* Raise error on expressions and declarations with an implied 'any' type. */\n        // \"strictNullChecks\": true,              /* Enable strict null checks. */\n        // \"noImplicitThis\": true,                /* Raise error on 'this' expressions with an implied 'any' type. */\n        // \"alwaysStrict\": true,                  /* Parse in strict mode and emit \"use strict\" for each source file. */\n        /* Additional Checks */\n        // \"noUnusedLocals\": true,                /* Report errors on unused locals. */\n        // \"noUnusedParameters\": true,            /* Report errors on unused parameters. */\n        // \"noImplicitReturns\": true,             /* Report error when not all code paths in function return a value. */\n        // \"noFallthroughCasesInSwitch\": true,    /* Report errors for fallthrough cases in switch statement. */\n        /* Module Resolution Options */\n        // \"moduleResolution\": \"node\",            /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */\n        // \"baseUrl\": \"./\",                       /* Base directory to resolve non-absolute module names. */\n        /* List of root folders whose combined content represents the structure of the project at runtime. */\n        // \"typeRoots\": [],                       /* List of folders to include type definitions from. */\n        // \"types\": [],                           /* Type declaration files to be included in compilation. */\n        // \"allowSyntheticDefaultImports\": true,  /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */\n        /* Source Map Options */\n        // \"sourceRoot\": \"./\",                    /* Specify the location where debugger should locate TypeScript files instead of source locations. */\n        // \"mapRoot\": \"./\",                       /* Specify the location where debugger should locate map files instead of generated locations. */\n        // \"inlineSourceMap\": true,               /* Emit a single file with source maps instead of having a separate file. */\n        // \"inlineSources\": true,                 /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */\n        /* Experimental Options */\n        // \"experimentalDecorators\": true,        /* Enables experimental support for ES7 decorators. */\n        // \"emitDecoratorMetadata\": true,         /* Enables experimental support for emitting type metadata for decorators. */\n    }\n}"
  },
  {
    "path": "demo/scripts/vivogame/vivogame.ts",
    "content": "import * as fs from 'fs';\nimport * as path from 'path';\nexport class VivogamePlugin implements plugins.Command {\n    jsFileList: any = []\n    constructor() {\n    }\n    async onFile(file: plugins.File) {\n        if (file.extname == '.js') {\n            const filename = file.origin;\n            \n            if (filename == \"libs/modules/promise/promise.js\" || filename == 'libs/modules/promise/promise.min.js') {\n                return null;\n            }\n            this.jsFileList.push(file.basename)\n            if (filename == 'libs/modules/egret/egret.js' || filename == 'libs/modules/egret/egret.min.js') {\n                let content = file.contents.toString();\n                content += `;window.egret = egret;`;\n                content = content.replace(/definition = __global/, \"definition = window\");\n                file.contents = new Buffer(content);\n            }\n            else {\n                let content = file.contents.toString();\n                if (\n                    filename == \"libs/modules/res/res.js\" ||\n                    filename == 'libs/modules/res/res.min.js' ||\n                    filename == 'libs/modules/assetsmanager/assetsmanager.min.js' ||\n                    filename == 'libs/modules/assetsmanager/assetsmanager.js'\n                ) {\n                    content += \";window.RES = RES;\"\n                }\n                if (filename == \"libs/modules/eui/eui.js\" || filename == 'libs/modules/eui/eui.min.js') {\n                    content += \";window.eui = eui;\"\n                    if (filename == \"libs/modules/eui/eui.js\") {\n                        content = content.replace(\"function getRepeatedIds\", \"window.getRepeatedIds=function getRepeatedIds\");\n                        content = content.replace(\"function getIds\", \"window.getIds=function getIds\");\n                        content = content.replace(\"function toXMLString\", \"window.toXMLString=function toXMLString\");\n                        content = content.replace(\"function checkDeclarations\", \"window.checkDeclarations=function checkDeclarations\");\n                        content = content.replace(\"function getPropertyStr\", \"window.getPropertyStr=function getPropertyStr\");\n                    }\n                }\n                if (filename == 'libs/modules/dragonBones/dragonBones.js' || filename == 'libs/modules/dragonBones/dragonBones.min.js') {\n                    content += ';window.dragonBones = dragonBones';\n                }\n                content = \"var egret = window.egret;\" + content;\n\n                if (filename == 'main.js') {\n                    content += \"\\n;window.Main = Main;\"\n                }\n                file.contents = new Buffer(content);\n            }\n        }\n        return file;\n    }\n    async onFinish(pluginContext: plugins.CommandContext) {\n        //同步 index.html 配置到 game.js\n        const gameJSPath = path.join(pluginContext.outputDir, \"game.js\");\n        if (!fs.existsSync(gameJSPath)) {\n            console.log(`${gameJSPath}不存在，请先使用 Launcher 发布 Vivo 小游戏`);\n            return;\n        }\n        let gameJSContent = fs.readFileSync(gameJSPath, { encoding: \"utf8\" });\n        const projectConfig = pluginContext.buildConfig.projectConfig;\n        const optionStr =\n            `entryClassName: ${projectConfig.entryClassName},\\n\\t\\t` +\n            `orientation: ${projectConfig.orientation},\\n\\t\\t` +\n            `frameRate: ${projectConfig.frameRate},\\n\\t\\t` +\n            `scaleMode: ${projectConfig.scaleMode},\\n\\t\\t` +\n            `contentWidth: ${projectConfig.contentWidth},\\n\\t\\t` +\n            `contentHeight: ${projectConfig.contentHeight},\\n\\t\\t` +\n            `showFPS: ${projectConfig.showFPS},\\n\\t\\t` +\n            `fpsStyles: ${projectConfig.fpsStyles},\\n\\t\\t` +\n            `showLog: ${projectConfig.showLog},\\n\\t\\t` +\n            `maxTouches: ${projectConfig.maxTouches},`;\n        const reg = /\\/\\/----auto option start----[\\s\\S]*\\/\\/----auto option end----/;\n        const replaceStr = '\\/\\/----auto option start----\\n\\t\\t' + optionStr + '\\n\\t\\t\\/\\/----auto option end----';\n        gameJSContent = gameJSContent.replace(reg, replaceStr);\n        fs.writeFileSync(gameJSPath, gameJSContent);\n\n        //修改横竖屏\n        let orientation;\n        if (projectConfig.orientation == '\"landscape\"') {\n            orientation = \"landscape\";\n        }\n        else {\n            orientation = \"portrait\";\n        }\n        const gameJSONPath = path.join(pluginContext.outputDir, \"manifest.json\");\n        let gameJSONContent = JSON.parse(fs.readFileSync(gameJSONPath, { encoding: \"utf8\" }));\n        gameJSONContent.deviceOrientation = orientation;\n        let engineVersion = this.readData(path.join(pluginContext.projectRoot, \"egretProperties.json\")).engineVersion\n        if(!gameJSONContent.thirdEngine)gameJSONContent.thirdEngine={}\n        gameJSONContent.thirdEngine.egret = engineVersion\n        \n        fs.writeFileSync(gameJSONPath, JSON.stringify(gameJSONContent, null, \"\\t\"));\n        let isPublish = pluginContext.buildConfig.command == \"publish\" ? true : false;\n        let configArr: any[] = []\n        for (var i = 0, len = this.jsFileList.length; i < len; i++) {\n            let jsFile = this.jsFileList[i];\n            if (isPublish) {\n                if (jsFile == \"main.js\") {\n                    jsFile = 'main.min.js'\n                } else if (jsFile == \"default.thm.js\") {\n                    jsFile = \"default.thm.min.js\"\n                }\n            }\n            configArr.push(JSON.stringify({\n                module_name: `./js/${jsFile}`,\n                module_path: `./js/${jsFile}`,\n                module_from: `engine/js/${jsFile}`,\n            }, null, \"\\t\"))\n        }\n        const replaceConfigStr = '\\/\\/----auto option start----\\n\\t\\t' + configArr.toString()  + '\\n\\t\\t\\/\\/----auto option end----';\n        const minigameConfigPath = path.join(pluginContext.outputDir,\"../\",  \"minigame.config.js\");\n        if(!fs.existsSync(minigameConfigPath)){\n            //5.2.28版本，vivo更新了项目结构，老项目需要升级\n            fs.writeFileSync(path.join(pluginContext.outputDir,\"../\",\"vivo更新了项目结构，请重新创建vivo小游戏项目.js\"), \"vivo更新了项目结构，请重新创建vivo小游戏项目\");\n        }else{\n            let configJSContent = fs.readFileSync(minigameConfigPath, { encoding: \"utf8\" });\n            configJSContent = configJSContent.replace(reg, replaceConfigStr);\n            fs.writeFileSync(minigameConfigPath, configJSContent);\n        }\n    }\n    readData(filePath: string): any {\n        return JSON.parse(fs.readFileSync(filePath, { encoding: \"utf8\" }));\n    }\n}\n"
  },
  {
    "path": "demo/scripts/wxgame/wxgame.ts",
    "content": "import * as fs from 'fs';\nimport * as path from 'path';\nexport class WxgamePlugin implements plugins.Command {\n\n    constructor() {\n    }\n    async onFile(file: plugins.File) {\n        if (file.extname == '.js') {\n            const filename = file.origin;\n            if (filename == \"libs/modules/promise/promise.js\" || filename == 'libs/modules/promise/promise.min.js') {\n                return null;\n            }\n            if (filename == 'libs/modules/egret/egret.js' || filename == 'libs/modules/egret/egret.min.js') {\n                let content = file.contents.toString();\n                content += `;window.egret = egret;`;\n                content = content.replace(/definition = __global/, \"definition = window\");\n                file.contents = new Buffer(content);\n            }\n            else {\n                let content = file.contents.toString();\n                if (\n                    filename == \"libs/modules/res/res.js\" ||\n                    filename == 'libs/modules/res/res.min.js' ||\n                    filename == 'libs/modules/assetsmanager/assetsmanager.min.js' ||\n                    filename == 'libs/modules/assetsmanager/assetsmanager.js'\n                ) {\n                    content += \";window.RES = RES;\"\n                }\n                if (filename == \"libs/modules/eui/eui.js\" || filename == 'libs/modules/eui/eui.min.js') {\n                    content += \";window.eui = eui;\"\n                }\n                if (filename == 'libs/modules/dragonBones/dragonBones.js' || filename == 'libs/modules/dragonBones/dragonBones.min.js') {\n                    content += ';window.dragonBones = dragonBones';\n                }\n                content = \"var egret = window.egret;\" + content;\n                if (filename == 'main.js') {\n                    content += \"\\n;window.Main = Main;\"\n                }\n                file.contents = new Buffer(content);\n            }\n        }\n        return file;\n    }\n    async onFinish(pluginContext: plugins.CommandContext) {\n        //同步 index.html 配置到 game.js\n        const gameJSPath = path.join(pluginContext.outputDir, \"game.js\");\n        if(!fs.existsSync(gameJSPath)) {\n            console.log(`${gameJSPath}不存在，请先使用 Launcher 发布微信小游戏`);\n            return;\n        }\n        let gameJSContent = fs.readFileSync(gameJSPath, { encoding: \"utf8\" });\n        const projectConfig = pluginContext.buildConfig.projectConfig;\n        const optionStr =\n            `entryClassName: ${projectConfig.entryClassName},\\n\\t\\t` +\n            `orientation: ${projectConfig.orientation},\\n\\t\\t` +\n            `frameRate: ${projectConfig.frameRate},\\n\\t\\t` +\n            `scaleMode: ${projectConfig.scaleMode},\\n\\t\\t` +\n            `contentWidth: ${projectConfig.contentWidth},\\n\\t\\t` +\n            `contentHeight: ${projectConfig.contentHeight},\\n\\t\\t` +\n            `showFPS: ${projectConfig.showFPS},\\n\\t\\t` +\n            `fpsStyles: ${projectConfig.fpsStyles},\\n\\t\\t` +\n            `showLog: ${projectConfig.showLog},\\n\\t\\t` +\n            `maxTouches: ${projectConfig.maxTouches},`;\n        const reg = /\\/\\/----auto option start----[\\s\\S]*\\/\\/----auto option end----/;\n        const replaceStr = '\\/\\/----auto option start----\\n\\t\\t' + optionStr + '\\n\\t\\t\\/\\/----auto option end----';\n        gameJSContent = gameJSContent.replace(reg, replaceStr);\n        fs.writeFileSync(gameJSPath, gameJSContent);\n\n        //修改横竖屏\n        let orientation;\n        if (projectConfig.orientation == '\"landscape\"') {\n            orientation = \"landscape\";\n        }\n        else {\n            orientation = \"portrait\";\n        }\n        const gameJSONPath = path.join(pluginContext.outputDir, \"game.json\");\n        let gameJSONContent = JSON.parse(fs.readFileSync(gameJSONPath, { encoding: \"utf8\" }));\n        gameJSONContent.deviceOrientation = orientation;\n        fs.writeFileSync(gameJSONPath, JSON.stringify(gameJSONContent, null, \"\\t\"));\n    }\n}"
  },
  {
    "path": "demo/src/LoadingUI.ts",
    "content": "//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n\nclass LoadingUI extends egret.Sprite implements RES.PromiseTaskReporter {\n\n    public constructor() {\n        super();\n        this.createView();\n    }\n\n    private textField: egret.TextField;\n\n    private createView(): void {\n        this.textField = new egret.TextField();\n        this.addChild(this.textField);\n        this.textField.y = 300;\n        this.textField.width = 480;\n        this.textField.height = 100;\n        this.textField.textAlign = \"center\";\n    }\n\n    public onProgress(current: number, total: number): void {\n        this.textField.text = `Loading...${current}/${total}`;\n    }\n}\n"
  },
  {
    "path": "demo/src/Main.ts",
    "content": "\n//////////////////////////////////////////////////////////////////////////////////////\n//\n//  Copyright (c) 2014-present, Egret Technology.\n//  All rights reserved.\n//  Redistribution and use in source and binary forms, with or without\n//  modification, are permitted provided that the following conditions are met:\n//\n//     * Redistributions of source code must retain the above copyright\n//       notice, this list of conditions and the following disclaimer.\n//     * Redistributions in binary form must reproduce the above copyright\n//       notice, this list of conditions and the following disclaimer in the\n//       documentation and/or other materials provided with the distribution.\n//     * Neither the name of the Egret nor the\n//       names of its contributors may be used to endorse or promote products\n//       derived from this software without specific prior written permission.\n//\n//  THIS SOFTWARE IS PROVIDED BY EGRET AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS\n//  OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n//  OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n//  IN NO EVENT SHALL EGRET AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n//  INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n//  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA,\n//  OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n//  LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n//  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\n//  EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n//\n//////////////////////////////////////////////////////////////////////////////////////\n\nclass Main extends egret.DisplayObjectContainer {\n\n\n\n    public constructor() {\n        super();\n        this.addEventListener(egret.Event.ADDED_TO_STAGE, this.onAddToStage, this);\n    }\n\n    private onAddToStage(event: egret.Event) {\n\n        egret.lifecycle.addLifecycleListener((context) => {\n            // custom lifecycle plugin\n\n            context.onUpdate = () => {\n\n            }\n        })\n\n        egret.lifecycle.onPause = () => {\n            egret.ticker.pause();\n        }\n\n        egret.lifecycle.onResume = () => {\n            egret.ticker.resume();\n        }\n\n        this.runGame().catch(e => {\n            console.log(e);\n        })\n    }\n\n    private _demoEntry: DemoEntry;\n\n    private async runGame() {\n        await this.loadResource()\n        await platform.login();\n        const userInfo = await platform.getUserInfo();\n\n        this.stage.addChild(fgui.GRoot.inst.displayObject);\n        this._demoEntry = new DemoEntry();\n    }\n\n    private async loadResource() {\n        try {\n            const loadingView = new LoadingUI();\n            this.stage.addChild(loadingView);\n            await RES.loadConfig(\"resource/default.res.json\", \"resource/\");\n            await RES.loadGroup(\"preload\", 0, loadingView);\n            this.stage.removeChild(loadingView);\n        }\n        catch (e) {\n            console.error(e);\n        }\n    }\n}"
  },
  {
    "path": "demo/src/Platform.ts",
    "content": "/** \n * 平台数据接口。\n * 由于每款游戏通常需要发布到多个平台上，所以提取出一个统一的接口用于开发者获取平台数据信息\n * 推荐开发者通过这种方式封装平台逻辑，以保证整体结构的稳定\n * 由于不同平台的接口形式各有不同，白鹭推荐开发者将所有接口封装为基于 Promise 的异步形式\n */\ndeclare interface Platform {\n\n    getUserInfo(): Promise<any>;\n\n    login(): Promise<any>\n\n}\n\nclass DebugPlatform implements Platform {\n    async getUserInfo() {\n        return { nickName: \"username\" }\n    }\n    async login() {\n\n    }\n}\n\n\nif (!window.platform) {\n    window.platform = new DebugPlatform();\n}\n\n\n\ndeclare let platform: Platform;\n\ndeclare interface Window {\n\n    platform: Platform\n}\n\n\n\n\n\n"
  },
  {
    "path": "demo/src/demo/BagDemo.ts",
    "content": "class BagDemo {\r\n    private _view: fgui.GComponent;\r\n    private _bagWindow: fgui.Window;\r\n\r\n    constructor() {\r\n    }\r\n\r\n    public async start() {\r\n        await fgui.UIPackage.loadPackage(\"Bag\");\r\n\r\n        this._view = fgui.UIPackage.createObject(\"Bag\", \"Main\").asCom;\r\n        this._view.makeFullScreen();\r\n        fgui.GRoot.inst.addChild(this._view);\r\n\r\n        this._bagWindow = new BagWindow();\r\n        this._view.getChild(\"bagBtn\").addClickListener(() => { this._bagWindow.show(); }, this);\r\n    }\r\n\r\n    public destroy() {\r\n        fgui.UIPackage.removePackage(\"Bag\");\r\n    }\r\n}\r\n\r\nclass BagWindow extends fgui.Window {\r\n    public constructor() {\r\n        super();\r\n    }\r\n\r\n    protected onInit(): void {\r\n        this.contentPane = fgui.UIPackage.createObject(\"Bag\", \"BagWin\").asCom;\r\n        this.center();\r\n    }\r\n\r\n    protected onShown(): void {\r\n        var list: fgui.GList = this.contentPane.getChild(\"list\").asList;\r\n        list.addEventListener(fgui.ItemEvent.CLICK, this.onClickItem, this);\r\n        list.itemRenderer = this.renderListItem;\r\n        list.callbackThisObj = this;\r\n        list.setVirtual();\r\n        list.numItems = 45;\r\n    }\r\n\r\n    private renderListItem(index: number, obj: fgui.GObject): void {\r\n        obj.icon = \"resource/assets/Icons/i\" + Math.floor(Math.random() * 10) +\".png\";\r\n        obj.text = \"\" + Math.floor(Math.random() * 100);\r\n    }\r\n\r\n    private onClickItem(evt: fgui.ItemEvent): void {\r\n        this.contentPane.getChild(\"n11\").asLoader.url = evt.itemObject.icon;\r\n        this.contentPane.getChild(\"n13\").text = evt.itemObject.icon;\r\n    }\r\n}"
  },
  {
    "path": "demo/src/demo/BasicsDemo.ts",
    "content": "\r\nclass BasicDemo {\r\n    private _view: fgui.GComponent;\r\n    private _backBtn: fgui.GObject;\r\n    private _demoContainer: fgui.GComponent;\r\n    private _cc: fgui.Controller;\r\n\r\n    private _demoObjects: { [index: string]: fgui.GComponent };\r\n\r\n    public constructor() {\r\n    }\r\n\r\n    public async start() {\r\n        await fgui.UIPackage.loadPackage(\"Basics\");\r\n\r\n        fgui.UIConfig.verticalScrollBar = \"ui://Basics/ScrollBar_VT\";\r\n        fgui.UIConfig.horizontalScrollBar = \"ui://Basics/ScrollBar_HZ\";\r\n        fgui.UIConfig.popupMenu = \"ui://Basics/PopupMenu\";\r\n        fgui.UIConfig.buttonSound = \"ui://Basics/click\";\r\n\r\n        this._view = fgui.UIPackage.createObject(\"Basics\", \"Main\").asCom;\r\n        this._view.makeFullScreen();\r\n        fgui.GRoot.inst.addChild(this._view);\r\n\r\n        this._backBtn = this._view.getChild(\"btn_Back\");\r\n        this._backBtn.visible = false;\r\n        this._backBtn.addClickListener(this.onClickBack, this);\r\n\r\n        this._demoContainer = this._view.getChild(\"container\").asCom;\r\n        this._cc = this._view.getController(\"c1\");\r\n\r\n        var cnt: number = this._view.numChildren;\r\n        for (var i: number = 0; i < cnt; i++) {\r\n            var obj: fgui.GObject = this._view.getChildAt(i);\r\n            if (obj.group != null && obj.group.name == \"btns\")\r\n                obj.addClickListener(this.runDemo, this);\r\n        }\r\n\r\n        this._demoObjects = {};\r\n    }\r\n\r\n    destroy() {\r\n        fgui.UIConfig.verticalScrollBar = \"\";\r\n        fgui.UIConfig.horizontalScrollBar = \"\";\r\n        fgui.UIConfig.popupMenu = \"\";\r\n        fgui.UIConfig.buttonSound = \"\";\r\n        fgui.UIPackage.removePackage(\"Basics\");\r\n    }\r\n\r\n    private runDemo(evt: egret.Event): void {\r\n        var type: string = (<fgui.GObject>(evt.currentTarget)).name.substr(4);\r\n        var obj: fgui.GComponent = this._demoObjects[type];\r\n        if (obj == null) {\r\n            obj = <fgui.GComponent>fgui.UIPackage.createObject(\"Basics\", \"Demo_\" + type);\r\n            this._demoObjects[type] = obj;\r\n        }\r\n\r\n        this._demoContainer.removeChildren();\r\n        this._demoContainer.addChild(obj);\r\n        this._cc.selectedIndex = 1;\r\n        this._backBtn.visible = true;\r\n\r\n        switch (type) {\r\n            case \"Button\":\r\n                this.playButton();\r\n                break;\r\n\r\n            case \"Text\":\r\n                this.playText();\r\n                break;\r\n\r\n            case \"Window\":\r\n                this.playWindow();\r\n                break;\r\n\r\n            case \"Popup\":\r\n                this.playPopup();\r\n                break;\r\n\r\n            case \"Drag&Drop\":\r\n                this.playDragDrop();\r\n                break;\r\n\r\n            case \"Depth\":\r\n                this.playDepth();\r\n                break;\r\n\r\n            case \"Grid\":\r\n                this.playGrid();\r\n                break;\r\n\r\n            case \"ProgressBar\":\r\n                this.playProgressBar();\r\n                break;\r\n        }\r\n    }\r\n\r\n    private onClickBack(evt: egret.Event): void {\r\n        this._cc.selectedIndex = 0;\r\n        this._backBtn.visible = false;\r\n    }\r\n\r\n    //------------------------------\r\n    private playButton(): void {\r\n        var obj: fgui.GComponent = this._demoObjects[\"Button\"];\r\n        obj.getChild(\"n34\").addClickListener(this.__clickButton, this);\r\n    }\r\n\r\n    private __clickButton(evt: egret.Event): void {\r\n        console.log(\"click button\");\r\n    }\r\n\r\n    //------------------------------\r\n    private playText(): void {\r\n        var obj: fgui.GComponent = this._demoObjects[\"Text\"];\r\n        obj.getChild(\"n12\").asRichTextField.addEventListener(egret.TextEvent.LINK, this.__clickLink, this);\r\n        obj.getChild(\"n25\").addClickListener(this.__clickGetInput, this);\r\n    }\r\n\r\n    private __clickLink(evt: egret.TextEvent): void {\r\n        var obj: fgui.GRichTextField = <fgui.GRichTextField>(evt.currentTarget);\r\n        obj.text = \"[img]ui://9leh0eyft9fj5f[/img][color=#FF0000]你点击了链接[/color]：\" + evt.text;\r\n    }\r\n\r\n    private __clickGetInput(evt: egret.Event): void {\r\n        var obj: fgui.GComponent = this._demoObjects[\"Text\"];\r\n        obj.getChild(\"n24\").text = obj.getChild(\"n22\").text;\r\n    }\r\n\r\n    //------------------------------\r\n    private _winA: fgui.Window;\r\n    private _winB: fgui.Window;\r\n    private playWindow(): void {\r\n        var obj: fgui.GComponent = this._demoObjects[\"Window\"];\r\n        obj.getChild(\"n0\").addClickListener(this.__clickWindowA, this);\r\n        obj.getChild(\"n1\").addClickListener(this.__clickWindowB, this);\r\n    }\r\n\r\n    private __clickWindowA(evt: egret.Event): void {\r\n        if (this._winA == null)\r\n            this._winA = new WindowA();\r\n        this._winA.show();\r\n    }\r\n\r\n    private __clickWindowB(evt: egret.Event): void {\r\n        if (this._winB == null)\r\n            this._winB = new WindowB();\r\n        this._winB.show();\r\n    }\r\n\r\n    //------------------------------\r\n    private _pm: fgui.PopupMenu;\r\n    private _popupCom: fgui.GComponent;\r\n    private playPopup(): void {\r\n        if (this._pm == null) {\r\n            this._pm = new fgui.PopupMenu();\r\n            this._pm.addItem(\"Item 1\");\r\n            this._pm.addItem(\"Item 2\");\r\n            this._pm.addItem(\"Item 3\");\r\n            this._pm.addItem(\"Item 4\");\r\n\r\n            if (this._popupCom == null) {\r\n                this._popupCom = fgui.UIPackage.createObject(\"Basics\", \"Component12\").asCom;\r\n                this._popupCom.center();\r\n            }\r\n        }\r\n\r\n        var obj: fgui.GComponent = this._demoObjects[\"Popup\"];\r\n        var btn: fgui.GObject = obj.getChild(\"n0\");\r\n        btn.addClickListener(this.__clickPopup1, this);\r\n\r\n        var btn2: fgui.GObject = obj.getChild(\"n1\");\r\n        btn2.addClickListener(this.__clickPopup2, this);\r\n    }\r\n\r\n    private __clickPopup1(evt: egret.Event): void {\r\n        var btn: fgui.GObject = <fgui.GObject>evt.currentTarget;\r\n        this._pm.show(btn);\r\n    }\r\n\r\n    private __clickPopup2(evt: egret.Event): void {\r\n        fgui.GRoot.inst.showPopup(this._popupCom);\r\n    }\r\n\r\n    //------------------------------\r\n    private playDragDrop(): void {\r\n        var obj: fgui.GComponent = this._demoObjects[\"Drag&Drop\"];\r\n        var btnA: fgui.GObject = obj.getChild(\"a\");\r\n        btnA.draggable = true;\r\n\r\n        var btnB: fgui.GButton = <fgui.GButton>obj.getChild(\"b\");\r\n        btnB.draggable = true;\r\n        btnB.addEventListener(fgui.DragEvent.DRAG_START, this.__onDragStart, this);\r\n\r\n        var btnC: fgui.GButton = <fgui.GButton>obj.getChild(\"c\");\r\n        btnC.icon = null;\r\n        btnC.addEventListener(fgui.DropEvent.DROP, this.__onDrop, this);\r\n\r\n        var btnD: fgui.GObject = obj.getChild(\"d\");\r\n        btnD.draggable = true;\r\n        var bounds: fgui.GObject = obj.getChild(\"bounds\");\r\n        var rect: egret.Rectangle = new egret.Rectangle();\r\n        bounds.localToGlobalRect(0, 0, bounds.width, bounds.height, rect);\r\n        fgui.GRoot.inst.globalToLocalRect(rect.x, rect.y, rect.width, rect.height, rect);\r\n\r\n        //因为这时候面板还在从右往左动，所以rect不准确，需要用相对位置算出最终停下来的范围\r\n        rect.x -= obj.parent.x;\r\n\r\n        btnD.dragBounds = rect;\r\n    }\r\n\r\n    private __onDragStart(evt: fgui.DragEvent): void {\r\n        //取消对原目标的拖动，换成一个替代品\r\n        evt.preventDefault();\r\n\r\n        var btn: fgui.GButton = <fgui.GButton>evt.currentTarget;\r\n        fgui.DragDropManager.inst.startDrag(btn, btn.icon, btn.icon);\r\n    }\r\n\r\n    private __onDrop(evt: fgui.DropEvent): void {\r\n        var btn: fgui.GButton = <fgui.GButton>evt.currentTarget;\r\n        btn.icon = evt.source;\r\n    }\r\n\r\n    //------------------------------\r\n    private playDepth(): void {\r\n        var obj: fgui.GComponent = this._demoObjects[\"Depth\"];\r\n        var testContainer: fgui.GComponent = obj.getChild(\"n22\").asCom;\r\n        var fixedObj: fgui.GObject = testContainer.getChild(\"n0\");\r\n        fixedObj.sortingOrder = 100;\r\n        fixedObj.draggable = true;\r\n\r\n        var numChildren: number = testContainer.numChildren;\r\n        var i: number = 0;\r\n        while (i < numChildren) {\r\n            var child: fgui.GObject = testContainer.getChildAt(i);\r\n            if (child != fixedObj) {\r\n                testContainer.removeChildAt(i);\r\n                numChildren--;\r\n            }\r\n            else\r\n                i++;\r\n        }\r\n        var startPos: egret.Point = new egret.Point(fixedObj.x, fixedObj.y);\r\n\r\n        obj.getChild(\"btn0\").addClickListener(function (): void {\r\n            var graph: fgui.GGraph = new fgui.GGraph();\r\n            startPos.x += 10;\r\n            startPos.y += 10;\r\n            graph.setXY(startPos.x, startPos.y);\r\n            graph.setSize(150, 150);\r\n            graph.drawRect(1, 0, 1, 0xFF0000, 1);\r\n            obj.getChild(\"n22\").asCom.addChild(graph);\r\n        }, this);\r\n\r\n        obj.getChild(\"btn1\").addClickListener(function (): void {\r\n            var graph: fgui.GGraph = new fgui.GGraph();\r\n            startPos.x += 10;\r\n            startPos.y += 10;\r\n            graph.setXY(startPos.x, startPos.y);\r\n            graph.setSize(150, 150);\r\n            graph.drawRect(1, 0, 1, 0x00FF00, 1);\r\n            graph.sortingOrder = 200;\r\n            obj.getChild(\"n22\").asCom.addChild(graph);\r\n        }, this);\r\n    }\r\n\r\n    //------------------------------\r\n    private playGrid(): void {\r\n        var obj: fgui.GComponent = this._demoObjects[\"Grid\"];\r\n        var list1: fgui.GList = obj.getChild(\"list1\").asList;\r\n        list1.removeChildrenToPool();\r\n        var testNames: Array<string> = [\"苹果手机操作系统\", \"安卓手机操作系统\", \"微软手机操作系统\", \"微软桌面操作系统\", \"苹果桌面操作系统\", \"未知操作系统\"];\r\n        var testColors: Array<number> = [0xFFFF00, 0xFF0000, 0xFFFFFF, 0x0000FF];\r\n        var cnt: number = testNames.length;\r\n        for (var i: number = 0; i < cnt; i++) {\r\n            var item: fgui.GButton = list1.addItemFromPool().asButton;\r\n            item.getChild(\"t0\").text = \"\" + (i + 1);\r\n            item.getChild(\"t1\").text = testNames[i];\r\n            item.getChild(\"t2\").asTextField.color = testColors[Math.floor(Math.random() * 4)];\r\n            item.getChild(\"star\").asProgress.value = (Math.floor(Math.random() * 3) + 1) / 3 * 100;\r\n        }\r\n\r\n        var list2: fgui.GList = obj.getChild(\"list2\").asList;\r\n        list2.removeChildrenToPool();\r\n        for (var i: number = 0; i < cnt; i++) {\r\n            var item: fgui.GButton = list2.addItemFromPool().asButton;\r\n            item.getChild(\"cb\").asButton.selected = false;\r\n            item.getChild(\"t1\").text = testNames[i];\r\n            item.getChild(\"mc\").asMovieClip.playing = i % 2 == 0;\r\n            item.getChild(\"t3\").text = \"\" + Math.floor(Math.random() * 10000)\r\n        }\r\n    }\r\n\r\n    //------------------------------\r\n    private playProgressBar(): void {\r\n        var obj: fgui.GComponent = this._demoObjects[\"ProgressBar\"];\r\n        fgui.GTimers.inst.add(40, 0, this.__playProgress, this);\r\n        obj.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.__removeTimer, this);\r\n    }\r\n\r\n    private __removeTimer(): void {\r\n        fgui.GTimers.inst.remove(this.__playProgress, this);\r\n    }\r\n\r\n    private __playProgress(): void {\r\n        var obj: fgui.GComponent = this._demoObjects[\"ProgressBar\"];\r\n        var cnt: number = obj.numChildren;\r\n        for (var i: number = 0; i < cnt; i++) {\r\n            var child: fgui.GObject = obj.getChildAt(i);\r\n            if (child instanceof fgui.GProgressBar) {\r\n                child.value += 1;\r\n                if (child.value > child.max)\r\n                    child.value = 0;\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "demo/src/demo/ChatDemo.ts",
    "content": "\r\ninterface Message {\r\n    sender?: string;\r\n    senderIcon?: string;\r\n    msg?: string;\r\n    fromMe?: boolean;\r\n}\r\n\r\nclass ChatDemo {\r\n    private _view: fgui.GComponent;\r\n    private _list: fgui.GList;\r\n    private _input: fgui.GTextInput;\r\n    private _emojiSelectUI: fgui.GComponent;\r\n    private _emojiParser: EmojiParser;\r\n    private _messages: Array<Message>;\r\n\r\n    constructor() {\r\n    }\r\n\r\n    public async start() {\r\n        await fgui.UIPackage.loadPackage(\"Chat\");\r\n\r\n        this._view = fgui.UIPackage.createObject(\"Chat\", \"Main\").asCom;\r\n        this._view.makeFullScreen();\r\n        fgui.GRoot.inst.addChild(this._view);\r\n\r\n        this._messages = new Array<Message>();\r\n        this._emojiParser = new EmojiParser();\r\n\r\n        this._list = this._view.getChild(\"list\").asList;\r\n        this._list.setVirtual();\r\n        this._list.itemProvider = this.getListItemResource;\r\n        this._list.itemRenderer = this.renderListItem;\r\n        this._list.callbackThisObj = this;\r\n\r\n        this._input = this._view.getChild(\"input1\").asTextInput;\r\n\r\n        this._view.getChild(\"btnSend1\").addClickListener(this.onClickSendBtn, this);\r\n        this._view.getChild(\"btnEmoji1\").addClickListener(this.onClickEmojiBtn, this);\r\n\r\n        this._emojiSelectUI = fgui.UIPackage.createObject(\"Chat\", \"EmojiSelectUI\").asCom;\r\n        this._emojiSelectUI.getChild(\"list\").addEventListener(fgui.ItemEvent.CLICK, this.onClickEmoji, this);\r\n    }\r\n\r\n    private addMsg(sender: string, senderIcon: string, msg: string, fromMe: boolean) {\r\n        let isScrollBottom: boolean = this._list.scrollPane.isBottomMost;\r\n\r\n        let newMessage: Message = {};\r\n        newMessage.sender = sender;\r\n        newMessage.senderIcon = senderIcon;\r\n        newMessage.msg = msg;\r\n        newMessage.fromMe = fromMe;\r\n        this._messages.push(newMessage);\r\n\r\n        if (newMessage.fromMe) {\r\n            if (this._messages.length == 1 || Math.random() < 0.5) {\r\n                let replyMessage: Message = {};\r\n                replyMessage.sender = \"FairyGUI\";\r\n                replyMessage.senderIcon = \"r1\";\r\n                replyMessage.msg = \"Today is a good day. \";\r\n                replyMessage.fromMe = false;\r\n                this._messages.push(replyMessage);\r\n            }\r\n        }\r\n\r\n        if (this._messages.length > 100)\r\n            this._messages.splice(0, this._messages.length - 100);\r\n\r\n        this._list.numItems = this._messages.length;\r\n\r\n        if (isScrollBottom)\r\n            this._list.scrollPane.scrollBottom();\r\n    }\r\n\r\n    private getListItemResource(index: number): string {\r\n        let msg = this._messages[index];\r\n        if (msg.fromMe)\r\n            return \"ui://Chat/chatRight\";\r\n        else\r\n            return \"ui://Chat/chatLeft\";\r\n    }\r\n\r\n    private renderListItem(index: number, item: fgui.GButton): void {\r\n        let msg = this._messages[index];\r\n        if (!msg.fromMe)\r\n            item.getChild(\"name\").text = msg.sender;\r\n        item.icon = fgui.UIPackage.getItemURL(\"Chat\", msg.senderIcon);\r\n\r\n        var txtObj: fgui.GRichTextField = item.getChild(\"msg\").asRichTextField;\r\n        txtObj.width = txtObj.initWidth;\r\n        txtObj.text = this._emojiParser.parse(msg.msg);\r\n        if (txtObj.textWidth < txtObj.width)\r\n            txtObj.width = txtObj.textWidth;\r\n    }\r\n\r\n    private onClickSendBtn() {\r\n        let msg = this._input.text;\r\n        if (!msg)\r\n            return;\r\n\r\n        this.addMsg(\"Creator\", \"r0\", msg, true);\r\n        this._input.text = \"\";\r\n    }\r\n\r\n    private onClickEmojiBtn(evt: egret.Event) {\r\n        fgui.GRoot.inst.showPopup(this._emojiSelectUI, evt.currentTarget, false);\r\n    }\r\n\r\n    private onClickEmoji(evt: fgui.ItemEvent) {\r\n        this._input.text += \"[:\" + evt.itemObject.text + \"]\";\r\n    }\r\n\r\n    private onSubmit() {\r\n        this.onClickSendBtn();\r\n    }\r\n}\r\n"
  },
  {
    "path": "demo/src/demo/CooldownDemo.ts",
    "content": "class CooldownDemo {\r\n    private _view: fgui.GComponent;\r\n    private _btn0: fgui.GProgressBar;\r\n    private _btn1: fgui.GProgressBar;\r\n\r\n    constructor() {\r\n    }\r\n\r\n    public async start() {\r\n        await fgui.UIPackage.loadPackage(\"Cooldown\");\r\n\r\n        this._view = fgui.UIPackage.createObject(\"Cooldown\", \"Main\").asCom;\r\n        this._view.makeFullScreen();\r\n        fgui.GRoot.inst.addChild(this._view);\r\n\r\n        this._btn0 = this._view.getChild(\"b0\").asProgress;\r\n        this._btn1 = this._view.getChild(\"b1\").asProgress;\r\n        this._btn0.getChild(\"icon\").icon = \"resource/assets/Icons/k0.png\";\r\n        this._btn1.getChild(\"icon\").icon = \"resource/assets/Icons/k1.png\";\r\n\r\n        fgui.GTween.to(0, 100, 5).setTarget(this._btn0, \"value\").setRepeat(-1);\r\n        fgui.GTween.to(10, 0, 10).setTarget(this._btn1, \"value\").setRepeat(-1);\r\n    }\r\n}\r\n"
  },
  {
    "path": "demo/src/demo/DemoEntry.ts",
    "content": "\r\nclass DemoEntry {\r\n\r\n    private _closeButton: fgui.GObject;\r\n    private _currentDemo: any;\r\n\r\n    constructor() {\r\n        fgui.UIPackage.addPackage(\"MainMenu\");\r\n\r\n        fgui.GRoot.inst.addEventListener(\"start_demo\", this.onDemoStart, this);\r\n        this._currentDemo = new MainMenu();\r\n    }\r\n\r\n    onDemoStart(evt:egret.Event) {\r\n        this._currentDemo = evt.data;\r\n        this._closeButton = fgui.UIPackage.createObject(\"MainMenu\", \"CloseButton\");\r\n        this._closeButton.setXY(fgui.GRoot.inst.width - this._closeButton.width - 10, fgui.GRoot.inst.height - this._closeButton.height - 10);\r\n        this._closeButton.addRelation(fgui.GRoot.inst, fgui.RelationType.Right_Right);\r\n        this._closeButton.addRelation(fgui.GRoot.inst, fgui.RelationType.Bottom_Bottom);\r\n        this._closeButton.sortingOrder = 100000;\r\n        this._closeButton.addClickListener(this.onDemoClosed, this);\r\n        fgui.GRoot.inst.addChild(this._closeButton);\r\n    }\r\n\r\n    onDemoClosed() {\r\n        if(this._currentDemo.destroy)\r\n            this._currentDemo.destroy();\r\n        fgui.GRoot.inst.removeChildren(0, -1, true);\r\n\r\n        this._currentDemo = new MainMenu();\r\n    }\r\n}\r\n"
  },
  {
    "path": "demo/src/demo/EmojiParser.ts",
    "content": "\r\nclass EmojiParser extends fgui.UBBParser {\r\n    public constructor() {\r\n        super();\r\n\r\n        TAGS.forEach(element => {\r\n            this._handlers[\":\" + element] = this.onTag_Emoji;\r\n        });\r\n    }\r\n\r\n    private onTag_Emoji(tagName: string, end: boolean, attr: string): string {\r\n        return \"<img src='\" + fgui.UIPackage.getItemURL(\"Chat\", tagName.substring(1).toLowerCase()) + \"'/>\";\r\n    }\r\n}\r\n\r\nconst TAGS: Array<string> = [\"88\", \"am\", \"bs\", \"bz\", \"ch\", \"cool\", \"dhq\", \"dn\", \"fd\", \"gz\", \"han\", \"hx\", \"hxiao\", \"hxiu\"];"
  },
  {
    "path": "demo/src/demo/GuideDemo.ts",
    "content": "class GuideDemo {\r\n    private _view: fgui.GComponent;\r\n    private _guideLayer: fgui.GComponent;\r\n\r\n    constructor() {\r\n    }\r\n\r\n    public async start() {\r\n        await fgui.UIPackage.loadPackage(\"Guide\");\r\n\r\n        this._view = fgui.UIPackage.createObject(\"Guide\", \"Main\").asCom;\r\n        this._view.makeFullScreen();\r\n        fgui.GRoot.inst.addChild(this._view);\r\n\r\n        this._guideLayer = fgui.UIPackage.createObject(\"Guide\", \"GuideLayer\").asCom;\r\n        this._guideLayer.makeFullScreen();\r\n        this._guideLayer.addRelation(fgui.GRoot.inst, fgui.RelationType.Size);\r\n\r\n        let bagBtn = this._view.getChild(\"bagBtn\");\r\n        bagBtn.addClickListener(() => {\r\n            this._guideLayer.removeFromParent();\r\n        }, this);\r\n\r\n        this._view.getChild(\"n2\").addClickListener(() => {\r\n            fgui.GRoot.inst.addChild(this._guideLayer);\r\n            let rect = bagBtn.localToGlobalRect(0, 0, bagBtn.width, bagBtn.height);\r\n            rect = this._guideLayer.globalToLocalRect(rect.x, rect.y, rect.width, rect.height);\r\n\r\n            let window = this._guideLayer.getChild(\"window\");\r\n            window.setSize(rect.width, rect.height);\r\n            fgui.GTween.to2(window.x, window.y, rect.x, rect.y, 0.5).setTarget(window, window.setXY);\r\n        }, this);\r\n    }\r\n}\r\n"
  },
  {
    "path": "demo/src/demo/HitTestDemo.ts",
    "content": "class HitTestDemo {\r\n    private _view: fgui.GComponent;\r\n\r\n    constructor() {\r\n    }\r\n\r\n    public async start() {\r\n        await fgui.UIPackage.loadPackage(\"HitTest\");\r\n\r\n        this._view = fgui.UIPackage.createObject(\"HitTest\", \"Main\").asCom;\r\n        this._view.makeFullScreen();\r\n        fgui.GRoot.inst.addChild(this._view);\r\n    }\r\n}\r\n"
  },
  {
    "path": "demo/src/demo/JoystickDemo.ts",
    "content": "\nclass JoystickDemo {\n    private _view: fgui.GComponent;\n    private _joystick: JoystickModule;\n    private _text: fgui.GTextField;\n\n    constructor() {\n    }\n\n    public async start() {\n        await fgui.UIPackage.loadPackage(\"Joystick\");\n\n        this._view = fgui.UIPackage.createObject(\"Joystick\", \"Main\").asCom;\n        this._view.makeFullScreen();\n        fgui.GRoot.inst.addChild(this._view);\n\n        this._text = this._view.getChild(\"n9\").asTextField;\n\n        this._joystick = new JoystickModule(this._view);\n        this._joystick.addEventListener(JoystickModule.JoystickMoving, this.onJoystickMoving, this);\n        this._joystick.addEventListener(JoystickModule.JoystickUp, this.onJoystickUp, this);\n    }\n\n    private onJoystickMoving(evt: egret.Event): void {\n        this._text.text = \"\" + evt.data;\n    }\n\n    private onJoystickUp(): void {\n        this._text.text = \"\";\n    }\n}"
  },
  {
    "path": "demo/src/demo/JoystickModule.ts",
    "content": "\r\nclass JoystickModule extends egret.EventDispatcher {\r\n    private _InitX: number;\r\n    private _InitY: number;\r\n    private _startStageX: number;\r\n    private _startStageY: number;\r\n    private _lastStageX: number;\r\n    private _lastStageY: number;\r\n    private _button: fgui.GButton;\r\n    private _touchArea: fgui.GObject;\r\n    private _thumb: fgui.GObject;\r\n    private _center: fgui.GObject;\r\n    private touchId: number;\r\n    private _tweener: egret.Tween;\r\n    private _curPos: egret.Point;\r\n    \r\n    public static JoystickMoving: string = \"JoystickMoving\";\r\n    public static JoystickUp: string = \"JoystickUp\";\r\n\r\n    public radius: number;\r\n\r\n    public constructor(mainView: fgui.GComponent) {\r\n        super();\r\n        \r\n        this._button = mainView.getChild(\"joystick\").asButton;\r\n        this._button.changeStateOnClick = false;\r\n        this._thumb = this._button.getChild(\"thumb\");\r\n        this._touchArea = mainView.getChild(\"joystick_touch\");\r\n        this._center = mainView.getChild(\"joystick_center\");\r\n\r\n        this._InitX = this._center.x + this._center.width / 2;\r\n        this._InitY = this._center.y + this._center.height / 2;\r\n        this.touchId = -1;\r\n        this.radius = 150;\r\n        \r\n        this._curPos = new egret.Point();\r\n\r\n        this._touchArea.addEventListener(egret.TouchEvent.TOUCH_BEGIN,this.onTouchDown,this);\r\n    }\r\n\r\n    public Trigger(evt: egret.TouchEvent): void {\r\n        this.onTouchDown(evt);\r\n    }\r\n\r\n    private onTouchDown(evt: egret.TouchEvent) {\r\n        if(this.touchId == -1)//First touch\r\n        {\r\n            this.touchId = evt.touchPointID;\r\n\r\n            if(this._tweener != null) {\r\n                this._tweener.setPaused(true);\r\n                this._tweener = null;\r\n            }\r\n\r\n            fgui.GRoot.inst.globalToLocal(evt.stageX,evt.stageY,this._curPos);\r\n            var bx: number = this._curPos.x;\r\n            var by: number = this._curPos.y;\r\n            this._button.selected = true;\r\n\r\n            if(bx < 0)\r\n                bx = 0;\r\n            else if(bx > this._touchArea.width)\r\n                bx = this._touchArea.width;\r\n\r\n            if(by > fgui.GRoot.inst.height)\r\n                by = fgui.GRoot.inst.height;\r\n            else if(by < this._touchArea.y)\r\n                by = this._touchArea.y;\r\n\r\n            this._lastStageX = bx;\r\n            this._lastStageY = by;\r\n            this._startStageX = bx;\r\n            this._startStageY = by;\r\n\r\n            this._center.visible = true;\r\n            this._center.x = bx - this._center.width / 2;\r\n            this._center.y = by - this._center.height / 2;\r\n            this._button.x = bx - this._button.width / 2;\r\n            this._button.y = by - this._button.height / 2;\r\n\r\n            var deltaX: number = bx - this._InitX;\r\n            var deltaY: number = by - this._InitY;\r\n            var degrees: number = Math.atan2(deltaY,deltaX) * 180 / Math.PI;\r\n            this._thumb.rotation = degrees + 90;\r\n\r\n            fgui.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_MOVE,this.OnTouchMove,this);\r\n            fgui.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END,this.OnTouchUp,this);\r\n        }\r\n    }\r\n\r\n    private OnTouchUp(evt: egret.TouchEvent): void {\r\n        if(this.touchId != -1 && evt.touchPointID == this.touchId) {\r\n            this.touchId = -1;\r\n            this._thumb.rotation = this._thumb.rotation + 180;\r\n            this._center.visible = false;\r\n            this._tweener = egret.Tween.get(this._button)\r\n                .to({ x: this._InitX - this._button.width / 2,y: this._InitY - this._button.height / 2 },\r\n                    300,egret.Ease.circOut)\r\n                .call(function(): void {\r\n                    this._tweener = null;\r\n                    this._button.selected = false;\r\n                    this._thumb.rotation = 0;\r\n                    this._center.visible = true;\r\n                    this._center.x = this._InitX - this._center.width / 2;\r\n                    this._center.y = this._InitY - this._center.height / 2;\r\n                },this);\r\n\r\n            fgui.GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_MOVE,this.OnTouchMove,this);\r\n            fgui.GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_END,this.OnTouchUp,this);\r\n\r\n            this.dispatchEventWith(JoystickModule.JoystickUp,false);\r\n        }\r\n    }\r\n\r\n    private OnTouchMove(evt: egret.TouchEvent): void {\r\n        if(this.touchId != -1 && evt.touchPointID == this.touchId) {\r\n            var bx: number = evt.stageX / fgui.GRoot.contentScaleFactor;\r\n            var by: number = evt.stageY / fgui.GRoot.contentScaleFactor;\r\n            var moveX: number = bx - this._lastStageX;\r\n            var moveY: number = by - this._lastStageY;\r\n            this._lastStageX = bx;\r\n            this._lastStageY = by;\r\n            var buttonX: number = this._button.x + moveX;\r\n            var buttonY: number = this._button.y + moveY;\r\n\r\n            var offsetX: number = buttonX + this._button.width / 2 - this._startStageX;\r\n            var offsetY: number = buttonY + this._button.height / 2 - this._startStageY;\r\n\r\n            var rad: number = Math.atan2(offsetY,offsetX);\r\n            var degree: number = rad * 180 / Math.PI;\r\n            this._thumb.rotation = degree + 90;\r\n\r\n            var maxX: number = this.radius * Math.cos(rad);\r\n            var maxY: number = this.radius * Math.sin(rad);\r\n            if(Math.abs(offsetX) > Math.abs(maxX))\r\n                offsetX = maxX;\r\n            if(Math.abs(offsetY) > Math.abs(maxY))\r\n                offsetY = maxY;\r\n\r\n            buttonX = this._startStageX + offsetX;\r\n            buttonY = this._startStageY + offsetY;\r\n            if(buttonX < 0)\r\n                buttonX = 0;\r\n            if(buttonY > fgui.GRoot.inst.height)\r\n                buttonY = fgui.GRoot.inst.height;\r\n\r\n            this._button.x = buttonX - this._button.width / 2;\r\n            this._button.y = buttonY - this._button.height / 2;\r\n\r\n            this.dispatchEventWith(JoystickModule.JoystickMoving,false,degree);\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "demo/src/demo/ListEffectDemo.ts",
    "content": "\r\nclass ListEffectDemo {\r\n    private _view: fgui.GComponent;\r\n    private _list: fgui.GList;\r\n\r\n    constructor() {\r\n    }\r\n\r\n    public async start() {\r\n        await fgui.UIPackage.loadPackage(\"ListEffect\");\r\n        \r\n        fgui.UIObjectFactory.setExtension(\"ui://ListEffect/mailItem\", MailItem);\r\n\r\n        this._view = fgui.UIPackage.createObject(\"ListEffect\", \"Main\").asCom;\r\n        this._view.makeFullScreen();\r\n        fgui.GRoot.inst.addChild(this._view);\r\n\r\n        this._list = this._view.getChild(\"mailList\").asList;\r\n        for (var i: number = 0; i < 10; i++) {\r\n            var item: MailItem = <MailItem>this._list.addItemFromPool();\r\n            item.setFetched(i % 3 == 0);\r\n            item.setRead(i % 2 == 0);\r\n            item.setTime(\"5 Nov 2015 16:24:33\");\r\n            item.title = \"Mail title here\";\r\n        }\r\n\r\n        this._list.ensureBoundsCorrect();\r\n        var delay: number = 0;\r\n        for (var i: number = 0; i < 10; i++) {\r\n            var item: MailItem = <MailItem>this._list.getChildAt(i);\r\n            if (this._list.isChildInView(item)) {\r\n                item.playEffect(delay);\r\n                delay += 0.2;\r\n            }\r\n            else\r\n                break;\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "demo/src/demo/LoopListDemo.ts",
    "content": "class LoopListDemo {\n    private _view: fgui.GComponent;\n    private _list: fgui.GList;\n\n    public async start() {\n        await fgui.UIPackage.loadPackage(\"LoopList\");\n\n        this._view = fgui.UIPackage.createObject(\"LoopList\", \"Main\").asCom;\n        this._view.setSize(fgui.GRoot.inst.width, fgui.GRoot.inst.height);\n        fgui.GRoot.inst.addChild(this._view);\n\n        this._list = this._view.getChild(\"list\").asList;\n        this._list.setVirtualAndLoop();\n\n        this._list.itemRenderer = this.renderListItem;\n        this._list.callbackThisObj = this;\n        this._list.numItems = 5;\n        this._list.scrollPane.addEventListener(fgui.ScrollPane.SCROLL, this.doSpecialEffect, this);\n        this.doSpecialEffect();\n    }\n\n    private doSpecialEffect(): void {\n        //change the scale according to the distance to the middle\n        var midX: number = this._list.scrollPane.posX + this._list.viewWidth / 2;\n        var cnt: number = this._list.numChildren;\n        for (var i: number = 0; i < cnt; i++) {\n            var obj: fgui.GObject = this._list.getChildAt(i);\n            var dist: number = Math.abs(midX - obj.x - obj.width / 2);\n            if (dist > obj.width) //no intersection\n                obj.setScale(1, 1);\n            else {\n                var ss: number = 1 + (1 - dist / obj.width) * 0.24;\n                obj.setScale(ss, ss);\n            }\n        }\n\n        this._view.getChild(\"n3\").text = \"\" + ((this._list.getFirstChildInView() + 1) % this._list.numItems);\n    }\n\n    private renderListItem(index: number, obj: fgui.GObject): void {\n        var item: fgui.GButton = obj.asButton;\n        item.setPivot(0.5, 0.5);\n        item.icon = fgui.UIPackage.getItemURL(\"LoopList\", \"n\" + (index + 1));\n    }\n}\n\n"
  },
  {
    "path": "demo/src/demo/MailItem.ts",
    "content": "\r\nclass MailItem extends fgui.GButton {\r\n\r\n    private _timeText: fgui.GTextField;\r\n    private _readController: fgui.Controller;\r\n    private _fetchController: fgui.Controller;\r\n    private _trans: fgui.Transition;\r\n\r\n    public constructor() {\r\n        super();\r\n    }\r\n\r\n    protected onConstruct(): void {\r\n        this._timeText = this.getChild(\"timeText\").asTextField;\r\n        this._readController = this.getController(\"IsRead\");\r\n        this._fetchController = this.getController(\"c1\");\r\n        this._trans = this.getTransition(\"t0\");\r\n    }\r\n\r\n    public setTime(value: string): void {\r\n        this._timeText.text = value;\r\n    }\r\n\r\n    public setRead(value: boolean): void {\r\n        this._readController.selectedIndex = value ? 1 : 0;\r\n    }\r\n\r\n    public setFetched(value: boolean): void {\r\n        this._fetchController.selectedIndex = value ? 1 : 0;\r\n    }\r\n\r\n    public playEffect(delay: number): void {\r\n        this.visible = false;\r\n        this._trans.play(null, null, null, 1, delay);\r\n    }\r\n}\r\n"
  },
  {
    "path": "demo/src/demo/MainMenu.ts",
    "content": "\r\n\r\nclass MainMenu {\r\n    private _view: fgui.GComponent;\r\n\r\n    constructor() {\r\n        fgui.UIPackage.addPackage(\"MainMenu\");\r\n        \r\n        this._view = fgui.UIPackage.createObject(\"MainMenu\", \"Main\").asCom;\r\n        this._view.makeFullScreen();\r\n        fgui.GRoot.inst.addChild(this._view);\r\n\r\n        this._view.getChild(\"n1\").addClickListener(function () {\r\n            this.startDemo(BasicDemo);\r\n        }, this);\r\n        this._view.getChild(\"n2\").addClickListener(function () {\r\n            this.startDemo(TransitionDemo);\r\n        }, this);\r\n        this._view.getChild(\"n4\").addClickListener(function () {\r\n            this.startDemo(VirtualListDemo);\r\n        }, this);\r\n        this._view.getChild(\"n5\").addClickListener(function () {\r\n            this.startDemo(LoopListDemo);\r\n        }, this);\r\n        this._view.getChild(\"n6\").addClickListener(function () {\r\n            this.startDemo(HitTestDemo);\r\n        }, this);\r\n        this._view.getChild(\"n7\").addClickListener(function () {\r\n            this.startDemo(PullToRefreshDemo);\r\n        }, this);\r\n        this._view.getChild(\"n8\").addClickListener(function () {\r\n            this.startDemo(ModalWaitingDemo);\r\n        }, this);\r\n        this._view.getChild(\"n9\").addClickListener(function () {\r\n            this.startDemo(JoystickDemo);\r\n        }, this);\r\n        this._view.getChild(\"n10\").addClickListener(function () {\r\n            this.startDemo(BagDemo);\r\n        }, this);\r\n        this._view.getChild(\"n11\").addClickListener(function () {\r\n            this.startDemo(ChatDemo);\r\n        }, this);\r\n        this._view.getChild(\"n12\").addClickListener(function () {\r\n            this.startDemo(ListEffectDemo);\r\n        }, this);\r\n        this._view.getChild(\"n13\").addClickListener(function () {\r\n            this.startDemo(ScrollPaneDemo);\r\n        }, this);\r\n        this._view.getChild(\"n14\").addClickListener(function () {\r\n            this.startDemo(TreeViewDemo);\r\n        }, this);\r\n        this._view.getChild(\"n15\").addClickListener(function () {\r\n            this.startDemo(GuideDemo);\r\n        }, this);\r\n        this._view.getChild(\"n16\").addClickListener(function () {\r\n            this.startDemo(CooldownDemo);\r\n        }, this);\r\n    }\r\n\r\n    startDemo(demoClass: any): void {\r\n        this._view.dispose();\r\n        let demo: any = new demoClass();\r\n        demo.start().then(()=> {\r\n            fgui.GRoot.inst.dispatchEventWith(\"start_demo\", false, demo);\r\n        });\r\n    }\r\n\r\n    destroy() {\r\n        this._view.dispose();\r\n    }\r\n}"
  },
  {
    "path": "demo/src/demo/ModalWaitingDemo.ts",
    "content": "\nclass ModalWaitingDemo {\n    private _view: fgui.GComponent;\n    private _testWin: TestWin;\n\n    public async start() {\n        await fgui.UIPackage.loadPackage(\"ModalWaiting\");\n\n        fgui.UIConfig.globalModalWaiting = \"ui://ModalWaiting/GlobalModalWaiting\";\n        fgui.UIConfig.windowModalWaiting = \"ui://ModalWaiting/WindowModalWaiting\";\n\n        this._view = fgui.UIPackage.createObject(\"ModalWaiting\", \"Main\").asCom;\n        this._view.setSize(fgui.GRoot.inst.width, fgui.GRoot.inst.height);\n        fgui.GRoot.inst.addChild(this._view);\n\n        this._testWin = new TestWin();\n        this._view.getChild(\"n0\").addClickListener(function (): void { this._testWin.show(); }, this);\n\n        //这里模拟一个要锁住全屏的等待过程\n        fgui.GRoot.inst.showModalWait();\n        fgui.GTimers.inst.add(3000, 1, function (): void {\n            fgui.GRoot.inst.closeModalWait();\n        }, this);\n    }\n}\n"
  },
  {
    "path": "demo/src/demo/PullToRefreshDemo.ts",
    "content": "\nclass PullToRefreshDemo {\n    private _view: fgui.GComponent;\n    private _list1: fgui.GList;\n    private _list2: fgui.GList;\n\n    public async start() {\n        await fgui.UIPackage.loadPackage(\"PullToRefresh\");\n\n        fgui.UIObjectFactory.setExtension(\"ui://PullToRefresh/Header\", ScrollPaneHeader);\n\n        this._view = fgui.UIPackage.createObject(\"PullToRefresh\", \"Main\").asCom;\n        this._view.makeFullScreen();\n        fgui.GRoot.inst.addChild(this._view);\n\n        this._list1 = this._view.getChild(\"list1\").asList;\n        this._list1.itemRenderer = this.renderListItem1;\n        this._list1.callbackThisObj = this;\n        this._list1.setVirtual();\n        this._list1.numItems = 1;\n        this._list1.scrollPane.addEventListener(fgui.ScrollPane.PULL_DOWN_RELEASE, this.onPullDownToRefresh, this);\n\n        this._list2 = this._view.getChild(\"list2\").asList;\n        this._list2.itemRenderer = this.renderListItem2;\n        this._list2.callbackThisObj = this;\n        this._list2.setVirtual();\n        this._list2.numItems = 1;\n        this._list2.scrollPane.addEventListener(fgui.ScrollPane.PULL_UP_RELEASE, this.onPullUpToRefresh, this);\n    }\n\n    private renderListItem1(index: number, item: fgui.GObject): void {\n        item.text = \"Item \" + (this._list1.numItems - index - 1);\n    }\n\n    private renderListItem2(index: number, item: fgui.GObject): void {\n        item.text = \"Item \" + index;\n    }\n\n    private onPullDownToRefresh(evt: egret.Event): void {\n        var header: ScrollPaneHeader = <ScrollPaneHeader>(this._list1.scrollPane.header);\n        if (header.readyToRefresh) {\n            header.setRefreshStatus(2);\n            this._list1.scrollPane.lockHeader(header.sourceHeight);\n\n            //Simulate a async resquest\n            fgui.GTimers.inst.add(2000, 1, function (): void {\n                this._list1.numItems += 5;\n\n                //Refresh completed\n                header.setRefreshStatus(3);\n                this._list1.scrollPane.lockHeader(35);\n\n                fgui.GTimers.inst.add(2000, 1, function (): void {\n                    header.setRefreshStatus(0);\n                    this._list1.scrollPane.lockHeader(0);\n                }, this);\n            }, this);\n        }\n    }\n\n    private onPullUpToRefresh(evt: egret.Event): void {\n        var footer: fgui.GComponent = this._list2.scrollPane.footer.asCom;\n\n        footer.getController(\"c1\").selectedIndex = 1;\n        this._list2.scrollPane.lockFooter(footer.sourceHeight);\n\n        //Simulate a async resquest\n        fgui.GTimers.inst.add(2000, 1, function (): void {\n            this._list2.numItems += 5;\n\n            //Refresh completed\n            footer.getController(\"c1\").selectedIndex = 0;\n            this._list2.scrollPane.lockFooter(0);\n        }, this);\n    }\n}\n\n"
  },
  {
    "path": "demo/src/demo/ScrollPaneDemo.ts",
    "content": "class ScrollPaneDemo {\r\n    private _view: fgui.GComponent;\r\n    private _list: fgui.GList;\r\n\r\n    public async start() {\r\n        await fgui.UIPackage.loadPackage(\"ScrollPane\");\r\n\r\n        this._view = fgui.UIPackage.createObject(\"ScrollPane\", \"Main\").asCom;\r\n        this._view.makeFullScreen();\r\n        fgui.GRoot.inst.addChild(this._view);\r\n\r\n        this._list = this._view.getChild(\"list\").asList;\r\n        this._list.itemRenderer = this.renderListItem;\r\n        this._list.callbackThisObj = this;\r\n        this._list.setVirtual();\r\n        this._list.numItems = 1000;\r\n        this._list.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.onClickList, this);\r\n    }\r\n\r\n    private renderListItem(index: number, item: fgui.GButton) {\r\n        item.title = \"Item \" + index;\r\n        item.scrollPane.posX = 0; //reset scroll pos\r\n\r\n        item.getChild(\"b0\").addClickListener(this.onClickStick, this);\r\n        item.getChild(\"b1\").addClickListener(this.onClickDelete, this);\r\n    }\r\n\r\n    private onClickList(evt: egret.TouchEvent) {\r\n        //点击列表时，查找是否有项目处于编辑状态， 如果有就归位\r\n        let touchTarget: fgui.GObject = //fgui.ToolSet.displayObjectToGObject(evt.target);\r\n        fgui.GRoot.inst.getObjectUnderPoint(evt.stageX, evt.stageY);\r\n        let cnt = this._list.numChildren;\r\n        for (let i: number = 0; i < cnt; i++) {\r\n            let item: fgui.GButton = this._list.getChildAt(i).asButton;\r\n            if (item.scrollPane.posX != 0) {\r\n                //Check if clicked on the button\r\n                if (item.getChild(\"b0\").asButton.isAncestorOf(touchTarget)\r\n                    || item.getChild(\"b1\").asButton.isAncestorOf(touchTarget)) {\r\n                    return;\r\n                }\r\n                item.scrollPane.setPosX(0, true);\r\n\r\n                //取消滚动面板可能发生的拉动。\r\n                item.scrollPane.cancelDragging();\r\n                this._list.scrollPane.cancelDragging();\r\n                break;\r\n            }\r\n        }\r\n    }\r\n\r\n    private onClickStick(evt: egret.Event) {\r\n        this._view.getChild(\"txt\").text = \"Stick \" + evt.currentTarget.parent.text;\r\n    }\r\n\r\n    private onClickDelete(evt: egret.Event) {\r\n        this._view.getChild(\"txt\").text = \"Delete \" + evt.currentTarget.parent.text;\r\n    }\r\n}\r\n"
  },
  {
    "path": "demo/src/demo/ScrollPaneHeader.ts",
    "content": "\r\nclass ScrollPaneHeader extends fgui.GComponent {\r\n\r\n    private _c1: fgui.Controller;\r\n\r\n    public constructor() {\r\n        super();\r\n    }\r\n\r\n    protected onConstruct(): void {\r\n        this._c1 = this.getController(\"c1\");\r\n        this.addEventListener(fgui.GObject.SIZE_CHANGED, this.onSizeChanged, this);\r\n    }\r\n\r\n    private onSizeChanged(): void {\r\n        if (this._c1.selectedIndex == 2 || this._c1.selectedIndex == 3)\r\n            return;\r\n\r\n        if (this.height > this.sourceHeight)\r\n            this._c1.selectedIndex = 1;\r\n        else\r\n            this._c1.selectedIndex = 0;\r\n    }\r\n\r\n    public get readyToRefresh(): boolean {\r\n        return this._c1.selectedIndex == 1;\r\n    }\r\n\r\n    public setRefreshStatus(value: number): void {\r\n        this._c1.selectedIndex = value;\r\n    }\r\n}\r\n"
  },
  {
    "path": "demo/src/demo/TestWin.ts",
    "content": "class TestWin extends fgui.Window {\n\n    public constructor() {\n        super();\n    }\n\n    protected onInit(): void {\n        this.contentPane = fgui.UIPackage.createObject(\"ModalWaiting\", \"TestWin\").asCom;\n        this.contentPane.getChild(\"n1\").addClickListener(this.onClickStart, this);\n        this.center();\n    }\n\n    private onClickStart(): void {\n        //这里模拟一个要锁住当前窗口的过程，在锁定过程中，窗口仍然是可以移动和关闭的\n        this.showModalWait();\n        fgui.GTween.delayedCall(3).onComplete(function (): void { this.closeModalWait(); }, this);\n    }\n}\n\n\nclass WindowA extends fgui.Window {\n    public constructor() {\n        super();\n    }\n\n    protected onInit(): void {\n        this.contentPane = fgui.UIPackage.createObject(\"Basics\", \"WindowA\").asCom;\n        this.center();\n    }\n\n    protected onShown(): void {\n        var list: fgui.GList = this.contentPane.getChild(\"n6\").asList;\n        list.removeChildrenToPool();\n\n        for (var i: number = 0; i < 6; i++) {\n            var item: fgui.GButton = list.addItemFromPool().asButton;\n            item.title = \"\" + i;\n            item.icon = fgui.UIPackage.getItemURL(\"Basics\", \"r4\");\n        }\n    }\n}\n\nclass WindowB extends fgui.Window {\n    public constructor() {\n        super();\n    }\n\n    protected onInit(): void {\n        this.contentPane = fgui.UIPackage.createObject(\"Basics\", \"WindowB\").asCom;\n        this.center();\n\n        //弹出窗口的动效已中心为轴心\n        this.setPivot(0.5, 0.5);\n    }\n\n    protected doShowAnimation(): void {\n        this.setScale(0.1, 0.1);\n        fgui.GTween.to2(0.1, 0.1, 1, 1, 0.3)\n            .setTarget(this, this.setScale)\n            .setEase(fgui.EaseType.QuadOut)\n            .onComplete(this.onShown, this);\n    }\n\n    protected doHideAnimation(): void {\n        fgui.GTween.to2(1, 1, 0.1, 0.1, 0.3)\n            .setTarget(this, this.setScale)\n            .setEase(fgui.EaseType.QuadOut)\n            .onComplete(this.hideImmediately, this);\n    }\n\n    protected onShown(): void {\n        this.contentPane.getTransition(\"t1\").play();\n    }\n\n    protected onHide(): void {\n        this.contentPane.getTransition(\"t1\").stop();\n    }\n}\n"
  },
  {
    "path": "demo/src/demo/TransitionDemo.ts",
    "content": "class TransitionDemo {\r\n    private _view: fgui.GComponent;\r\n\r\n    private _btnGroup: fgui.GGroup;\r\n    private _g1: fgui.GComponent;\r\n    private _g2: fgui.GComponent;\r\n    private _g3: fgui.GComponent;\r\n    private _g4: fgui.GComponent;\r\n    private _g5: fgui.GComponent;\r\n    private _g6: fgui.GComponent;\r\n\r\n    private _startValue: number;\r\n    private _endValue: number;\r\n\r\n    public async start() {\r\n        await fgui.UIPackage.loadPackage(\"Transition\");\r\n\r\n        this._view = fgui.UIPackage.createObject(\"Transition\", \"Main\").asCom;\r\n        this._view.makeFullScreen();\r\n        fgui.GRoot.inst.addChild(this._view);\r\n\r\n        this._btnGroup = this._view.getChild(\"g0\").asGroup;\r\n\r\n        this._g1 = fgui.UIPackage.createObject(\"Transition\", \"BOSS\").asCom;\r\n        this._g2 = fgui.UIPackage.createObject(\"Transition\", \"BOSS_SKILL\").asCom;\r\n        this._g3 = fgui.UIPackage.createObject(\"Transition\", \"TRAP\").asCom;\r\n        this._g4 = fgui.UIPackage.createObject(\"Transition\", \"GoodHit\").asCom;\r\n        this._g5 = fgui.UIPackage.createObject(\"Transition\", \"PowerUp\").asCom;\r\n        this._g6 = fgui.UIPackage.createObject(\"Transition\", \"PathDemo\").asCom;\r\n\r\n        //play_num_now是在编辑器里设定的名称，这里表示播放到'play_num_now'这个位置时才开始播放数字变化效果\r\n        this._g5.getTransition(\"t0\").setHook(\"play_num_now\", this.__playNum, this);\r\n\r\n        this._view.getChild(\"btn0\").addClickListener(function (): void { this.__play(this._g1); }, this);\r\n        this._view.getChild(\"btn1\").addClickListener(function (): void { this.__play(this._g2); }, this);\r\n        this._view.getChild(\"btn2\").addClickListener(function (): void { this.__play(this._g3); }, this);\r\n        this._view.getChild(\"btn3\").addClickListener(this.__play4, this);\r\n        this._view.getChild(\"btn4\").addClickListener(this.__play5, this);\r\n        this._view.getChild(\"btn5\").addClickListener(function (): void { this.__play(this._g6); }, this);\r\n    }\r\n\r\n    private __play(target: fgui.GComponent): void {\r\n        this._btnGroup.visible = false;\r\n        fgui.GRoot.inst.addChild(target);\r\n        var t: fgui.Transition = target.getTransition(\"t0\");\r\n        t.play(() => {\r\n            this._btnGroup.visible = true;\r\n            fgui.GRoot.inst.removeChild(target);\r\n        }, this);\r\n    }\r\n\r\n    private __play4(): void {\r\n        this._btnGroup.visible = false;\r\n        this._g4.x = fgui.GRoot.inst.width - this._g4.width - 20;\r\n        this._g4.y = 100;\r\n        fgui.GRoot.inst.addChild(this._g4);\r\n        var t: fgui.Transition = this._g4.getTransition(\"t0\");\r\n        //播放3次\r\n        t.play(() => {\r\n            this._btnGroup.visible = true;\r\n            fgui.GRoot.inst.removeChild(this._g4);\r\n        }, this, null, 3);\r\n    }\r\n\r\n    private __play5(): void {\r\n        this._btnGroup.visible = false;\r\n        this._g5.x = 20;\r\n        this._g5.y = fgui.GRoot.inst.height - this._g5.height - 100;\r\n        fgui.GRoot.inst.addChild(this._g5);\r\n        var t: fgui.Transition = this._g5.getTransition(\"t0\");\r\n        this._startValue = 10000;\r\n        var add: number = Math.ceil(Math.random() * 2000 + 1000);\r\n        this._endValue = this._startValue + add;\r\n        this._g5.getChild(\"value\").text = \"\" + this._startValue;\r\n        this._g5.getChild(\"add_value\").text = \"+\" + add;\r\n        t.play(() => {\r\n            this._btnGroup.visible = true;\r\n            fgui.GRoot.inst.removeChild(this._g5);\r\n        }, this);\r\n    }\r\n\r\n    private __playNum(): void {\r\n        //这里演示了一个数字变化的过程\r\n        fgui.GTween.to(this._startValue, this._endValue, 0.3)\r\n            .setEase(fgui.EaseType.Linear)\r\n            .onUpdate(function (tweener): void {\r\n                this._g5.getChild(\"value\").text = \"\" + Math.floor(tweener.value.x);\r\n            }, this);\r\n    }\r\n}\r\n\r\n"
  },
  {
    "path": "demo/src/demo/TreeViewDemo.ts",
    "content": "class TreeViewDemo {\r\n    private _view: fgui.GComponent;\r\n    private _tree1: fgui.GTree;\r\n    private _tree2: fgui.GTree;\r\n    private _fileURL: string;\r\n\r\n    public async start() {\r\n        await fgui.UIPackage.loadPackage(\"TreeView\");\r\n\r\n        this._view = fgui.UIPackage.createObject(\"TreeView\", \"Main\").asCom;\r\n        this._view.makeFullScreen();\r\n        fgui.GRoot.inst.addChild(this._view);\r\n\r\n        this._fileURL = \"ui://TreeView/file\";\r\n\r\n        this._tree1 = this._view.getChild(\"tree\").asTree;\r\n        this._tree1.addEventListener(fgui.ItemEvent.CLICK, this.__clickNode, this);\r\n        this._tree2 = this._view.getChild(\"tree2\").asTree;\r\n        this._tree2.addEventListener(fgui.ItemEvent.CLICK, this.__clickNode, this);\r\n        this._tree2.treeNodeRender = this.renderTreeNode;\r\n        this._tree2.callbackThisObj = this;\r\n\r\n        var topNode: fgui.GTreeNode = new fgui.GTreeNode(true);\r\n        topNode.data = \"I'm a top node\";\r\n        this._tree2.rootNode.addChild(topNode);\r\n        for (var i: number = 0; i < 5; i++) {\r\n            var node: fgui.GTreeNode = new fgui.GTreeNode(false);\r\n            node.data = \"Hello \" + i;\r\n            topNode.addChild(node);\r\n        }\r\n\r\n        var aFolderNode: fgui.GTreeNode = new fgui.GTreeNode(true);\r\n        aFolderNode.data = \"A folder node\";\r\n        topNode.addChild(aFolderNode);\r\n        for (var i: number = 0; i < 5; i++) {\r\n            var node: fgui.GTreeNode = new fgui.GTreeNode(false);\r\n            node.data = \"Good \" + i;\r\n            aFolderNode.addChild(node);\r\n        }\r\n\r\n        for (var i: number = 0; i < 3; i++) {\r\n            var node: fgui.GTreeNode = new fgui.GTreeNode(false);\r\n            node.data = \"World \" + i;\r\n            topNode.addChild(node);\r\n        }\r\n\r\n        var anotherTopNode: fgui.GTreeNode = new fgui.GTreeNode(false);\r\n        anotherTopNode.data = [\"I'm a top node too\", \"ui://TreeView/heart\"];\r\n        this._tree2.rootNode.addChild(anotherTopNode);\r\n    }\r\n\r\n    private renderTreeNode(node: fgui.GTreeNode, obj: fgui.GComponent) {\r\n        if (node.isFolder) {\r\n            obj.text = node.data;\r\n        }\r\n        else if (node.data instanceof Array) {\r\n            obj.icon = (<any>node.data)[1];\r\n            obj.text = (<any>node.data)[0];\r\n        }\r\n        else {\r\n            obj.icon = this._fileURL;\r\n            obj.text = node.data;\r\n        }\r\n    }\r\n\r\n    private __clickNode(evt: fgui.ItemEvent) {\r\n        var node: fgui.GTreeNode = evt.itemObject.treeNode;\r\n        console.log(node.text);\r\n    }\r\n}\r\n"
  },
  {
    "path": "demo/src/demo/VirtualListDemo.ts",
    "content": "\nclass VirtualListDemo {\n    private _view: fgui.GComponent;\n    private _list: fgui.GList;\n\n    public async start() {\n        await fgui.UIPackage.loadPackage(\"VirtualList\");\n\n        fgui.UIObjectFactory.setExtension(\"ui://VirtualList/mailItem\", MailItem);\n\n        this._view = fgui.UIPackage.createObject(\"VirtualList\", \"Main\").asCom;\n        this._view.makeFullScreen();\n        fgui.GRoot.inst.addChild(this._view);\n\n        this._view.getChild(\"n6\").addClickListener(function (): void { this._list.addSelection(500, true); }, this);\n        this._view.getChild(\"n7\").addClickListener(function (): void { this._list.scrollPane.scrollTop(); }, this);\n        this._view.getChild(\"n8\").addClickListener(function (): void { this._list.scrollPane.scrollBottom(); }, this);\n\n        this._list = this._view.getChild(\"mailList\").asList;\n        this._list.setVirtual();\n\n        this._list.itemRenderer = this.renderListItem;\n        this._list.callbackThisObj = this;\n        this._list.numItems = 1000;\n    }\n\n    private renderListItem(index: number, obj: fgui.GObject): void {\n        var item: MailItem = <MailItem>obj;\n        item.setFetched(index % 3 == 0);\n        item.setRead(index % 2 == 0);\n        item.setTime(\"5 Nov 2015 16:24:33\");\n        item.title = index + \" Mail title here\";\n    }\n}\n\n"
  },
  {
    "path": "demo/template/runtime/native_loader.js",
    "content": "require(\"launcher/native_require.js\");\n\negret_native.egtMain = function () {\n    egret_native.nativeType = \"native\";\n\n    egret_native.egretInit();\n    egret_native.egretStart();\n};\n"
  },
  {
    "path": "demo/template/runtime/native_require.js",
    "content": "var manifest = JSON.parse(egret_native.readFileSync(\"manifest.json\"));\nvar game_file_list = manifest.initial.concat(manifest.game);\n\nvar window = this;\n\negret_native.setSearchPaths([\"\"]);\n\negret_native.requireFiles = function () {\n    for (var key in game_file_list) {\n        var src = game_file_list[key];\n        require(src);\n    }\n};\n\negret_native.egretInit = function () {\n    if(egret_native.featureEnable) {\n        //控制一些优化方案是否开启\n        //Control whether some optimization options are open\n        var result = egret_native.featureEnable({\n            \n        });\n    }\n    egret_native.requireFiles();\n    egret.dom = {};\n    egret.dom.drawAsCanvas = function () {\n    };\n};\n\negret_native.egretStart = function () {\n    var option = {\n        //以下为自动修改，请勿修改\n        //The following is automatically modified, please do not modify\n        //----auto option start----\n\t\tentryClassName: \"Main\",\n\t\tframeRate: 30,\n\t\tscaleMode: \"fixedNarrow\",\n\t\tcontentWidth: 1136,\n\t\tcontentHeight: 640,\n\t\tshowPaintRect: false,\n\t\tshowFPS: false,\n\t\tfpsStyles: \"x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9\",\n\t\tshowLog: false,\n\t\tlogFilter: \"\",\n\t\tmaxTouches: 2,\n\t\ttextureScaleFactor: 1\n\t\t//----auto option end----\n    };\n\n    egret.native.NativePlayer.option = option;\n    egret.runEgret();\n    egret_native.Label.createLabel(\"/system/fonts/DroidSansFallback.ttf\", 20, \"\", 0);\n    egret_native.EGTView.preSetOffScreenBufferEnable(true);\n};"
  },
  {
    "path": "demo/template/runtime/runtime_loader.js",
    "content": "require(\"launcher/native_require.js\");\n\negret_native.egtMain = function () {\n    egret_native.nativeType = \"runtime\";\n\n    egret_native.egretInit();\n    egret_native.egretStart();\n};"
  },
  {
    "path": "demo/template/web/index.html",
    "content": "<!DOCTYPE HTML>\n<html>\n\n<head>\n    <meta charset=\"utf-8\">\n    <title>Egret</title>\n    <meta name=\"viewport\" content=\"width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no\" />\n    <meta name=\"apple-mobile-web-app-capable\" content=\"yes\" />\n    <meta name=\"full-screen\" content=\"true\" />\n    <meta name=\"screen-orientation\" content=\"portrait\" />\n    <meta name=\"x5-fullscreen\" content=\"true\" />\n    <meta name=\"360-fullscreen\" content=\"true\" />\n    <style>\n        html, body {\n            -ms-touch-action: none;\n            background: #888888;\n            padding: 0;\n            border: 0;\n            margin: 0;\n            height: 100%;\n        }\n    </style>\n</head>\n\n<body>\n    <div style=\"margin: auto;width: 100%;height: 100%;\" class=\"egret-player\"\n         data-entry-class=\"Main\"\n         data-orientation=\"landscape\"\n         data-scale-mode=\"fixedNarrow\"\n         data-frame-rate=\"30\"\n         data-content-width=\"640\"\n         data-content-height=\"1136\"\n         data-show-paint-rect=\"false\"\n         data-multi-fingered=\"2\"\n         data-show-fps=\"false\" data-show-log=\"false\"\n         data-show-fps-style=\"x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9\">\n    </div>\n<script>\n    var loadScript = function (list, callback) {\n        var loaded = 0;\n        var loadNext = function () {\n            loadSingleScript(list[loaded], function () {\n                loaded++;\n                if (loaded >= list.length) {\n                    callback();\n                }\n                else {\n                    loadNext();\n                }\n            })\n        };\n        loadNext();\n    };\n\n    var loadSingleScript = function (src, callback) {\n        var s = document.createElement('script');\n        s.async = false;\n        s.src = src;\n        s.addEventListener('load', function () {\n            s.parentNode.removeChild(s);\n            s.removeEventListener('load', arguments.callee, false);\n            callback();\n        }, false);\n        document.body.appendChild(s);\n    };\n\n    var xhr = new XMLHttpRequest();\n    xhr.open('GET', './manifest.json?v=' + Math.random(), true);\n    xhr.addEventListener(\"load\", function () {\n        var manifest = JSON.parse(xhr.response);\n        var list = manifest.initial.concat(manifest.game);\n        loadScript(list, function () {\n            /**\n             * {\n             * \"renderMode\":, //Engine rendering mode, \"canvas\" or \"webgl\"\n             * \"audioType\": 0 //Use the audio type, 0: default, 2: web audio, 3: audio\n             * \"antialias\": //Whether the anti-aliasing is enabled in WebGL mode, true: on, false: off, defaults to false\n             * \"calculateCanvasScaleFactor\": //a function return canvas scale factor\n             * }\n             **/\n            egret.runEgret({ renderMode: \"webgl\", audioType: 0, calculateCanvasScaleFactor:function(context) {\n                var backingStore = context.backingStorePixelRatio ||\n                    context.webkitBackingStorePixelRatio ||\n                    context.mozBackingStorePixelRatio ||\n                    context.msBackingStorePixelRatio ||\n                    context.oBackingStorePixelRatio ||\n                    context.backingStorePixelRatio || 1;\n                return (window.devicePixelRatio || 1) / backingStore;\n            }});\n        });\n    });\n    xhr.send(null);\n</script>\n</body>\n\n</html>"
  },
  {
    "path": "demo/tsconfig.json",
    "content": "{\n    \"compilerOptions\": {\n        \"target\": \"es5\",\n        \"outDir\": \"bin-debug\",\n        \"experimentalDecorators\": true,\n        \"lib\": [\n            \"es5\",\n            \"dom\",\n            \"es2015.promise\"\n        ],\n        \"types\": []\n    },\n    \"include\": [\n        \"src\",\n        \"libs\"\n    ]\n}"
  },
  {
    "path": "demo/wingProperties.json",
    "content": "{\n\t\"resourcePlugin\":{\n\t\t\"configs\":[{\n\t\t\t\"configPath\":\"resource/default.res.json\",\n\t\t\t\"relativePath\":\"resource/\"\n\t\t}]\n\t},\n\t\"theme\":\"resource/default.thm.json\"\n}"
  },
  {
    "path": "source/.vscode/tasks.json",
    "content": "{\n    // See https://go.microsoft.com/fwlink/?LinkId=733558 \n    // for the documentation about the tasks.json format\n    \"version\": \"2.0.0\",\n    \"tasks\": [\n        {\n            \"type\": \"gulp\",\n            \"task\": \"build\",\n            \"group\": \"build\",\n            \"problemMatcher\": []\n        }\n    ]\n}"
  },
  {
    "path": "source/bin/fairygui.d.ts",
    "content": "declare module fgui {\n    class AsyncOperation {\n        callback: (obj: GObject) => void;\n        callbackObj: any;\n        private _itemList;\n        private _objectPool;\n        private _index;\n        constructor();\n        createObject(pkgName: string, resName: string): void;\n        createObjectFromURL(url: string): void;\n        cancel(): void;\n        private internalCreateObject;\n        private collectComponentChildren;\n        private collectListChildren;\n        private run;\n    }\n}\ndeclare module fgui {\n    class Controller extends egret.EventDispatcher {\n        private _selectedIndex;\n        private _previousIndex;\n        private _pageIds;\n        private _pageNames;\n        private _actions?;\n        name: string;\n        parent: GComponent;\n        autoRadioGroupDepth?: boolean;\n        changing: boolean;\n        constructor();\n        dispose(): void;\n        selectedIndex: number;\n        setSelectedIndex(value: number): void;\n        readonly previsousIndex: number;\n        selectedPage: string;\n        setSelectedPage(value: string): void;\n        readonly previousPage: string;\n        readonly pageCount: number;\n        getPageName(index: number): string;\n        addPage(name?: string): void;\n        addPageAt(name: string, index: number): void;\n        removePage(name: string): void;\n        removePageAt(index?: number): void;\n        clearPages(): void;\n        hasPage(aName: string): boolean;\n        getPageIndexById(aId: string): number;\n        getPageIdByName(aName: string): string;\n        getPageNameById(aId: string): string;\n        getPageId(index?: number): string;\n        selectedPageId: string;\n        oppositePageId: string;\n        readonly previousPageId: string;\n        runActions(): void;\n        setup(buffer: ByteBuffer): void;\n    }\n}\ndeclare module fgui {\n    class DragDropManager {\n        private _agent;\n        private _sourceData;\n        private static _inst;\n        static readonly inst: DragDropManager;\n        constructor();\n        readonly dragAgent: GObject;\n        readonly dragging: boolean;\n        startDrag(source: GObject, icon: string, sourceData?: any, touchPointID?: number): void;\n        cancel(): void;\n        private __dragEnd;\n    }\n}\ndeclare module fgui {\n    enum ButtonMode {\n        Common = 0,\n        Check = 1,\n        Radio = 2\n    }\n    enum AutoSizeType {\n        None = 0,\n        Both = 1,\n        Height = 2\n    }\n    enum AlignType {\n        Left = 0,\n        Center = 1,\n        Right = 2\n    }\n    enum VertAlignType {\n        Top = 0,\n        Middle = 1,\n        Bottom = 2\n    }\n    enum LoaderFillType {\n        None = 0,\n        Scale = 1,\n        ScaleMatchHeight = 2,\n        ScaleMatchWidth = 3,\n        ScaleFree = 4,\n        ScaleNoBorder = 5\n    }\n    enum ListLayoutType {\n        SingleColumn = 0,\n        SingleRow = 1,\n        FlowHorizontal = 2,\n        FlowVertical = 3,\n        Pagination = 4\n    }\n    enum ListSelectionMode {\n        Single = 0,\n        Multiple = 1,\n        Multiple_SingleClick = 2,\n        None = 3\n    }\n    enum OverflowType {\n        Visible = 0,\n        Hidden = 1,\n        Scroll = 2\n    }\n    enum PackageItemType {\n        Image = 0,\n        MovieClip = 1,\n        Sound = 2,\n        Component = 3,\n        Atlas = 4,\n        Font = 5,\n        Swf = 6,\n        Misc = 7,\n        Unknown = 8,\n        Spine = 9,\n        DragonBones = 10\n    }\n    enum ObjectType {\n        Image = 0,\n        MovieClip = 1,\n        Swf = 2,\n        Graph = 3,\n        Loader = 4,\n        Group = 5,\n        Text = 6,\n        RichText = 7,\n        InputText = 8,\n        Component = 9,\n        List = 10,\n        Label = 11,\n        Button = 12,\n        ComboBox = 13,\n        ProgressBar = 14,\n        Slider = 15,\n        ScrollBar = 16,\n        Tree = 17,\n        Loader3D = 18\n    }\n    enum ProgressTitleType {\n        Percent = 0,\n        ValueAndMax = 1,\n        Value = 2,\n        Max = 3\n    }\n    enum ScrollBarDisplayType {\n        Default = 0,\n        Visible = 1,\n        Auto = 2,\n        Hidden = 3\n    }\n    enum ScrollType {\n        Horizontal = 0,\n        Vertical = 1,\n        Both = 2\n    }\n    enum FlipType {\n        None = 0,\n        Horizontal = 1,\n        Vertical = 2,\n        Both = 3\n    }\n    enum ChildrenRenderOrder {\n        Ascent = 0,\n        Descent = 1,\n        Arch = 2\n    }\n    enum GroupLayoutType {\n        None = 0,\n        Horizontal = 1,\n        Vertical = 2\n    }\n    enum PopupDirection {\n        Auto = 0,\n        Up = 1,\n        Down = 2\n    }\n    enum RelationType {\n        Left_Left = 0,\n        Left_Center = 1,\n        Left_Right = 2,\n        Center_Center = 3,\n        Right_Left = 4,\n        Right_Center = 5,\n        Right_Right = 6,\n        Top_Top = 7,\n        Top_Middle = 8,\n        Top_Bottom = 9,\n        Middle_Middle = 10,\n        Bottom_Top = 11,\n        Bottom_Middle = 12,\n        Bottom_Bottom = 13,\n        Width = 14,\n        Height = 15,\n        LeftExt_Left = 16,\n        LeftExt_Right = 17,\n        RightExt_Left = 18,\n        RightExt_Right = 19,\n        TopExt_Top = 20,\n        TopExt_Bottom = 21,\n        BottomExt_Top = 22,\n        BottomExt_Bottom = 23,\n        Size = 24\n    }\n    enum FillMethod {\n        None = 0,\n        Horizontal = 1,\n        Vertical = 2,\n        Radial90 = 3,\n        Radial180 = 4,\n        Radial360 = 5\n    }\n    enum FillOrigin {\n        Top = 0,\n        Bottom = 1,\n        Left = 2,\n        Right = 3,\n        TopLeft = 0,\n        TopRight = 1,\n        BottomLeft = 2,\n        BottomRight = 3\n    }\n    enum FillOrigin90 {\n        TopLeft = 0,\n        TopRight = 1,\n        BottomLeft = 2,\n        BottomRight = 3\n    }\n    enum ObjectPropID {\n        Text = 0,\n        Icon = 1,\n        Color = 2,\n        OutlineColor = 3,\n        Playing = 4,\n        Frame = 5,\n        DeltaTime = 6,\n        TimeScale = 7,\n        FontSize = 8,\n        Selected = 9\n    }\n}\ndeclare module fgui {\n    class GObject extends egret.EventDispatcher {\n        data: any;\n        packageItem: PackageItem;\n        static draggingObject: GObject;\n        private _x;\n        private _y;\n        private _alpha;\n        private _rotation;\n        private _visible;\n        private _touchable;\n        private _grayed;\n        private _draggable;\n        private _scaleX;\n        private _scaleY;\n        private _skewX;\n        private _skewY;\n        private _pivotX;\n        private _pivotY;\n        private _pivotAsAnchor;\n        private _pivotOffsetX;\n        private _pivotOffsetY;\n        private _sortingOrder;\n        private _internalVisible;\n        private _handlingController?;\n        private _tooltips?;\n        private _pixelSnapping?;\n        private _disposed?;\n        private _dragTesting?;\n        private _dragStartPos?;\n        private _relations;\n        private _group?;\n        private _gears;\n        private _displayObject;\n        private _dragBounds?;\n        sourceWidth: number;\n        sourceHeight: number;\n        initWidth: number;\n        initHeight: number;\n        minWidth: number;\n        minHeight: number;\n        maxWidth: number;\n        maxHeight: number;\n        _parent: GComponent;\n        _width: number;\n        _height: number;\n        _rawWidth: number;\n        _rawHeight: number;\n        _id: string;\n        _name: string;\n        _underConstruct: boolean;\n        _gearLocked?: boolean;\n        _sizePercentInGroup: number;\n        _treeNode?: GTreeNode;\n        static XY_CHANGED: string;\n        static SIZE_CHANGED: string;\n        static SIZE_DELAY_CHANGE: string;\n        static GEAR_STOP: string;\n        constructor();\n        readonly id: string;\n        name: string;\n        x: number;\n        y: number;\n        setXY(xv: number, yv: number): void;\n        xMin: number;\n        yMin: number;\n        pixelSnapping: boolean;\n        center(restraint?: boolean): void;\n        width: number;\n        height: number;\n        setSize(wv: number, hv: number, ignorePivot?: boolean): void;\n        makeFullScreen(): void;\n        ensureSizeCorrect(): void;\n        readonly actualWidth: number;\n        readonly actualHeight: number;\n        scaleX: number;\n        scaleY: number;\n        setScale(sx: number, sy: number): void;\n        skewX: number;\n        skewY: number;\n        setSkew(xv: number, yv: number): void;\n        pivotX: number;\n        pivotY: number;\n        setPivot(xv: number, yv: number, asAnchor?: boolean): void;\n        readonly pivotAsAnchor: boolean;\n        protected internalSetPivot(xv: number, yv: number, asAnchor: boolean): void;\n        private updatePivotOffset;\n        private applyPivot;\n        touchable: boolean;\n        grayed: boolean;\n        enabled: boolean;\n        rotation: number;\n        readonly normalizeRotation: number;\n        alpha: number;\n        visible: boolean;\n        readonly internalVisible: boolean;\n        readonly internalVisible2: boolean;\n        readonly internalVisible3: boolean;\n        sortingOrder: number;\n        readonly focused: boolean;\n        requestFocus(): void;\n        tooltips: string;\n        blendMode: string;\n        filters: egret.Filter[];\n        readonly inContainer: boolean;\n        readonly onStage: boolean;\n        readonly resourceURL: string;\n        group: GGroup;\n        getGear(index: number): GearBase;\n        protected updateGear(index: number): void;\n        checkGearController(index: number, c: Controller): boolean;\n        updateGearFromRelations(index: number, dx: number, dy: number): void;\n        addDisplayLock(): number;\n        releaseDisplayLock(token: number): void;\n        private checkGearDisplay;\n        readonly gearXY: GearXY;\n        readonly gearSize: GearSize;\n        readonly gearLook: GearLook;\n        readonly relations: Relations;\n        addRelation(target: GObject, relationType: number, usePercent?: boolean): void;\n        removeRelation(target: GObject, relationType?: number): void;\n        readonly displayObject: egret.DisplayObject;\n        protected setDisplayObject(value: egret.DisplayObject): void;\n        parent: GComponent;\n        removeFromParent(): void;\n        readonly root: GRoot;\n        readonly asCom: GComponent;\n        readonly asButton: GButton;\n        readonly asLabel: GLabel;\n        readonly asProgress: GProgressBar;\n        readonly asTextField: GTextField;\n        readonly asRichTextField: GRichTextField;\n        readonly asTextInput: GTextInput;\n        readonly asLoader: GLoader;\n        readonly asList: GList;\n        readonly asTree: GTree;\n        readonly asGraph: GGraph;\n        readonly asGroup: GGroup;\n        readonly asSlider: GSlider;\n        readonly asComboBox: GComboBox;\n        readonly asImage: GImage;\n        readonly asMovieClip: GMovieClip;\n        static cast(obj: egret.DisplayObject): GObject;\n        text: string;\n        icon: string;\n        readonly isDisposed: boolean;\n        readonly treeNode: GTreeNode;\n        dispose(): void;\n        addClickListener(listener: Function, thisObj?: any): void;\n        removeClickListener(listener: Function, thisObj?: any): void;\n        hasClickListener(): boolean;\n        addEventListener(type: string, listener: Function, thisObject?: any): void;\n        removeEventListener(type: string, listener: Function, thisObject?: any): void;\n        private _reDispatch;\n        draggable: boolean;\n        dragBounds: egret.Rectangle;\n        startDrag(touchPointID?: number, stageX?: number, stageY?: number): void;\n        stopDrag(): void;\n        readonly dragging: boolean;\n        localToGlobal(ax?: number, ay?: number, result?: egret.Point): egret.Point;\n        globalToLocal(ax?: number, ay?: number, result?: egret.Point): egret.Point;\n        localToRoot(ax?: number, ay?: number, result?: egret.Point): egret.Point;\n        rootToLocal(ax?: number, ay?: number, resultPoint?: egret.Point): egret.Point;\n        localToGlobalRect(ax?: number, ay?: number, aw?: number, ah?: number, result?: egret.Rectangle): egret.Rectangle;\n        globalToLocalRect(ax?: number, ay?: number, aw?: number, ah?: number, result?: egret.Rectangle): egret.Rectangle;\n        handleControllerChanged(c: Controller): void;\n        protected createDisplayObject(): void;\n        protected switchDisplayObject(newObj: egret.DisplayObject): void;\n        protected handleXYChanged(): void;\n        protected handleSizeChanged(): void;\n        protected handleScaleChanged(): void;\n        protected handleGrayedChanged(): void;\n        protected handleAlphaChanged(): void;\n        handleVisibleChanged(): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        constructFromResource(): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n        private initDrag;\n        private dragBegin;\n        private dragEnd;\n        private reset;\n        private __begin;\n        private __moving;\n        private __end;\n    }\n}\ndeclare module fgui {\n    class GComponent extends GObject {\n        private _sortingChildCount;\n        private _applyingController?;\n        protected _margin: Margin;\n        protected _trackBounds: boolean;\n        protected _boundsChanged: boolean;\n        protected _childrenRenderOrder: ChildrenRenderOrder;\n        protected _apexIndex: number;\n        _buildingDisplayList: boolean;\n        _children: Array<GObject>;\n        _controllers: Array<Controller>;\n        _transitions: Array<Transition>;\n        _rootContainer: UIContainer;\n        _container: egret.DisplayObjectContainer;\n        _scrollPane?: ScrollPane;\n        _alignOffset: egret.Point;\n        constructor();\n        protected createDisplayObject(): void;\n        dispose(): void;\n        readonly displayListContainer: egret.DisplayObjectContainer;\n        addChild(child: GObject): GObject;\n        addChildAt(child: GObject, index?: number): GObject;\n        private getInsertPosForSortingChild;\n        removeChild(child: GObject, dispose?: boolean): GObject;\n        removeChildAt(index: number, dispose?: boolean): GObject;\n        removeChildren(beginIndex?: number, endIndex?: number, dispose?: boolean): void;\n        getChildAt(index: number): GObject;\n        getChild(name: string): GObject;\n        getChildByPath(path: String): GObject;\n        getVisibleChild(name: string): GObject;\n        getChildInGroup(name: string, group: GGroup): GObject;\n        getChildById(id: string): GObject;\n        getChildIndex(child: GObject): number;\n        setChildIndex(child: GObject, index: number): void;\n        setChildIndexBefore(child: GObject, index: number): number;\n        private _setChildIndex;\n        swapChildren(child1: GObject, child2: GObject): void;\n        swapChildrenAt(index1: number, index2: number): void;\n        readonly numChildren: number;\n        isAncestorOf(child: GObject): boolean;\n        addController(controller: Controller): void;\n        getControllerAt(index: number): Controller;\n        getController(name: string): Controller;\n        removeController(c: Controller): void;\n        readonly controllers: Array<Controller>;\n        childStateChanged(child: GObject): void;\n        private buildNativeDisplayList;\n        applyController(c: Controller): void;\n        applyAllControllers(): void;\n        adjustRadioGroupDepth(obj: GObject, c: Controller): void;\n        getTransitionAt(index: number): Transition;\n        getTransition(transName: string): Transition;\n        isChildInView(child: GObject): boolean;\n        getFirstChildInView(): number;\n        readonly scrollPane: ScrollPane;\n        opaque: boolean;\n        margin: Margin;\n        childrenRenderOrder: ChildrenRenderOrder;\n        apexIndex: number;\n        mask: egret.DisplayObject | egret.Rectangle;\n        readonly baseUserData: string;\n        protected updateScrollRect(): void;\n        protected setupScroll(buffer: ByteBuffer): void;\n        protected setupOverflow(overflow: OverflowType): void;\n        protected handleSizeChanged(): void;\n        protected handleGrayedChanged(): void;\n        handleControllerChanged(c: Controller): void;\n        setBoundsChangedFlag(): void;\n        private __render;\n        ensureBoundsCorrect(): void;\n        protected updateBounds(): void;\n        setBounds(ax: number, ay: number, aw: number, ah?: number): void;\n        viewWidth: number;\n        viewHeight: number;\n        getSnappingPosition(xValue: number, yValue: number, resultPoint?: egret.Point): egret.Point;\n        childSortingOrderChanged(child: GObject, oldValue: number, newValue?: number): void;\n        constructFromResource(): void;\n        constructFromResource2(objectPool: Array<GObject>, poolIndex: number): void;\n        protected onConstruct(): void;\n        protected constructExtension(buffer: ByteBuffer): void;\n        protected constructFromXML(xml: any): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n        private ___added;\n        private ___removed;\n    }\n}\ndeclare module fgui {\n    class GButton extends GComponent {\n        protected _titleObject: GObject;\n        protected _iconObject: GObject;\n        private _mode;\n        private _selected;\n        private _title;\n        private _selectedTitle;\n        private _icon;\n        private _selectedIcon;\n        private _sound;\n        private _soundVolumeScale;\n        private _buttonController;\n        private _relatedController?;\n        private _relatedPageId;\n        private _changeStateOnClick;\n        private _linkedPopup?;\n        private _downEffect;\n        private _downEffectValue;\n        private _downScaled?;\n        private _down;\n        private _over;\n        static UP: string;\n        static DOWN: string;\n        static OVER: string;\n        static SELECTED_OVER: string;\n        static DISABLED: string;\n        static SELECTED_DISABLED: string;\n        constructor();\n        icon: string;\n        selectedIcon: string;\n        title: string;\n        text: string;\n        selectedTitle: string;\n        titleColor: number;\n        titleFontSize: number;\n        sound: string;\n        soundVolumeScale: number;\n        selected: boolean;\n        mode: ButtonMode;\n        relatedController: Controller;\n        relatedPageId: string;\n        changeStateOnClick: boolean;\n        linkedPopup: GObject;\n        getTextField(): GTextField;\n        addStateListener(listener: Function, thisObj: any): void;\n        removeStateListener(listener: Function, thisObj: any): void;\n        fireClick(downEffect?: boolean): void;\n        protected setState(val: string): void;\n        handleControllerChanged(c: Controller): void;\n        protected handleGrayedChanged(): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        protected constructExtension(buffer: ByteBuffer): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n        private __mousedown;\n        private __mouseup;\n        private __click;\n    }\n}\ndeclare module fgui {\n    class GComboBox extends GComponent {\n        dropdown: GComponent;\n        protected _titleObject: GObject;\n        protected _iconObject: GObject;\n        protected _list: GList;\n        private _items;\n        private _values;\n        private _icons?;\n        private _visibleItemCount;\n        private _itemsUpdated;\n        private _selectedIndex;\n        private _buttonController;\n        private _popupDirection;\n        private _selectionController?;\n        private _over;\n        private _down;\n        constructor();\n        text: string;\n        icon: string;\n        titleColor: number;\n        titleFontSize: number;\n        visibleItemCount: number;\n        popupDirection: PopupDirection;\n        items: Array<string>;\n        icons: Array<string>;\n        values: Array<string>;\n        selectedIndex: number;\n        value: string;\n        selectionController: Controller;\n        getTextField(): GTextField;\n        protected setState(val: string): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        protected constructExtension(buffer: ByteBuffer): void;\n        handleControllerChanged(c: Controller): void;\n        private updateSelectionController;\n        dispose(): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n        protected showDropdown(): void;\n        private __popupWinClosed;\n        private __clickItem;\n        private __clickItem2;\n        private __mousedown;\n        private __mouseup;\n    }\n}\ndeclare module fgui {\n    class GGraph extends GObject {\n        private _graphics;\n        private _type;\n        private _lineSize;\n        private _lineColor;\n        private _lineAlpha;\n        private _fillColor;\n        private _fillAlpha;\n        private _cornerRadius?;\n        private _sides?;\n        private _startAngle?;\n        private _polygonPoints?;\n        private _distances?;\n        constructor();\n        readonly graphics: egret.Graphics;\n        drawRect(lineSize: number, lineColor: number, lineAlpha: number, fillColor: number, fillAlpha: number, corner?: Array<number>): void;\n        drawEllipse(lineSize: number, lineColor: number, lineAlpha: number, fillColor: number, fillAlpha: number): void;\n        drawRegularPolygon(lineSize: number, lineColor: number, lineAlpha: number, fillColor: number, fillAlpha: number, sides: number, startAngle?: number, distances?: number[]): void;\n        drawPolygon(lineSize: number, lineColor: number, lineAlpha: number, fillColor: number, fillAlpha: number, points: number[]): void;\n        distances: number[];\n        clearGraphics(): void;\n        color: number;\n        private updateGraph;\n        replaceMe(target: GObject): void;\n        addBeforeMe(target: GObject): void;\n        addAfterMe(target: GObject): void;\n        setNativeObject(obj: egret.DisplayObject): void;\n        protected createDisplayObject(): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        protected handleSizeChanged(): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare namespace fgui {\n    class GGroup extends GObject {\n        private _layout;\n        private _lineGap;\n        private _columnGap;\n        private _excludeInvisibles?;\n        private _autoSizeDisabled?;\n        private _mainGridIndex;\n        private _mainGridMinSize;\n        private _boundsChanged;\n        private _percentReady;\n        private _mainChildIndex;\n        private _totalSize;\n        private _numChildren;\n        _updating: number;\n        constructor();\n        dispose(): void;\n        layout: number;\n        lineGap: number;\n        columnGap: number;\n        excludeInvisibles: boolean;\n        autoSizeDisabled: boolean;\n        mainGridMinSize: number;\n        mainGridIndex: number;\n        setBoundsChangedFlag(positionChangedOnly?: boolean): void;\n        ensureSizeCorrect(): void;\n        ensureBoundsCorrect(): void;\n        private updateBounds;\n        private handleLayout;\n        moveChildren(dx: number, dy: number): void;\n        resizeChildren(dw: number, dh: number): void;\n        handleAlphaChanged(): void;\n        handleVisibleChanged(): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare module fgui {\n    class GImage extends GObject {\n        private _content;\n        private _flip;\n        constructor();\n        color: number;\n        flip: FlipType;\n        fillMethod: number;\n        fillOrigin: number;\n        fillClockwise: boolean;\n        fillAmount: number;\n        texture: egret.Texture;\n        protected createDisplayObject(): void;\n        constructFromResource(): void;\n        protected handleXYChanged(): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare module fgui {\n    class GLabel extends GComponent {\n        protected _titleObject: GObject;\n        protected _iconObject: GObject;\n        constructor();\n        icon: string;\n        title: string;\n        text: string;\n        titleColor: number;\n        titleFontSize: number;\n        editable: boolean;\n        getTextField(): GTextField;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        protected constructExtension(buffer: ByteBuffer): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare module fgui {\n    class GList extends GComponent {\n        itemRenderer: (index: number, item: GObject) => void;\n        itemProvider: (index: number) => string;\n        callbackThisObj: any;\n        scrollItemToViewOnClick: boolean;\n        foldInvisibleItems: boolean;\n        private _layout;\n        private _lineCount;\n        private _columnCount;\n        private _lineGap;\n        private _columnGap;\n        private _defaultItem;\n        private _autoResizeItem;\n        private _selectionMode;\n        private _align;\n        private _verticalAlign;\n        private _selectionController?;\n        private _lastSelectedIndex;\n        private _pool;\n        private _virtual?;\n        private _loop?;\n        private _numItems;\n        private _realNumItems;\n        private _firstIndex;\n        private _curLineItemCount;\n        private _curLineItemCount2;\n        private _itemSize?;\n        private _virtualListChanged;\n        private _virtualItems?;\n        private _eventLocked?;\n        private itemInfoVer;\n        constructor();\n        dispose(): void;\n        layout: ListLayoutType;\n        lineCount: number;\n        columnCount: number;\n        lineGap: number;\n        columnGap: number;\n        align: AlignType;\n        verticalAlign: VertAlignType;\n        virtualItemSize: egret.Point;\n        defaultItem: string;\n        autoResizeItem: boolean;\n        selectionMode: ListSelectionMode;\n        selectionController: Controller;\n        readonly itemPool: GObjectPool;\n        getFromPool(url?: string): GObject;\n        returnToPool(obj: GObject): void;\n        addChildAt(child: GObject, index: number): GObject;\n        addItem(url?: string): GObject;\n        addItemFromPool(url?: string): GObject;\n        removeChildAt(index: number, dispose?: boolean): GObject;\n        removeChildToPoolAt(index: number): void;\n        removeChildToPool(child: GObject): void;\n        removeChildrenToPool(beginIndex?: number, endIndex?: number): void;\n        selectedIndex: number;\n        getSelection(result?: number[]): number[];\n        addSelection(index: number, scrollItToView?: boolean): void;\n        removeSelection(index: number): void;\n        clearSelection(): void;\n        private clearSelectionExcept;\n        selectAll(): void;\n        selectNone(): void;\n        selectReverse(): void;\n        handleArrowKey(dir: number): void;\n        private __clickItem;\n        protected dispatchItemEvent(evt: ItemEvent): void;\n        private setSelectionOnEvent;\n        resizeToFit(itemCount?: number, minSize?: number): void;\n        getMaxItemWidth(): number;\n        protected handleSizeChanged(): void;\n        handleControllerChanged(c: Controller): void;\n        private updateSelectionController;\n        getSnappingPosition(xValue: number, yValue: number, result?: egret.Point): egret.Point;\n        scrollToView(index: number, ani?: boolean, setFirst?: boolean): void;\n        getFirstChildInView(): number;\n        childIndexToItemIndex(index: number): number;\n        itemIndexToChildIndex(index: number): number;\n        setVirtual(): void;\n        setVirtualAndLoop(): void;\n        private _setVirtual;\n        numItems: number;\n        refreshVirtualList(): void;\n        private checkVirtualList;\n        private setVirtualListChangedFlag;\n        private _refreshVirtualList;\n        private __scrolled;\n        private getIndexOnPos1;\n        private getIndexOnPos2;\n        private getIndexOnPos3;\n        private handleScroll;\n        private handleScroll1;\n        private handleScroll2;\n        private handleScroll3;\n        private handleArchOrder1;\n        private handleArchOrder2;\n        private handleAlign;\n        protected updateBounds(): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n        protected readItems(buffer: ByteBuffer): void;\n        protected setupItem(buffer: ByteBuffer, obj: GObject): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare module fgui {\n    class GObjectPool {\n        private _pool;\n        private _count;\n        constructor();\n        clear(): void;\n        readonly count: number;\n        getObject(url: string): GObject;\n        returnObject(obj: GObject): void;\n    }\n}\ndeclare module fgui {\n    class GLoader extends GObject {\n        private _url;\n        private _align;\n        private _verticalAlign;\n        private _autoSize;\n        private _fill;\n        private _shrinkOnly;\n        private _showErrorSign;\n        private _contentItem;\n        private _container;\n        private _content;\n        private _errorSign?;\n        private _content2?;\n        private _updatingLayout;\n        private static _errorSignPool;\n        constructor();\n        protected createDisplayObject(): void;\n        dispose(): void;\n        url: string;\n        icon: string;\n        align: AlignType;\n        verticalAlign: VertAlignType;\n        fill: LoaderFillType;\n        shrinkOnly: boolean;\n        autoSize: boolean;\n        playing: boolean;\n        frame: number;\n        color: number;\n        showErrorSign: boolean;\n        readonly content: MovieClip;\n        readonly component: GComponent;\n        texture: egret.Texture;\n        fillMethod: number;\n        fillOrigin: number;\n        fillClockwise: boolean;\n        fillAmount: number;\n        protected loadContent(): void;\n        protected loadFromPackage(itemURL: string): void;\n        protected loadExternal(): void;\n        protected freeExternal(texture: egret.Texture): void;\n        protected onExternalLoadSuccess(texture: egret.Texture): void;\n        protected onExternalLoadFailed(): void;\n        private __getResCompleted;\n        private setErrorState;\n        private clearErrorState;\n        private updateLayout;\n        private clearContent;\n        protected handleSizeChanged(): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare namespace fgui {\n    class GLoader3D extends GObject {\n        private _url;\n        private _align;\n        private _verticalAlign;\n        private _autoSize;\n        private _fill;\n        private _shrinkOnly;\n        private _playing;\n        private _frame;\n        private _loop;\n        private _animationName;\n        private _skinName;\n        private _color;\n        private _contentItem;\n        private _container;\n        private _content;\n        private _updatingLayout;\n        constructor();\n        protected createDisplayObject(): void;\n        dispose(): void;\n        url: string;\n        icon: string;\n        align: AlignType;\n        verticalAlign: VertAlignType;\n        fill: LoaderFillType;\n        shrinkOnly: boolean;\n        autoSize: boolean;\n        playing: boolean;\n        frame: number;\n        animationName: string;\n        skinName: string;\n        loop: boolean;\n        color: number;\n        readonly content: egret.DisplayObject;\n        protected loadContent(): void;\n        protected loadFromPackage(itemURL: string): void;\n        private onLoaded;\n        setDragonBones(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string, anchor?: egret.Point): void;\n        private onChange;\n        private onChangeDragonBones;\n        protected loadExternal(): void;\n        private updateLayout;\n        private clearContent;\n        protected handleSizeChanged(): void;\n        protected handleGrayedChanged(): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare module fgui {\n    class GMovieClip extends GObject {\n        private _content;\n        constructor();\n        color: number;\n        protected createDisplayObject(): void;\n        playing: boolean;\n        frame: number;\n        timeScale: number;\n        rewind(): void;\n        syncStatus(anotherMc: GMovieClip): void;\n        advance(timeInMiniseconds: number): void;\n        setPlaySettings(start?: number, end?: number, times?: number, endAt?: number, endCallback?: Function, callbackObj?: any): void;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        constructFromResource(): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare module fgui {\n    class GProgressBar extends GComponent {\n        private _min;\n        private _max;\n        private _value;\n        private _titleType;\n        private _reverse;\n        private _titleObject;\n        private _aniObject;\n        private _barObjectH;\n        private _barObjectV;\n        private _barMaxWidth;\n        private _barMaxHeight;\n        private _barMaxWidthDelta;\n        private _barMaxHeightDelta;\n        private _barStartX;\n        private _barStartY;\n        constructor();\n        titleType: ProgressTitleType;\n        min: number;\n        max: number;\n        value: number;\n        tweenValue(value: number, duration: number): GTweener;\n        update(newValue: number): void;\n        private setFillAmount;\n        protected constructExtension(buffer: ByteBuffer): void;\n        protected handleSizeChanged(): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n}\ndeclare module fgui {\n    class GTextField extends GObject {\n        protected _textField: egret.TextField;\n        protected _bitmapContainer?: egret.DisplayObjectContainer;\n        protected _font: string;\n        protected _fontSize: number;\n        protected _align: AlignType;\n        protected _verticalAlign: VertAlignType;\n        protected _color: number;\n        protected _leading: number;\n        protected _letterSpacing: number;\n        protected _underline: boolean;\n        protected _text: string;\n        protected _ubbEnabled: boolean;\n        protected _templateVars?: {\n            [index: string]: string;\n        };\n        protected _autoSize: AutoSizeType;\n        protected _widthAutoSize: boolean;\n        protected _heightAutoSize: boolean;\n        protected _updatingSize: boolean;\n        protected _sizeDirty: boolean;\n        protected _textWidth: number;\n        protected _textHeight: number;\n        protected _requireRender: boolean;\n        protected _bitmapFont?: BitmapFont;\n        protected _lines?: Array<LineInfo>;\n        protected _bitmapPool?: Array<egret.Bitmap>;\n        protected static _htmlParser: egret.HtmlTextParser;\n        constructor();\n        protected createDisplayObject(): void;\n        private switchBitmapMode;\n        dispose(): void;\n        text: string;\n        protected updateTextFieldText(): void;\n        font: string;\n        fontSize: number;\n        color: number;\n        align: AlignType;\n        verticalAlign: VertAlignType;\n        private getAlignTypeString;\n        private getVertAlignTypeString;\n        leading: number;\n        letterSpacing: number;\n        underline: boolean;\n        bold: boolean;\n        italic: boolean;\n        singleLine: boolean;\n        stroke: number;\n        strokeColor: number;\n        ubbEnabled: boolean;\n        autoSize: AutoSizeType;\n        readonly textWidth: number;\n        ensureSizeCorrect(): void;\n        protected updateTextFormat(): void;\n        protected render(): void;\n        private __render;\n        protected renderNow(updateBounds?: boolean): void;\n        private renderWithBitmapFont;\n        protected handleSizeChanged(): void;\n        protected parseTemplate(template: string): string;\n        templateVars: {\n            [index: string]: string;\n        };\n        setVar(name: string, value: string): GTextField;\n        flushVars(): void;\n        protected handleGrayedChanged(): void;\n        private doAlign;\n        getProp(index: number): any;\n        setProp(index: number, value: any): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n    }\n    interface LineInfo {\n        width: number;\n        height: number;\n        textHeight: number;\n        text: string;\n        y: number;\n    }\n}\ndeclare module fgui {\n    class GRichTextField extends GTextField {\n        constructor();\n        protected updateTextFieldText(): void;\n    }\n}\ndeclare module fgui {\n    class GRoot extends GComponent {\n        static contentScaleLevel: number;\n        private _nativeStage;\n        private _modalLayer;\n        private _popupStack;\n        private _justClosedPopups;\n        private _modalWaitPane;\n        private _tooltipWin;\n        private _defaultTooltipWin;\n        private _volumeScale;\n        private static _inst;\n        static touchScreen: boolean;\n        static contentScaleFactor: number;\n        static touchDown: boolean;\n        static ctrlKeyDown: boolean;\n        static shiftKeyDown: boolean;\n        static mouseX: number;\n        static mouseY: number;\n        static readonly inst: GRoot;\n        constructor();\n        readonly nativeStage: egret.Stage;\n        showWindow(win: Window): void;\n        hideWindow(win: Window): void;\n        hideWindowImmediately(win: Window): void;\n        bringToFront(win: Window): void;\n        showModalWait(msg?: string): void;\n        closeModalWait(): void;\n        closeAllExceptModals(): void;\n        closeAllWindows(): void;\n        getTopWindow(): Window;\n        readonly modalLayer: GGraph;\n        readonly hasModalWindow: boolean;\n        readonly modalWaiting: boolean;\n        showPopup(popup: GObject, target?: GObject, dir?: PopupDirection | boolean): void;\n        togglePopup(popup: GObject, target?: GObject, dir?: PopupDirection | boolean): void;\n        hidePopup(popup?: GObject): void;\n        readonly hasAnyPopup: boolean;\n        private closePopup;\n        showTooltips(msg: string): void;\n        showTooltipsWin(tooltipWin: GObject, position?: egret.Point): void;\n        hideTooltips(): void;\n        getObjectUnderPoint(globalX: number, globalY: number): GObject;\n        focus: GObject;\n        private setFocus;\n        volumeScale: number;\n        playOneShotSound(sound: egret.Sound, volumeScale?: number): void;\n        private adjustModalLayer;\n        private __addedToStage;\n        private __stageMouseDownCapture;\n        private __stageMouseMoveCapture;\n        private __stageMouseUpCapture;\n        private __winResize;\n        private updateContentScaleLevel;\n    }\n}\ndeclare module fgui {\n    class GScrollBar extends GComponent {\n        private _grip;\n        private _arrowButton1;\n        private _arrowButton2;\n        private _bar;\n        private _target;\n        private _vertical;\n        private _scrollPerc;\n        private _fixedGripSize;\n        private _dragOffset;\n        private _gripDragging;\n        constructor();\n        setScrollPane(target: ScrollPane, vertical: boolean): void;\n        setDisplayPerc(value: number): void;\n        setScrollPerc(val: number): void;\n        readonly minSize: number;\n        readonly gripDragging: boolean;\n        protected constructExtension(buffer: ByteBuffer): void;\n        private __gripMouseDown;\n        private __gripMouseMove;\n        private __gripMouseUp;\n        private __arrowButton1Click;\n        private __arrowButton2Click;\n        private __barMouseDown;\n    }\n}\ndeclare module fgui {\n    class GSlider extends GComponent {\n        private _min;\n        private _max;\n        private _value;\n        private _titleType;\n        private _reverse;\n        private _wholeNumbers;\n        private _titleObject;\n        private _barObjectH;\n        private _barObjectV;\n        private _barMaxWidth;\n        private _barMaxHeight;\n        private _barMaxWidthDelta;\n        private _barMaxHeightDelta;\n        private _gripObject;\n        private _clickPos;\n        private _clickPercent;\n        private _barStartX;\n        private _barStartY;\n        changeOnClick: boolean;\n        canDrag: boolean;\n        constructor();\n        titleType: ProgressTitleType;\n        wholeNumbers: boolean;\n        min: number;\n        max: number;\n        value: number;\n        update(): void;\n        private updateWithPercent;\n        protected constructExtension(buffer: ByteBuffer): void;\n        protected handleSizeChanged(): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n        private __gripMouseDown;\n        private __gripMouseMove;\n        private __gripMouseUp;\n        private __barMouseDown;\n    }\n}\ndeclare module fgui {\n    class GTextInput extends GTextField {\n        private _promptText;\n        private _password;\n        constructor();\n        dispose(): void;\n        editable: boolean;\n        maxLength: number;\n        promptText: string;\n        restrict: string;\n        password: boolean;\n        verticalAlign: VertAlignType;\n        private updateVertAlign;\n        protected updateTextFieldText(): void;\n        protected handleSizeChanged(): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n        setup_afterAdd(buffer: ByteBuffer, beginPos: number): void;\n        private __textChanged;\n        private __focusIn;\n        private __focusOut;\n    }\n}\ndeclare namespace fgui {\n    class GTree extends GList {\n        treeNodeRender: (node: GTreeNode, obj: GComponent) => void;\n        treeNodeWillExpand: (node: GTreeNode, expanded: boolean) => void;\n        private _indent;\n        private _clickToExpand;\n        private _rootNode;\n        private _expandedStatusInEvt;\n        constructor();\n        readonly rootNode: GTreeNode;\n        indent: number;\n        clickToExpand: number;\n        getSelectedNode(): GTreeNode;\n        getSelectedNodes(result?: Array<GTreeNode>): Array<GTreeNode>;\n        selectNode(node: GTreeNode, scrollItToView?: boolean): void;\n        unselectNode(node: GTreeNode): void;\n        expandAll(folderNode?: GTreeNode): void;\n        collapseAll(folderNode?: GTreeNode): void;\n        private createCell;\n        _afterInserted(node: GTreeNode): void;\n        private getInsertIndexForNode;\n        _afterRemoved(node: GTreeNode): void;\n        _afterExpanded(node: GTreeNode): void;\n        _afterCollapsed(node: GTreeNode): void;\n        _afterMoved(node: GTreeNode): void;\n        private getFolderEndIndex;\n        private checkChildren;\n        private hideFolderNode;\n        private removeNode;\n        private __cellMouseDown;\n        private __expandedStateChanged;\n        protected dispatchItemEvent(evt: ItemEvent): void;\n        setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void;\n        protected readItems(buffer: ByteBuffer): void;\n    }\n}\ndeclare namespace fgui {\n    class GTreeNode {\n        data: any;\n        private _parent;\n        private _children;\n        private _expanded;\n        private _level;\n        private _tree;\n        _cell: GComponent;\n        _resURL?: string;\n        constructor(hasChild: boolean, resURL?: string);\n        expanded: boolean;\n        readonly isFolder: boolean;\n        readonly parent: GTreeNode;\n        text: string;\n        icon: string;\n        readonly cell: GComponent;\n        readonly level: number;\n        _setLevel(value: number): void;\n        addChild(child: GTreeNode): GTreeNode;\n        addChildAt(child: GTreeNode, index: number): GTreeNode;\n        removeChild(child: GTreeNode): GTreeNode;\n        removeChildAt(index: number): GTreeNode;\n        removeChildren(beginIndex?: number, endIndex?: number): void;\n        getChildAt(index: number): GTreeNode;\n        getChildIndex(child: GTreeNode): number;\n        getPrevSibling(): GTreeNode;\n        getNextSibling(): GTreeNode;\n        setChildIndex(child: GTreeNode, index: number): void;\n        swapChildren(child1: GTreeNode, child2: GTreeNode): void;\n        swapChildrenAt(index1: number, index2: number): void;\n        readonly numChildren: number;\n        expandToRoot(): void;\n        readonly tree: GTree;\n        _setTree(value: GTree): void;\n    }\n}\ndeclare module fgui {\n    interface IUISource {\n        fileName: string;\n        loaded: boolean;\n        load(callback: Function, thisObj: any): void;\n    }\n}\ndeclare module fgui {\n    class Margin {\n        left: number;\n        right: number;\n        top: number;\n        bottom: number;\n        constructor();\n        copy(source: Margin): void;\n    }\n}\ndeclare namespace fgui {\n    class PixelHitTest {\n        private _data;\n        offsetX: number;\n        offsetY: number;\n        scaleX: number;\n        scaleY: number;\n        constructor(data: PixelHitTestData, offsetX: number, offsetY: number);\n        contains(x: number, y: number): boolean;\n    }\n    class PixelHitTestData {\n        pixelWidth: number;\n        scale: number;\n        pixels: number[];\n        constructor();\n        load(ba: ByteBuffer): void;\n    }\n}\ndeclare module fgui {\n    class PackageItem {\n        owner: UIPackage;\n        type: PackageItemType;\n        objectType?: ObjectType;\n        id: string;\n        name: string;\n        width: number;\n        height: number;\n        file: string;\n        decoded?: boolean;\n        loading?: Array<Function>;\n        rawData?: ByteBuffer;\n        asset?: egret.Texture | egret.Sound | any;\n        highResolution?: Array<string>;\n        branches?: Array<string>;\n        scale9Grid?: egret.Rectangle;\n        scaleByTile?: boolean;\n        tileGridIndice?: number;\n        smoothing?: boolean;\n        pixelHitTestData?: PixelHitTestData;\n        interval?: number;\n        repeatDelay?: number;\n        swing?: boolean;\n        frames?: Array<Frame>;\n        extensionType?: any;\n        bitmapFont?: BitmapFont;\n        skeletonAnchor?: egret.Point;\n        armatureName?: string;\n        constructor();\n        load(): Object;\n        getBranch(): PackageItem;\n        getHighResolution(): PackageItem;\n        toString(): string;\n    }\n}\ndeclare module fgui {\n    class PopupMenu {\n        protected _contentPane: GComponent;\n        protected _list: GList;\n        constructor(resourceURL?: string);\n        dispose(): void;\n        addItem(caption: string, callback?: (item?: ItemEvent) => void): GButton;\n        addItemAt(caption: string, index: number, callback?: (item?: ItemEvent) => void): GButton;\n        addSeperator(): void;\n        getItemName(index: number): string;\n        setItemText(name: string, caption: string): void;\n        setItemVisible(name: string, visible: boolean): void;\n        setItemGrayed(name: string, grayed: boolean): void;\n        setItemCheckable(name: string, checkable: boolean): void;\n        setItemChecked(name: string, checked: boolean): void;\n        isItemChecked(name: string): boolean;\n        removeItem(name: string): boolean;\n        clearItems(): void;\n        readonly itemCount: number;\n        readonly contentPane: GComponent;\n        readonly list: GList;\n        show(target?: GObject, dir?: PopupDirection | boolean): void;\n        private __clickItem;\n        private __clickItem2;\n        private __addedToStage;\n    }\n}\ndeclare module fgui {\n    class RelationItem {\n        private _owner;\n        private _target;\n        private _defs;\n        private _targetX;\n        private _targetY;\n        private _targetWidth;\n        private _targetHeight;\n        constructor(owner: GObject);\n        readonly owner: GObject;\n        target: GObject;\n        add(relationType: number, usePercent: boolean): void;\n        internalAdd(relationType: number, usePercent: boolean): void;\n        remove(relationType?: number): void;\n        copyFrom(source: RelationItem): void;\n        dispose(): void;\n        readonly isEmpty: boolean;\n        applyOnSelfResized(dWidth: number, dHeight: number, applyPivot: boolean): void;\n        private applyOnXYChanged;\n        private applyOnSizeChanged;\n        private addRefTarget;\n        private releaseRefTarget;\n        private __targetXYChanged;\n        private __targetSizeChanged;\n        private __targetSizeWillChange;\n    }\n    class RelationDef {\n        percent: boolean;\n        type: number;\n        axis: number;\n        constructor();\n        copyFrom(source: RelationDef): void;\n    }\n}\ndeclare module fgui {\n    class Relations {\n        private _owner;\n        private _items;\n        handling: GObject;\n        sizeDirty: boolean;\n        constructor(owner: GObject);\n        add(target: GObject, relationType: number, usePercent?: boolean): void;\n        remove(target: GObject, relationType?: number): void;\n        contains(target: GObject): boolean;\n        clearFor(target: GObject): void;\n        clearAll(): void;\n        copyFrom(source: Relations): void;\n        dispose(): void;\n        onOwnerSizeChanged(dWidth: number, dHeight: number, applyPivot: boolean): void;\n        ensureRelationsSizeCorrect(): void;\n        readonly empty: boolean;\n        setup(buffer: ByteBuffer, parentToChild: boolean): void;\n    }\n}\ndeclare module fgui {\n    class ScrollPane extends egret.EventDispatcher {\n        private _owner;\n        private _container;\n        private _maskContainer;\n        private _alignContainer?;\n        private _scrollType;\n        private _scrollStep;\n        private _decelerationRate;\n        private _scrollBarMargin;\n        private _bouncebackEffect;\n        private _touchEffect;\n        private _scrollBarDisplayAuto?;\n        private _vScrollNone;\n        private _hScrollNone;\n        private _needRefresh;\n        private _refreshBarAxis;\n        private _displayOnLeft?;\n        private _snapToItem?;\n        _displayInDemand?: boolean;\n        private _pageMode?;\n        private _inertiaDisabled?;\n        private _floating?;\n        private _dontClipMargin?;\n        private _xPos;\n        private _yPos;\n        private _viewSize;\n        private _contentSize;\n        private _overlapSize;\n        private _pageSize;\n        private _containerPos;\n        private _beginTouchPos;\n        private _lastTouchPos;\n        private _lastTouchGlobalPos;\n        private _velocity;\n        private _velocityScale;\n        private _lastMoveTime;\n        private _isHoldAreaDone;\n        private _aniFlag;\n        _loop: number;\n        private _headerLockedSize;\n        private _footerLockedSize;\n        private _refreshEventDispatching;\n        private _dragged;\n        private _tweening;\n        private _tweenTime;\n        private _tweenDuration;\n        private _tweenStart;\n        private _tweenChange;\n        private _pageController?;\n        private _hzScrollBar?;\n        private _vtScrollBar?;\n        private _header?;\n        private _footer?;\n        static draggingPane: ScrollPane;\n        static SCROLL: string;\n        static SCROLL_END: string;\n        static PULL_DOWN_RELEASE: string;\n        static PULL_UP_RELEASE: string;\n        constructor(owner: GComponent);\n        setup(buffer: ByteBuffer): void;\n        dispose(): void;\n        readonly owner: GComponent;\n        readonly hzScrollBar: GScrollBar;\n        readonly vtScrollBar: GScrollBar;\n        readonly header: GComponent;\n        readonly footer: GComponent;\n        bouncebackEffect: boolean;\n        touchEffect: boolean;\n        scrollStep: number;\n        decelerationRate: number;\n        snapToItem: boolean;\n        readonly isDragged: boolean;\n        percX: number;\n        setPercX(value: number, ani?: boolean): void;\n        percY: number;\n        setPercY(value: number, ani?: boolean): void;\n        posX: number;\n        setPosX(value: number, ani?: boolean): void;\n        posY: number;\n        setPosY(value: number, ani?: boolean): void;\n        readonly contentWidth: number;\n        readonly contentHeight: number;\n        viewWidth: number;\n        viewHeight: number;\n        currentPageX: number;\n        currentPageY: number;\n        setCurrentPageX(value: number, ani?: boolean): void;\n        setCurrentPageY(value: number, ani?: boolean): void;\n        readonly isBottomMost: boolean;\n        readonly isRightMost: boolean;\n        pageController: Controller;\n        readonly scrollingPosX: number;\n        readonly scrollingPosY: number;\n        scrollTop(ani?: boolean): void;\n        scrollBottom(ani?: boolean): void;\n        scrollUp(ratio?: number, ani?: boolean): void;\n        scrollDown(ratio?: number, ani?: boolean): void;\n        scrollLeft(ratio?: number, ani?: boolean): void;\n        scrollRight(ratio?: number, ani?: boolean): void;\n        scrollToView(target: egret.Rectangle | GObject, ani?: boolean, setFirst?: boolean): void;\n        isChildInView(obj: GObject): boolean;\n        cancelDragging(): void;\n        lockHeader(size: number): void;\n        lockFooter(size: number): void;\n        onOwnerSizeChanged(): void;\n        handleControllerChanged(c: Controller): void;\n        private updatePageController;\n        adjustMaskContainer(): void;\n        setSize(aWidth: number, aHeight: number): void;\n        setContentSize(aWidth: number, aHeight: number): void;\n        changeContentSizeOnScrolling(deltaWidth: number, deltaHeight: number, deltaPosX: number, deltaPosY: number): void;\n        private handleSizeChanged;\n        private posChanged;\n        private refresh;\n        private refresh2;\n        private __touchBegin;\n        private __touchMove;\n        private __touchEnd;\n        private __touchTap;\n        private updateScrollBarPos;\n        updateScrollBarVisible(): void;\n        private updateScrollBarVisible2;\n        private __barTweenComplete;\n        private getLoopPartSize;\n        private loopCheckingCurrent;\n        private loopCheckingTarget;\n        private loopCheckingTarget2;\n        private loopCheckingNewPos;\n        private alignPosition;\n        private alignByPage;\n        private updateTargetAndDuration;\n        private updateTargetAndDuration2;\n        private fixDuration;\n        private startTween;\n        private killTween;\n        private checkRefreshBar;\n        private tweenUpdate;\n        private runTween;\n    }\n}\ndeclare module fgui {\n    class Transition {\n        name: string;\n        private _owner;\n        private _ownerBaseX;\n        private _ownerBaseY;\n        private _items;\n        private _totalTimes;\n        private _totalTasks;\n        private _playing;\n        private _paused;\n        private _onComplete;\n        private _onCompleteCaller;\n        private _onCompleteParam;\n        private _options;\n        private _reversed;\n        private _totalDuration;\n        private _autoPlay;\n        private _autoPlayTimes;\n        private _autoPlayDelay;\n        private _timeScale;\n        private _startTime;\n        private _endTime;\n        constructor(owner: GComponent);\n        play(onComplete?: () => void, onCompleteObj?: any, onCompleteParam?: any, times?: number, delay?: number, startTime?: number, endTime?: number): void;\n        playReverse(onComplete?: () => void, onCompleteObj?: any, onCompleteParam?: any, times?: number, delay?: number): void;\n        changePlayTimes(value: number): void;\n        setAutoPlay(value: boolean, times?: number, delay?: number): void;\n        private _play;\n        stop(setToComplete?: boolean, processCallback?: boolean): void;\n        private stopItem;\n        setPaused(paused: boolean): void;\n        dispose(): void;\n        readonly playing: boolean;\n        setValue(label: string, ...args: any[]): void;\n        setHook(label: string, callback: Function, caller?: any): void;\n        clearHooks(): void;\n        setTarget(label: string, newTarget: GObject): void;\n        setDuration(label: string, value: number): void;\n        getLabelTime(label: string): number;\n        timeScale: number;\n        updateFromRelations(targetId: string, dx: number, dy: number): void;\n        onOwnerAddedToStage(): void;\n        onOwnerRemovedFromStage(): void;\n        private onDelayedPlay;\n        private internalPlay;\n        private playItem;\n        private skipAnimations;\n        private onDelayedPlayItem;\n        private onTweenStart;\n        private onTweenUpdate;\n        private onTweenComplete;\n        private onPlayTransCompleted;\n        private callHook;\n        private checkAllComplete;\n        private applyValue;\n        setup(buffer: ByteBuffer): void;\n        private decodeValue;\n    }\n}\ndeclare module fgui {\n    class TranslationHelper {\n        static strings: {\n            [index: string]: {\n                [index: string]: string;\n            };\n        };\n        static loadFromXML(source: string): void;\n        static translateComponent(item: PackageItem): void;\n    }\n}\ndeclare module fgui {\n    class UIConfig {\n        constructor();\n        static defaultFont: string;\n        static windowModalWaiting: string;\n        static globalModalWaiting: string;\n        static modalLayerColor: number;\n        static modalLayerAlpha: number;\n        static buttonSound: string;\n        static buttonSoundVolumeScale: number;\n        static horizontalScrollBar: string;\n        static verticalScrollBar: string;\n        static defaultScrollStep: number;\n        static defaultScrollDecelerationRate: number;\n        static defaultScrollBarDisplay: number;\n        static defaultScrollTouchEffect: boolean;\n        static defaultScrollBounceEffect: boolean;\n        static popupMenu: string;\n        static popupMenu_seperator: string;\n        static loaderErrorSign: string;\n        static tooltipsWin: string;\n        static defaultComboBoxVisibleItemCount: number;\n        static touchScrollSensitivity: number;\n        static touchDragSensitivity: number;\n        static clickDragSensitivity: number;\n        static bringWindowToFrontOnClick: boolean;\n        static frameTimeForAsyncUIConstruction: number;\n    }\n}\ndeclare module fgui {\n    class UIObjectFactory {\n        static extensions: {\n            [index: string]: new () => GComponent;\n        };\n        static loaderType: new () => GLoader;\n        constructor();\n        static setExtension(url: string, type: new () => GComponent): void;\n        static setPackageItemExtension(url: string, type: new () => GComponent): void;\n        static setLoaderExtension(type: new () => GLoader): void;\n        static resolvePackageItemExtension(pi: PackageItem): void;\n        static newObject(type: number | PackageItem, userClass?: new () => GObject): GObject;\n    }\n}\ndeclare module fgui {\n    class UIPackage {\n        private _id;\n        private _name;\n        private _items;\n        private _itemsById;\n        private _itemsByName;\n        private _resKey;\n        private _customId;\n        private _sprites;\n        private _dependencies;\n        private _branches;\n        _branchIndex: number;\n        static _constructing: number;\n        private static _instById;\n        private static _instByName;\n        private static _branch;\n        private static _vars;\n        constructor();\n        static branch: string;\n        static getVar(key: string): string;\n        static setVar(key: string, value: string): void;\n        static getById(id: string): UIPackage;\n        static getByName(name: string): UIPackage;\n        static loadPackage(resKey: string): Promise<UIPackage>;\n        static addPackage(resKey: string, descData?: ArrayBuffer): UIPackage;\n        static removePackage(packageIdOrName: string): void;\n        static createObject(pkgName: string, resName: string, userClass?: new () => GObject): GObject;\n        static createObjectFromURL(url: string, userClass?: new () => GObject): GObject;\n        static getItemURL(pkgName: string, resName: string): string;\n        static getItemByURL(url: string): PackageItem;\n        static normalizeURL(url: string): string;\n        static setStringsSource(source: string): void;\n        private loadPackage;\n        dispose(): void;\n        readonly id: string;\n        readonly name: string;\n        customId: string;\n        createObject(resName: string, userClass?: new () => GObject): GObject;\n        internalCreateObject(item: PackageItem, userClass?: new () => GObject): GObject;\n        getItemById(itemId: string): PackageItem;\n        getItemByName(resName: string): PackageItem;\n        getItemAssetByName(resName: string): Object;\n        getItemAsset(item: PackageItem): Object;\n        getItemAssetAsync(item: PackageItem, onComplete?: (err: any, item: PackageItem) => void): void;\n        private loadMovieClip;\n        private loadFont;\n        private loadDragonBones;\n    }\n}\ndeclare module fgui {\n    class Window extends GComponent {\n        private _contentPane;\n        private _modalWaitPane;\n        private _closeButton;\n        private _dragArea;\n        private _contentArea;\n        private _frame;\n        private _modal;\n        private _uiSources?;\n        private _inited?;\n        private _loading?;\n        protected _requestingCmd: number;\n        bringToFontOnClick: boolean;\n        constructor();\n        addUISource(source: IUISource): void;\n        contentPane: GComponent;\n        readonly frame: GComponent;\n        closeButton: GObject;\n        dragArea: GObject;\n        contentArea: GObject;\n        show(): void;\n        showOn(root: GRoot): void;\n        hide(): void;\n        hideImmediately(): void;\n        centerOn(r: GRoot, restraint?: boolean): void;\n        toggleStatus(): void;\n        readonly isShowing: boolean;\n        readonly isTop: boolean;\n        modal: boolean;\n        bringToFront(): void;\n        showModalWait(requestingCmd?: number): void;\n        protected layoutModalWaitPane(): void;\n        closeModalWait(requestingCmd?: number): boolean;\n        readonly modalWaiting: boolean;\n        init(): void;\n        protected onInit(): void;\n        protected onShown(): void;\n        protected onHide(): void;\n        protected doShowAnimation(): void;\n        protected doHideAnimation(): void;\n        private __uiLoadComplete;\n        private _init;\n        dispose(): void;\n        protected closeEventHandler(evt: egret.Event): void;\n        private __onShown;\n        private __onHidden;\n        private __mouseDown;\n        private __dragStart;\n    }\n}\ndeclare module fgui {\n    class ControllerAction {\n        fromPage: string[];\n        toPage: string[];\n        static createAction(type: number): ControllerAction;\n        constructor();\n        run(controller: Controller, prevPage: string, curPage: string): void;\n        protected enter(controller: Controller): void;\n        protected leave(controller: Controller): void;\n        setup(buffer: ByteBuffer): void;\n    }\n}\ndeclare module fgui {\n    class ChangePageAction extends ControllerAction {\n        objectId: string;\n        controllerName: string;\n        targetPage: string;\n        constructor();\n        protected enter(controller: Controller): void;\n        setup(buffer: ByteBuffer): void;\n    }\n}\ndeclare module fgui {\n    class PlayTransitionAction extends ControllerAction {\n        transitionName: string;\n        playTimes: number;\n        delay: number;\n        stopOnExit: boolean;\n        private _currentTransition;\n        constructor();\n        protected enter(controller: Controller): void;\n        protected leave(controller: Controller): void;\n        setup(buffer: ByteBuffer): void;\n    }\n}\ndeclare module fgui {\n    class BitmapFont {\n        id: string;\n        size: number;\n        ttf: boolean;\n        glyphs: {\n            [index: string]: BMGlyph;\n        };\n        resizable: boolean;\n        tint: boolean;\n        constructor();\n    }\n    interface BMGlyph {\n        x?: number;\n        y?: number;\n        width?: number;\n        height?: number;\n        advance?: number;\n        lineHeight?: number;\n        channel?: number;\n        texture?: egret.Texture;\n    }\n}\ndeclare namespace fgui {\n    function fillImage(w: number, h: number, method: number, origin: number, clockwise: boolean, amount: number): Array<number>;\n}\ndeclare module fgui {\n    class Image extends egret.Bitmap {\n        private _fillMethod;\n        private _fillOrigin;\n        private _fillAmount;\n        private _fillClockwise?;\n        private _mask?;\n        private _maskDirtyFlag?;\n        private _color;\n        constructor();\n        color: number;\n        $setX(value: number): boolean;\n        $setY(value: number): boolean;\n        fillMethod: FillMethod;\n        fillOrigin: number;\n        fillClockwise: boolean;\n        fillAmount: number;\n        private markChanged;\n        private doFill;\n    }\n}\ndeclare module fgui {\n    interface Frame {\n        addDelay?: number;\n        texture?: egret.Texture;\n    }\n    class MovieClip extends Image {\n        interval: number;\n        swing: boolean;\n        repeatDelay: number;\n        timeScale: number;\n        private _playing;\n        private _frameCount;\n        private _frames;\n        private _frame;\n        private _start;\n        private _end;\n        private _times;\n        private _endAt;\n        private _status;\n        private _callback;\n        private _callbackObj;\n        private _smoothing;\n        private _frameElapsed;\n        private _reversed;\n        private _repeatedCount;\n        constructor();\n        frames: Array<Frame>;\n        readonly frameCount: number;\n        frame: number;\n        playing: boolean;\n        smoothing: boolean;\n        rewind(): void;\n        syncStatus(anotherMc: MovieClip): void;\n        advance(timeInMiniseconds: number): void;\n        setPlaySettings(start?: number, end?: number, times?: number, endAt?: number, endCallback?: Function, callbackObj?: any): void;\n        private update;\n        private drawFrame;\n        private checkTimer;\n        $onAddToStage(stage: egret.Stage, nestLevel: number): void;\n        $onRemoveFromStage(): void;\n    }\n}\ndeclare module fgui {\n    class UIContainer extends egret.DisplayObjectContainer {\n        private _hitArea?;\n        private _cachedMatrix?;\n        private _cachedHitArea?;\n        private _opaque?;\n        constructor();\n        cacheHitArea(value: boolean): void;\n        hitArea: PixelHitTest | egret.DisplayObject;\n        opaque: boolean;\n        $hitTest(stageX: number, stageY: number): egret.DisplayObject;\n    }\n}\ndeclare module fgui {\n    class DragEvent extends egret.Event {\n        stageX: number;\n        stageY: number;\n        touchPointID: number;\n        private _prevented;\n        static DRAG_START: string;\n        static DRAG_END: string;\n        static DRAG_MOVING: string;\n        constructor(type: string, stageX?: number, stageY?: number, touchPointID?: number);\n        preventDefault(): void;\n        isDefaultPrevented(): boolean;\n    }\n}\ndeclare module fgui {\n    class DropEvent extends egret.Event {\n        source: any;\n        static DROP: string;\n        constructor(type: string, source?: any);\n    }\n}\ndeclare module fgui {\n    class ItemEvent extends egret.Event {\n        itemObject: GObject;\n        stageX: number;\n        stageY: number;\n        static CLICK: string;\n        constructor(type: string, itemObject?: GObject, stageX?: number, stageY?: number);\n    }\n}\ndeclare module fgui {\n    class StateChangeEvent extends egret.Event {\n        static CHANGED: string;\n        constructor(type: string);\n    }\n}\ndeclare namespace fgui {\n    class GearBase {\n        static disableAllTweenEffect: boolean;\n        protected _owner: GObject;\n        protected _controller: Controller;\n        protected _tweenConfig?: GearTweenConfig;\n        static create(owner: GObject, index: number): GearBase;\n        constructor(owner: GObject);\n        dispose(): void;\n        controller: Controller;\n        readonly tweenConfig: GearTweenConfig;\n        setup(buffer: ByteBuffer): void;\n        updateFromRelations(dx: number, dy: number): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        protected init(): void;\n        apply(): void;\n        updateState(): void;\n    }\n    class GearTweenConfig {\n        tween: boolean;\n        easeType: number;\n        duration: number;\n        delay: number;\n        _displayLockToken: number;\n        _tweener: GTweener;\n        constructor();\n    }\n}\ndeclare namespace fgui {\n    class GearAnimation extends GearBase {\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        updateState(): void;\n    }\n}\ndeclare namespace fgui {\n    class GearColor extends GearBase {\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        updateState(): void;\n    }\n}\ndeclare namespace fgui {\n    class GearDisplay extends GearBase {\n        pages: string[];\n        private _visible;\n        private _displayLockToken;\n        constructor(owner: GObject);\n        protected init(): void;\n        apply(): void;\n        addLock(): number;\n        releaseLock(token: number): void;\n        readonly connected: boolean;\n    }\n}\ndeclare namespace fgui {\n    class GearDisplay2 extends GearBase {\n        pages: string[];\n        condition: number;\n        private _visible;\n        constructor(owner: GObject);\n        protected init(): void;\n        apply(): void;\n        evaluate(connected: boolean): boolean;\n    }\n}\ndeclare namespace fgui {\n    class GearFontSize extends GearBase {\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        updateState(): void;\n    }\n}\ndeclare namespace fgui {\n    class GearIcon extends GearBase {\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        updateState(): void;\n    }\n}\ndeclare namespace fgui {\n    class GearLook extends GearBase {\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        private __tweenUpdate;\n        private __tweenComplete;\n        updateState(): void;\n    }\n}\ndeclare namespace fgui {\n    class GearSize extends GearBase {\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        private __tweenUpdate;\n        private __tweenComplete;\n        updateState(): void;\n        updateFromRelations(dx: number, dy: number): void;\n    }\n}\ndeclare namespace fgui {\n    class GearText extends GearBase {\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        updateState(): void;\n    }\n}\ndeclare namespace fgui {\n    class GearXY extends GearBase {\n        positionsInPercent: boolean;\n        private _storage;\n        private _default;\n        constructor(owner: GObject);\n        protected init(): void;\n        protected addStatus(pageId: string, buffer: ByteBuffer): void;\n        addExtStatus(pageId: string, buffer: ByteBuffer): void;\n        apply(): void;\n        private __tweenUpdate;\n        private __tweenComplete;\n        updateState(): void;\n        updateFromRelations(dx: number, dy: number): void;\n    }\n}\ndeclare namespace fgui {\n    function evaluateEase(easeType: number, time: number, duration: number, overshootOrAmplitude: number, period: number): number;\n}\ndeclare namespace fgui {\n    class EaseType {\n        static Linear: number;\n        static SineIn: number;\n        static SineOut: number;\n        static SineInOut: number;\n        static QuadIn: number;\n        static QuadOut: number;\n        static QuadInOut: number;\n        static CubicIn: number;\n        static CubicOut: number;\n        static CubicInOut: number;\n        static QuartIn: number;\n        static QuartOut: number;\n        static QuartInOut: number;\n        static QuintIn: number;\n        static QuintOut: number;\n        static QuintInOut: number;\n        static ExpoIn: number;\n        static ExpoOut: number;\n        static ExpoInOut: number;\n        static CircIn: number;\n        static CircOut: number;\n        static CircInOut: number;\n        static ElasticIn: number;\n        static ElasticOut: number;\n        static ElasticInOut: number;\n        static BackIn: number;\n        static BackOut: number;\n        static BackInOut: number;\n        static BounceIn: number;\n        static BounceOut: number;\n        static BounceInOut: number;\n        static Custom: number;\n    }\n}\ndeclare namespace fgui {\n    class GPath {\n        private _segments;\n        private _points;\n        private _fullLength;\n        constructor();\n        readonly length: number;\n        create(pt1: Array<GPathPoint> | GPathPoint, pt2?: GPathPoint, pt3?: GPathPoint, pt4?: GPathPoint): void;\n        private createSplineSegment;\n        clear(): void;\n        getPointAt(t: number, result?: egret.Point): egret.Point;\n        readonly segmentCount: number;\n        getAnchorsInSegment(segmentIndex: number, points?: Array<egret.Point>): Array<egret.Point>;\n        getPointsInSegment(segmentIndex: number, t0: number, t1: number, points?: Array<egret.Point>, ts?: Array<number>, pointDensity?: number): Array<egret.Point>;\n        getAllPoints(points?: Array<egret.Point>, ts?: Array<number>, pointDensity?: number): Array<egret.Point>;\n        private onCRSplineCurve;\n        private onBezierCurve;\n    }\n}\ndeclare namespace fgui {\n    enum CurveType {\n        CRSpline = 0,\n        Bezier = 1,\n        CubicBezier = 2,\n        Straight = 3\n    }\n    class GPathPoint {\n        x: number;\n        y: number;\n        control1_x: number;\n        control1_y: number;\n        control2_x: number;\n        control2_y: number;\n        curveType: number;\n        constructor();\n        static newPoint(x?: number, y?: number, curveType?: number): GPathPoint;\n        static newBezierPoint(x?: number, y?: number, control1_x?: number, control1_y?: number): GPathPoint;\n        static newCubicBezierPoint(x?: number, y?: number, control1_x?: number, control1_y?: number, control2_x?: number, control2_y?: number): GPathPoint;\n        clone(): GPathPoint;\n    }\n}\ndeclare namespace fgui {\n    class GTween {\n        static catchCallbackExceptions: boolean;\n        static to(start: number, end: number, duration: number): GTweener;\n        static to2(start: number, start2: number, end: number, end2: number, duration: number): GTweener;\n        static to3(start: number, start2: number, start3: number, end: number, end2: number, end3: number, duration: number): GTweener;\n        static to4(start: number, start2: number, start3: number, start4: number, end: number, end2: number, end3: number, end4: number, duration: number): GTweener;\n        static toColor(start: number, end: number, duration: number): GTweener;\n        static delayedCall(delay: number): GTweener;\n        static shake(startX: number, startY: number, amplitude: number, duration: number): GTweener;\n        static isTweening(target: any, propType?: any): Boolean;\n        static kill(target: any, complete?: boolean, propType?: any): void;\n        static getTween(target: any, propType?: any): GTweener;\n    }\n}\ndeclare module fgui {\n    class GTweener {\n        _target: any;\n        _propType: any;\n        _killed: boolean;\n        _paused: boolean;\n        private _delay;\n        private _duration;\n        private _breakpoint;\n        private _easeType;\n        private _easeOvershootOrAmplitude;\n        private _easePeriod;\n        private _repeat;\n        private _yoyo;\n        private _timeScale;\n        private _snapping;\n        private _userData;\n        private _path;\n        private _onUpdate;\n        private _onStart;\n        private _onComplete;\n        private _onUpdateCaller;\n        private _onStartCaller;\n        private _onCompleteCaller;\n        private _startValue;\n        private _endValue;\n        private _value;\n        private _deltaValue;\n        private _valueSize;\n        private _started;\n        private _ended;\n        private _elapsedTime;\n        private _normalizedTime;\n        constructor();\n        setDelay(value: number): GTweener;\n        readonly delay: number;\n        setDuration(value: number): GTweener;\n        readonly duration: number;\n        setBreakpoint(value: number): GTweener;\n        setEase(value: number): GTweener;\n        setEasePeriod(value: number): GTweener;\n        setEaseOvershootOrAmplitude(value: number): GTweener;\n        setRepeat(repeat: number, yoyo?: boolean): GTweener;\n        readonly repeat: number;\n        setTimeScale(value: number): GTweener;\n        setSnapping(value: boolean): GTweener;\n        setTarget(value: any, propType?: any): GTweener;\n        readonly target: any;\n        setUserData(value: any): GTweener;\n        readonly userData: any;\n        setPath(value: GPath): GTweener;\n        onUpdate(callback: Function, caller?: any): GTweener;\n        onStart(callback: Function, caller?: any): GTweener;\n        onComplete(callback: Function, caller?: any): GTweener;\n        readonly startValue: TweenValue;\n        readonly endValue: TweenValue;\n        readonly value: TweenValue;\n        readonly deltaValue: TweenValue;\n        readonly normalizedTime: number;\n        readonly completed: boolean;\n        readonly allCompleted: boolean;\n        setPaused(paused: boolean): GTweener;\n        seek(time: number): void;\n        kill(complete?: boolean): void;\n        _to(start: number, end: number, duration: number): GTweener;\n        _to2(start: number, start2: number, end: number, end2: number, duration: number): GTweener;\n        _to3(start: number, start2: number, start3: number, end: number, end2: number, end3: number, duration: number): GTweener;\n        _to4(start: number, start2: number, start3: number, start4: number, end: number, end2: number, end3: number, end4: number, duration: number): GTweener;\n        _toColor(start: number, end: number, duration: number): GTweener;\n        _shake(startX: number, startY: number, amplitude: number, duration: number): GTweener;\n        _init(): void;\n        _reset(): void;\n        _update(dt: number): void;\n        private update;\n        private callStartCallback;\n        private callUpdateCallback;\n        private callCompleteCallback;\n    }\n}\ndeclare module fgui {\n    class TweenManager {\n        static createTween(): GTweener;\n        static isTweening(target: any, propType?: any): boolean;\n        static killTweens(target: any, completed?: boolean, propType?: any): boolean;\n        static getTween(target: any, propType?: any): GTweener;\n        private static update;\n    }\n}\ndeclare namespace fgui {\n    class TweenValue {\n        x: number;\n        y: number;\n        z: number;\n        w: number;\n        constructor();\n        color: number;\n        getField(index: number): number;\n        setField(index: number, value: number): void;\n        setZero(): void;\n    }\n}\ndeclare module fgui {\n    class ByteBuffer extends egret.ByteArray {\n        stringTable?: Array<string>;\n        version: number;\n        constructor(buffer?: ArrayBuffer | Uint8Array, bufferExtSize?: number);\n        skip(count: number): void;\n        readBool(): boolean;\n        readS(): string;\n        readSArray(cnt: number): Array<string>;\n        writeS(value: string): void;\n        readColor(hasAlpha?: boolean): number;\n        readChar(): string;\n        readBuffer(): ByteBuffer;\n        seek(indexTablePos: number, blockIndex: number): boolean;\n    }\n}\ndeclare namespace fgui {\n    class ColorMatrix {\n        readonly matrix: Array<number>;\n        constructor(p_brightness?: number, p_contrast?: number, p_saturation?: number, p_hue?: number);\n        reset(): void;\n        invert(): void;\n        adjustColor(p_brightness: number, p_contrast: number, p_saturation: number, p_hue: number): void;\n        adjustBrightness(p_val: number): void;\n        adjustContrast(p_val: number): void;\n        adjustSaturation(p_val: number): void;\n        adjustHue(p_val: number): void;\n        concat(p_matrix: Array<number>): void;\n        clone(): ColorMatrix;\n        protected copyMatrix(p_matrix: Array<number>): void;\n        protected multiplyMatrix(p_matrix: Array<number>): void;\n        protected cleanValue(p_val: number, p_limit: number): number;\n    }\n}\ndeclare module fgui {\n    class GTimers {\n        private _items;\n        private _itemPool;\n        private _enumI;\n        private _enumCount;\n        private _lastTime;\n        static deltaTime: number;\n        static time: number;\n        static readonly inst: GTimers;\n        constructor();\n        private getItem;\n        private findItem;\n        add(delayInMiniseconds: number, repeat: number, callback: Function, thisObj?: any, callbackParam?: any): void;\n        callLater(callback: Function, thisObj?: any, callbackParam?: any): void;\n        callDelay(delay: number, callback: Function, thisObj?: any, callbackParam?: any): void;\n        exists(callback: Function, thisObj?: any): boolean;\n        remove(callback: Function, thisObj?: any): void;\n        private __timer;\n    }\n}\ndeclare module fgui {\n    class UBBParser {\n        private _text;\n        private _readPos;\n        protected _handlers: {\n            [index: string]: (tagName: string, end: boolean, attr: string) => string;\n        };\n        smallFontSize: number;\n        normalFontSize: number;\n        largeFontSize: number;\n        defaultImgWidth: number;\n        defaultImgHeight: number;\n        static inst: UBBParser;\n        constructor();\n        protected onTag_URL(tagName: string, end: boolean, attr: string): string;\n        protected onTag_IMG(tagName: string, end: boolean, attr: string): string;\n        protected onTag_Simple(tagName: string, end: boolean, attr: string): string;\n        protected onTag_COLOR(tagName: string, end: boolean, attr: string): string;\n        protected onTag_FONT(tagName: string, end: boolean, attr: string): string;\n        protected onTag_SIZE(tagName: string, end: boolean, attr: string): string;\n        protected getTagText(remove?: boolean): string;\n        parse(text: string, remove?: boolean): string;\n    }\n}\ndeclare module fgui {\n    class ToolSet {\n        static startsWith(source: string, str: string, ignoreCase?: boolean): boolean;\n        static trimRight(targetString: string): string;\n        static convertToHtmlColor(argb: number, hasAlpha?: boolean): string;\n        static convertFromHtmlColor(str: string, hasAlpha?: boolean): number;\n        static displayObjectToGObject(obj: egret.DisplayObject): GObject;\n        static encodeHTML(str: string): string;\n        static clamp(value: number, min: number, max: number): number;\n        static clamp01(value: number): number;\n        static lerp(start: number, end: number, percent: number): number;\n        static repeat(t: number, length: number): number;\n        static distance(x1: number, y1: number, x2: number, y2: number): number;\n        static fillPath(ctx: egret.Graphics, points: number[], px: number, py: number): void;\n        static setColorFilter(obj: egret.DisplayObject, color?: number | number[] | boolean): void;\n    }\n}\nimport fairygui = fgui;"
  },
  {
    "path": "source/bin/fairygui.js",
    "content": "window.fgui = {};\nwindow.fairygui = window.fgui;\nwindow.__extends = (this && this.__extends) || (function () {\n    var extendStatics = Object.setPrototypeOf ||\n        ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n        function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n    return function (d, b) {\n        extendStatics(d, b);\n        function __() { this.constructor = d; }\n        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n    };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n    return new (P || (P = Promise))(function (resolve, reject) {\n        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n        function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n        function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n        step((generator = generator.apply(thisArg, _arguments || [])).next());\n    });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n    return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n    function verb(n) { return function (v) { return step([n, v]); }; }\n    function step(op) {\n        if (f) throw new TypeError(\"Generator is already executing.\");\n        while (_) try {\n            if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n            if (y = 0, t) op = [op[0] & 2, t.value];\n            switch (op[0]) {\n                case 0: case 1: t = op; break;\n                case 4: _.label++; return { value: op[1], done: false };\n                case 5: _.label++; y = op[1]; op = [0]; continue;\n                case 7: op = _.ops.pop(); _.trys.pop(); continue;\n                default:\n                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n                    if (t[2]) _.ops.pop();\n                    _.trys.pop(); continue;\n            }\n            op = body.call(thisArg, _);\n        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n    }\n};\n\n(function (fgui) {\n    var AsyncOperation = (function () {\n        function AsyncOperation() {\n            this._itemList = new Array();\n            this._objectPool = new Array();\n        }\n        AsyncOperation.prototype.createObject = function (pkgName, resName) {\n            var pkg = fgui.UIPackage.getByName(pkgName);\n            if (pkg) {\n                var pi = pkg.getItemByName(resName);\n                if (!pi)\n                    throw new Error(\"resource not found: \" + resName);\n                this.internalCreateObject(pi);\n            }\n            else\n                throw new Error(\"package not found: \" + pkgName);\n        };\n        AsyncOperation.prototype.createObjectFromURL = function (url) {\n            var pi = fgui.UIPackage.getItemByURL(url);\n            if (pi)\n                this.internalCreateObject(pi);\n            else\n                throw new Error(\"resource not found: \" + url);\n        };\n        AsyncOperation.prototype.cancel = function () {\n            fgui.GTimers.inst.remove(this.run, this);\n            this._itemList.length = 0;\n            var cnt = this._objectPool.length;\n            if (cnt > 0) {\n                for (var i = 0; i < cnt; i++)\n                    this._objectPool[i].dispose();\n                this._objectPool.length = 0;\n            }\n        };\n        AsyncOperation.prototype.internalCreateObject = function (item) {\n            this._itemList.length = 0;\n            this._objectPool.length = 0;\n            var di = { pi: item, type: item.objectType };\n            di.childCount = this.collectComponentChildren(item);\n            this._itemList.push(di);\n            this._index = 0;\n            fgui.GTimers.inst.add(1, 0, this.run, this);\n        };\n        AsyncOperation.prototype.collectComponentChildren = function (item) {\n            var buffer = item.rawData;\n            buffer.seek(0, 2);\n            var di;\n            var pi;\n            var i;\n            var dataLen;\n            var curPos;\n            var pkg;\n            var dcnt = buffer.readShort();\n            for (i = 0; i < dcnt; i++) {\n                dataLen = buffer.readShort();\n                curPos = buffer.position;\n                buffer.seek(curPos, 0);\n                var type = buffer.readByte();\n                var src = buffer.readS();\n                var pkgId = buffer.readS();\n                buffer.position = curPos;\n                if (src != null) {\n                    if (pkgId != null)\n                        pkg = fgui.UIPackage.getById(pkgId);\n                    else\n                        pkg = item.owner;\n                    pi = pkg != null ? pkg.getItemById(src) : null;\n                    di = { pi: pi, type: type };\n                    if (pi != null && pi.type == fgui.PackageItemType.Component)\n                        di.childCount = this.collectComponentChildren(pi);\n                }\n                else {\n                    di = { type: type };\n                    if (type == fgui.ObjectType.List)\n                        di.listItemCount = this.collectListChildren(buffer);\n                }\n                this._itemList.push(di);\n                buffer.position = curPos + dataLen;\n            }\n            return dcnt;\n        };\n        AsyncOperation.prototype.collectListChildren = function (buffer) {\n            buffer.seek(buffer.position, 8);\n            var listItemCount = 0;\n            var i;\n            var nextPos;\n            var url;\n            var pi;\n            var di;\n            var defaultItem = buffer.readS();\n            var itemCount = buffer.readShort();\n            for (i = 0; i < itemCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                url = buffer.readS();\n                if (url == null)\n                    url = defaultItem;\n                if (url) {\n                    pi = fgui.UIPackage.getItemByURL(url);\n                    if (pi) {\n                        di = { pi: pi, type: pi.objectType };\n                        if (pi.type == fgui.PackageItemType.Component)\n                            di.childCount = this.collectComponentChildren(pi);\n                        this._itemList.push(di);\n                        listItemCount++;\n                    }\n                }\n                buffer.position = nextPos;\n            }\n            return listItemCount;\n        };\n        AsyncOperation.prototype.run = function () {\n            var obj;\n            var di;\n            var poolStart;\n            var k;\n            var t = egret.getTimer();\n            var frameTime = fgui.UIConfig.frameTimeForAsyncUIConstruction;\n            var totalItems = this._itemList.length;\n            while (this._index < totalItems) {\n                di = this._itemList[this._index];\n                if (di.pi) {\n                    obj = fgui.UIObjectFactory.newObject(di.pi);\n                    this._objectPool.push(obj);\n                    fgui.UIPackage._constructing++;\n                    if (di.pi.type == fgui.PackageItemType.Component) {\n                        poolStart = this._objectPool.length - di.childCount - 1;\n                        obj.constructFromResource2(this._objectPool, poolStart);\n                        this._objectPool.splice(poolStart, di.childCount);\n                    }\n                    else {\n                        obj.constructFromResource();\n                    }\n                    fgui.UIPackage._constructing--;\n                }\n                else {\n                    obj = fgui.UIObjectFactory.newObject(di.type);\n                    this._objectPool.push(obj);\n                    if (di.type == fgui.ObjectType.List && di.listItemCount > 0) {\n                        poolStart = this._objectPool.length - di.listItemCount - 1;\n                        for (k = 0; k < di.listItemCount; k++)\n                            obj.itemPool.returnObject(this._objectPool[k + poolStart]);\n                        this._objectPool.splice(poolStart, di.listItemCount);\n                    }\n                }\n                this._index++;\n                if ((this._index % 5 == 0) && egret.getTimer() - t >= frameTime)\n                    return;\n            }\n            fgui.GTimers.inst.remove(this.run, this);\n            var result = this._objectPool[0];\n            this._itemList.length = 0;\n            this._objectPool.length = 0;\n            if (this.callback != null)\n                this.callback.call(this.callbackObj, result);\n        };\n        return AsyncOperation;\n    }());\n    fgui.AsyncOperation = AsyncOperation;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var _nextPageId = 0;\n    var Controller = (function (_super_1) {\n        __extends(Controller, _super_1);\n        function Controller() {\n            var _this = _super_1.call(this) || this;\n            _this._pageIds = [];\n            _this._pageNames = [];\n            _this._selectedIndex = -1;\n            _this._previousIndex = -1;\n            return _this;\n        }\n        Controller.prototype.dispose = function () {\n        };\n        Object.defineProperty(Controller.prototype, \"selectedIndex\", {\n            get: function () {\n                return this._selectedIndex;\n            },\n            set: function (value) {\n                if (this._selectedIndex != value) {\n                    if (value > this._pageIds.length - 1)\n                        throw \"index out of bounds: \" + value;\n                    this.changing = true;\n                    this._previousIndex = this._selectedIndex;\n                    this._selectedIndex = value;\n                    this.parent.applyController(this);\n                    this.dispatchEvent(new fgui.StateChangeEvent(fgui.StateChangeEvent.CHANGED));\n                    this.changing = false;\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Controller.prototype.setSelectedIndex = function (value) {\n            if (this._selectedIndex != value) {\n                if (value > this._pageIds.length - 1)\n                    throw \"index out of bounds: \" + value;\n                this.changing = true;\n                this._previousIndex = this._selectedIndex;\n                this._selectedIndex = value;\n                this.parent.applyController(this);\n                this.changing = false;\n            }\n        };\n        Object.defineProperty(Controller.prototype, \"previsousIndex\", {\n            get: function () {\n                return this._previousIndex;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Controller.prototype, \"selectedPage\", {\n            get: function () {\n                if (this._selectedIndex == -1)\n                    return null;\n                else\n                    return this._pageNames[this._selectedIndex];\n            },\n            set: function (val) {\n                var i = this._pageNames.indexOf(val);\n                if (i == -1)\n                    i = 0;\n                this.selectedIndex = i;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Controller.prototype.setSelectedPage = function (value) {\n            var i = this._pageNames.indexOf(value);\n            if (i == -1)\n                i = 0;\n            this.setSelectedIndex(i);\n        };\n        Object.defineProperty(Controller.prototype, \"previousPage\", {\n            get: function () {\n                if (this._previousIndex == -1)\n                    return null;\n                else\n                    return this._pageNames[this._previousIndex];\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Controller.prototype, \"pageCount\", {\n            get: function () {\n                return this._pageIds.length;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Controller.prototype.getPageName = function (index) {\n            return this._pageNames[index];\n        };\n        Controller.prototype.addPage = function (name) {\n            this.addPageAt(name || \"\", this._pageIds.length);\n        };\n        Controller.prototype.addPageAt = function (name, index) {\n            var nid = \"\" + (_nextPageId++);\n            if (index == this._pageIds.length) {\n                this._pageIds.push(nid);\n                this._pageNames.push(name);\n            }\n            else {\n                this._pageIds.splice(index, 0, nid);\n                this._pageNames.splice(index, 0, name);\n            }\n        };\n        Controller.prototype.removePage = function (name) {\n            var i = this._pageNames.indexOf(name);\n            if (i != -1) {\n                this._pageIds.splice(i, 1);\n                this._pageNames.splice(i, 1);\n                if (this._selectedIndex >= this._pageIds.length)\n                    this.selectedIndex = this._selectedIndex - 1;\n                else\n                    this.parent.applyController(this);\n            }\n        };\n        Controller.prototype.removePageAt = function (index) {\n            if (index === void 0) { index = 0; }\n            this._pageIds.splice(index, 1);\n            this._pageNames.splice(index, 1);\n            if (this._selectedIndex >= this._pageIds.length)\n                this.selectedIndex = this._selectedIndex - 1;\n            else\n                this.parent.applyController(this);\n        };\n        Controller.prototype.clearPages = function () {\n            this._pageIds.length = 0;\n            this._pageNames.length = 0;\n            if (this._selectedIndex != -1)\n                this.selectedIndex = -1;\n            else\n                this.parent.applyController(this);\n        };\n        Controller.prototype.hasPage = function (aName) {\n            return this._pageNames.indexOf(aName) != -1;\n        };\n        Controller.prototype.getPageIndexById = function (aId) {\n            return this._pageIds.indexOf(aId);\n        };\n        Controller.prototype.getPageIdByName = function (aName) {\n            var i = this._pageNames.indexOf(aName);\n            if (i != -1)\n                return this._pageIds[i];\n            else\n                return null;\n        };\n        Controller.prototype.getPageNameById = function (aId) {\n            var i = this._pageIds.indexOf(aId);\n            if (i != -1)\n                return this._pageNames[i];\n            else\n                return null;\n        };\n        Controller.prototype.getPageId = function (index) {\n            if (index === void 0) { index = 0; }\n            return this._pageIds[index];\n        };\n        Object.defineProperty(Controller.prototype, \"selectedPageId\", {\n            get: function () {\n                if (this._selectedIndex == -1)\n                    return null;\n                else\n                    return this._pageIds[this._selectedIndex];\n            },\n            set: function (val) {\n                var i = this._pageIds.indexOf(val);\n                this.selectedIndex = i;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Controller.prototype, \"oppositePageId\", {\n            set: function (val) {\n                var i = this._pageIds.indexOf(val);\n                if (i > 0)\n                    this.selectedIndex = 0;\n                else if (this._pageIds.length > 1)\n                    this.selectedIndex = 1;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Controller.prototype, \"previousPageId\", {\n            get: function () {\n                if (this._previousIndex == -1)\n                    return null;\n                else\n                    return this._pageIds[this._previousIndex];\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Controller.prototype.runActions = function () {\n            if (this._actions) {\n                var cnt = this._actions.length;\n                for (var i = 0; i < cnt; i++)\n                    this._actions[i].run(this, this.previousPageId, this.selectedPageId);\n            }\n        };\n        Controller.prototype.setup = function (buffer) {\n            var beginPos = buffer.position;\n            buffer.seek(beginPos, 0);\n            this.name = buffer.readS();\n            if (buffer.readBool())\n                this.autoRadioGroupDepth = true;\n            buffer.seek(beginPos, 1);\n            var i;\n            var nextPos;\n            var cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++) {\n                this._pageIds.push(buffer.readS());\n                this._pageNames.push(buffer.readS());\n            }\n            var homePageIndex = 0;\n            if (buffer.version >= 2) {\n                var homePageType = buffer.readByte();\n                switch (homePageType) {\n                    case 1:\n                        homePageIndex = buffer.readShort();\n                        break;\n                    case 2:\n                        homePageIndex = this._pageNames.indexOf(fgui.UIPackage.branch);\n                        if (homePageIndex == -1)\n                            homePageIndex = 0;\n                        break;\n                    case 3:\n                        homePageIndex = this._pageNames.indexOf(fgui.UIPackage.getVar(buffer.readS()));\n                        if (homePageIndex == -1)\n                            homePageIndex = 0;\n                        break;\n                }\n            }\n            buffer.seek(beginPos, 2);\n            cnt = buffer.readShort();\n            if (cnt > 0) {\n                if (!this._actions)\n                    this._actions = new Array();\n                for (i = 0; i < cnt; i++) {\n                    nextPos = buffer.readShort();\n                    nextPos += buffer.position;\n                    var action = fgui.ControllerAction.createAction(buffer.readByte());\n                    action.setup(buffer);\n                    this._actions.push(action);\n                    buffer.position = nextPos;\n                }\n            }\n            if (this.parent && this._pageIds.length > 0)\n                this._selectedIndex = homePageIndex;\n            else\n                this._selectedIndex = -1;\n        };\n        return Controller;\n    }(egret.EventDispatcher));\n    fgui.Controller = Controller;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var DragDropManager = (function () {\n        function DragDropManager() {\n            this._agent = new fgui.GLoader();\n            this._agent.draggable = true;\n            this._agent.touchable = false;\n            this._agent.setSize(100, 100);\n            this._agent.setPivot(0.5, 0.5, true);\n            this._agent.align = fgui.AlignType.Center;\n            this._agent.verticalAlign = fgui.VertAlignType.Middle;\n            this._agent.sortingOrder = 1000000;\n            this._agent.addEventListener(fgui.DragEvent.DRAG_END, this.__dragEnd, this);\n        }\n        Object.defineProperty(DragDropManager, \"inst\", {\n            get: function () {\n                if (DragDropManager._inst == null)\n                    DragDropManager._inst = new DragDropManager();\n                return DragDropManager._inst;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(DragDropManager.prototype, \"dragAgent\", {\n            get: function () {\n                return this._agent;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(DragDropManager.prototype, \"dragging\", {\n            get: function () {\n                return this._agent.parent != null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        DragDropManager.prototype.startDrag = function (source, icon, sourceData, touchPointID) {\n            if (this._agent.parent)\n                return;\n            this._sourceData = sourceData;\n            this._agent.url = icon;\n            fgui.GRoot.inst.addChild(this._agent);\n            var pt = fgui.GRoot.inst.globalToLocal(fgui.GRoot.mouseX, fgui.GRoot.mouseY);\n            this._agent.setXY(pt.x, pt.y);\n            this._agent.startDrag(touchPointID);\n        };\n        DragDropManager.prototype.cancel = function () {\n            if (this._agent.parent) {\n                this._agent.stopDrag();\n                fgui.GRoot.inst.removeChild(this._agent);\n                this._sourceData = null;\n            }\n        };\n        DragDropManager.prototype.__dragEnd = function (evt) {\n            if (this._agent.parent == null)\n                return;\n            fgui.GRoot.inst.removeChild(this._agent);\n            var sourceData = this._sourceData;\n            this._sourceData = null;\n            var obj = fgui.GRoot.inst.getObjectUnderPoint(evt.stageX, evt.stageY);\n            while (obj) {\n                if (obj.hasEventListener(fgui.DropEvent.DROP)) {\n                    var dropEvt = new fgui.DropEvent(fgui.DropEvent.DROP, sourceData);\n                    obj.requestFocus();\n                    obj.dispatchEvent(dropEvt);\n                    return;\n                }\n                obj = obj.parent;\n            }\n        };\n        return DragDropManager;\n    }());\n    fgui.DragDropManager = DragDropManager;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ButtonMode;\n    (function (ButtonMode) {\n        ButtonMode[ButtonMode[\"Common\"] = 0] = \"Common\";\n        ButtonMode[ButtonMode[\"Check\"] = 1] = \"Check\";\n        ButtonMode[ButtonMode[\"Radio\"] = 2] = \"Radio\";\n    })(ButtonMode = fgui.ButtonMode || (fgui.ButtonMode = {}));\n    var AutoSizeType;\n    (function (AutoSizeType) {\n        AutoSizeType[AutoSizeType[\"None\"] = 0] = \"None\";\n        AutoSizeType[AutoSizeType[\"Both\"] = 1] = \"Both\";\n        AutoSizeType[AutoSizeType[\"Height\"] = 2] = \"Height\";\n    })(AutoSizeType = fgui.AutoSizeType || (fgui.AutoSizeType = {}));\n    var AlignType;\n    (function (AlignType) {\n        AlignType[AlignType[\"Left\"] = 0] = \"Left\";\n        AlignType[AlignType[\"Center\"] = 1] = \"Center\";\n        AlignType[AlignType[\"Right\"] = 2] = \"Right\";\n    })(AlignType = fgui.AlignType || (fgui.AlignType = {}));\n    var VertAlignType;\n    (function (VertAlignType) {\n        VertAlignType[VertAlignType[\"Top\"] = 0] = \"Top\";\n        VertAlignType[VertAlignType[\"Middle\"] = 1] = \"Middle\";\n        VertAlignType[VertAlignType[\"Bottom\"] = 2] = \"Bottom\";\n    })(VertAlignType = fgui.VertAlignType || (fgui.VertAlignType = {}));\n    var LoaderFillType;\n    (function (LoaderFillType) {\n        LoaderFillType[LoaderFillType[\"None\"] = 0] = \"None\";\n        LoaderFillType[LoaderFillType[\"Scale\"] = 1] = \"Scale\";\n        LoaderFillType[LoaderFillType[\"ScaleMatchHeight\"] = 2] = \"ScaleMatchHeight\";\n        LoaderFillType[LoaderFillType[\"ScaleMatchWidth\"] = 3] = \"ScaleMatchWidth\";\n        LoaderFillType[LoaderFillType[\"ScaleFree\"] = 4] = \"ScaleFree\";\n        LoaderFillType[LoaderFillType[\"ScaleNoBorder\"] = 5] = \"ScaleNoBorder\";\n    })(LoaderFillType = fgui.LoaderFillType || (fgui.LoaderFillType = {}));\n    var ListLayoutType;\n    (function (ListLayoutType) {\n        ListLayoutType[ListLayoutType[\"SingleColumn\"] = 0] = \"SingleColumn\";\n        ListLayoutType[ListLayoutType[\"SingleRow\"] = 1] = \"SingleRow\";\n        ListLayoutType[ListLayoutType[\"FlowHorizontal\"] = 2] = \"FlowHorizontal\";\n        ListLayoutType[ListLayoutType[\"FlowVertical\"] = 3] = \"FlowVertical\";\n        ListLayoutType[ListLayoutType[\"Pagination\"] = 4] = \"Pagination\";\n    })(ListLayoutType = fgui.ListLayoutType || (fgui.ListLayoutType = {}));\n    var ListSelectionMode;\n    (function (ListSelectionMode) {\n        ListSelectionMode[ListSelectionMode[\"Single\"] = 0] = \"Single\";\n        ListSelectionMode[ListSelectionMode[\"Multiple\"] = 1] = \"Multiple\";\n        ListSelectionMode[ListSelectionMode[\"Multiple_SingleClick\"] = 2] = \"Multiple_SingleClick\";\n        ListSelectionMode[ListSelectionMode[\"None\"] = 3] = \"None\";\n    })(ListSelectionMode = fgui.ListSelectionMode || (fgui.ListSelectionMode = {}));\n    var OverflowType;\n    (function (OverflowType) {\n        OverflowType[OverflowType[\"Visible\"] = 0] = \"Visible\";\n        OverflowType[OverflowType[\"Hidden\"] = 1] = \"Hidden\";\n        OverflowType[OverflowType[\"Scroll\"] = 2] = \"Scroll\";\n    })(OverflowType = fgui.OverflowType || (fgui.OverflowType = {}));\n    var PackageItemType;\n    (function (PackageItemType) {\n        PackageItemType[PackageItemType[\"Image\"] = 0] = \"Image\";\n        PackageItemType[PackageItemType[\"MovieClip\"] = 1] = \"MovieClip\";\n        PackageItemType[PackageItemType[\"Sound\"] = 2] = \"Sound\";\n        PackageItemType[PackageItemType[\"Component\"] = 3] = \"Component\";\n        PackageItemType[PackageItemType[\"Atlas\"] = 4] = \"Atlas\";\n        PackageItemType[PackageItemType[\"Font\"] = 5] = \"Font\";\n        PackageItemType[PackageItemType[\"Swf\"] = 6] = \"Swf\";\n        PackageItemType[PackageItemType[\"Misc\"] = 7] = \"Misc\";\n        PackageItemType[PackageItemType[\"Unknown\"] = 8] = \"Unknown\";\n        PackageItemType[PackageItemType[\"Spine\"] = 9] = \"Spine\";\n        PackageItemType[PackageItemType[\"DragonBones\"] = 10] = \"DragonBones\";\n    })(PackageItemType = fgui.PackageItemType || (fgui.PackageItemType = {}));\n    ;\n    var ObjectType;\n    (function (ObjectType) {\n        ObjectType[ObjectType[\"Image\"] = 0] = \"Image\";\n        ObjectType[ObjectType[\"MovieClip\"] = 1] = \"MovieClip\";\n        ObjectType[ObjectType[\"Swf\"] = 2] = \"Swf\";\n        ObjectType[ObjectType[\"Graph\"] = 3] = \"Graph\";\n        ObjectType[ObjectType[\"Loader\"] = 4] = \"Loader\";\n        ObjectType[ObjectType[\"Group\"] = 5] = \"Group\";\n        ObjectType[ObjectType[\"Text\"] = 6] = \"Text\";\n        ObjectType[ObjectType[\"RichText\"] = 7] = \"RichText\";\n        ObjectType[ObjectType[\"InputText\"] = 8] = \"InputText\";\n        ObjectType[ObjectType[\"Component\"] = 9] = \"Component\";\n        ObjectType[ObjectType[\"List\"] = 10] = \"List\";\n        ObjectType[ObjectType[\"Label\"] = 11] = \"Label\";\n        ObjectType[ObjectType[\"Button\"] = 12] = \"Button\";\n        ObjectType[ObjectType[\"ComboBox\"] = 13] = \"ComboBox\";\n        ObjectType[ObjectType[\"ProgressBar\"] = 14] = \"ProgressBar\";\n        ObjectType[ObjectType[\"Slider\"] = 15] = \"Slider\";\n        ObjectType[ObjectType[\"ScrollBar\"] = 16] = \"ScrollBar\";\n        ObjectType[ObjectType[\"Tree\"] = 17] = \"Tree\";\n        ObjectType[ObjectType[\"Loader3D\"] = 18] = \"Loader3D\";\n    })(ObjectType = fgui.ObjectType || (fgui.ObjectType = {}));\n    var ProgressTitleType;\n    (function (ProgressTitleType) {\n        ProgressTitleType[ProgressTitleType[\"Percent\"] = 0] = \"Percent\";\n        ProgressTitleType[ProgressTitleType[\"ValueAndMax\"] = 1] = \"ValueAndMax\";\n        ProgressTitleType[ProgressTitleType[\"Value\"] = 2] = \"Value\";\n        ProgressTitleType[ProgressTitleType[\"Max\"] = 3] = \"Max\";\n    })(ProgressTitleType = fgui.ProgressTitleType || (fgui.ProgressTitleType = {}));\n    var ScrollBarDisplayType;\n    (function (ScrollBarDisplayType) {\n        ScrollBarDisplayType[ScrollBarDisplayType[\"Default\"] = 0] = \"Default\";\n        ScrollBarDisplayType[ScrollBarDisplayType[\"Visible\"] = 1] = \"Visible\";\n        ScrollBarDisplayType[ScrollBarDisplayType[\"Auto\"] = 2] = \"Auto\";\n        ScrollBarDisplayType[ScrollBarDisplayType[\"Hidden\"] = 3] = \"Hidden\";\n    })(ScrollBarDisplayType = fgui.ScrollBarDisplayType || (fgui.ScrollBarDisplayType = {}));\n    ;\n    var ScrollType;\n    (function (ScrollType) {\n        ScrollType[ScrollType[\"Horizontal\"] = 0] = \"Horizontal\";\n        ScrollType[ScrollType[\"Vertical\"] = 1] = \"Vertical\";\n        ScrollType[ScrollType[\"Both\"] = 2] = \"Both\";\n    })(ScrollType = fgui.ScrollType || (fgui.ScrollType = {}));\n    ;\n    var FlipType;\n    (function (FlipType) {\n        FlipType[FlipType[\"None\"] = 0] = \"None\";\n        FlipType[FlipType[\"Horizontal\"] = 1] = \"Horizontal\";\n        FlipType[FlipType[\"Vertical\"] = 2] = \"Vertical\";\n        FlipType[FlipType[\"Both\"] = 3] = \"Both\";\n    })(FlipType = fgui.FlipType || (fgui.FlipType = {}));\n    var ChildrenRenderOrder;\n    (function (ChildrenRenderOrder) {\n        ChildrenRenderOrder[ChildrenRenderOrder[\"Ascent\"] = 0] = \"Ascent\";\n        ChildrenRenderOrder[ChildrenRenderOrder[\"Descent\"] = 1] = \"Descent\";\n        ChildrenRenderOrder[ChildrenRenderOrder[\"Arch\"] = 2] = \"Arch\";\n    })(ChildrenRenderOrder = fgui.ChildrenRenderOrder || (fgui.ChildrenRenderOrder = {}));\n    var GroupLayoutType;\n    (function (GroupLayoutType) {\n        GroupLayoutType[GroupLayoutType[\"None\"] = 0] = \"None\";\n        GroupLayoutType[GroupLayoutType[\"Horizontal\"] = 1] = \"Horizontal\";\n        GroupLayoutType[GroupLayoutType[\"Vertical\"] = 2] = \"Vertical\";\n    })(GroupLayoutType = fgui.GroupLayoutType || (fgui.GroupLayoutType = {}));\n    var PopupDirection;\n    (function (PopupDirection) {\n        PopupDirection[PopupDirection[\"Auto\"] = 0] = \"Auto\";\n        PopupDirection[PopupDirection[\"Up\"] = 1] = \"Up\";\n        PopupDirection[PopupDirection[\"Down\"] = 2] = \"Down\";\n    })(PopupDirection = fgui.PopupDirection || (fgui.PopupDirection = {}));\n    var RelationType;\n    (function (RelationType) {\n        RelationType[RelationType[\"Left_Left\"] = 0] = \"Left_Left\";\n        RelationType[RelationType[\"Left_Center\"] = 1] = \"Left_Center\";\n        RelationType[RelationType[\"Left_Right\"] = 2] = \"Left_Right\";\n        RelationType[RelationType[\"Center_Center\"] = 3] = \"Center_Center\";\n        RelationType[RelationType[\"Right_Left\"] = 4] = \"Right_Left\";\n        RelationType[RelationType[\"Right_Center\"] = 5] = \"Right_Center\";\n        RelationType[RelationType[\"Right_Right\"] = 6] = \"Right_Right\";\n        RelationType[RelationType[\"Top_Top\"] = 7] = \"Top_Top\";\n        RelationType[RelationType[\"Top_Middle\"] = 8] = \"Top_Middle\";\n        RelationType[RelationType[\"Top_Bottom\"] = 9] = \"Top_Bottom\";\n        RelationType[RelationType[\"Middle_Middle\"] = 10] = \"Middle_Middle\";\n        RelationType[RelationType[\"Bottom_Top\"] = 11] = \"Bottom_Top\";\n        RelationType[RelationType[\"Bottom_Middle\"] = 12] = \"Bottom_Middle\";\n        RelationType[RelationType[\"Bottom_Bottom\"] = 13] = \"Bottom_Bottom\";\n        RelationType[RelationType[\"Width\"] = 14] = \"Width\";\n        RelationType[RelationType[\"Height\"] = 15] = \"Height\";\n        RelationType[RelationType[\"LeftExt_Left\"] = 16] = \"LeftExt_Left\";\n        RelationType[RelationType[\"LeftExt_Right\"] = 17] = \"LeftExt_Right\";\n        RelationType[RelationType[\"RightExt_Left\"] = 18] = \"RightExt_Left\";\n        RelationType[RelationType[\"RightExt_Right\"] = 19] = \"RightExt_Right\";\n        RelationType[RelationType[\"TopExt_Top\"] = 20] = \"TopExt_Top\";\n        RelationType[RelationType[\"TopExt_Bottom\"] = 21] = \"TopExt_Bottom\";\n        RelationType[RelationType[\"BottomExt_Top\"] = 22] = \"BottomExt_Top\";\n        RelationType[RelationType[\"BottomExt_Bottom\"] = 23] = \"BottomExt_Bottom\";\n        RelationType[RelationType[\"Size\"] = 24] = \"Size\";\n    })(RelationType = fgui.RelationType || (fgui.RelationType = {}));\n    var FillMethod;\n    (function (FillMethod) {\n        FillMethod[FillMethod[\"None\"] = 0] = \"None\";\n        FillMethod[FillMethod[\"Horizontal\"] = 1] = \"Horizontal\";\n        FillMethod[FillMethod[\"Vertical\"] = 2] = \"Vertical\";\n        FillMethod[FillMethod[\"Radial90\"] = 3] = \"Radial90\";\n        FillMethod[FillMethod[\"Radial180\"] = 4] = \"Radial180\";\n        FillMethod[FillMethod[\"Radial360\"] = 5] = \"Radial360\";\n    })(FillMethod = fgui.FillMethod || (fgui.FillMethod = {}));\n    var FillOrigin;\n    (function (FillOrigin) {\n        FillOrigin[FillOrigin[\"Top\"] = 0] = \"Top\";\n        FillOrigin[FillOrigin[\"Bottom\"] = 1] = \"Bottom\";\n        FillOrigin[FillOrigin[\"Left\"] = 2] = \"Left\";\n        FillOrigin[FillOrigin[\"Right\"] = 3] = \"Right\";\n        FillOrigin[FillOrigin[\"TopLeft\"] = 0] = \"TopLeft\";\n        FillOrigin[FillOrigin[\"TopRight\"] = 1] = \"TopRight\";\n        FillOrigin[FillOrigin[\"BottomLeft\"] = 2] = \"BottomLeft\";\n        FillOrigin[FillOrigin[\"BottomRight\"] = 3] = \"BottomRight\";\n    })(FillOrigin = fgui.FillOrigin || (fgui.FillOrigin = {}));\n    var FillOrigin90;\n    (function (FillOrigin90) {\n        FillOrigin90[FillOrigin90[\"TopLeft\"] = 0] = \"TopLeft\";\n        FillOrigin90[FillOrigin90[\"TopRight\"] = 1] = \"TopRight\";\n        FillOrigin90[FillOrigin90[\"BottomLeft\"] = 2] = \"BottomLeft\";\n        FillOrigin90[FillOrigin90[\"BottomRight\"] = 3] = \"BottomRight\";\n    })(FillOrigin90 = fgui.FillOrigin90 || (fgui.FillOrigin90 = {}));\n    var ObjectPropID;\n    (function (ObjectPropID) {\n        ObjectPropID[ObjectPropID[\"Text\"] = 0] = \"Text\";\n        ObjectPropID[ObjectPropID[\"Icon\"] = 1] = \"Icon\";\n        ObjectPropID[ObjectPropID[\"Color\"] = 2] = \"Color\";\n        ObjectPropID[ObjectPropID[\"OutlineColor\"] = 3] = \"OutlineColor\";\n        ObjectPropID[ObjectPropID[\"Playing\"] = 4] = \"Playing\";\n        ObjectPropID[ObjectPropID[\"Frame\"] = 5] = \"Frame\";\n        ObjectPropID[ObjectPropID[\"DeltaTime\"] = 6] = \"DeltaTime\";\n        ObjectPropID[ObjectPropID[\"TimeScale\"] = 7] = \"TimeScale\";\n        ObjectPropID[ObjectPropID[\"FontSize\"] = 8] = \"FontSize\";\n        ObjectPropID[ObjectPropID[\"Selected\"] = 9] = \"Selected\";\n    })(ObjectPropID = fgui.ObjectPropID || (fgui.ObjectPropID = {}));\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GObject = (function (_super_1) {\n        __extends(GObject, _super_1);\n        function GObject() {\n            var _this = _super_1.call(this) || this;\n            _this._x = 0;\n            _this._y = 0;\n            _this._alpha = 1;\n            _this._rotation = 0;\n            _this._visible = true;\n            _this._touchable = true;\n            _this._scaleX = 1;\n            _this._scaleY = 1;\n            _this._skewX = 0;\n            _this._skewY = 0;\n            _this._pivotX = 0;\n            _this._pivotY = 0;\n            _this._pivotOffsetX = 0;\n            _this._pivotOffsetY = 0;\n            _this._sortingOrder = 0;\n            _this._internalVisible = true;\n            _this._disposed = false;\n            _this.sourceWidth = 0;\n            _this.sourceHeight = 0;\n            _this.initWidth = 0;\n            _this.initHeight = 0;\n            _this.minWidth = 0;\n            _this.minHeight = 0;\n            _this.maxWidth = 0;\n            _this.maxHeight = 0;\n            _this._width = 0;\n            _this._height = 0;\n            _this._rawWidth = 0;\n            _this._rawHeight = 0;\n            _this._sizePercentInGroup = 0;\n            _this._id = \"\" + _gInstanceCounter++;\n            _this._name = \"\";\n            _this.createDisplayObject();\n            _this._relations = new fgui.Relations(_this);\n            _this._gears = new Array(10);\n            return _this;\n        }\n        Object.defineProperty(GObject.prototype, \"id\", {\n            get: function () {\n                return this._id;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"name\", {\n            get: function () {\n                return this._name;\n            },\n            set: function (value) {\n                this._name = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"x\", {\n            get: function () {\n                return this._x;\n            },\n            set: function (value) {\n                this.setXY(value, this._y);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"y\", {\n            get: function () {\n                return this._y;\n            },\n            set: function (value) {\n                this.setXY(this._x, value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.setXY = function (xv, yv) {\n            if (this._x != xv || this._y != yv) {\n                var dx = xv - this._x;\n                var dy = yv - this._y;\n                this._x = xv;\n                this._y = yv;\n                this.handleXYChanged();\n                if (this instanceof fgui.GGroup)\n                    this.moveChildren(dx, dy);\n                this.updateGear(1);\n                if (this._parent && !(this._parent instanceof fgui.GList)) {\n                    this._parent.setBoundsChangedFlag();\n                    if (this._group)\n                        this._group.setBoundsChangedFlag(true);\n                    this.dispatchEventWith(GObject.XY_CHANGED);\n                }\n                if (GObject.draggingObject == this && !sUpdateInDragging)\n                    this.localToGlobalRect(0, 0, this._width, this._height, sGlobalRect);\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"xMin\", {\n            get: function () {\n                return this._pivotAsAnchor ? (this._x - this._width * this._pivotX) : this._x;\n            },\n            set: function (value) {\n                if (this._pivotAsAnchor)\n                    this.setXY(value + this._width * this._pivotX, this._y);\n                else\n                    this.setXY(value, this._y);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"yMin\", {\n            get: function () {\n                return this._pivotAsAnchor ? (this._y - this._height * this._pivotY) : this._y;\n            },\n            set: function (value) {\n                if (this._pivotAsAnchor)\n                    this.setXY(this._x, value + this._height * this._pivotY);\n                else\n                    this.setXY(this._x, value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"pixelSnapping\", {\n            get: function () {\n                return this._pixelSnapping;\n            },\n            set: function (value) {\n                if (this._pixelSnapping != value) {\n                    this._pixelSnapping = value;\n                    this.handleXYChanged();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.center = function (restraint) {\n            var r;\n            if (this._parent)\n                r = this.parent;\n            else\n                r = this.root;\n            this.setXY((r.width - this._width) / 2, (r.height - this._height) / 2);\n            if (restraint) {\n                this.addRelation(r, fgui.RelationType.Center_Center);\n                this.addRelation(r, fgui.RelationType.Middle_Middle);\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"width\", {\n            get: function () {\n                this.ensureSizeCorrect();\n                if (this._relations.sizeDirty)\n                    this._relations.ensureRelationsSizeCorrect();\n                return this._width;\n            },\n            set: function (value) {\n                this.setSize(value, this._rawHeight);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"height\", {\n            get: function () {\n                this.ensureSizeCorrect();\n                if (this._relations.sizeDirty)\n                    this._relations.ensureRelationsSizeCorrect();\n                return this._height;\n            },\n            set: function (value) {\n                this.setSize(this._rawWidth, value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.setSize = function (wv, hv, ignorePivot) {\n            if (this._rawWidth != wv || this._rawHeight != hv) {\n                this._rawWidth = wv;\n                this._rawHeight = hv;\n                if (wv < this.minWidth)\n                    wv = this.minWidth;\n                if (hv < this.minHeight)\n                    hv = this.minHeight;\n                if (this.maxWidth > 0 && wv > this.maxWidth)\n                    wv = this.maxWidth;\n                if (this.maxHeight > 0 && hv > this.maxHeight)\n                    hv = this.maxHeight;\n                var dWidth = wv - this._width;\n                var dHeight = hv - this._height;\n                this._width = wv;\n                this._height = hv;\n                this.handleSizeChanged();\n                if (this._pivotX != 0 || this._pivotY != 0) {\n                    if (!this._pivotAsAnchor) {\n                        if (!ignorePivot)\n                            this.setXY(this.x - this._pivotX * dWidth, this.y - this._pivotY * dHeight);\n                        this.updatePivotOffset();\n                    }\n                    else {\n                        this.applyPivot();\n                    }\n                }\n                if (this instanceof fgui.GGroup)\n                    this.resizeChildren(dWidth, dHeight);\n                this.updateGear(2);\n                if (this._parent) {\n                    this._relations.onOwnerSizeChanged(dWidth, dHeight, this._pivotAsAnchor || !ignorePivot);\n                    this._parent.setBoundsChangedFlag();\n                    if (this._group)\n                        this._group.setBoundsChangedFlag();\n                }\n                this.dispatchEventWith(GObject.SIZE_CHANGED);\n            }\n        };\n        GObject.prototype.makeFullScreen = function () {\n            this.setSize(fgui.GRoot.inst.width, fgui.GRoot.inst.height);\n        };\n        GObject.prototype.ensureSizeCorrect = function () {\n        };\n        Object.defineProperty(GObject.prototype, \"actualWidth\", {\n            get: function () {\n                return this.width * Math.abs(this._scaleX);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"actualHeight\", {\n            get: function () {\n                return this.height * Math.abs(this._scaleY);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"scaleX\", {\n            get: function () {\n                return this._scaleX;\n            },\n            set: function (value) {\n                this.setScale(value, this._scaleY);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"scaleY\", {\n            get: function () {\n                return this._scaleY;\n            },\n            set: function (value) {\n                this.setScale(this._scaleX, value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.setScale = function (sx, sy) {\n            if (this._scaleX != sx || this._scaleY != sy) {\n                this._scaleX = sx;\n                this._scaleY = sy;\n                this.handleScaleChanged();\n                this.applyPivot();\n                this.updateGear(2);\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"skewX\", {\n            get: function () {\n                return this._skewX;\n            },\n            set: function (value) {\n                this.setSkew(value, this._skewY);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"skewY\", {\n            get: function () {\n                return this._skewY;\n            },\n            set: function (value) {\n                this.setSkew(this._skewX, value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.setSkew = function (xv, yv) {\n            if (this._skewX != xv || this._skewY != yv) {\n                this._skewX = xv;\n                this._skewY = yv;\n                if (this._displayObject) {\n                    this._displayObject.skewX = xv;\n                    this._displayObject.skewY = yv;\n                }\n                this.applyPivot();\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"pivotX\", {\n            get: function () {\n                return this._pivotX;\n            },\n            set: function (value) {\n                this.setPivot(value, this._pivotY);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"pivotY\", {\n            get: function () {\n                return this._pivotY;\n            },\n            set: function (value) {\n                this.setPivot(this._pivotX, value);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.setPivot = function (xv, yv, asAnchor) {\n            if (this._pivotX != xv || this._pivotY != yv || this._pivotAsAnchor != asAnchor) {\n                this._pivotX = xv;\n                this._pivotY = yv;\n                this._pivotAsAnchor = asAnchor;\n                this.updatePivotOffset();\n                this.handleXYChanged();\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"pivotAsAnchor\", {\n            get: function () {\n                return this._pivotAsAnchor;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.internalSetPivot = function (xv, yv, asAnchor) {\n            this._pivotX = xv;\n            this._pivotY = yv;\n            this._pivotAsAnchor = asAnchor;\n            if (asAnchor)\n                this.handleXYChanged();\n        };\n        GObject.prototype.updatePivotOffset = function () {\n            if (this._displayObject) {\n                if (this._pivotX != 0 || this._pivotY != 0) {\n                    var px = this._pivotX * this._width;\n                    var py = this._pivotY * this._height;\n                    var pt = this._displayObject.matrix.transformPoint(px, py, sHelperPoint);\n                    this._pivotOffsetX = this._pivotX * this._width - (pt.x - this._displayObject.x);\n                    this._pivotOffsetY = this._pivotY * this._height - (pt.y - this._displayObject.y);\n                }\n                else {\n                    this._pivotOffsetX = 0;\n                    this._pivotOffsetY = 0;\n                }\n            }\n        };\n        GObject.prototype.applyPivot = function () {\n            if (this._pivotX != 0 || this._pivotY != 0) {\n                this.updatePivotOffset();\n                this.handleXYChanged();\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"touchable\", {\n            get: function () {\n                return this._touchable;\n            },\n            set: function (value) {\n                if (this._touchable != value) {\n                    this._touchable = value;\n                    this.updateGear(3);\n                    if ((this instanceof fgui.GImage) || (this instanceof fgui.GMovieClip)\n                        || (this instanceof fgui.GTextField) && !(this instanceof fgui.GTextInput) && !(this instanceof fgui.GRichTextField))\n                        return;\n                    if (this._displayObject) {\n                        this._displayObject.touchEnabled = this._touchable;\n                        if (this._displayObject instanceof egret.DisplayObjectContainer)\n                            this._displayObject.touchChildren = this._touchable;\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"grayed\", {\n            get: function () {\n                return this._grayed;\n            },\n            set: function (value) {\n                if (this._grayed != value) {\n                    this._grayed = value;\n                    this.handleGrayedChanged();\n                    this.updateGear(3);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"enabled\", {\n            get: function () {\n                return !this._grayed && this._touchable;\n            },\n            set: function (value) {\n                this.grayed = !value;\n                this.touchable = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"rotation\", {\n            get: function () {\n                return this._rotation;\n            },\n            set: function (value) {\n                if (this._rotation != value) {\n                    this._rotation = value;\n                    if (this._displayObject)\n                        this._displayObject.rotation = this.normalizeRotation;\n                    this.applyPivot();\n                    this.updateGear(3);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"normalizeRotation\", {\n            get: function () {\n                var rot = this._rotation % 360;\n                if (rot > 180)\n                    rot -= 360;\n                else if (rot < -180)\n                    rot += 360;\n                return rot;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"alpha\", {\n            get: function () {\n                return this._alpha;\n            },\n            set: function (value) {\n                if (this._alpha != value) {\n                    this._alpha = value;\n                    this.handleAlphaChanged();\n                    this.updateGear(3);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"visible\", {\n            get: function () {\n                return this._visible;\n            },\n            set: function (value) {\n                if (this._visible != value) {\n                    this._visible = value;\n                    this.handleVisibleChanged();\n                    if (this._parent)\n                        this._parent.setBoundsChangedFlag();\n                    if (this._group && this._group.excludeInvisibles)\n                        this._group.setBoundsChangedFlag();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"internalVisible\", {\n            get: function () {\n                return this._internalVisible && (!this._group || this._group.internalVisible);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"internalVisible2\", {\n            get: function () {\n                return this._visible && (!this._group || this._group.internalVisible2);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"internalVisible3\", {\n            get: function () {\n                return this._visible && this._internalVisible;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"sortingOrder\", {\n            get: function () {\n                return this._sortingOrder;\n            },\n            set: function (value) {\n                if (value < 0)\n                    value = 0;\n                if (this._sortingOrder != value) {\n                    var old = this._sortingOrder;\n                    this._sortingOrder = value;\n                    if (this._parent)\n                        this._parent.childSortingOrderChanged(this, old, this._sortingOrder);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"focused\", {\n            get: function () {\n                return this.root.focus == this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.requestFocus = function () {\n            this.root.focus = this;\n        };\n        Object.defineProperty(GObject.prototype, \"tooltips\", {\n            get: function () {\n                return this._tooltips;\n            },\n            set: function (value) {\n                this._tooltips = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"blendMode\", {\n            get: function () {\n                return this._displayObject.blendMode;\n            },\n            set: function (value) {\n                this._displayObject.blendMode = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"filters\", {\n            get: function () {\n                return this._displayObject.filters;\n            },\n            set: function (value) {\n                this._displayObject.filters = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"inContainer\", {\n            get: function () {\n                return this._displayObject != null && this._displayObject.parent != null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"onStage\", {\n            get: function () {\n                return this._displayObject != null && this._displayObject.stage != null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"resourceURL\", {\n            get: function () {\n                if (this.packageItem)\n                    return \"ui://\" + this.packageItem.owner.id + this.packageItem.id;\n                else\n                    return null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"group\", {\n            get: function () {\n                return this._group;\n            },\n            set: function (value) {\n                if (this._group != value) {\n                    if (this._group)\n                        this._group.setBoundsChangedFlag();\n                    this._group = value;\n                    if (this._group)\n                        this._group.setBoundsChangedFlag();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.getGear = function (index) {\n            var gear = this._gears[index];\n            if (gear == null)\n                this._gears[index] = gear = fgui.GearBase.create(this, index);\n            return gear;\n        };\n        GObject.prototype.updateGear = function (index) {\n            if (this._underConstruct || this._gearLocked)\n                return;\n            var gear = this._gears[index];\n            if (gear && gear.controller)\n                gear.updateState();\n        };\n        GObject.prototype.checkGearController = function (index, c) {\n            return this._gears[index] != null && this._gears[index].controller == c;\n        };\n        GObject.prototype.updateGearFromRelations = function (index, dx, dy) {\n            if (this._gears[index])\n                this._gears[index].updateFromRelations(dx, dy);\n        };\n        GObject.prototype.addDisplayLock = function () {\n            var gearDisplay = this._gears[0];\n            if (gearDisplay && gearDisplay.controller) {\n                var ret = gearDisplay.addLock();\n                this.checkGearDisplay();\n                return ret;\n            }\n            else\n                return 0;\n        };\n        GObject.prototype.releaseDisplayLock = function (token) {\n            var gearDisplay = this._gears[0];\n            if (gearDisplay && gearDisplay.controller) {\n                gearDisplay.releaseLock(token);\n                this.checkGearDisplay();\n            }\n        };\n        GObject.prototype.checkGearDisplay = function () {\n            if (this._handlingController)\n                return;\n            var connected = this._gears[0] == null || this._gears[0].connected;\n            if (this._gears[8])\n                connected = this._gears[8].evaluate(connected);\n            if (connected != this._internalVisible) {\n                this._internalVisible = connected;\n                if (this._parent)\n                    this._parent.childStateChanged(this);\n                if (this._group && this._group.excludeInvisibles)\n                    this._group.setBoundsChangedFlag();\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"gearXY\", {\n            get: function () {\n                return this.getGear(1);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"gearSize\", {\n            get: function () {\n                return this.getGear(2);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"gearLook\", {\n            get: function () {\n                return this.getGear(3);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"relations\", {\n            get: function () {\n                return this._relations;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.addRelation = function (target, relationType, usePercent) {\n            this._relations.add(target, relationType, usePercent);\n        };\n        GObject.prototype.removeRelation = function (target, relationType) {\n            this._relations.remove(target, relationType || 0);\n        };\n        Object.defineProperty(GObject.prototype, \"displayObject\", {\n            get: function () {\n                return this._displayObject;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.setDisplayObject = function (value) {\n            if (this._displayObject != value) {\n                if (this._displayObject)\n                    delete this._displayObject[\"$owner\"];\n                this._displayObject = value;\n                this._displayObject[\"$owner\"] = this;\n            }\n        };\n        Object.defineProperty(GObject.prototype, \"parent\", {\n            get: function () {\n                return this._parent;\n            },\n            set: function (val) {\n                this._parent = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.removeFromParent = function () {\n            if (this._parent)\n                this._parent.removeChild(this);\n        };\n        Object.defineProperty(GObject.prototype, \"root\", {\n            get: function () {\n                if (this instanceof fgui.GRoot)\n                    return this;\n                var p = this._parent;\n                while (p) {\n                    if (p instanceof fgui.GRoot)\n                        return p;\n                    p = p.parent;\n                }\n                return fgui.GRoot.inst;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asCom\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asButton\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asLabel\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asProgress\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asTextField\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asRichTextField\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asTextInput\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asLoader\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asList\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asTree\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asGraph\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asGroup\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asSlider\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asComboBox\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asImage\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"asMovieClip\", {\n            get: function () {\n                return this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.cast = function (obj) {\n            return obj[\"$owner\"];\n        };\n        Object.defineProperty(GObject.prototype, \"text\", {\n            get: function () {\n                return null;\n            },\n            set: function (value) {\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"icon\", {\n            get: function () {\n                return null;\n            },\n            set: function (value) {\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"isDisposed\", {\n            get: function () {\n                return this._disposed;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"treeNode\", {\n            get: function () {\n                return this._treeNode;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.dispose = function () {\n            if (this._disposed)\n                return;\n            this._disposed = true;\n            this.removeFromParent();\n            this._relations.dispose();\n            this._displayObject = null;\n            for (var i = 0; i < 10; i++) {\n                var gear = this._gears[i];\n                if (gear)\n                    gear.dispose();\n            }\n        };\n        GObject.prototype.addClickListener = function (listener, thisObj) {\n            this.addEventListener(egret.TouchEvent.TOUCH_TAP, listener, thisObj);\n        };\n        GObject.prototype.removeClickListener = function (listener, thisObj) {\n            this.removeEventListener(egret.TouchEvent.TOUCH_TAP, listener, thisObj);\n        };\n        GObject.prototype.hasClickListener = function () {\n            return this.hasEventListener(egret.TouchEvent.TOUCH_TAP);\n        };\n        GObject.prototype.addEventListener = function (type, listener, thisObject) {\n            _super_1.prototype.addEventListener.call(this, type, listener, thisObject);\n            if (this._displayObject) {\n                this._displayObject.addEventListener(type, this._reDispatch, this);\n            }\n        };\n        GObject.prototype.removeEventListener = function (type, listener, thisObject) {\n            _super_1.prototype.removeEventListener.call(this, type, listener, thisObject);\n            if (this._displayObject && !this.hasEventListener(type)) {\n                this._displayObject.removeEventListener(type, this._reDispatch, this);\n            }\n        };\n        GObject.prototype._reDispatch = function (evt) {\n            this.dispatchEvent(evt);\n        };\n        Object.defineProperty(GObject.prototype, \"draggable\", {\n            get: function () {\n                return this._draggable;\n            },\n            set: function (value) {\n                if (this._draggable != value) {\n                    this._draggable = value;\n                    this.initDrag();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GObject.prototype, \"dragBounds\", {\n            get: function () {\n                return this._dragBounds;\n            },\n            set: function (value) {\n                this._dragBounds = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.startDrag = function (touchPointID, stageX, stageY) {\n            if (this._displayObject.stage == null)\n                return;\n            this.dragBegin(touchPointID, stageX, stageY);\n        };\n        GObject.prototype.stopDrag = function () {\n            this.dragEnd();\n        };\n        Object.defineProperty(GObject.prototype, \"dragging\", {\n            get: function () {\n                return GObject.draggingObject == this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObject.prototype.localToGlobal = function (ax, ay, result) {\n            ax = ax || 0;\n            ay = ay || 0;\n            if (this._pivotAsAnchor) {\n                ax += this._pivotX * this._width;\n                ay += this._pivotY * this._height;\n            }\n            return this._displayObject.localToGlobal(ax, ay, result);\n        };\n        GObject.prototype.globalToLocal = function (ax, ay, result) {\n            ax = ax || 0;\n            ay = ay || 0;\n            var pt = this._displayObject.globalToLocal(ax, ay, result);\n            if (this._pivotAsAnchor) {\n                pt.x -= this._pivotX * this._width;\n                pt.y -= this._pivotY * this._height;\n            }\n            return pt;\n        };\n        GObject.prototype.localToRoot = function (ax, ay, result) {\n            ax = ax || 0;\n            ay = ay || 0;\n            var pt = this._displayObject.localToGlobal(ax, ay, result);\n            pt.x /= fgui.GRoot.contentScaleFactor;\n            pt.y /= fgui.GRoot.contentScaleFactor;\n            return pt;\n        };\n        GObject.prototype.rootToLocal = function (ax, ay, resultPoint) {\n            ax = ax || 0;\n            ay = ay || 0;\n            ax *= fgui.GRoot.contentScaleFactor;\n            ay *= fgui.GRoot.contentScaleFactor;\n            return this._displayObject.globalToLocal(ax, ay, resultPoint);\n        };\n        GObject.prototype.localToGlobalRect = function (ax, ay, aw, ah, result) {\n            ax = ax || 0;\n            ay = ay || 0;\n            aw = aw || 0;\n            ah = ah || 0;\n            result = result || new egret.Rectangle();\n            var pt = this.localToGlobal(ax, ay);\n            result.x = pt.x;\n            result.y = pt.y;\n            pt = this.localToGlobal(ax + aw, ay + ah);\n            result.right = pt.x;\n            result.bottom = pt.y;\n            return result;\n        };\n        GObject.prototype.globalToLocalRect = function (ax, ay, aw, ah, result) {\n            ax = ax || 0;\n            ay = ay || 0;\n            aw = aw || 0;\n            ah = ah || 0;\n            result = result || new egret.Rectangle();\n            var pt = this.globalToLocal(ax, ay);\n            result.x = pt.x;\n            result.y = pt.y;\n            pt = this.globalToLocal(ax + aw, ay + ah);\n            result.right = pt.x;\n            result.bottom = pt.y;\n            return result;\n        };\n        GObject.prototype.handleControllerChanged = function (c) {\n            this._handlingController = true;\n            for (var i = 0; i < 10; i++) {\n                var gear = this._gears[i];\n                if (gear && gear.controller == c)\n                    gear.apply();\n            }\n            this._handlingController = false;\n            this.checkGearDisplay();\n        };\n        GObject.prototype.createDisplayObject = function () {\n        };\n        GObject.prototype.switchDisplayObject = function (newObj) {\n            if (newObj == this._displayObject)\n                return;\n            var old = this._displayObject;\n            if (this._displayObject && this._displayObject.parent) {\n                var i = this._displayObject.parent.getChildIndex(this._displayObject);\n                this._displayObject.parent.addChildAt(newObj, i);\n                this._displayObject.parent.removeChild(this._displayObject);\n            }\n            this._displayObject = newObj;\n            this._displayObject.x = old.x;\n            this._displayObject.y = old.y;\n            this._displayObject.rotation = old.rotation;\n            this._displayObject.alpha = old.alpha;\n            this._displayObject.visible = old.visible;\n            this._displayObject.touchEnabled = old.touchEnabled;\n            this._displayObject.scaleX = old.scaleX;\n            this._displayObject.scaleY = old.scaleY;\n            fgui.ToolSet.setColorFilter(this._displayObject, this._grayed);\n            if (this._displayObject instanceof egret.DisplayObjectContainer)\n                this._displayObject.touchChildren = this._touchable;\n        };\n        GObject.prototype.handleXYChanged = function () {\n            if (this._displayObject) {\n                var xv = this._x;\n                var yv = this._y;\n                if (this._pivotAsAnchor) {\n                    xv -= this._pivotX * this._width;\n                    yv -= this._pivotY * this._height;\n                }\n                if (this._pixelSnapping) {\n                    xv = Math.round(xv);\n                    yv = Math.round(yv);\n                }\n                this._displayObject.x = xv + this._pivotOffsetX;\n                this._displayObject.y = yv + this._pivotOffsetY;\n            }\n        };\n        GObject.prototype.handleSizeChanged = function () {\n            if (this._displayObject) {\n                this._displayObject.width = this._width;\n                this._displayObject.height = this._height;\n            }\n        };\n        GObject.prototype.handleScaleChanged = function () {\n            if (this._displayObject) {\n                this._displayObject.scaleX = this._scaleX;\n                this._displayObject.scaleY = this._scaleY;\n            }\n        };\n        GObject.prototype.handleGrayedChanged = function () {\n            if (this._displayObject) {\n                fgui.ToolSet.setColorFilter(this._displayObject, this._grayed);\n            }\n        };\n        GObject.prototype.handleAlphaChanged = function () {\n            if (this._displayObject)\n                this._displayObject.alpha = this._alpha;\n        };\n        GObject.prototype.handleVisibleChanged = function () {\n            if (this._displayObject)\n                this._displayObject.visible = this.internalVisible2;\n            if (this instanceof fgui.GGroup)\n                this.handleVisibleChanged();\n        };\n        GObject.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Text:\n                    return this.text;\n                case fgui.ObjectPropID.Icon:\n                    return this.icon;\n                case fgui.ObjectPropID.Color:\n                    return NaN;\n                case fgui.ObjectPropID.OutlineColor:\n                    return NaN;\n                case fgui.ObjectPropID.Playing:\n                    return false;\n                case fgui.ObjectPropID.Frame:\n                    return 0;\n                case fgui.ObjectPropID.DeltaTime:\n                    return 0;\n                case fgui.ObjectPropID.TimeScale:\n                    return 1;\n                case fgui.ObjectPropID.FontSize:\n                    return 0;\n                case fgui.ObjectPropID.Selected:\n                    return false;\n                default:\n                    return undefined;\n            }\n        };\n        GObject.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Text:\n                    this.text = value;\n                    break;\n                case fgui.ObjectPropID.Icon:\n                    this.icon = value;\n                    break;\n            }\n        };\n        GObject.prototype.constructFromResource = function () {\n        };\n        GObject.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            buffer.seek(beginPos, 0);\n            buffer.skip(5);\n            var f1;\n            var f2;\n            this._id = buffer.readS();\n            this._name = buffer.readS();\n            f1 = buffer.readInt();\n            f2 = buffer.readInt();\n            this.setXY(f1, f2);\n            if (buffer.readBool()) {\n                this.initWidth = buffer.readInt();\n                this.initHeight = buffer.readInt();\n                this.setSize(this.initWidth, this.initHeight, true);\n            }\n            if (buffer.readBool()) {\n                this.minWidth = buffer.readInt();\n                this.maxWidth = buffer.readInt();\n                this.minHeight = buffer.readInt();\n                this.maxHeight = buffer.readInt();\n            }\n            if (buffer.readBool()) {\n                f1 = buffer.readFloat();\n                f2 = buffer.readFloat();\n                this.setScale(f1, f2);\n            }\n            if (buffer.readBool()) {\n                f1 = buffer.readFloat();\n                f2 = buffer.readFloat();\n                this.setSkew(f1, f2);\n            }\n            if (buffer.readBool()) {\n                f1 = buffer.readFloat();\n                f2 = buffer.readFloat();\n                this.setPivot(f1, f2, buffer.readBool());\n            }\n            f1 = buffer.readFloat();\n            if (f1 != 1)\n                this.alpha = f1;\n            f1 = buffer.readFloat();\n            if (f1 != 0)\n                this.rotation = f1;\n            if (!buffer.readBool())\n                this.visible = false;\n            if (!buffer.readBool())\n                this.touchable = false;\n            if (buffer.readBool())\n                this.grayed = true;\n            var bm = buffer.readByte();\n            if (bm == 2)\n                this.blendMode = egret.BlendMode.ADD;\n            else if (bm == 5)\n                this.blendMode = egret.BlendMode.ERASE;\n            var filter = buffer.readByte();\n            if (filter == 1 && this._displayObject)\n                fgui.ToolSet.setColorFilter(this._displayObject, [buffer.readFloat(), buffer.readFloat(), buffer.readFloat(), buffer.readFloat()]);\n            var str = buffer.readS();\n            if (str != null)\n                this.data = str;\n        };\n        GObject.prototype.setup_afterAdd = function (buffer, beginPos) {\n            buffer.seek(beginPos, 1);\n            var str = buffer.readS();\n            if (str != null)\n                this.tooltips = str;\n            var groupId = buffer.readShort();\n            if (groupId >= 0)\n                this.group = this.parent.getChildAt(groupId);\n            buffer.seek(beginPos, 2);\n            var cnt = buffer.readShort();\n            for (var i = 0; i < cnt; i++) {\n                var nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                var gear = this.getGear(buffer.readByte());\n                gear.setup(buffer);\n                buffer.position = nextPos;\n            }\n        };\n        GObject.prototype.initDrag = function () {\n            if (this._draggable)\n                this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__begin, this);\n            else\n                this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__begin, this);\n        };\n        GObject.prototype.dragBegin = function (touchPointID, stageX, stageY) {\n            if (GObject.draggingObject) {\n                var tmp = GObject.draggingObject;\n                tmp.stopDrag();\n                GObject.draggingObject = null;\n                var dragEvent = new fgui.DragEvent(fgui.DragEvent.DRAG_END);\n                dragEvent.stageX = stageX || fgui.GRoot.mouseX;\n                dragEvent.stageY = stageY || fgui.GRoot.mouseY;\n                dragEvent.touchPointID = touchPointID || 0;\n                tmp.dispatchEvent(dragEvent);\n            }\n            sGlobalDragStart.x = stageX || fgui.GRoot.mouseX;\n            sGlobalDragStart.y = stageY || fgui.GRoot.mouseY;\n            this.localToGlobalRect(0, 0, this._width, this._height, sGlobalRect);\n            this._dragTesting = true;\n            GObject.draggingObject = this;\n            fgui.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__moving, this);\n            fgui.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__end, this);\n        };\n        GObject.prototype.dragEnd = function () {\n            if (GObject.draggingObject == this) {\n                this.reset();\n                this._dragTesting = false;\n                GObject.draggingObject = null;\n            }\n        };\n        GObject.prototype.reset = function () {\n            fgui.GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__moving, this);\n            fgui.GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_END, this.__end, this);\n        };\n        GObject.prototype.__begin = function (evt) {\n            if (this._dragStartPos == null)\n                this._dragStartPos = new egret.Point();\n            this._dragStartPos.x = evt.stageX;\n            this._dragStartPos.y = evt.stageY;\n            this._dragTesting = true;\n            fgui.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__moving, this);\n            fgui.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__end, this);\n        };\n        GObject.prototype.__moving = function (evt) {\n            if (GObject.draggingObject != this && this._draggable && this._dragTesting) {\n                var sensitivity = fgui.UIConfig.touchDragSensitivity;\n                if (this._dragStartPos\n                    && Math.abs(this._dragStartPos.x - evt.stageX) < sensitivity\n                    && Math.abs(this._dragStartPos.y - evt.stageY) < sensitivity)\n                    return;\n                this._dragTesting = false;\n                var dragEvent = new fgui.DragEvent(fgui.DragEvent.DRAG_START);\n                dragEvent.stageX = evt.stageX;\n                dragEvent.stageY = evt.stageY;\n                dragEvent.touchPointID = evt.touchPointID;\n                this.dispatchEvent(dragEvent);\n                if (!dragEvent.isDefaultPrevented())\n                    this.dragBegin(evt.touchPointID, evt.stageX, evt.stageY);\n            }\n            if (GObject.draggingObject == this) {\n                var xx = evt.stageX - sGlobalDragStart.x + sGlobalRect.x;\n                var yy = evt.stageY - sGlobalDragStart.y + sGlobalRect.y;\n                if (this._dragBounds) {\n                    var rect = fgui.GRoot.inst.localToGlobalRect(this._dragBounds.x, this._dragBounds.y, this._dragBounds.width, this._dragBounds.height, sDragHelperRect);\n                    if (xx < rect.x)\n                        xx = rect.x;\n                    else if (xx + sGlobalRect.width > rect.right) {\n                        xx = rect.right - sGlobalRect.width;\n                        if (xx < rect.x)\n                            xx = rect.x;\n                    }\n                    if (yy < rect.y)\n                        yy = rect.y;\n                    else if (yy + sGlobalRect.height > rect.bottom) {\n                        yy = rect.bottom - sGlobalRect.height;\n                        if (yy < rect.y)\n                            yy = rect.y;\n                    }\n                }\n                sUpdateInDragging = true;\n                var pt = this.parent.globalToLocal(xx, yy, sHelperPoint);\n                this.setXY(Math.round(pt.x), Math.round(pt.y));\n                sUpdateInDragging = false;\n                var dragEvent = new fgui.DragEvent(fgui.DragEvent.DRAG_MOVING);\n                dragEvent.stageX = evt.stageX;\n                dragEvent.stageY = evt.stageY;\n                dragEvent.touchPointID = evt.touchPointID;\n                this.dispatchEvent(dragEvent);\n            }\n        };\n        GObject.prototype.__end = function (evt) {\n            if (GObject.draggingObject == this) {\n                GObject.draggingObject = null;\n                this.reset();\n                var dragEvent = new fgui.DragEvent(fgui.DragEvent.DRAG_END);\n                dragEvent.stageX = evt.stageX;\n                dragEvent.stageY = evt.stageY;\n                dragEvent.touchPointID = evt.touchPointID;\n                this.dispatchEvent(dragEvent);\n            }\n            else if (this._dragTesting) {\n                this._dragTesting = false;\n                this.reset();\n            }\n        };\n        GObject.XY_CHANGED = \"__xyChanged\";\n        GObject.SIZE_CHANGED = \"__sizeChanged\";\n        GObject.SIZE_DELAY_CHANGE = \"__sizeDelayChange\";\n        GObject.GEAR_STOP = \"gearStop\";\n        return GObject;\n    }(egret.EventDispatcher));\n    fgui.GObject = GObject;\n    var _gInstanceCounter = 0;\n    var sGlobalDragStart = new egret.Point();\n    var sGlobalRect = new egret.Rectangle();\n    var sHelperPoint = new egret.Point();\n    var sDragHelperRect = new egret.Rectangle();\n    var sUpdateInDragging;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GComponent = (function (_super_1) {\n        __extends(GComponent, _super_1);\n        function GComponent() {\n            var _this = _super_1.call(this) || this;\n            _this._sortingChildCount = 0;\n            _this._childrenRenderOrder = fgui.ChildrenRenderOrder.Ascent;\n            _this._apexIndex = 0;\n            _this._children = new Array();\n            _this._controllers = new Array();\n            _this._transitions = new Array();\n            _this._margin = new fgui.Margin();\n            _this._alignOffset = new egret.Point();\n            return _this;\n        }\n        GComponent.prototype.createDisplayObject = function () {\n            this._rootContainer = new fgui.UIContainer();\n            this.setDisplayObject(this._rootContainer);\n            this._container = this._rootContainer;\n        };\n        GComponent.prototype.dispose = function () {\n            var i;\n            var cnt;\n            cnt = this._transitions.length;\n            for (i = 0; i < cnt; ++i) {\n                var trans = this._transitions[i];\n                trans.dispose();\n            }\n            cnt = this._controllers.length;\n            for (i = 0; i < cnt; ++i) {\n                var cc = this._controllers[i];\n                cc.dispose();\n            }\n            if (this._scrollPane)\n                this._scrollPane.dispose();\n            cnt = this._children.length;\n            for (i = cnt - 1; i >= 0; --i) {\n                var obj = this._children[i];\n                obj.parent = null;\n                obj.dispose();\n            }\n            this._boundsChanged = false;\n            _super_1.prototype.dispose.call(this);\n        };\n        Object.defineProperty(GComponent.prototype, \"displayListContainer\", {\n            get: function () {\n                return this._container;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GComponent.prototype.addChild = function (child) {\n            this.addChildAt(child, this._children.length);\n            return child;\n        };\n        GComponent.prototype.addChildAt = function (child, index) {\n            if (index === void 0) { index = 0; }\n            if (!child)\n                throw \"child is null\";\n            var numChildren = this._children.length;\n            if (index >= 0 && index <= numChildren) {\n                if (child.parent == this) {\n                    this.setChildIndex(child, index);\n                }\n                else {\n                    child.removeFromParent();\n                    child.parent = this;\n                    var cnt = this._children.length;\n                    if (child.sortingOrder != 0) {\n                        this._sortingChildCount++;\n                        index = this.getInsertPosForSortingChild(child);\n                    }\n                    else if (this._sortingChildCount > 0) {\n                        if (index > (cnt - this._sortingChildCount))\n                            index = cnt - this._sortingChildCount;\n                    }\n                    if (index == cnt)\n                        this._children.push(child);\n                    else\n                        this._children.splice(index, 0, child);\n                    this.childStateChanged(child);\n                    this.setBoundsChangedFlag();\n                }\n                return child;\n            }\n            else {\n                throw \"Invalid child index\";\n            }\n        };\n        GComponent.prototype.getInsertPosForSortingChild = function (target) {\n            var cnt = this._children.length;\n            var i = 0;\n            for (i = 0; i < cnt; i++) {\n                var child = this._children[i];\n                if (child == target)\n                    continue;\n                if (target.sortingOrder < child.sortingOrder)\n                    break;\n            }\n            return i;\n        };\n        GComponent.prototype.removeChild = function (child, dispose) {\n            var childIndex = this._children.indexOf(child);\n            if (childIndex != -1) {\n                this.removeChildAt(childIndex, dispose);\n            }\n            return child;\n        };\n        GComponent.prototype.removeChildAt = function (index, dispose) {\n            if (index >= 0 && index < this.numChildren) {\n                var child = this._children[index];\n                child.parent = null;\n                if (child.sortingOrder != 0)\n                    this._sortingChildCount--;\n                this._children.splice(index, 1);\n                child.group = null;\n                if (child.inContainer) {\n                    this._container.removeChild(child.displayObject);\n                    if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Arch)\n                        fgui.GTimers.inst.callLater(this.buildNativeDisplayList, this);\n                }\n                if (dispose)\n                    child.dispose();\n                this.setBoundsChangedFlag();\n                return child;\n            }\n            else {\n                throw \"Invalid child index\";\n            }\n        };\n        GComponent.prototype.removeChildren = function (beginIndex, endIndex, dispose) {\n            if (beginIndex == undefined)\n                beginIndex = 0;\n            if (endIndex == undefined)\n                endIndex = -1;\n            if (endIndex < 0 || endIndex >= this.numChildren)\n                endIndex = this.numChildren - 1;\n            for (var i = beginIndex; i <= endIndex; ++i)\n                this.removeChildAt(beginIndex, dispose);\n        };\n        GComponent.prototype.getChildAt = function (index) {\n            if (index >= 0 && index < this.numChildren)\n                return this._children[index];\n            else\n                throw \"Invalid child index\";\n        };\n        GComponent.prototype.getChild = function (name) {\n            var cnt = this._children.length;\n            for (var i = 0; i < cnt; ++i) {\n                if (this._children[i].name == name)\n                    return this._children[i];\n            }\n            return null;\n        };\n        GComponent.prototype.getChildByPath = function (path) {\n            var arr = path.split(\".\");\n            var cnt = arr.length;\n            var gcom = this;\n            var obj;\n            for (var i = 0; i < cnt; ++i) {\n                obj = gcom.getChild(arr[i]);\n                if (!obj)\n                    break;\n                if (i != cnt - 1) {\n                    if (!(obj instanceof GComponent)) {\n                        obj = null;\n                        break;\n                    }\n                    else\n                        gcom = obj;\n                }\n            }\n            return obj;\n        };\n        GComponent.prototype.getVisibleChild = function (name) {\n            var cnt = this._children.length;\n            for (var i = 0; i < cnt; ++i) {\n                var child = this._children[i];\n                if (child.internalVisible && child.internalVisible && child.name == name)\n                    return child;\n            }\n            return null;\n        };\n        GComponent.prototype.getChildInGroup = function (name, group) {\n            var cnt = this._children.length;\n            for (var i = 0; i < cnt; ++i) {\n                var child = this._children[i];\n                if (child.group == group && child.name == name)\n                    return child;\n            }\n            return null;\n        };\n        GComponent.prototype.getChildById = function (id) {\n            var cnt = this._children.length;\n            for (var i = 0; i < cnt; ++i) {\n                if (this._children[i]._id == id)\n                    return this._children[i];\n            }\n            return null;\n        };\n        GComponent.prototype.getChildIndex = function (child) {\n            return this._children.indexOf(child);\n        };\n        GComponent.prototype.setChildIndex = function (child, index) {\n            var oldIndex = this._children.indexOf(child);\n            if (oldIndex == -1)\n                throw \"Not a child of this container\";\n            if (child.sortingOrder != 0)\n                return;\n            var cnt = this._children.length;\n            if (this._sortingChildCount > 0) {\n                if (index > (cnt - this._sortingChildCount - 1))\n                    index = cnt - this._sortingChildCount - 1;\n            }\n            this._setChildIndex(child, oldIndex, index);\n        };\n        GComponent.prototype.setChildIndexBefore = function (child, index) {\n            var oldIndex = this._children.indexOf(child);\n            if (oldIndex == -1)\n                throw \"Not a child of this container\";\n            if (child.sortingOrder != 0)\n                return oldIndex;\n            var cnt = this._children.length;\n            if (this._sortingChildCount > 0) {\n                if (index > (cnt - this._sortingChildCount - 1))\n                    index = cnt - this._sortingChildCount - 1;\n            }\n            if (oldIndex < index)\n                return this._setChildIndex(child, oldIndex, index - 1);\n            else\n                return this._setChildIndex(child, oldIndex, index);\n        };\n        GComponent.prototype._setChildIndex = function (child, oldIndex, index) {\n            var cnt = this._children.length;\n            if (index > cnt)\n                index = cnt;\n            if (oldIndex == index)\n                return oldIndex;\n            this._children.splice(oldIndex, 1);\n            this._children.splice(index, 0, child);\n            if (child.inContainer) {\n                var displayIndex = 0;\n                var g;\n                var i;\n                if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Ascent) {\n                    for (i = 0; i < index; i++) {\n                        g = this._children[i];\n                        if (g.inContainer)\n                            displayIndex++;\n                    }\n                    if (displayIndex == this._container.numChildren)\n                        displayIndex--;\n                    this._container.setChildIndex(child.displayObject, displayIndex);\n                }\n                else if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Descent) {\n                    for (i = cnt - 1; i > index; i--) {\n                        g = this._children[i];\n                        if (g.inContainer)\n                            displayIndex++;\n                    }\n                    if (displayIndex == this._container.numChildren)\n                        displayIndex--;\n                    this._container.setChildIndex(child.displayObject, displayIndex);\n                }\n                else {\n                    fgui.GTimers.inst.callLater(this.buildNativeDisplayList, this);\n                }\n                this.setBoundsChangedFlag();\n            }\n            return index;\n        };\n        GComponent.prototype.swapChildren = function (child1, child2) {\n            var index1 = this._children.indexOf(child1);\n            var index2 = this._children.indexOf(child2);\n            if (index1 == -1 || index2 == -1)\n                throw \"Not a child of this container\";\n            this.swapChildrenAt(index1, index2);\n        };\n        GComponent.prototype.swapChildrenAt = function (index1, index2) {\n            var child1 = this._children[index1];\n            var child2 = this._children[index2];\n            this.setChildIndex(child1, index2);\n            this.setChildIndex(child2, index1);\n        };\n        Object.defineProperty(GComponent.prototype, \"numChildren\", {\n            get: function () {\n                return this._children.length;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GComponent.prototype.isAncestorOf = function (child) {\n            if (!child)\n                return false;\n            var p = child.parent;\n            while (p) {\n                if (p == this)\n                    return true;\n                p = p.parent;\n            }\n            return false;\n        };\n        GComponent.prototype.addController = function (controller) {\n            this._controllers.push(controller);\n            controller.parent = this;\n            this.applyController(controller);\n        };\n        GComponent.prototype.getControllerAt = function (index) {\n            return this._controllers[index];\n        };\n        GComponent.prototype.getController = function (name) {\n            var cnt = this._controllers.length;\n            for (var i = 0; i < cnt; ++i) {\n                var c = this._controllers[i];\n                if (c.name == name)\n                    return c;\n            }\n            return null;\n        };\n        GComponent.prototype.removeController = function (c) {\n            var index = this._controllers.indexOf(c);\n            if (index == -1)\n                throw \"controller not exists\";\n            c.parent = null;\n            this._controllers.splice(index, 1);\n            var length = this._children.length;\n            for (var i = 0; i < length; i++) {\n                var child = this._children[i];\n                child.handleControllerChanged(c);\n            }\n        };\n        Object.defineProperty(GComponent.prototype, \"controllers\", {\n            get: function () {\n                return this._controllers;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GComponent.prototype.childStateChanged = function (child) {\n            if (this._buildingDisplayList)\n                return;\n            var cnt = this._children.length;\n            var g;\n            var i;\n            if (child instanceof fgui.GGroup) {\n                for (i = 0; i < cnt; i++) {\n                    g = this._children[i];\n                    if (g.group == child)\n                        this.childStateChanged(g);\n                }\n                return;\n            }\n            if (!child.displayObject)\n                return;\n            if (child.internalVisible) {\n                if (!child.displayObject.parent) {\n                    var index = 0;\n                    if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Ascent) {\n                        for (i = 0; i < cnt; i++) {\n                            g = this._children[i];\n                            if (g == child)\n                                break;\n                            if (g.displayObject && g.displayObject.parent)\n                                index++;\n                        }\n                        this._container.addChildAt(child.displayObject, index);\n                    }\n                    else if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Descent) {\n                        for (i = cnt - 1; i >= 0; i--) {\n                            g = this._children[i];\n                            if (g == child)\n                                break;\n                            if (g.displayObject && g.displayObject.parent)\n                                index++;\n                        }\n                        this._container.addChildAt(child.displayObject, index);\n                    }\n                    else {\n                        this._container.addChild(child.displayObject);\n                        fgui.GTimers.inst.callLater(this.buildNativeDisplayList, this);\n                    }\n                }\n            }\n            else {\n                if (child.displayObject.parent)\n                    this._container.removeChild(child.displayObject);\n            }\n        };\n        GComponent.prototype.buildNativeDisplayList = function () {\n            var cnt = this._children.length;\n            if (cnt == 0)\n                return;\n            var i;\n            var child;\n            switch (this._childrenRenderOrder) {\n                case fgui.ChildrenRenderOrder.Ascent:\n                    {\n                        for (i = 0; i < cnt; i++) {\n                            child = this._children[i];\n                            if (child.displayObject && child.internalVisible)\n                                this._container.addChild(child.displayObject);\n                        }\n                    }\n                    break;\n                case fgui.ChildrenRenderOrder.Descent:\n                    {\n                        for (i = cnt - 1; i >= 0; i--) {\n                            child = this._children[i];\n                            if (child.displayObject && child.internalVisible)\n                                this._container.addChild(child.displayObject);\n                        }\n                    }\n                    break;\n                case fgui.ChildrenRenderOrder.Arch:\n                    {\n                        var apex = fgui.ToolSet.clamp(this._apexIndex, 0, cnt);\n                        for (i = 0; i < apex; i++) {\n                            child = this._children[i];\n                            if (child.displayObject && child.internalVisible)\n                                this._container.addChild(child.displayObject);\n                        }\n                        for (i = cnt - 1; i >= apex; i--) {\n                            child = this._children[i];\n                            if (child.displayObject && child.internalVisible)\n                                this._container.addChild(child.displayObject);\n                        }\n                    }\n                    break;\n            }\n        };\n        GComponent.prototype.applyController = function (c) {\n            this._applyingController = c;\n            var child;\n            var length = this._children.length;\n            for (var i = 0; i < length; i++) {\n                child = this._children[i];\n                child.handleControllerChanged(c);\n            }\n            this._applyingController = null;\n            c.runActions();\n        };\n        GComponent.prototype.applyAllControllers = function () {\n            var cnt = this._controllers.length;\n            for (var i = 0; i < cnt; ++i) {\n                this.applyController(this._controllers[i]);\n            }\n        };\n        GComponent.prototype.adjustRadioGroupDepth = function (obj, c) {\n            var cnt = this._children.length;\n            var i;\n            var child;\n            var myIndex = -1, maxIndex = -1;\n            for (i = 0; i < cnt; i++) {\n                child = this._children[i];\n                if (child == obj) {\n                    myIndex = i;\n                }\n                else if ((child instanceof fgui.GButton) && child.relatedController == c) {\n                    if (i > maxIndex)\n                        maxIndex = i;\n                }\n            }\n            if (myIndex < maxIndex) {\n                if (this._applyingController)\n                    this._children[maxIndex].handleControllerChanged(this._applyingController);\n                this.swapChildrenAt(myIndex, maxIndex);\n            }\n        };\n        GComponent.prototype.getTransitionAt = function (index) {\n            return this._transitions[index];\n        };\n        GComponent.prototype.getTransition = function (transName) {\n            var cnt = this._transitions.length;\n            for (var i = 0; i < cnt; ++i) {\n                var trans = this._transitions[i];\n                if (trans.name == transName)\n                    return trans;\n            }\n            return null;\n        };\n        GComponent.prototype.isChildInView = function (child) {\n            if (this._rootContainer.scrollRect) {\n                return child.x + child.width >= 0 && child.x <= this.width\n                    && child.y + child.height >= 0 && child.y <= this.height;\n            }\n            else if (this._scrollPane) {\n                return this._scrollPane.isChildInView(child);\n            }\n            else\n                return true;\n        };\n        GComponent.prototype.getFirstChildInView = function () {\n            var cnt = this._children.length;\n            for (var i = 0; i < cnt; ++i) {\n                var child = this._children[i];\n                if (this.isChildInView(child))\n                    return i;\n            }\n            return -1;\n        };\n        Object.defineProperty(GComponent.prototype, \"scrollPane\", {\n            get: function () {\n                return this._scrollPane;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComponent.prototype, \"opaque\", {\n            get: function () {\n                return this._rootContainer.opaque;\n            },\n            set: function (value) {\n                this._rootContainer.opaque = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComponent.prototype, \"margin\", {\n            get: function () {\n                return this._margin;\n            },\n            set: function (value) {\n                this._margin.copy(value);\n                if (this._rootContainer.scrollRect) {\n                    this._container.x = this._margin.left + this._alignOffset.x;\n                    this._container.y = this._margin.top + this._alignOffset.y;\n                }\n                this.handleSizeChanged();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComponent.prototype, \"childrenRenderOrder\", {\n            get: function () {\n                return this._childrenRenderOrder;\n            },\n            set: function (value) {\n                if (this._childrenRenderOrder != value) {\n                    this._childrenRenderOrder = value;\n                    this.buildNativeDisplayList();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComponent.prototype, \"apexIndex\", {\n            get: function () {\n                return this._apexIndex;\n            },\n            set: function (value) {\n                if (this._apexIndex != value) {\n                    this._apexIndex = value;\n                    if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Arch)\n                        this.buildNativeDisplayList();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComponent.prototype, \"mask\", {\n            get: function () {\n                return this._rootContainer.mask;\n            },\n            set: function (value) {\n                this._rootContainer.mask = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComponent.prototype, \"baseUserData\", {\n            get: function () {\n                var buffer = this.packageItem.rawData;\n                buffer.seek(0, 4);\n                return buffer.readS();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GComponent.prototype.updateScrollRect = function () {\n            var rect = this._rootContainer.scrollRect;\n            if (rect == null)\n                rect = new egret.Rectangle();\n            var w = this.width - this._margin.right;\n            var h = this.height - this._margin.bottom;\n            rect.setTo(0, 0, w, h);\n            this._rootContainer.scrollRect = rect;\n        };\n        GComponent.prototype.setupScroll = function (buffer) {\n            if (this._rootContainer == this._container) {\n                this._container = new egret.DisplayObjectContainer();\n                this._rootContainer.addChild(this._container);\n            }\n            this._scrollPane = new fgui.ScrollPane(this);\n            this._scrollPane.setup(buffer);\n            this.setBoundsChangedFlag();\n        };\n        GComponent.prototype.setupOverflow = function (overflow) {\n            if (overflow == fgui.OverflowType.Hidden) {\n                if (this._rootContainer == this._container) {\n                    this._container = new egret.DisplayObjectContainer();\n                    this._rootContainer.addChild(this._container);\n                }\n                this.updateScrollRect();\n                this._container.x = this._margin.left;\n                this._container.y = this._margin.top;\n            }\n            else if (this._margin.left != 0 || this._margin.top != 0) {\n                if (this._rootContainer == this._container) {\n                    this._container = new egret.DisplayObjectContainer();\n                    this._rootContainer.addChild(this._container);\n                }\n                this._container.x = this._margin.left;\n                this._container.y = this._margin.top;\n            }\n            this.setBoundsChangedFlag();\n        };\n        GComponent.prototype.handleSizeChanged = function () {\n            _super_1.prototype.handleSizeChanged.call(this);\n            if (this._scrollPane)\n                this._scrollPane.onOwnerSizeChanged();\n            else if (this._rootContainer.scrollRect)\n                this.updateScrollRect();\n            if (this._rootContainer.hitArea instanceof fgui.PixelHitTest) {\n                var hitTest = (this._rootContainer.hitArea);\n                if (this.sourceWidth != 0)\n                    hitTest.scaleX = this._width / this.sourceWidth;\n                if (this.sourceHeight != 0)\n                    hitTest.scaleY = this._height / this.sourceHeight;\n            }\n        };\n        GComponent.prototype.handleGrayedChanged = function () {\n            var c = this.getController(\"grayed\");\n            if (c) {\n                c.selectedIndex = this.grayed ? 1 : 0;\n                return;\n            }\n            var v = this.grayed;\n            var cnt = this._children.length;\n            for (var i = 0; i < cnt; ++i) {\n                this._children[i].grayed = v;\n            }\n        };\n        GComponent.prototype.handleControllerChanged = function (c) {\n            _super_1.prototype.handleControllerChanged.call(this, c);\n            if (this._scrollPane)\n                this._scrollPane.handleControllerChanged(c);\n        };\n        GComponent.prototype.setBoundsChangedFlag = function () {\n            if (!this._scrollPane && !this._trackBounds)\n                return;\n            if (!this._boundsChanged) {\n                this._boundsChanged = true;\n                egret.callLater(this.__render, this);\n            }\n        };\n        GComponent.prototype.__render = function () {\n            if (this._boundsChanged) {\n                var len = this._children.length;\n                if (len > 0) {\n                    for (var i = 0; i < len; i++) {\n                        var child = this._children[i];\n                        child.ensureSizeCorrect();\n                    }\n                }\n                this.updateBounds();\n            }\n        };\n        GComponent.prototype.ensureBoundsCorrect = function () {\n            var len = this._children.length;\n            if (len > 0) {\n                for (var i = 0; i < len; i++) {\n                    var child = this._children[i];\n                    child.ensureSizeCorrect();\n                }\n            }\n            if (this._boundsChanged)\n                this.updateBounds();\n        };\n        GComponent.prototype.updateBounds = function () {\n            var ax = 0, ay = 0, aw = 0, ah = 0;\n            var len = this._children.length;\n            if (len > 0) {\n                ax = Number.POSITIVE_INFINITY, ay = Number.POSITIVE_INFINITY;\n                var ar = Number.NEGATIVE_INFINITY, ab = Number.NEGATIVE_INFINITY;\n                var tmp = 0;\n                var i = 0;\n                for (var i = 0; i < len; i++) {\n                    var child = this._children[i];\n                    tmp = child.x;\n                    if (tmp < ax)\n                        ax = tmp;\n                    tmp = child.y;\n                    if (tmp < ay)\n                        ay = tmp;\n                    tmp = child.x + child.actualWidth;\n                    if (tmp > ar)\n                        ar = tmp;\n                    tmp = child.y + child.actualHeight;\n                    if (tmp > ab)\n                        ab = tmp;\n                }\n                aw = ar - ax;\n                ah = ab - ay;\n            }\n            this.setBounds(ax, ay, aw, ah);\n        };\n        GComponent.prototype.setBounds = function (ax, ay, aw, ah) {\n            if (ah === void 0) { ah = 0; }\n            this._boundsChanged = false;\n            if (this._scrollPane)\n                this._scrollPane.setContentSize(Math.round(ax + aw), Math.round(ay + ah));\n        };\n        Object.defineProperty(GComponent.prototype, \"viewWidth\", {\n            get: function () {\n                if (this._scrollPane)\n                    return this._scrollPane.viewWidth;\n                else\n                    return this.width - this._margin.left - this._margin.right;\n            },\n            set: function (value) {\n                if (this._scrollPane)\n                    this._scrollPane.viewWidth = value;\n                else\n                    this.width = value + this._margin.left + this._margin.right;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComponent.prototype, \"viewHeight\", {\n            get: function () {\n                if (this._scrollPane)\n                    return this._scrollPane.viewHeight;\n                else\n                    return this.height - this._margin.top - this._margin.bottom;\n            },\n            set: function (value) {\n                if (this._scrollPane)\n                    this._scrollPane.viewHeight = value;\n                else\n                    this.height = value + this._margin.top + this._margin.bottom;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GComponent.prototype.getSnappingPosition = function (xValue, yValue, resultPoint) {\n            if (!resultPoint)\n                resultPoint = new egret.Point();\n            var cnt = this._children.length;\n            if (cnt == 0) {\n                resultPoint.x = 0;\n                resultPoint.y = 0;\n                return resultPoint;\n            }\n            this.ensureBoundsCorrect();\n            var obj = null;\n            var prev = null;\n            var i = 0;\n            if (yValue != 0) {\n                for (; i < cnt; i++) {\n                    obj = this._children[i];\n                    if (yValue < obj.y) {\n                        if (i == 0) {\n                            yValue = 0;\n                            break;\n                        }\n                        else {\n                            prev = this._children[i - 1];\n                            if (yValue < prev.y + prev.actualHeight / 2)\n                                yValue = prev.y;\n                            else\n                                yValue = obj.y;\n                            break;\n                        }\n                    }\n                }\n                if (i == cnt)\n                    yValue = obj.y;\n            }\n            if (xValue != 0) {\n                if (i > 0)\n                    i--;\n                for (; i < cnt; i++) {\n                    obj = this._children[i];\n                    if (xValue < obj.x) {\n                        if (i == 0) {\n                            xValue = 0;\n                            break;\n                        }\n                        else {\n                            prev = this._children[i - 1];\n                            if (xValue < prev.x + prev.actualWidth / 2)\n                                xValue = prev.x;\n                            else\n                                xValue = obj.x;\n                            break;\n                        }\n                    }\n                }\n                if (i == cnt)\n                    xValue = obj.x;\n            }\n            resultPoint.x = xValue;\n            resultPoint.y = yValue;\n            return resultPoint;\n        };\n        GComponent.prototype.childSortingOrderChanged = function (child, oldValue, newValue) {\n            if (newValue === void 0) { newValue = 0; }\n            if (newValue == 0) {\n                this._sortingChildCount--;\n                this.setChildIndex(child, this._children.length);\n            }\n            else {\n                if (oldValue == 0)\n                    this._sortingChildCount++;\n                var oldIndex = this._children.indexOf(child);\n                var index = this.getInsertPosForSortingChild(child);\n                if (oldIndex < index)\n                    this._setChildIndex(child, oldIndex, index - 1);\n                else\n                    this._setChildIndex(child, oldIndex, index);\n            }\n        };\n        GComponent.prototype.constructFromResource = function () {\n            this.constructFromResource2(null, 0);\n        };\n        GComponent.prototype.constructFromResource2 = function (objectPool, poolIndex) {\n            var contentItem = this.packageItem.getBranch();\n            if (!contentItem.decoded) {\n                contentItem.decoded = true;\n                fgui.TranslationHelper.translateComponent(contentItem);\n            }\n            var i;\n            var dataLen;\n            var curPos;\n            var nextPos;\n            var f1;\n            var f2;\n            var i1;\n            var i2;\n            var buffer = contentItem.rawData;\n            buffer.seek(0, 0);\n            this._underConstruct = true;\n            this.sourceWidth = buffer.readInt();\n            this.sourceHeight = buffer.readInt();\n            this.initWidth = this.sourceWidth;\n            this.initHeight = this.sourceHeight;\n            this.setSize(this.sourceWidth, this.sourceHeight);\n            if (buffer.readBool()) {\n                this.minWidth = buffer.readInt();\n                this.maxWidth = buffer.readInt();\n                this.minHeight = buffer.readInt();\n                this.maxHeight = buffer.readInt();\n            }\n            if (buffer.readBool()) {\n                f1 = buffer.readFloat();\n                f2 = buffer.readFloat();\n                this.internalSetPivot(f1, f2, buffer.readBool());\n            }\n            if (buffer.readBool()) {\n                this._margin.top = buffer.readInt();\n                this._margin.bottom = buffer.readInt();\n                this._margin.left = buffer.readInt();\n                this._margin.right = buffer.readInt();\n            }\n            var overflow = buffer.readByte();\n            if (overflow == fgui.OverflowType.Scroll) {\n                var savedPos = buffer.position;\n                buffer.seek(0, 7);\n                this.setupScroll(buffer);\n                buffer.position = savedPos;\n            }\n            else\n                this.setupOverflow(overflow);\n            if (buffer.readBool())\n                buffer.skip(8);\n            this._buildingDisplayList = true;\n            buffer.seek(0, 1);\n            var controllerCount = buffer.readShort();\n            for (i = 0; i < controllerCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                var controller = new fgui.Controller();\n                this._controllers.push(controller);\n                controller.parent = this;\n                controller.setup(buffer);\n                buffer.position = nextPos;\n            }\n            buffer.seek(0, 2);\n            var child;\n            var childCount = buffer.readShort();\n            for (i = 0; i < childCount; i++) {\n                dataLen = buffer.readShort();\n                curPos = buffer.position;\n                if (objectPool)\n                    child = objectPool[poolIndex + i];\n                else {\n                    buffer.seek(curPos, 0);\n                    var type = buffer.readByte();\n                    var src = buffer.readS();\n                    var pkgId = buffer.readS();\n                    var pi = null;\n                    if (src != null) {\n                        var pkg;\n                        if (pkgId != null)\n                            pkg = fgui.UIPackage.getById(pkgId);\n                        else\n                            pkg = contentItem.owner;\n                        pi = pkg ? pkg.getItemById(src) : null;\n                    }\n                    if (pi) {\n                        child = fgui.UIObjectFactory.newObject(pi);\n                        child.constructFromResource();\n                    }\n                    else\n                        child = fgui.UIObjectFactory.newObject(type);\n                }\n                child._underConstruct = true;\n                child.setup_beforeAdd(buffer, curPos);\n                child.parent = this;\n                this._children.push(child);\n                buffer.position = curPos + dataLen;\n            }\n            buffer.seek(0, 3);\n            this.relations.setup(buffer, true);\n            buffer.seek(0, 2);\n            buffer.skip(2);\n            for (i = 0; i < childCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                buffer.seek(buffer.position, 3);\n                this._children[i].relations.setup(buffer, false);\n                buffer.position = nextPos;\n            }\n            buffer.seek(0, 2);\n            buffer.skip(2);\n            for (i = 0; i < childCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                child = this._children[i];\n                child.setup_afterAdd(buffer, buffer.position);\n                child._underConstruct = false;\n                buffer.position = nextPos;\n            }\n            buffer.seek(0, 4);\n            buffer.skip(2);\n            this.opaque = buffer.readBool();\n            var maskId = buffer.readShort();\n            if (maskId != -1) {\n                this.mask = this.getChildAt(maskId).displayObject;\n                buffer.readBool();\n            }\n            var hitTestId = buffer.readS();\n            i1 = buffer.readInt();\n            i2 = buffer.readInt();\n            if (hitTestId != null) {\n                pi = contentItem.owner.getItemById(hitTestId);\n                if (pi && pi.pixelHitTestData)\n                    this._rootContainer.hitArea = new fgui.PixelHitTest(pi.pixelHitTestData, i1, i2);\n            }\n            else if (i1 != 0 && i2 != -1) {\n                this._rootContainer.hitArea = this.getChildAt(i2).displayObject;\n            }\n            buffer.seek(0, 5);\n            var transitionCount = buffer.readShort();\n            for (i = 0; i < transitionCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                var trans = new fgui.Transition(this);\n                trans.setup(buffer);\n                this._transitions.push(trans);\n                buffer.position = nextPos;\n            }\n            if (this._transitions.length > 0) {\n                this.displayObject.addEventListener(egret.Event.ADDED_TO_STAGE, this.___added, this);\n                this.displayObject.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.___removed, this);\n            }\n            this.applyAllControllers();\n            this._buildingDisplayList = false;\n            this._underConstruct = false;\n            this.buildNativeDisplayList();\n            this.setBoundsChangedFlag();\n            if (contentItem.objectType != fgui.ObjectType.Component)\n                this.constructExtension(buffer);\n            this.onConstruct();\n        };\n        GComponent.prototype.onConstruct = function () {\n            this.constructFromXML(null);\n        };\n        GComponent.prototype.constructExtension = function (buffer) {\n        };\n        GComponent.prototype.constructFromXML = function (xml) {\n        };\n        GComponent.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 4);\n            var pageController = buffer.readShort();\n            if (pageController != -1 && this._scrollPane)\n                this._scrollPane.pageController = this._parent.getControllerAt(pageController);\n            var cnt = buffer.readShort();\n            for (var i = 0; i < cnt; i++) {\n                var cc = this.getController(buffer.readS());\n                var pageId = buffer.readS();\n                if (cc)\n                    cc.selectedPageId = pageId;\n            }\n            if (buffer.version >= 2) {\n                cnt = buffer.readShort();\n                for (i = 0; i < cnt; i++) {\n                    var target = buffer.readS();\n                    var propertyId = buffer.readShort();\n                    var value = buffer.readS();\n                    var obj = this.getChildByPath(target);\n                    if (obj)\n                        obj.setProp(propertyId, value);\n                }\n            }\n        };\n        GComponent.prototype.___added = function (evt) {\n            var cnt = this._transitions.length;\n            for (var i = 0; i < cnt; ++i) {\n                this._transitions[i].onOwnerAddedToStage();\n            }\n        };\n        GComponent.prototype.___removed = function (evt) {\n            var cnt = this._transitions.length;\n            for (var i = 0; i < cnt; ++i) {\n                this._transitions[i].onOwnerRemovedFromStage();\n            }\n        };\n        return GComponent;\n    }(fgui.GObject));\n    fgui.GComponent = GComponent;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GButton = (function (_super_1) {\n        __extends(GButton, _super_1);\n        function GButton() {\n            var _this = _super_1.call(this) || this;\n            _this._mode = fgui.ButtonMode.Common;\n            _this._title = \"\";\n            _this._icon = \"\";\n            _this._sound = fgui.UIConfig.buttonSound;\n            _this._soundVolumeScale = fgui.UIConfig.buttonSoundVolumeScale;\n            _this._changeStateOnClick = true;\n            _this._downEffect = 0;\n            _this._downEffectValue = 0.8;\n            return _this;\n        }\n        Object.defineProperty(GButton.prototype, \"icon\", {\n            get: function () {\n                return this._icon;\n            },\n            set: function (value) {\n                this._icon = value;\n                value = (this._selected && this._selectedIcon) ? this._selectedIcon : this._icon;\n                if (this._iconObject)\n                    this._iconObject.icon = value;\n                this.updateGear(7);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"selectedIcon\", {\n            get: function () {\n                return this._selectedIcon;\n            },\n            set: function (value) {\n                this._selectedIcon = value;\n                value = (this._selected && this._selectedIcon) ? this._selectedIcon : this._icon;\n                if (this._iconObject)\n                    this._iconObject.icon = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"title\", {\n            get: function () {\n                return this._title;\n            },\n            set: function (value) {\n                this._title = value;\n                if (this._titleObject)\n                    this._titleObject.text = (this._selected && this._selectedTitle) ? this._selectedTitle : this._title;\n                this.updateGear(6);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"text\", {\n            get: function () {\n                return this.title;\n            },\n            set: function (value) {\n                this.title = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"selectedTitle\", {\n            get: function () {\n                return this._selectedTitle;\n            },\n            set: function (value) {\n                this._selectedTitle = value;\n                if (this._titleObject)\n                    this._titleObject.text = (this._selected && this._selectedTitle) ? this._selectedTitle : this._title;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"titleColor\", {\n            get: function () {\n                var tf = this.getTextField();\n                if (tf)\n                    return tf.color;\n                else\n                    return 0;\n            },\n            set: function (value) {\n                var tf = this.getTextField();\n                if (tf)\n                    tf.color = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"titleFontSize\", {\n            get: function () {\n                var tf = this.getTextField();\n                if (tf)\n                    return tf.fontSize;\n                else\n                    return 0;\n            },\n            set: function (value) {\n                var tf = this.getTextField();\n                if (tf)\n                    tf.fontSize = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"sound\", {\n            get: function () {\n                return this._sound;\n            },\n            set: function (val) {\n                this._sound = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"soundVolumeScale\", {\n            get: function () {\n                return this._soundVolumeScale;\n            },\n            set: function (value) {\n                this._soundVolumeScale = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"selected\", {\n            get: function () {\n                return this._selected;\n            },\n            set: function (val) {\n                if (this._mode == fgui.ButtonMode.Common)\n                    return;\n                if (this._selected != val) {\n                    this._selected = val;\n                    if (this.grayed && this._buttonController && this._buttonController.hasPage(GButton.DISABLED)) {\n                        if (this._selected)\n                            this.setState(GButton.SELECTED_DISABLED);\n                        else\n                            this.setState(GButton.DISABLED);\n                    }\n                    else {\n                        if (this._selected)\n                            this.setState(this._over ? GButton.SELECTED_OVER : GButton.DOWN);\n                        else\n                            this.setState(this._over ? GButton.OVER : GButton.UP);\n                    }\n                    if (this._selectedTitle && this._titleObject)\n                        this._titleObject.text = this._selected ? this._selectedTitle : this._title;\n                    if (this._selectedIcon) {\n                        var str = this._selected ? this._selectedIcon : this._icon;\n                        if (this._iconObject)\n                            this._iconObject.icon = str;\n                    }\n                    if (this._relatedController\n                        && this._parent\n                        && !this._parent._buildingDisplayList) {\n                        if (this._selected) {\n                            this._relatedController.selectedPageId = this._relatedPageId;\n                            if (this._relatedController.autoRadioGroupDepth)\n                                this._parent.adjustRadioGroupDepth(this, this._relatedController);\n                        }\n                        else if (this._mode == fgui.ButtonMode.Check && this._relatedController.selectedPageId == this._relatedPageId)\n                            this._relatedController.oppositePageId = this._relatedPageId;\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"mode\", {\n            get: function () {\n                return this._mode;\n            },\n            set: function (value) {\n                if (this._mode != value) {\n                    if (value == fgui.ButtonMode.Common)\n                        this.selected = false;\n                    this._mode = value;\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"relatedController\", {\n            get: function () {\n                return this._relatedController;\n            },\n            set: function (val) {\n                this._relatedController = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"relatedPageId\", {\n            get: function () {\n                return this._relatedPageId;\n            },\n            set: function (val) {\n                this._relatedPageId = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"changeStateOnClick\", {\n            get: function () {\n                return this._changeStateOnClick;\n            },\n            set: function (value) {\n                this._changeStateOnClick = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GButton.prototype, \"linkedPopup\", {\n            get: function () {\n                return this._linkedPopup;\n            },\n            set: function (value) {\n                this._linkedPopup = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GButton.prototype.getTextField = function () {\n            if (this._titleObject instanceof fgui.GTextField)\n                return this._titleObject;\n            else if ((this._titleObject instanceof fgui.GLabel) || (this._titleObject instanceof GButton))\n                return this._titleObject.getTextField();\n            else\n                return null;\n        };\n        GButton.prototype.addStateListener = function (listener, thisObj) {\n            this.addEventListener(fgui.StateChangeEvent.CHANGED, listener, thisObj);\n        };\n        GButton.prototype.removeStateListener = function (listener, thisObj) {\n            this.removeEventListener(fgui.StateChangeEvent.CHANGED, listener, thisObj);\n        };\n        GButton.prototype.fireClick = function (downEffect) {\n            if (downEffect && this._mode == fgui.ButtonMode.Common) {\n                this.setState(GButton.OVER);\n                fgui.GTimers.inst.add(100, 1, function () { this.setState(GButton.DOWN); }, this);\n                fgui.GTimers.inst.add(200, 1, function () { this.setState(GButton.UP); }, this);\n            }\n            this.__click(null);\n        };\n        GButton.prototype.setState = function (val) {\n            if (this._buttonController)\n                this._buttonController.selectedPage = val;\n            if (this._downEffect == 1) {\n                var cnt = this.numChildren;\n                if (val == GButton.DOWN || val == GButton.SELECTED_OVER || val == GButton.SELECTED_DISABLED) {\n                    var r = this._downEffectValue * 255;\n                    var color = (r << 16) + (r << 8) + r;\n                    for (var i = 0; i < cnt; i++) {\n                        var obj = this.getChildAt(i);\n                        if (obj[\"color\"] != undefined && !(obj instanceof fgui.GTextField))\n                            obj.color = color;\n                    }\n                }\n                else {\n                    for (var i = 0; i < cnt; i++) {\n                        var obj = this.getChildAt(i);\n                        if (obj[\"color\"] != undefined && !(obj instanceof fgui.GTextField))\n                            obj.color = 0xFFFFFF;\n                    }\n                }\n            }\n            else if (this._downEffect == 2) {\n                if (val == GButton.DOWN || val == GButton.SELECTED_OVER || val == GButton.SELECTED_DISABLED) {\n                    if (!this._downScaled) {\n                        this._downScaled = true;\n                        this._rootContainer.cacheHitArea(true);\n                        this.setScale(this.scaleX * this._downEffectValue, this.scaleY * this._downEffectValue);\n                    }\n                }\n                else {\n                    if (this._downScaled) {\n                        this._downScaled = false;\n                        this._rootContainer.cacheHitArea(false);\n                        this.setScale(this.scaleX / this._downEffectValue, this.scaleY / this._downEffectValue);\n                    }\n                }\n            }\n        };\n        GButton.prototype.handleControllerChanged = function (c) {\n            _super_1.prototype.handleControllerChanged.call(this, c);\n            if (this._relatedController == c)\n                this.selected = this._relatedPageId == c.selectedPageId;\n        };\n        GButton.prototype.handleGrayedChanged = function () {\n            if (this._buttonController && this._buttonController.hasPage(GButton.DISABLED)) {\n                if (this.grayed) {\n                    if (this._selected && this._buttonController.hasPage(GButton.SELECTED_DISABLED))\n                        this.setState(GButton.SELECTED_DISABLED);\n                    else\n                        this.setState(GButton.DISABLED);\n                }\n                else if (this._selected)\n                    this.setState(GButton.DOWN);\n                else\n                    this.setState(GButton.UP);\n            }\n            else\n                _super_1.prototype.handleGrayedChanged.call(this);\n        };\n        GButton.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    return this.titleColor;\n                case fgui.ObjectPropID.OutlineColor:\n                    {\n                        var tf = this.getTextField();\n                        if (tf)\n                            return tf.strokeColor;\n                        else\n                            return 0;\n                    }\n                case fgui.ObjectPropID.FontSize:\n                    return this.titleFontSize;\n                case fgui.ObjectPropID.Selected:\n                    return this.selected;\n                default:\n                    return _super_1.prototype.getProp.call(this, index);\n            }\n        };\n        GButton.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    this.titleColor = value;\n                    break;\n                case fgui.ObjectPropID.OutlineColor:\n                    {\n                        var tf = this.getTextField();\n                        if (tf)\n                            tf.strokeColor = value;\n                    }\n                    break;\n                case fgui.ObjectPropID.FontSize:\n                    this.titleFontSize = value;\n                    break;\n                case fgui.ObjectPropID.Selected:\n                    this.selected = value;\n                    break;\n                default:\n                    _super_1.prototype.setProp.call(this, index, value);\n                    break;\n            }\n        };\n        GButton.prototype.constructExtension = function (buffer) {\n            buffer.seek(0, 6);\n            this._mode = buffer.readByte();\n            var str = buffer.readS();\n            if (str)\n                this._sound = str;\n            this._soundVolumeScale = buffer.readFloat();\n            this._downEffect = buffer.readByte();\n            this._downEffectValue = buffer.readFloat();\n            if (this._downEffect == 2)\n                this.setPivot(0.5, 0.5, this.pivotAsAnchor);\n            this._buttonController = this.getController(\"button\");\n            this._titleObject = this.getChild(\"title\");\n            this._iconObject = this.getChild(\"icon\");\n            if (this._titleObject)\n                this._title = this._titleObject.text;\n            if (this._iconObject)\n                this._icon = this._iconObject.icon;\n            if (this._mode == fgui.ButtonMode.Common)\n                this.setState(GButton.UP);\n            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__mousedown, this);\n            this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.__click, this);\n        };\n        GButton.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            if (!buffer.seek(beginPos, 6))\n                return;\n            if (buffer.readByte() != this.packageItem.objectType)\n                return;\n            var str;\n            var iv;\n            str = buffer.readS();\n            if (str != null)\n                this.title = str;\n            str = buffer.readS();\n            if (str != null)\n                this.selectedTitle = str;\n            str = buffer.readS();\n            if (str != null)\n                this.icon = str;\n            str = buffer.readS();\n            if (str != null)\n                this.selectedIcon = str;\n            if (buffer.readBool())\n                this.titleColor = buffer.readColor();\n            iv = buffer.readInt();\n            if (iv != 0)\n                this.titleFontSize = iv;\n            iv = buffer.readShort();\n            if (iv >= 0)\n                this._relatedController = this.parent.getControllerAt(iv);\n            this._relatedPageId = buffer.readS();\n            str = buffer.readS();\n            if (str != null)\n                this._sound = str;\n            if (buffer.readBool())\n                this._soundVolumeScale = buffer.readFloat();\n            this.selected = buffer.readBool();\n        };\n        GButton.prototype.__mousedown = function (evt) {\n            this._down = true;\n            fgui.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__mouseup, this);\n            if (this._mode == fgui.ButtonMode.Common) {\n                if (this.grayed && this._buttonController && this._buttonController.hasPage(GButton.DISABLED))\n                    this.setState(GButton.SELECTED_DISABLED);\n                else\n                    this.setState(GButton.DOWN);\n            }\n            if (this._linkedPopup) {\n                if (this._linkedPopup instanceof fgui.Window)\n                    this._linkedPopup.toggleStatus();\n                else\n                    this.root.togglePopup(this._linkedPopup, this);\n            }\n        };\n        GButton.prototype.__mouseup = function (evt) {\n            if (this._down) {\n                fgui.GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_END, this.__mouseup, this);\n                this._down = false;\n                if (!this.displayObject)\n                    return;\n                if (this._mode == fgui.ButtonMode.Common) {\n                    if (this.grayed && this._buttonController && this._buttonController.hasPage(GButton.DISABLED))\n                        this.setState(GButton.DISABLED);\n                    else if (this._over)\n                        this.setState(GButton.OVER);\n                    else\n                        this.setState(GButton.UP);\n                }\n            }\n        };\n        GButton.prototype.__click = function (evt) {\n            if (this._sound) {\n                var pi = fgui.UIPackage.getItemByURL(this._sound);\n                if (pi) {\n                    var sound = pi.owner.getItemAsset(pi);\n                    if (sound)\n                        fgui.GRoot.inst.playOneShotSound(sound, this._soundVolumeScale);\n                }\n            }\n            if (this._mode == fgui.ButtonMode.Check) {\n                if (this._changeStateOnClick) {\n                    this.selected = !this._selected;\n                    this.dispatchEvent(new fgui.StateChangeEvent(fgui.StateChangeEvent.CHANGED));\n                }\n            }\n            else if (this._mode == fgui.ButtonMode.Radio) {\n                if (this._changeStateOnClick && !this._selected) {\n                    this.selected = true;\n                    this.dispatchEvent(new fgui.StateChangeEvent(fgui.StateChangeEvent.CHANGED));\n                }\n            }\n            else {\n                if (this._relatedController)\n                    this._relatedController.selectedPageId = this._relatedPageId;\n            }\n        };\n        GButton.UP = \"up\";\n        GButton.DOWN = \"down\";\n        GButton.OVER = \"over\";\n        GButton.SELECTED_OVER = \"selectedOver\";\n        GButton.DISABLED = \"disabled\";\n        GButton.SELECTED_DISABLED = \"selectedDisabled\";\n        return GButton;\n    }(fgui.GComponent));\n    fgui.GButton = GButton;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GComboBox = (function (_super_1) {\n        __extends(GComboBox, _super_1);\n        function GComboBox() {\n            var _this = _super_1.call(this) || this;\n            _this._visibleItemCount = 0;\n            _this._selectedIndex = 0;\n            _this._popupDirection = fgui.PopupDirection.Auto;\n            _this._visibleItemCount = fgui.UIConfig.defaultComboBoxVisibleItemCount;\n            _this._itemsUpdated = true;\n            _this._selectedIndex = -1;\n            _this._items = [];\n            _this._values = [];\n            return _this;\n        }\n        Object.defineProperty(GComboBox.prototype, \"text\", {\n            get: function () {\n                if (this._titleObject)\n                    return this._titleObject.text;\n                else\n                    return null;\n            },\n            set: function (value) {\n                if (this._titleObject)\n                    this._titleObject.text = value;\n                this.updateGear(6);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"icon\", {\n            get: function () {\n                if (this._iconObject)\n                    return this._iconObject.icon;\n                else\n                    return null;\n            },\n            set: function (value) {\n                if (this._iconObject)\n                    this._iconObject.icon = value;\n                this.updateGear(7);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"titleColor\", {\n            get: function () {\n                var tf = this.getTextField();\n                if (tf)\n                    return tf.color;\n                else\n                    return 0;\n            },\n            set: function (value) {\n                var tf = this.getTextField();\n                if (tf)\n                    tf.color = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"titleFontSize\", {\n            get: function () {\n                var tf = this.getTextField();\n                if (tf)\n                    return tf.fontSize;\n                else\n                    return 0;\n            },\n            set: function (value) {\n                var tf = this.getTextField();\n                if (tf)\n                    tf.fontSize = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"visibleItemCount\", {\n            get: function () {\n                return this._visibleItemCount;\n            },\n            set: function (value) {\n                this._visibleItemCount = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"popupDirection\", {\n            get: function () {\n                return this._popupDirection;\n            },\n            set: function (value) {\n                this._popupDirection = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"items\", {\n            get: function () {\n                return this._items;\n            },\n            set: function (value) {\n                if (!value)\n                    this._items.length = 0;\n                else\n                    this._items = value.concat();\n                if (this._items.length > 0) {\n                    if (this._selectedIndex >= this._items.length)\n                        this._selectedIndex = this._items.length - 1;\n                    else if (this._selectedIndex == -1)\n                        this._selectedIndex = 0;\n                    this.text = this._items[this._selectedIndex];\n                    if (this._icons && this._selectedIndex < this._icons.length)\n                        this.icon = this._icons[this._selectedIndex];\n                }\n                else {\n                    this.text = \"\";\n                    if (this._icons)\n                        this.icon = null;\n                    this._selectedIndex = -1;\n                }\n                this._itemsUpdated = true;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"icons\", {\n            get: function () {\n                return this._icons;\n            },\n            set: function (value) {\n                this._icons = value;\n                if (this._icons && this._selectedIndex != -1 && this._selectedIndex < this._icons.length)\n                    this.icon = this._icons[this._selectedIndex];\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"values\", {\n            get: function () {\n                return this._values;\n            },\n            set: function (value) {\n                if (!value)\n                    this._values.length = 0;\n                else\n                    this._values = value.concat();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"selectedIndex\", {\n            get: function () {\n                return this._selectedIndex;\n            },\n            set: function (val) {\n                if (this._selectedIndex == val)\n                    return;\n                this._selectedIndex = val;\n                if (this._selectedIndex >= 0 && this._selectedIndex < this._items.length) {\n                    this.text = this._items[this._selectedIndex];\n                    if (this._icons && this._selectedIndex < this._icons.length)\n                        this.icon = this._icons[this._selectedIndex];\n                }\n                else {\n                    this.text = \"\";\n                    if (this._icons)\n                        this.icon = null;\n                }\n                this.updateSelectionController();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"value\", {\n            get: function () {\n                return this._values[this._selectedIndex];\n            },\n            set: function (val) {\n                var index = this._values.indexOf(val);\n                if (index == -1 && val == null)\n                    index = this._values.indexOf(\"\");\n                this.selectedIndex = index;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GComboBox.prototype, \"selectionController\", {\n            get: function () {\n                return this._selectionController;\n            },\n            set: function (value) {\n                this._selectionController = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GComboBox.prototype.getTextField = function () {\n            if (this._titleObject instanceof fgui.GTextField)\n                return this._titleObject;\n            else if ((this._titleObject instanceof fgui.GLabel) || (this._titleObject instanceof fgui.GButton))\n                return this._titleObject.getTextField();\n            else\n                return null;\n        };\n        GComboBox.prototype.setState = function (val) {\n            if (this._buttonController)\n                this._buttonController.selectedPage = val;\n        };\n        GComboBox.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    return this.titleColor;\n                case fgui.ObjectPropID.OutlineColor:\n                    {\n                        var tf = this.getTextField();\n                        if (tf)\n                            return tf.strokeColor;\n                        else\n                            return 0;\n                    }\n                case fgui.ObjectPropID.FontSize:\n                    {\n                        tf = this.getTextField();\n                        if (tf)\n                            return tf.fontSize;\n                        else\n                            return 0;\n                    }\n                default:\n                    return _super_1.prototype.getProp.call(this, index);\n            }\n        };\n        GComboBox.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    this.titleColor = value;\n                    break;\n                case fgui.ObjectPropID.OutlineColor:\n                    {\n                        var tf = this.getTextField();\n                        if (tf)\n                            tf.strokeColor = value;\n                    }\n                    break;\n                case fgui.ObjectPropID.FontSize:\n                    {\n                        tf = this.getTextField();\n                        if (tf)\n                            tf.fontSize = value;\n                    }\n                    break;\n                default:\n                    _super_1.prototype.setProp.call(this, index, value);\n                    break;\n            }\n        };\n        GComboBox.prototype.constructExtension = function (buffer) {\n            var str;\n            this._buttonController = this.getController(\"button\");\n            this._titleObject = this.getChild(\"title\");\n            this._iconObject = this.getChild(\"icon\");\n            str = buffer.readS();\n            if (str) {\n                this.dropdown = (fgui.UIPackage.createObjectFromURL(str));\n                if (!this.dropdown) {\n                    console.error(\"下拉框必须为元件\");\n                    return;\n                }\n                this.dropdown.name = \"this.dropdown\";\n                this._list = this.dropdown.getChild(\"list\").asList;\n                if (this._list == null) {\n                    console.error(this.resourceURL + \": 下拉框的弹出元件里必须包含名为list的列表\");\n                    return;\n                }\n                this._list.addEventListener(fgui.ItemEvent.CLICK, this.__clickItem, this);\n                this._list.addRelation(this.dropdown, fgui.RelationType.Width);\n                this._list.removeRelation(this.dropdown, fgui.RelationType.Height);\n                this.dropdown.addRelation(this._list, fgui.RelationType.Height);\n                this.dropdown.removeRelation(this._list, fgui.RelationType.Width);\n                this.dropdown.displayObject.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.__popupWinClosed, this);\n            }\n            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__mousedown, this);\n        };\n        GComboBox.prototype.handleControllerChanged = function (c) {\n            _super_1.prototype.handleControllerChanged.call(this, c);\n            if (this._selectionController == c)\n                this.selectedIndex = c.selectedIndex;\n        };\n        GComboBox.prototype.updateSelectionController = function () {\n            if (this._selectionController && !this._selectionController.changing\n                && this._selectedIndex < this._selectionController.pageCount) {\n                var c = this._selectionController;\n                this._selectionController = null;\n                c.selectedIndex = this._selectedIndex;\n                this._selectionController = c;\n            }\n        };\n        GComboBox.prototype.dispose = function () {\n            if (this.dropdown) {\n                this.dropdown.dispose();\n                this.dropdown = null;\n            }\n            _super_1.prototype.dispose.call(this);\n        };\n        GComboBox.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            if (!buffer.seek(beginPos, 6))\n                return;\n            if (buffer.readByte() != this.packageItem.objectType)\n                return;\n            var i;\n            var iv;\n            var nextPos;\n            var str;\n            var itemCount = buffer.readShort();\n            for (i = 0; i < itemCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                this._items[i] = buffer.readS();\n                this._values[i] = buffer.readS();\n                str = buffer.readS();\n                if (str != null) {\n                    if (this._icons == null)\n                        this._icons = new Array();\n                    this._icons[i] = str;\n                }\n                buffer.position = nextPos;\n            }\n            str = buffer.readS();\n            if (str != null) {\n                this.text = str;\n                this._selectedIndex = this._items.indexOf(str);\n            }\n            else if (this._items.length > 0) {\n                this._selectedIndex = 0;\n                this.text = this._items[0];\n            }\n            else\n                this._selectedIndex = -1;\n            str = buffer.readS();\n            if (str != null)\n                this.icon = str;\n            if (buffer.readBool())\n                this.titleColor = buffer.readColor();\n            iv = buffer.readInt();\n            if (iv > 0)\n                this._visibleItemCount = iv;\n            this._popupDirection = buffer.readByte();\n            iv = buffer.readShort();\n            if (iv >= 0)\n                this._selectionController = this.parent.getControllerAt(iv);\n        };\n        GComboBox.prototype.showDropdown = function () {\n            if (this._itemsUpdated) {\n                this._itemsUpdated = false;\n                this._list.removeChildrenToPool();\n                var cnt = this._items.length;\n                for (var i = 0; i < cnt; i++) {\n                    var item = this._list.addItemFromPool();\n                    item.name = i < this._values.length ? this._values[i] : \"\";\n                    item.text = this._items[i];\n                    item.icon = (this._icons && i < this._icons.length) ? this._icons[i] : null;\n                }\n                this._list.resizeToFit(this._visibleItemCount);\n            }\n            this._list.selectedIndex = -1;\n            this.dropdown.width = this.width;\n            this._list.ensureBoundsCorrect();\n            this.root.togglePopup(this.dropdown, this, this._popupDirection);\n            if (this.dropdown.parent)\n                this.setState(fgui.GButton.DOWN);\n        };\n        GComboBox.prototype.__popupWinClosed = function (evt) {\n            if (this._over)\n                this.setState(fgui.GButton.OVER);\n            else\n                this.setState(fgui.GButton.UP);\n        };\n        GComboBox.prototype.__clickItem = function (evt) {\n            fgui.GTimers.inst.add(100, 1, this.__clickItem2, this, this._list.getChildIndex(evt.itemObject));\n        };\n        GComboBox.prototype.__clickItem2 = function (index) {\n            if (this.dropdown.parent instanceof fgui.GRoot)\n                this.dropdown.parent.hidePopup();\n            this._selectedIndex = -1;\n            this.selectedIndex = index;\n            this.dispatchEvent(new fgui.StateChangeEvent(fgui.StateChangeEvent.CHANGED));\n        };\n        GComboBox.prototype.__mousedown = function (evt) {\n            if ((evt.target instanceof egret.TextField) && evt.target.type == egret.TextFieldType.INPUT)\n                return;\n            this._down = true;\n            fgui.GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__mouseup, this);\n            if (this.dropdown)\n                this.showDropdown();\n        };\n        GComboBox.prototype.__mouseup = function (evt) {\n            if (this._down) {\n                this._down = false;\n                fgui.GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_END, this.__mouseup, this);\n                if (this.dropdown && !this.dropdown.parent) {\n                    if (this._over)\n                        this.setState(fgui.GButton.OVER);\n                    else\n                        this.setState(fgui.GButton.UP);\n                }\n            }\n        };\n        return GComboBox;\n    }(fgui.GComponent));\n    fgui.GComboBox = GComboBox;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GGraph = (function (_super_1) {\n        __extends(GGraph, _super_1);\n        function GGraph() {\n            var _this = _super_1.call(this) || this;\n            _this._type = 0;\n            _this._lineSize = 0;\n            _this._lineColor = 0;\n            _this._fillColor = 0;\n            _this._lineSize = 1;\n            _this._lineAlpha = 1;\n            _this._fillAlpha = 1;\n            _this._fillColor = 0xFFFFFF;\n            return _this;\n        }\n        Object.defineProperty(GGraph.prototype, \"graphics\", {\n            get: function () {\n                return this._graphics;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GGraph.prototype.drawRect = function (lineSize, lineColor, lineAlpha, fillColor, fillAlpha, corner) {\n            this._type = 1;\n            this._lineSize = lineSize;\n            this._lineColor = lineColor;\n            this._lineAlpha = lineAlpha;\n            this._fillColor = fillColor;\n            this._fillAlpha = fillAlpha;\n            this._cornerRadius = corner;\n            this.updateGraph();\n        };\n        GGraph.prototype.drawEllipse = function (lineSize, lineColor, lineAlpha, fillColor, fillAlpha) {\n            this._type = 2;\n            this._lineSize = lineSize;\n            this._lineColor = lineColor;\n            this._lineAlpha = lineAlpha;\n            this._fillColor = fillColor;\n            this._fillAlpha = fillAlpha;\n            this._cornerRadius = null;\n            this.updateGraph();\n        };\n        GGraph.prototype.drawRegularPolygon = function (lineSize, lineColor, lineAlpha, fillColor, fillAlpha, sides, startAngle, distances) {\n            this._type = 4;\n            this._lineSize = lineSize;\n            this._lineColor = lineColor;\n            this._lineAlpha = lineAlpha;\n            this._fillColor = fillColor;\n            this._fillAlpha = fillAlpha;\n            this._sides = sides;\n            this._startAngle = startAngle || 0;\n            this._distances = distances;\n            this.updateGraph();\n        };\n        GGraph.prototype.drawPolygon = function (lineSize, lineColor, lineAlpha, fillColor, fillAlpha, points) {\n            this._type = 3;\n            this._lineSize = lineSize;\n            this._lineColor = lineColor;\n            this._lineAlpha = lineAlpha;\n            this._fillColor = fillColor;\n            this._fillAlpha = fillAlpha;\n            this._polygonPoints = points;\n            this.updateGraph();\n        };\n        Object.defineProperty(GGraph.prototype, \"distances\", {\n            get: function () {\n                return this._distances;\n            },\n            set: function (value) {\n                this._distances = value;\n                if (this._type == 3)\n                    this.updateGraph();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GGraph.prototype.clearGraphics = function () {\n            if (this._graphics) {\n                this._type = 0;\n                this._graphics.clear();\n            }\n        };\n        Object.defineProperty(GGraph.prototype, \"color\", {\n            get: function () {\n                return this._fillColor;\n            },\n            set: function (value) {\n                this._fillColor = value;\n                if (this._type != 0)\n                    this.updateGraph();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GGraph.prototype.updateGraph = function () {\n            var ctx = this.graphics;\n            ctx.clear();\n            var w = this.width;\n            var h = this.height;\n            if (w == 0 || h == 0)\n                return;\n            if (this._lineSize == 0)\n                ctx.lineStyle(0, 0, 0);\n            else\n                ctx.lineStyle(this._lineSize, this._lineColor, this._lineAlpha);\n            ctx.beginFill(this._fillColor, this._fillAlpha);\n            if (this._type == 1) {\n                if (this._cornerRadius) {\n                    if (this._cornerRadius.length == 1)\n                        ctx.drawRoundRect(0, 0, w, h, this._cornerRadius[0] * 2, this._cornerRadius[0] * 2);\n                    else\n                        ctx.drawRoundRect(0, 0, w, h, this._cornerRadius[0] * 2, this._cornerRadius[1] * 2);\n                }\n                else\n                    ctx.drawRect(0, 0, w, h);\n            }\n            else if (this._type == 2)\n                ctx.drawEllipse(0, 0, w, h);\n            else if (this._type == 3) {\n                fgui.ToolSet.fillPath(ctx, this._polygonPoints, 0, 0);\n            }\n            else if (this._type == 4) {\n                if (!this._polygonPoints)\n                    this._polygonPoints = [];\n                var radius = Math.min(this._width, this._height) / 2;\n                this._polygonPoints.length = 0;\n                var angle = this._startAngle * Math.PI / 180;\n                var deltaAngle = 2 * Math.PI / this._sides;\n                var dist;\n                for (var i = 0; i < this._sides; i++) {\n                    if (this._distances) {\n                        dist = this._distances[i];\n                        if (isNaN(dist))\n                            dist = 1;\n                    }\n                    else\n                        dist = 1;\n                    var xv = radius + radius * dist * Math.cos(angle);\n                    var yv = radius + radius * dist * Math.sin(angle);\n                    this._polygonPoints.push(xv, yv);\n                    angle += deltaAngle;\n                }\n                fgui.ToolSet.fillPath(ctx, this._polygonPoints, 0, 0);\n            }\n            ctx.endFill();\n        };\n        GGraph.prototype.replaceMe = function (target) {\n            if (!this._parent)\n                throw \"parent not set\";\n            target.name = this.name;\n            target.alpha = this.alpha;\n            target.rotation = this.rotation;\n            target.visible = this.visible;\n            target.touchable = this.touchable;\n            target.grayed = this.grayed;\n            target.setXY(this.x, this.y);\n            target.setSize(this.width, this.height);\n            var index = this._parent.getChildIndex(this);\n            this._parent.addChildAt(target, index);\n            target.relations.copyFrom(this.relations);\n            this._parent.removeChild(this, true);\n        };\n        GGraph.prototype.addBeforeMe = function (target) {\n            if (this._parent == null)\n                throw \"parent not set\";\n            var index = this._parent.getChildIndex(this);\n            this._parent.addChildAt(target, index);\n        };\n        GGraph.prototype.addAfterMe = function (target) {\n            if (this._parent == null)\n                throw \"parent not set\";\n            var index = this._parent.getChildIndex(this);\n            index++;\n            this._parent.addChildAt(target, index);\n        };\n        GGraph.prototype.setNativeObject = function (obj) {\n            var sprite = new egret.Sprite();\n            this.setDisplayObject(sprite);\n            if (this._parent)\n                this._parent.childStateChanged(this);\n            this.handleXYChanged();\n            sprite.alpha = this.alpha;\n            sprite.rotation = this.rotation;\n            sprite.visible = this.visible;\n            sprite.touchEnabled = this.touchable;\n            sprite.touchChildren = this.touchable;\n            sprite.addChild(obj);\n        };\n        GGraph.prototype.createDisplayObject = function () {\n            var sprite = new egret.Sprite();\n            sprite.touchEnabled = true;\n            this._graphics = sprite.graphics;\n            this.setDisplayObject(sprite);\n        };\n        GGraph.prototype.getProp = function (index) {\n            if (index == fgui.ObjectPropID.Color)\n                return this.color;\n            else\n                return _super_1.prototype.getProp.call(this, index);\n        };\n        GGraph.prototype.setProp = function (index, value) {\n            if (index == fgui.ObjectPropID.Color)\n                this.color = value;\n            else\n                _super_1.prototype.setProp.call(this, index, value);\n        };\n        GGraph.prototype.handleSizeChanged = function () {\n            _super_1.prototype.handleSizeChanged.call(this);\n            if (this._type != 0)\n                this.updateGraph();\n        };\n        GGraph.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            this._type = buffer.readByte();\n            if (this._type != 0) {\n                var i;\n                var cnt;\n                this._lineSize = buffer.readInt();\n                var c = buffer.readColor(true);\n                this._lineColor = c & 0xFFFFFF;\n                this._lineAlpha = ((c >> 24) & 0xFF) / 0xFF;\n                c = buffer.readColor(true);\n                this._fillColor = c & 0xFFFFFF;\n                this._fillAlpha = ((c >> 24) & 0xFF) / 0xFF;\n                if (buffer.readBool()) {\n                    this._cornerRadius = new Array(4);\n                    for (i = 0; i < 4; i++)\n                        this._cornerRadius[i] = buffer.readFloat();\n                }\n                if (this._type == 3) {\n                    cnt = buffer.readShort();\n                    this._polygonPoints = [];\n                    this._polygonPoints.length = cnt;\n                    for (i = 0; i < cnt; i++)\n                        this._polygonPoints[i] = buffer.readFloat();\n                }\n                else if (this._type == 4) {\n                    this._sides = buffer.readShort();\n                    this._startAngle = buffer.readFloat();\n                    cnt = buffer.readShort();\n                    if (cnt > 0) {\n                        this._distances = [];\n                        for (i = 0; i < cnt; i++)\n                            this._distances[i] = buffer.readFloat();\n                    }\n                }\n                this.updateGraph();\n            }\n        };\n        return GGraph;\n    }(fgui.GObject));\n    fgui.GGraph = GGraph;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GGroup = (function (_super_1) {\n        __extends(GGroup, _super_1);\n        function GGroup() {\n            var _this = _super_1.call(this) || this;\n            _this._layout = 0;\n            _this._lineGap = 0;\n            _this._columnGap = 0;\n            _this._mainGridIndex = -1;\n            _this._mainGridMinSize = 50;\n            _this._mainChildIndex = -1;\n            _this._totalSize = 0;\n            _this._numChildren = 0;\n            _this._updating = 0;\n            return _this;\n        }\n        GGroup.prototype.dispose = function () {\n            this._boundsChanged = false;\n            _super_1.prototype.dispose.call(this);\n        };\n        Object.defineProperty(GGroup.prototype, \"layout\", {\n            get: function () {\n                return this._layout;\n            },\n            set: function (value) {\n                if (this._layout != value) {\n                    this._layout = value;\n                    this.setBoundsChangedFlag();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GGroup.prototype, \"lineGap\", {\n            get: function () {\n                return this._lineGap;\n            },\n            set: function (value) {\n                if (this._lineGap != value) {\n                    this._lineGap = value;\n                    this.setBoundsChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GGroup.prototype, \"columnGap\", {\n            get: function () {\n                return this._columnGap;\n            },\n            set: function (value) {\n                if (this._columnGap != value) {\n                    this._columnGap = value;\n                    this.setBoundsChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GGroup.prototype, \"excludeInvisibles\", {\n            get: function () {\n                return this._excludeInvisibles;\n            },\n            set: function (value) {\n                if (this._excludeInvisibles != value) {\n                    this._excludeInvisibles = value;\n                    this.setBoundsChangedFlag();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GGroup.prototype, \"autoSizeDisabled\", {\n            get: function () {\n                return this._autoSizeDisabled;\n            },\n            set: function (value) {\n                this._autoSizeDisabled = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GGroup.prototype, \"mainGridMinSize\", {\n            get: function () {\n                return this._mainGridMinSize;\n            },\n            set: function (value) {\n                if (this._mainGridMinSize != value) {\n                    this._mainGridMinSize = value;\n                    this.setBoundsChangedFlag();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GGroup.prototype, \"mainGridIndex\", {\n            get: function () {\n                return this._mainGridIndex;\n            },\n            set: function (value) {\n                if (this._mainGridIndex != value) {\n                    this._mainGridIndex = value;\n                    this.setBoundsChangedFlag();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GGroup.prototype.setBoundsChangedFlag = function (positionChangedOnly) {\n            if (this._updating == 0 && this._parent) {\n                if (!positionChangedOnly)\n                    this._percentReady = false;\n                if (!this._boundsChanged) {\n                    this._boundsChanged = true;\n                    if (this._layout != fgui.GroupLayoutType.None)\n                        fgui.GTimers.inst.callLater(this.ensureBoundsCorrect, this);\n                }\n            }\n        };\n        GGroup.prototype.ensureSizeCorrect = function () {\n            if (this._parent == null || !this._boundsChanged || this._layout == 0)\n                return;\n            this._boundsChanged = false;\n            if (this._autoSizeDisabled)\n                this.resizeChildren(0, 0);\n            else {\n                this.handleLayout();\n                this.updateBounds();\n            }\n        };\n        GGroup.prototype.ensureBoundsCorrect = function () {\n            if (this._parent == null || !this._boundsChanged)\n                return;\n            this._boundsChanged = false;\n            if (this._layout == 0)\n                this.updateBounds();\n            else {\n                if (this._autoSizeDisabled)\n                    this.resizeChildren(0, 0);\n                else {\n                    this.handleLayout();\n                    this.updateBounds();\n                }\n            }\n        };\n        GGroup.prototype.updateBounds = function () {\n            fgui.GTimers.inst.remove(this.ensureBoundsCorrect, this);\n            var cnt = this._parent.numChildren;\n            var i;\n            var child;\n            var ax = Number.POSITIVE_INFINITY, ay = Number.POSITIVE_INFINITY;\n            var ar = Number.NEGATIVE_INFINITY, ab = Number.NEGATIVE_INFINITY;\n            var tmp;\n            var empty = true;\n            for (i = 0; i < cnt; i++) {\n                child = this._parent.getChildAt(i);\n                if (child.group != this || this._excludeInvisibles && !child.internalVisible3)\n                    continue;\n                tmp = child.xMin;\n                if (tmp < ax)\n                    ax = tmp;\n                tmp = child.yMin;\n                if (tmp < ay)\n                    ay = tmp;\n                tmp = child.xMin + child.width;\n                if (tmp > ar)\n                    ar = tmp;\n                tmp = child.yMin + child.height;\n                if (tmp > ab)\n                    ab = tmp;\n                empty = false;\n            }\n            var w = 0, h = 0;\n            if (!empty) {\n                this._updating |= 1;\n                this.setXY(ax, ay);\n                this._updating &= 2;\n                w = ar - ax;\n                h = ab - ay;\n            }\n            if ((this._updating & 2) == 0) {\n                this._updating |= 2;\n                this.setSize(w, h);\n                this._updating &= 1;\n            }\n            else {\n                this._updating &= 1;\n                this.resizeChildren(this._width - w, this._height - h);\n            }\n        };\n        GGroup.prototype.handleLayout = function () {\n            this._updating |= 1;\n            var child;\n            var i;\n            var cnt;\n            if (this._layout == fgui.GroupLayoutType.Horizontal) {\n                var curX = this.x;\n                cnt = this._parent.numChildren;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n                    if (this._excludeInvisibles && !child.internalVisible3)\n                        continue;\n                    child.xMin = curX;\n                    if (child.width != 0)\n                        curX += child.width + this._columnGap;\n                }\n            }\n            else if (this._layout == fgui.GroupLayoutType.Vertical) {\n                var curY = this.y;\n                cnt = this._parent.numChildren;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n                    if (this._excludeInvisibles && !child.internalVisible3)\n                        continue;\n                    child.yMin = curY;\n                    if (child.height != 0)\n                        curY += child.height + this._lineGap;\n                }\n            }\n            this._updating &= 2;\n        };\n        GGroup.prototype.moveChildren = function (dx, dy) {\n            if ((this._updating & 1) != 0 || this._parent == null)\n                return;\n            this._updating |= 1;\n            var cnt = this._parent.numChildren;\n            var i;\n            var child;\n            for (i = 0; i < cnt; i++) {\n                child = this._parent.getChildAt(i);\n                if (child.group == this) {\n                    child.setXY(child.x + dx, child.y + dy);\n                }\n            }\n            this._updating &= 2;\n        };\n        GGroup.prototype.resizeChildren = function (dw, dh) {\n            if (this._layout == fgui.GroupLayoutType.None || (this._updating & 2) != 0 || this._parent == null)\n                return;\n            this._updating |= 2;\n            if (this._boundsChanged) {\n                this._boundsChanged = false;\n                if (!this._autoSizeDisabled) {\n                    this.updateBounds();\n                    return;\n                }\n            }\n            var cnt = this._parent.numChildren;\n            var i;\n            var child;\n            if (!this._percentReady) {\n                this._percentReady = true;\n                this._numChildren = 0;\n                this._totalSize = 0;\n                this._mainChildIndex = -1;\n                var j = 0;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n                    if (!this._excludeInvisibles || child.internalVisible3) {\n                        if (j == this._mainGridIndex)\n                            this._mainChildIndex = i;\n                        this._numChildren++;\n                        if (this._layout == 1)\n                            this._totalSize += child.width;\n                        else\n                            this._totalSize += child.height;\n                    }\n                    j++;\n                }\n                if (this._mainChildIndex != -1) {\n                    if (this._layout == 1) {\n                        child = this._parent.getChildAt(this._mainChildIndex);\n                        this._totalSize += this._mainGridMinSize - child.width;\n                        child._sizePercentInGroup = this._mainGridMinSize / this._totalSize;\n                    }\n                    else {\n                        child = this._parent.getChildAt(this._mainChildIndex);\n                        this._totalSize += this._mainGridMinSize - child.height;\n                        child._sizePercentInGroup = this._mainGridMinSize / this._totalSize;\n                    }\n                }\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n                    if (i == this._mainChildIndex)\n                        continue;\n                    if (this._totalSize > 0)\n                        child._sizePercentInGroup = (this._layout == 1 ? child.width : child.height) / this._totalSize;\n                    else\n                        child._sizePercentInGroup = 0;\n                }\n            }\n            var remainSize = 0;\n            var remainPercent = 1;\n            var priorHandled = false;\n            if (this._layout == 1) {\n                remainSize = this.width - (this._numChildren - 1) * this._columnGap;\n                if (this._mainChildIndex != -1 && remainSize >= this._totalSize) {\n                    child = this._parent.getChildAt(this._mainChildIndex);\n                    child.setSize(remainSize - (this._totalSize - this._mainGridMinSize), child._rawHeight + dh, true);\n                    remainSize -= child.width;\n                    remainPercent -= child._sizePercentInGroup;\n                    priorHandled = true;\n                }\n                var curX = this.x;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n                    if (this._excludeInvisibles && !child.internalVisible3) {\n                        child.setSize(child._rawWidth, child._rawHeight + dh, true);\n                        continue;\n                    }\n                    if (!priorHandled || i != this._mainChildIndex) {\n                        child.setSize(Math.round(child._sizePercentInGroup / remainPercent * remainSize), child._rawHeight + dh, true);\n                        remainPercent -= child._sizePercentInGroup;\n                        remainSize -= child.width;\n                    }\n                    child.xMin = curX;\n                    if (child.width != 0)\n                        curX += child.width + this._columnGap;\n                }\n            }\n            else {\n                remainSize = this.height - (this._numChildren - 1) * this._lineGap;\n                if (this._mainChildIndex != -1 && remainSize >= this._totalSize) {\n                    child = this._parent.getChildAt(this._mainChildIndex);\n                    child.setSize(child._rawWidth + dw, remainSize - (this._totalSize - this._mainGridMinSize), true);\n                    remainSize -= child.height;\n                    remainPercent -= child._sizePercentInGroup;\n                    priorHandled = true;\n                }\n                var curY = this.y;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n                    if (this._excludeInvisibles && !child.internalVisible3) {\n                        child.setSize(child._rawWidth + dw, child._rawHeight, true);\n                        continue;\n                    }\n                    if (!priorHandled || i != this._mainChildIndex) {\n                        child.setSize(child._rawWidth + dw, Math.round(child._sizePercentInGroup / remainPercent * remainSize), true);\n                        remainPercent -= child._sizePercentInGroup;\n                        remainSize -= child.height;\n                    }\n                    child.yMin = curY;\n                    if (child.height != 0)\n                        curY += child.height + this._lineGap;\n                }\n            }\n            this._updating &= 1;\n        };\n        GGroup.prototype.handleAlphaChanged = function () {\n            if (this._underConstruct)\n                return;\n            var cnt = this._parent.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                var child = this._parent.getChildAt(i);\n                if (child.group == this)\n                    child.alpha = this.alpha;\n            }\n        };\n        GGroup.prototype.handleVisibleChanged = function () {\n            if (!this._parent)\n                return;\n            var cnt = this._parent.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                var child = this._parent.getChildAt(i);\n                if (child.group == this)\n                    child.handleVisibleChanged();\n            }\n        };\n        GGroup.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            this._layout = buffer.readByte();\n            this._lineGap = buffer.readInt();\n            this._columnGap = buffer.readInt();\n            if (buffer.version >= 2) {\n                this._excludeInvisibles = buffer.readBool();\n                this._autoSizeDisabled = buffer.readBool();\n                this._mainGridIndex = buffer.readInt();\n            }\n        };\n        GGroup.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            if (!this.visible)\n                this.handleVisibleChanged();\n        };\n        return GGroup;\n    }(fgui.GObject));\n    fgui.GGroup = GGroup;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GImage = (function (_super_1) {\n        __extends(GImage, _super_1);\n        function GImage() {\n            var _this = _super_1.call(this) || this;\n            _this._flip = fgui.FlipType.None;\n            return _this;\n        }\n        Object.defineProperty(GImage.prototype, \"color\", {\n            get: function () {\n                return this._content.color;\n            },\n            set: function (value) {\n                if (this._content.color != value) {\n                    this._content.color = value;\n                    this.updateGear(4);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GImage.prototype, \"flip\", {\n            get: function () {\n                return this._flip;\n            },\n            set: function (value) {\n                if (this._flip != value) {\n                    this._flip = value;\n                    var sx = 1, sy = 1;\n                    if (this._flip == fgui.FlipType.Horizontal || this._flip == fgui.FlipType.Both)\n                        sx = -1;\n                    if (this._flip == fgui.FlipType.Vertical || this._flip == fgui.FlipType.Both)\n                        sy = -1;\n                    this._content.scaleX = sx;\n                    this._content.scaleY = sy;\n                    this.handleXYChanged();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GImage.prototype, \"fillMethod\", {\n            get: function () {\n                return this._content.fillMethod;\n            },\n            set: function (value) {\n                this._content.fillMethod = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GImage.prototype, \"fillOrigin\", {\n            get: function () {\n                return this._content.fillOrigin;\n            },\n            set: function (value) {\n                this._content.fillOrigin = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GImage.prototype, \"fillClockwise\", {\n            get: function () {\n                return this._content.fillClockwise;\n            },\n            set: function (value) {\n                this._content.fillClockwise = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GImage.prototype, \"fillAmount\", {\n            get: function () {\n                return this._content.fillAmount;\n            },\n            set: function (value) {\n                this._content.fillAmount = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GImage.prototype, \"texture\", {\n            get: function () {\n                return this._content.texture;\n            },\n            set: function (value) {\n                if (value) {\n                    this.sourceWidth = value.textureWidth;\n                    this.sourceHeight = value.textureHeight;\n                }\n                else {\n                    this.sourceWidth = 0;\n                    this.sourceHeight = 0;\n                }\n                this.initWidth = this.sourceWidth;\n                this.initHeight = this.sourceHeight;\n                this._content.scale9Grid = null;\n                this._content.fillMode = egret.BitmapFillMode.SCALE;\n                this._content.texture = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GImage.prototype.createDisplayObject = function () {\n            this._content = new fgui.Image();\n            this._content.touchEnabled = false;\n            this.setDisplayObject(this._content);\n        };\n        GImage.prototype.constructFromResource = function () {\n            var contentItem = this.packageItem.getBranch();\n            this.sourceWidth = contentItem.width;\n            this.sourceHeight = contentItem.height;\n            this.initWidth = this.sourceWidth;\n            this.initHeight = this.sourceHeight;\n            this.setSize(this.sourceWidth, this.sourceHeight);\n            contentItem = contentItem.getHighResolution();\n            contentItem.load();\n            this._content.scale9Grid = contentItem.scale9Grid;\n            this._content.smoothing = contentItem.smoothing;\n            if (contentItem.scaleByTile)\n                this._content.fillMode = egret.BitmapFillMode.REPEAT;\n            this.setSize(this.sourceWidth, this.sourceHeight);\n            this._content.texture = contentItem.asset;\n        };\n        GImage.prototype.handleXYChanged = function () {\n            _super_1.prototype.handleXYChanged.call(this);\n            if (this._flip != fgui.FlipType.None) {\n                if (this._content.scaleX == -1)\n                    this._content.x += this.width;\n                if (this._content.scaleY == -1)\n                    this._content.y += this.height;\n            }\n        };\n        GImage.prototype.getProp = function (index) {\n            if (index == fgui.ObjectPropID.Color)\n                return this.color;\n            else\n                return _super_1.prototype.getProp.call(this, index);\n        };\n        GImage.prototype.setProp = function (index, value) {\n            if (index == fgui.ObjectPropID.Color)\n                this.color = value;\n            else\n                _super_1.prototype.setProp.call(this, index, value);\n        };\n        GImage.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            if (buffer.readBool())\n                this.color = buffer.readColor();\n            this.flip = buffer.readByte();\n            this._content.fillMethod = buffer.readByte();\n            if (this._content.fillMethod != 0) {\n                this._content.fillOrigin = buffer.readByte();\n                this._content.fillClockwise = buffer.readBool();\n                this._content.fillAmount = buffer.readFloat();\n            }\n        };\n        return GImage;\n    }(fgui.GObject));\n    fgui.GImage = GImage;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GLabel = (function (_super_1) {\n        __extends(GLabel, _super_1);\n        function GLabel() {\n            return _super_1.call(this) || this;\n        }\n        Object.defineProperty(GLabel.prototype, \"icon\", {\n            get: function () {\n                if (this._iconObject)\n                    return this._iconObject.icon;\n            },\n            set: function (value) {\n                if (this._iconObject)\n                    this._iconObject.icon = value;\n                this.updateGear(7);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLabel.prototype, \"title\", {\n            get: function () {\n                if (this._titleObject)\n                    return this._titleObject.text;\n                else\n                    return null;\n            },\n            set: function (value) {\n                if (this._titleObject)\n                    this._titleObject.text = value;\n                this.updateGear(6);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLabel.prototype, \"text\", {\n            get: function () {\n                return this.title;\n            },\n            set: function (value) {\n                this.title = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLabel.prototype, \"titleColor\", {\n            get: function () {\n                var tf = this.getTextField();\n                if (tf)\n                    return tf.color;\n                else\n                    return 0;\n            },\n            set: function (value) {\n                var tf = this.getTextField();\n                if (tf)\n                    tf.color = value;\n                this.updateGear(4);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLabel.prototype, \"titleFontSize\", {\n            get: function () {\n                var tf = this.getTextField();\n                if (tf)\n                    return tf.fontSize;\n                else\n                    return 0;\n            },\n            set: function (value) {\n                var tf = this.getTextField();\n                if (tf)\n                    tf.fontSize = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLabel.prototype, \"editable\", {\n            get: function () {\n                if (this._titleObject && (this._titleObject instanceof fgui.GTextInput))\n                    return this._titleObject.asTextInput.editable;\n                else\n                    return false;\n            },\n            set: function (val) {\n                if (this._titleObject)\n                    this._titleObject.asTextInput.editable = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GLabel.prototype.getTextField = function () {\n            if (this._titleObject instanceof fgui.GTextField)\n                return this._titleObject;\n            else if ((this._titleObject instanceof GLabel) || (this._titleObject instanceof fgui.GButton))\n                return this._titleObject.getTextField();\n            else\n                return null;\n        };\n        GLabel.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    return this.titleColor;\n                case fgui.ObjectPropID.OutlineColor:\n                    {\n                        var tf = this.getTextField();\n                        if (tf)\n                            return tf.strokeColor;\n                        else\n                            return 0;\n                    }\n                case fgui.ObjectPropID.FontSize:\n                    return this.titleFontSize;\n                default:\n                    return _super_1.prototype.getProp.call(this, index);\n            }\n        };\n        GLabel.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    this.titleColor = value;\n                    break;\n                case fgui.ObjectPropID.OutlineColor:\n                    {\n                        var tf = this.getTextField();\n                        if (tf)\n                            tf.strokeColor = value;\n                    }\n                    break;\n                case fgui.ObjectPropID.FontSize:\n                    this.titleFontSize = value;\n                    break;\n                default:\n                    _super_1.prototype.setProp.call(this, index, value);\n                    break;\n            }\n        };\n        GLabel.prototype.constructExtension = function (buffer) {\n            this._titleObject = this.getChild(\"title\");\n            this._iconObject = this.getChild(\"icon\");\n        };\n        GLabel.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            if (!buffer.seek(beginPos, 6))\n                return;\n            if (buffer.readByte() != this.packageItem.objectType)\n                return;\n            var str;\n            str = buffer.readS();\n            if (str != null)\n                this.title = str;\n            str = buffer.readS();\n            if (str != null)\n                this.icon = str;\n            if (buffer.readBool())\n                this.titleColor = buffer.readColor();\n            var iv = buffer.readInt();\n            if (iv != 0)\n                this.titleFontSize = iv;\n            if (buffer.readBool()) {\n                var input = this.getTextField();\n                if (input instanceof fgui.GTextInput) {\n                    str = buffer.readS();\n                    if (str != null)\n                        input.promptText = str;\n                    str = buffer.readS();\n                    if (str != null)\n                        input.restrict = str;\n                    iv = buffer.readInt();\n                    if (iv != 0)\n                        input.maxLength = iv;\n                    iv = buffer.readInt();\n                    if (iv != 0) {\n                    }\n                    if (buffer.readBool())\n                        input.password = true;\n                }\n                else\n                    buffer.skip(13);\n            }\n        };\n        return GLabel;\n    }(fgui.GComponent));\n    fgui.GLabel = GLabel;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GList = (function (_super_1) {\n        __extends(GList, _super_1);\n        function GList() {\n            var _this = _super_1.call(this) || this;\n            _this.scrollItemToViewOnClick = true;\n            _this.foldInvisibleItems = false;\n            _this._lineCount = 0;\n            _this._columnCount = 0;\n            _this._lineGap = 0;\n            _this._columnGap = 0;\n            _this._lastSelectedIndex = 0;\n            _this._numItems = 0;\n            _this._realNumItems = 0;\n            _this._firstIndex = 0;\n            _this._curLineItemCount = 0;\n            _this._curLineItemCount2 = 0;\n            _this._virtualListChanged = 0;\n            _this.itemInfoVer = 0;\n            _this._trackBounds = true;\n            _this._pool = new fgui.GObjectPool();\n            _this._layout = fgui.ListLayoutType.SingleColumn;\n            _this._autoResizeItem = true;\n            _this._lastSelectedIndex = -1;\n            _this._selectionMode = fgui.ListSelectionMode.Single;\n            _this.opaque = true;\n            _this._align = fgui.AlignType.Left;\n            _this._verticalAlign = fgui.VertAlignType.Top;\n            _this._container = new egret.DisplayObjectContainer();\n            _this._rootContainer.addChild(_this._container);\n            return _this;\n        }\n        GList.prototype.dispose = function () {\n            this._pool.clear();\n            _super_1.prototype.dispose.call(this);\n        };\n        Object.defineProperty(GList.prototype, \"layout\", {\n            get: function () {\n                return this._layout;\n            },\n            set: function (value) {\n                if (this._layout != value) {\n                    this._layout = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"lineCount\", {\n            get: function () {\n                return this._lineCount;\n            },\n            set: function (value) {\n                if (this._lineCount != value) {\n                    this._lineCount = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"columnCount\", {\n            get: function () {\n                return this._columnCount;\n            },\n            set: function (value) {\n                if (this._columnCount != value) {\n                    this._columnCount = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"lineGap\", {\n            get: function () {\n                return this._lineGap;\n            },\n            set: function (value) {\n                if (this._lineGap != value) {\n                    this._lineGap = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"columnGap\", {\n            get: function () {\n                return this._columnGap;\n            },\n            set: function (value) {\n                if (this._columnGap != value) {\n                    this._columnGap = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"align\", {\n            get: function () {\n                return this._align;\n            },\n            set: function (value) {\n                if (this._align != value) {\n                    this._align = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"verticalAlign\", {\n            get: function () {\n                return this._verticalAlign;\n            },\n            set: function (value) {\n                if (this._verticalAlign != value) {\n                    this._verticalAlign = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"virtualItemSize\", {\n            get: function () {\n                return this._itemSize;\n            },\n            set: function (value) {\n                if (this._virtual) {\n                    if (!this._itemSize)\n                        this._itemSize = new egret.Point();\n                    this._itemSize.copyFrom(value);\n                    this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"defaultItem\", {\n            get: function () {\n                return this._defaultItem;\n            },\n            set: function (val) {\n                this._defaultItem = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"autoResizeItem\", {\n            get: function () {\n                return this._autoResizeItem;\n            },\n            set: function (value) {\n                if (this._autoResizeItem != value) {\n                    this._autoResizeItem = value;\n                    this.setBoundsChangedFlag();\n                    if (this._virtual)\n                        this.setVirtualListChangedFlag(true);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"selectionMode\", {\n            get: function () {\n                return this._selectionMode;\n            },\n            set: function (value) {\n                this._selectionMode = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"selectionController\", {\n            get: function () {\n                return this._selectionController;\n            },\n            set: function (value) {\n                this._selectionController = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GList.prototype, \"itemPool\", {\n            get: function () {\n                return this._pool;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GList.prototype.getFromPool = function (url) {\n            if (!url)\n                url = this._defaultItem;\n            var obj = this._pool.getObject(url);\n            if (obj)\n                obj.visible = true;\n            return obj;\n        };\n        GList.prototype.returnToPool = function (obj) {\n            obj.displayObject.cacheAsBitmap = false;\n            this._pool.returnObject(obj);\n        };\n        GList.prototype.addChildAt = function (child, index) {\n            _super_1.prototype.addChildAt.call(this, child, index);\n            if (child instanceof fgui.GButton) {\n                child.selected = false;\n                child.changeStateOnClick = false;\n            }\n            child.addEventListener(egret.TouchEvent.TOUCH_TAP, this.__clickItem, this);\n            return child;\n        };\n        GList.prototype.addItem = function (url) {\n            if (!url)\n                url = this._defaultItem;\n            return this.addChild(fgui.UIPackage.createObjectFromURL(url));\n        };\n        GList.prototype.addItemFromPool = function (url) {\n            return this.addChild(this.getFromPool(url));\n        };\n        GList.prototype.removeChildAt = function (index, dispose) {\n            var child = _super_1.prototype.removeChildAt.call(this, index, dispose);\n            child.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.__clickItem, this);\n            return child;\n        };\n        GList.prototype.removeChildToPoolAt = function (index) {\n            var child = _super_1.prototype.removeChildAt.call(this, index);\n            this.returnToPool(child);\n        };\n        GList.prototype.removeChildToPool = function (child) {\n            _super_1.prototype.removeChild.call(this, child);\n            this.returnToPool(child);\n        };\n        GList.prototype.removeChildrenToPool = function (beginIndex, endIndex) {\n            if (beginIndex == undefined)\n                beginIndex = 0;\n            if (endIndex == undefined)\n                endIndex = -1;\n            if (endIndex < 0 || endIndex >= this._children.length)\n                endIndex = this._children.length - 1;\n            for (var i = beginIndex; i <= endIndex; ++i)\n                this.removeChildToPoolAt(beginIndex);\n        };\n        Object.defineProperty(GList.prototype, \"selectedIndex\", {\n            get: function () {\n                var i;\n                if (this._virtual) {\n                    for (i = 0; i < this._realNumItems; i++) {\n                        var ii = this._virtualItems[i];\n                        if ((ii.obj instanceof fgui.GButton) && ii.obj.selected\n                            || ii.obj == null && ii.selected) {\n                            if (this._loop)\n                                return i % this._numItems;\n                            else\n                                return i;\n                        }\n                    }\n                }\n                else {\n                    var cnt = this._children.length;\n                    for (i = 0; i < cnt; i++) {\n                        var obj = this._children[i];\n                        if ((obj instanceof fgui.GButton) && obj.selected)\n                            return i;\n                    }\n                }\n                return -1;\n            },\n            set: function (value) {\n                if (value >= 0 && value < this.numItems) {\n                    if (this._selectionMode != fgui.ListSelectionMode.Single)\n                        this.clearSelection();\n                    this.addSelection(value);\n                }\n                else\n                    this.clearSelection();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GList.prototype.getSelection = function (result) {\n            if (!result)\n                result = new Array();\n            var i;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii = this._virtualItems[i];\n                    if ((ii.obj instanceof fgui.GButton) && ii.obj.selected\n                        || ii.obj == null && ii.selected) {\n                        var j = i;\n                        if (this._loop) {\n                            j = i % this._numItems;\n                            if (result.indexOf(j) != -1)\n                                continue;\n                        }\n                        result.push(j);\n                    }\n                }\n            }\n            else {\n                var cnt = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj = this._children[i];\n                    if ((obj instanceof fgui.GButton) && obj.selected)\n                        result.push(i);\n                }\n            }\n            return result;\n        };\n        GList.prototype.addSelection = function (index, scrollItToView) {\n            if (this._selectionMode == fgui.ListSelectionMode.None)\n                return;\n            this.checkVirtualList();\n            if (this._selectionMode == fgui.ListSelectionMode.Single)\n                this.clearSelection();\n            if (scrollItToView)\n                this.scrollToView(index);\n            this._lastSelectedIndex = index;\n            var obj;\n            if (this._virtual) {\n                var ii = this._virtualItems[index];\n                if (ii.obj)\n                    obj = ii.obj;\n                ii.selected = true;\n            }\n            else\n                obj = this.getChildAt(index);\n            if ((obj instanceof fgui.GButton) && !obj.selected) {\n                obj.selected = true;\n                this.updateSelectionController(index);\n            }\n        };\n        GList.prototype.removeSelection = function (index) {\n            if (this._selectionMode == fgui.ListSelectionMode.None)\n                return;\n            var obj;\n            if (this._virtual) {\n                var ii = this._virtualItems[index];\n                if (ii.obj)\n                    obj = ii.obj;\n                ii.selected = false;\n            }\n            else\n                obj = this.getChildAt(index);\n            if (obj instanceof fgui.GButton)\n                obj.selected = false;\n        };\n        GList.prototype.clearSelection = function () {\n            var i;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii = this._virtualItems[i];\n                    if (ii.obj instanceof fgui.GButton)\n                        ii.obj.selected = false;\n                    ii.selected = false;\n                }\n            }\n            else {\n                var cnt = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj = this._children[i];\n                    if (obj instanceof fgui.GButton)\n                        obj.selected = false;\n                }\n            }\n        };\n        GList.prototype.clearSelectionExcept = function (g) {\n            var i;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii = this._virtualItems[i];\n                    if (ii.obj != g) {\n                        if ((ii.obj instanceof fgui.GButton))\n                            ii.obj.selected = false;\n                        ii.selected = false;\n                    }\n                }\n            }\n            else {\n                var cnt = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj = this._children[i];\n                    if ((obj instanceof fgui.GButton) && obj != g)\n                        obj.selected = false;\n                }\n            }\n        };\n        GList.prototype.selectAll = function () {\n            this.checkVirtualList();\n            var last = -1;\n            var i;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii = this._virtualItems[i];\n                    if ((ii.obj instanceof fgui.GButton) && !ii.obj.selected) {\n                        ii.obj.selected = true;\n                        last = i;\n                    }\n                    ii.selected = true;\n                }\n            }\n            else {\n                var cnt = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj = this._children[i];\n                    if ((obj instanceof fgui.GButton) && !obj.selected) {\n                        obj.selected = true;\n                        last = i;\n                    }\n                }\n            }\n            if (last != -1)\n                this.updateSelectionController(last);\n        };\n        GList.prototype.selectNone = function () {\n            this.clearSelection();\n        };\n        GList.prototype.selectReverse = function () {\n            this.checkVirtualList();\n            var last = -1;\n            var i;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii = this._virtualItems[i];\n                    if (ii.obj instanceof fgui.GButton) {\n                        ii.obj.selected = !ii.obj.selected;\n                        if (ii.obj.selected)\n                            last = i;\n                    }\n                    ii.selected = !ii.selected;\n                }\n            }\n            else {\n                var cnt = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj = this._children[i];\n                    if (obj instanceof fgui.GButton) {\n                        obj.selected = !obj.selected;\n                        if (obj.selected)\n                            last = i;\n                    }\n                }\n            }\n            if (last != -1)\n                this.updateSelectionController(last);\n        };\n        GList.prototype.handleArrowKey = function (dir) {\n            var index = this.selectedIndex;\n            if (index == -1)\n                return;\n            switch (dir) {\n                case 1:\n                    if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowVertical) {\n                        index--;\n                        if (index >= 0) {\n                            this.clearSelection();\n                            this.addSelection(index, true);\n                        }\n                    }\n                    else if (this._layout == fgui.ListLayoutType.FlowHorizontal || this._layout == fgui.ListLayoutType.Pagination) {\n                        var current = this._children[index];\n                        var k = 0;\n                        for (var i = index - 1; i >= 0; i--) {\n                            var obj = this._children[i];\n                            if (obj.y != current.y) {\n                                current = obj;\n                                break;\n                            }\n                            k++;\n                        }\n                        for (; i >= 0; i--) {\n                            obj = this._children[i];\n                            if (obj.y != current.y) {\n                                this.clearSelection();\n                                this.addSelection(i + k + 1, true);\n                                break;\n                            }\n                        }\n                    }\n                    break;\n                case 3:\n                    if (this._layout == fgui.ListLayoutType.SingleRow || this._layout == fgui.ListLayoutType.FlowHorizontal || this._layout == fgui.ListLayoutType.Pagination) {\n                        index++;\n                        if (index < this._children.length) {\n                            this.clearSelection();\n                            this.addSelection(index, true);\n                        }\n                    }\n                    else if (this._layout == fgui.ListLayoutType.FlowVertical) {\n                        current = this._children[index];\n                        k = 0;\n                        var cnt = this._children.length;\n                        for (i = index + 1; i < cnt; i++) {\n                            obj = this._children[i];\n                            if (obj.x != current.x) {\n                                current = obj;\n                                break;\n                            }\n                            k++;\n                        }\n                        for (; i < cnt; i++) {\n                            obj = this._children[i];\n                            if (obj.x != current.x) {\n                                this.clearSelection();\n                                this.addSelection(i - k - 1, true);\n                                break;\n                            }\n                        }\n                    }\n                    break;\n                case 5:\n                    if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowVertical) {\n                        index++;\n                        if (index < this._children.length) {\n                            this.clearSelection();\n                            this.addSelection(index, true);\n                        }\n                    }\n                    else if (this._layout == fgui.ListLayoutType.FlowHorizontal || this._layout == fgui.ListLayoutType.Pagination) {\n                        current = this._children[index];\n                        k = 0;\n                        cnt = this._children.length;\n                        for (i = index + 1; i < cnt; i++) {\n                            obj = this._children[i];\n                            if (obj.y != current.y) {\n                                current = obj;\n                                break;\n                            }\n                            k++;\n                        }\n                        for (; i < cnt; i++) {\n                            obj = this._children[i];\n                            if (obj.y != current.y) {\n                                this.clearSelection();\n                                this.addSelection(i - k - 1, true);\n                                break;\n                            }\n                        }\n                    }\n                    break;\n                case 7:\n                    if (this._layout == fgui.ListLayoutType.SingleRow || this._layout == fgui.ListLayoutType.FlowHorizontal || this._layout == fgui.ListLayoutType.Pagination) {\n                        index--;\n                        if (index >= 0) {\n                            this.clearSelection();\n                            this.addSelection(index, true);\n                        }\n                    }\n                    else if (this._layout == fgui.ListLayoutType.FlowVertical) {\n                        current = this._children[index];\n                        k = 0;\n                        for (i = index - 1; i >= 0; i--) {\n                            obj = this._children[i];\n                            if (obj.x != current.x) {\n                                current = obj;\n                                break;\n                            }\n                            k++;\n                        }\n                        for (; i >= 0; i--) {\n                            obj = this._children[i];\n                            if (obj.x != current.x) {\n                                this.clearSelection();\n                                this.addSelection(i + k + 1, true);\n                                break;\n                            }\n                        }\n                    }\n                    break;\n            }\n        };\n        GList.prototype.__clickItem = function (evt) {\n            if (this._scrollPane && this._scrollPane.isDragged)\n                return;\n            var item = (evt.currentTarget);\n            this.setSelectionOnEvent(item);\n            if (this._scrollPane && this.scrollItemToViewOnClick)\n                this._scrollPane.scrollToView(item, true);\n            var ie = new fgui.ItemEvent(fgui.ItemEvent.CLICK, item);\n            ie.stageX = evt.stageX;\n            ie.stageY = evt.stageY;\n            this.dispatchItemEvent(ie);\n        };\n        GList.prototype.dispatchItemEvent = function (evt) {\n            this.dispatchEvent(evt);\n        };\n        GList.prototype.setSelectionOnEvent = function (item) {\n            if (!(item instanceof fgui.GButton) || this._selectionMode == fgui.ListSelectionMode.None)\n                return;\n            var dontChangeLastIndex = false;\n            var index = this.childIndexToItemIndex(this.getChildIndex(item));\n            if (this._selectionMode == fgui.ListSelectionMode.Single) {\n                if (!item.selected) {\n                    this.clearSelectionExcept(item);\n                    item.selected = true;\n                }\n            }\n            else {\n                if (fgui.GRoot.shiftKeyDown) {\n                    if (!item.selected) {\n                        if (this._lastSelectedIndex != -1) {\n                            var min = Math.min(this._lastSelectedIndex, index);\n                            var max = Math.max(this._lastSelectedIndex, index);\n                            max = Math.min(max, this.numItems - 1);\n                            var i;\n                            if (this._virtual) {\n                                for (i = min; i <= max; i++) {\n                                    var ii = this._virtualItems[i];\n                                    if (ii.obj instanceof fgui.GButton)\n                                        ii.obj.selected = true;\n                                    ii.selected = true;\n                                }\n                            }\n                            else {\n                                for (i = min; i <= max; i++) {\n                                    var obj = this.getChildAt(i);\n                                    if (obj instanceof fgui.GButton)\n                                        obj.selected = true;\n                                }\n                            }\n                            dontChangeLastIndex = true;\n                        }\n                        else {\n                            item.selected = true;\n                        }\n                    }\n                }\n                else if (fgui.GRoot.ctrlKeyDown || this._selectionMode == fgui.ListSelectionMode.Multiple_SingleClick) {\n                    item.selected = !item.selected;\n                }\n                else {\n                    if (!item.selected) {\n                        this.clearSelectionExcept(item);\n                        item.selected = true;\n                    }\n                    else\n                        this.clearSelectionExcept(item);\n                }\n            }\n            if (!dontChangeLastIndex)\n                this._lastSelectedIndex = index;\n            if (item.selected)\n                this.updateSelectionController(index);\n        };\n        GList.prototype.resizeToFit = function (itemCount, minSize) {\n            if (itemCount === void 0) { itemCount = Number.POSITIVE_INFINITY; }\n            if (minSize === void 0) { minSize = 0; }\n            this.ensureBoundsCorrect();\n            var curCount = this.numItems;\n            if (itemCount > curCount)\n                itemCount = curCount;\n            if (this._virtual) {\n                var lineCount = Math.ceil(itemCount / this._curLineItemCount);\n                if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal)\n                    this.viewHeight = lineCount * this._itemSize.y + Math.max(0, lineCount - 1) * this._lineGap;\n                else\n                    this.viewWidth = lineCount * this._itemSize.x + Math.max(0, lineCount - 1) * this._columnGap;\n            }\n            else if (itemCount == 0) {\n                if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal)\n                    this.viewHeight = minSize;\n                else\n                    this.viewWidth = minSize;\n            }\n            else {\n                var i = itemCount - 1;\n                var obj;\n                while (i >= 0) {\n                    obj = this.getChildAt(i);\n                    if (!this.foldInvisibleItems || obj.visible)\n                        break;\n                    i--;\n                }\n                if (i < 0) {\n                    if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal)\n                        this.viewHeight = minSize;\n                    else\n                        this.viewWidth = minSize;\n                }\n                else {\n                    var size = 0;\n                    if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                        size = obj.y + obj.height;\n                        if (size < minSize)\n                            size = minSize;\n                        this.viewHeight = size;\n                    }\n                    else {\n                        size = obj.x + obj.width;\n                        if (size < minSize)\n                            size = minSize;\n                        this.viewWidth = size;\n                    }\n                }\n            }\n        };\n        GList.prototype.getMaxItemWidth = function () {\n            var cnt = this._children.length;\n            var max = 0;\n            for (var i = 0; i < cnt; i++) {\n                var child = this.getChildAt(i);\n                if (child.width > max)\n                    max = child.width;\n            }\n            return max;\n        };\n        GList.prototype.handleSizeChanged = function () {\n            _super_1.prototype.handleSizeChanged.call(this);\n            this.setBoundsChangedFlag();\n            if (this._virtual)\n                this.setVirtualListChangedFlag(true);\n        };\n        GList.prototype.handleControllerChanged = function (c) {\n            _super_1.prototype.handleControllerChanged.call(this, c);\n            if (this._selectionController == c)\n                this.selectedIndex = c.selectedIndex;\n        };\n        GList.prototype.updateSelectionController = function (index) {\n            if (this._selectionController && !this._selectionController.changing\n                && index < this._selectionController.pageCount) {\n                var c = this._selectionController;\n                this._selectionController = null;\n                c.selectedIndex = index;\n                this._selectionController = c;\n            }\n        };\n        GList.prototype.getSnappingPosition = function (xValue, yValue, result) {\n            if (this._virtual) {\n                if (!result)\n                    result = new egret.Point();\n                var saved;\n                var index;\n                if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                    saved = yValue;\n                    s_n = yValue;\n                    index = this.getIndexOnPos1(false);\n                    yValue = s_n;\n                    if (index < this._virtualItems.length && saved - yValue > this._virtualItems[index].height / 2 && index < this._realNumItems)\n                        yValue += this._virtualItems[index].height + this._lineGap;\n                }\n                else if (this._layout == fgui.ListLayoutType.SingleRow || this._layout == fgui.ListLayoutType.FlowVertical) {\n                    saved = xValue;\n                    s_n = xValue;\n                    index = this.getIndexOnPos2(false);\n                    xValue = s_n;\n                    if (index < this._virtualItems.length && saved - xValue > this._virtualItems[index].width / 2 && index < this._realNumItems)\n                        xValue += this._virtualItems[index].width + this._columnGap;\n                }\n                else {\n                    saved = xValue;\n                    s_n = xValue;\n                    index = this.getIndexOnPos3(false);\n                    xValue = s_n;\n                    if (index < this._virtualItems.length && saved - xValue > this._virtualItems[index].width / 2 && index < this._realNumItems)\n                        xValue += this._virtualItems[index].width + this._columnGap;\n                }\n                result.x = xValue;\n                result.y = yValue;\n                return result;\n            }\n            else {\n                return _super_1.prototype.getSnappingPosition.call(this, xValue, yValue, result);\n            }\n        };\n        GList.prototype.scrollToView = function (index, ani, setFirst) {\n            if (this._virtual) {\n                if (this._numItems == 0)\n                    return;\n                this.checkVirtualList();\n                if (index >= this._virtualItems.length)\n                    throw \"Invalid child index: \" + index + \">\" + this._virtualItems.length;\n                if (this._loop)\n                    index = Math.floor(this._firstIndex / this._numItems) * this._numItems + index;\n                var rect;\n                var ii = this._virtualItems[index];\n                var pos = 0;\n                var i;\n                if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                    for (i = this._curLineItemCount - 1; i < index; i += this._curLineItemCount)\n                        pos += this._virtualItems[i].height + this._lineGap;\n                    rect = new egret.Rectangle(0, pos, this._itemSize.x, ii.height);\n                }\n                else if (this._layout == fgui.ListLayoutType.SingleRow || this._layout == fgui.ListLayoutType.FlowVertical) {\n                    for (i = this._curLineItemCount - 1; i < index; i += this._curLineItemCount)\n                        pos += this._virtualItems[i].width + this._columnGap;\n                    rect = new egret.Rectangle(pos, 0, ii.width, this._itemSize.y);\n                }\n                else {\n                    var page = index / (this._curLineItemCount * this._curLineItemCount2);\n                    rect = new egret.Rectangle(page * this.viewWidth + (index % this._curLineItemCount) * (ii.width + this._columnGap), (index / this._curLineItemCount) % this._curLineItemCount2 * (ii.height + this._lineGap), ii.width, ii.height);\n                }\n                if (this._scrollPane)\n                    this._scrollPane.scrollToView(rect, ani, setFirst);\n            }\n            else {\n                var obj = this.getChildAt(index);\n                if (obj) {\n                    if (this._scrollPane)\n                        this._scrollPane.scrollToView(obj, ani, setFirst);\n                    else if (this.parent && this.parent.scrollPane)\n                        this.parent.scrollPane.scrollToView(obj, ani, setFirst);\n                }\n            }\n        };\n        GList.prototype.getFirstChildInView = function () {\n            return this.childIndexToItemIndex(_super_1.prototype.getFirstChildInView.call(this));\n        };\n        GList.prototype.childIndexToItemIndex = function (index) {\n            if (!this._virtual)\n                return index;\n            if (this._layout == fgui.ListLayoutType.Pagination) {\n                for (var i = this._firstIndex; i < this._realNumItems; i++) {\n                    if (this._virtualItems[i].obj) {\n                        index--;\n                        if (index < 0)\n                            return i;\n                    }\n                }\n                return index;\n            }\n            else {\n                index += this._firstIndex;\n                if (this._loop && this._numItems > 0)\n                    index = index % this._numItems;\n                return index;\n            }\n        };\n        GList.prototype.itemIndexToChildIndex = function (index) {\n            if (!this._virtual)\n                return index;\n            if (this._layout == fgui.ListLayoutType.Pagination) {\n                return this.getChildIndex(this._virtualItems[index].obj);\n            }\n            else {\n                if (this._loop && this._numItems > 0) {\n                    var j = this._firstIndex % this._numItems;\n                    if (index >= j)\n                        index = index - j;\n                    else\n                        index = this._numItems - j + index;\n                }\n                else\n                    index -= this._firstIndex;\n                return index;\n            }\n        };\n        GList.prototype.setVirtual = function () {\n            this._setVirtual(false);\n        };\n        GList.prototype.setVirtualAndLoop = function () {\n            this._setVirtual(true);\n        };\n        GList.prototype._setVirtual = function (loop) {\n            if (!this._virtual) {\n                if (this._scrollPane == null)\n                    throw \"Virtual list must be scrollable!\";\n                if (loop) {\n                    if (this._layout == fgui.ListLayoutType.FlowHorizontal || this._layout == fgui.ListLayoutType.FlowVertical)\n                        throw \"Loop list is not supported for FlowHorizontal or FlowVertical layout!\";\n                    this._scrollPane.bouncebackEffect = false;\n                }\n                this._virtual = true;\n                this._loop = loop;\n                this._virtualItems = new Array();\n                this.removeChildrenToPool();\n                if (this._itemSize == null) {\n                    this._itemSize = new egret.Point();\n                    var obj = this.getFromPool(null);\n                    if (obj == null) {\n                        throw \"Virtual List must have a default list item resource.\";\n                    }\n                    else {\n                        this._itemSize.x = obj.width;\n                        this._itemSize.y = obj.height;\n                    }\n                    this.returnToPool(obj);\n                }\n                if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                    this._scrollPane.scrollStep = this._itemSize.y;\n                    if (this._loop)\n                        this._scrollPane._loop = 2;\n                }\n                else {\n                    this._scrollPane.scrollStep = this._itemSize.x;\n                    if (this._loop)\n                        this._scrollPane._loop = 1;\n                }\n                this._scrollPane.addEventListener(fgui.ScrollPane.SCROLL, this.__scrolled, this);\n                this.setVirtualListChangedFlag(true);\n            }\n        };\n        Object.defineProperty(GList.prototype, \"numItems\", {\n            get: function () {\n                if (this._virtual)\n                    return this._numItems;\n                else\n                    return this._children.length;\n            },\n            set: function (value) {\n                if (this._virtual) {\n                    if (this.itemRenderer == null)\n                        throw \"Set itemRenderer first!\";\n                    this._numItems = value;\n                    if (this._loop)\n                        this._realNumItems = this._numItems * 6;\n                    else\n                        this._realNumItems = this._numItems;\n                    var oldCount = this._virtualItems.length;\n                    if (this._realNumItems > oldCount) {\n                        for (i = oldCount; i < this._realNumItems; i++) {\n                            var ii = {\n                                width: this._itemSize.x,\n                                height: this._itemSize.y,\n                                updateFlag: 0\n                            };\n                            this._virtualItems.push(ii);\n                        }\n                    }\n                    else {\n                        for (i = this._realNumItems; i < oldCount; i++)\n                            this._virtualItems[i].selected = false;\n                    }\n                    if (this._virtualListChanged != 0)\n                        fgui.GTimers.inst.remove(this._refreshVirtualList, this);\n                    this._refreshVirtualList();\n                }\n                else {\n                    var cnt = this._children.length;\n                    if (value > cnt) {\n                        for (var i = cnt; i < value; i++) {\n                            if (this.itemProvider == null)\n                                this.addItemFromPool();\n                            else\n                                this.addItemFromPool(this.itemProvider.call(this.callbackThisObj, i));\n                        }\n                    }\n                    else {\n                        this.removeChildrenToPool(value, cnt);\n                    }\n                    if (this.itemRenderer != null) {\n                        for (i = 0; i < value; i++)\n                            this.itemRenderer.call(this.callbackThisObj, i, this.getChildAt(i));\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GList.prototype.refreshVirtualList = function () {\n            this.setVirtualListChangedFlag(false);\n        };\n        GList.prototype.checkVirtualList = function () {\n            if (this._virtualListChanged != 0) {\n                this._refreshVirtualList();\n                fgui.GTimers.inst.remove(this._refreshVirtualList, this);\n            }\n        };\n        GList.prototype.setVirtualListChangedFlag = function (layoutChanged) {\n            if (layoutChanged)\n                this._virtualListChanged = 2;\n            else if (this._virtualListChanged == 0)\n                this._virtualListChanged = 1;\n            fgui.GTimers.inst.callLater(this._refreshVirtualList, this);\n        };\n        GList.prototype._refreshVirtualList = function () {\n            var layoutChanged = this._virtualListChanged == 2;\n            this._virtualListChanged = 0;\n            this._eventLocked = true;\n            if (layoutChanged) {\n                if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.SingleRow)\n                    this._curLineItemCount = 1;\n                else if (this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                    if (this._columnCount > 0)\n                        this._curLineItemCount = this._columnCount;\n                    else {\n                        this._curLineItemCount = Math.floor((this._scrollPane.viewWidth + this._columnGap) / (this._itemSize.x + this._columnGap));\n                        if (this._curLineItemCount <= 0)\n                            this._curLineItemCount = 1;\n                    }\n                }\n                else if (this._layout == fgui.ListLayoutType.FlowVertical) {\n                    if (this._lineCount > 0)\n                        this._curLineItemCount = this._lineCount;\n                    else {\n                        this._curLineItemCount = Math.floor((this._scrollPane.viewHeight + this._lineGap) / (this._itemSize.y + this._lineGap));\n                        if (this._curLineItemCount <= 0)\n                            this._curLineItemCount = 1;\n                    }\n                }\n                else {\n                    if (this._columnCount > 0)\n                        this._curLineItemCount = this._columnCount;\n                    else {\n                        this._curLineItemCount = Math.floor((this._scrollPane.viewWidth + this._columnGap) / (this._itemSize.x + this._columnGap));\n                        if (this._curLineItemCount <= 0)\n                            this._curLineItemCount = 1;\n                    }\n                    if (this._lineCount > 0)\n                        this._curLineItemCount2 = this._lineCount;\n                    else {\n                        this._curLineItemCount2 = Math.floor((this._scrollPane.viewHeight + this._lineGap) / (this._itemSize.y + this._lineGap));\n                        if (this._curLineItemCount2 <= 0)\n                            this._curLineItemCount2 = 1;\n                    }\n                }\n            }\n            var ch = 0, cw = 0;\n            if (this._realNumItems > 0) {\n                var i;\n                var len = Math.ceil(this._realNumItems / this._curLineItemCount) * this._curLineItemCount;\n                var len2 = Math.min(this._curLineItemCount, this._realNumItems);\n                if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                    for (i = 0; i < len; i += this._curLineItemCount)\n                        ch += this._virtualItems[i].height + this._lineGap;\n                    if (ch > 0)\n                        ch -= this._lineGap;\n                    if (this._autoResizeItem)\n                        cw = this._scrollPane.viewWidth;\n                    else {\n                        for (i = 0; i < len2; i++)\n                            cw += this._virtualItems[i].width + this._columnGap;\n                        if (cw > 0)\n                            cw -= this._columnGap;\n                    }\n                }\n                else if (this._layout == fgui.ListLayoutType.SingleRow || this._layout == fgui.ListLayoutType.FlowVertical) {\n                    for (i = 0; i < len; i += this._curLineItemCount)\n                        cw += this._virtualItems[i].width + this._columnGap;\n                    if (cw > 0)\n                        cw -= this._columnGap;\n                    if (this._autoResizeItem)\n                        ch = this._scrollPane.viewHeight;\n                    else {\n                        for (i = 0; i < len2; i++)\n                            ch += this._virtualItems[i].height + this._lineGap;\n                        if (ch > 0)\n                            ch -= this._lineGap;\n                    }\n                }\n                else {\n                    var pageCount = Math.ceil(len / (this._curLineItemCount * this._curLineItemCount2));\n                    cw = pageCount * this.viewWidth;\n                    ch = this.viewHeight;\n                }\n            }\n            this.handleAlign(cw, ch);\n            this._scrollPane.setContentSize(cw, ch);\n            this._eventLocked = false;\n            this.handleScroll(true);\n        };\n        GList.prototype.__scrolled = function (evt) {\n            this.handleScroll(false);\n        };\n        GList.prototype.getIndexOnPos1 = function (forceUpdate) {\n            if (this._realNumItems < this._curLineItemCount) {\n                s_n = 0;\n                return 0;\n            }\n            var i;\n            var pos2;\n            var pos3;\n            if (this.numChildren > 0 && !forceUpdate) {\n                pos2 = this.getChildAt(0).y;\n                if (pos2 > s_n) {\n                    for (i = this._firstIndex - this._curLineItemCount; i >= 0; i -= this._curLineItemCount) {\n                        pos2 -= (this._virtualItems[i].height + this._lineGap);\n                        if (pos2 <= s_n) {\n                            s_n = pos2;\n                            return i;\n                        }\n                    }\n                    s_n = 0;\n                    return 0;\n                }\n                else {\n                    for (i = this._firstIndex; i < this._realNumItems; i += this._curLineItemCount) {\n                        pos3 = pos2 + this._virtualItems[i].height + this._lineGap;\n                        if (pos3 > s_n) {\n                            s_n = pos2;\n                            return i;\n                        }\n                        pos2 = pos3;\n                    }\n                    s_n = pos2;\n                    return this._realNumItems - this._curLineItemCount;\n                }\n            }\n            else {\n                pos2 = 0;\n                for (i = 0; i < this._realNumItems; i += this._curLineItemCount) {\n                    pos3 = pos2 + this._virtualItems[i].height + this._lineGap;\n                    if (pos3 > s_n) {\n                        s_n = pos2;\n                        return i;\n                    }\n                    pos2 = pos3;\n                }\n                s_n = pos2;\n                return this._realNumItems - this._curLineItemCount;\n            }\n        };\n        GList.prototype.getIndexOnPos2 = function (forceUpdate) {\n            if (this._realNumItems < this._curLineItemCount) {\n                s_n = 0;\n                return 0;\n            }\n            var i;\n            var pos2;\n            var pos3;\n            if (this.numChildren > 0 && !forceUpdate) {\n                pos2 = this.getChildAt(0).x;\n                if (pos2 > s_n) {\n                    for (i = this._firstIndex - this._curLineItemCount; i >= 0; i -= this._curLineItemCount) {\n                        pos2 -= (this._virtualItems[i].width + this._columnGap);\n                        if (pos2 <= s_n) {\n                            s_n = pos2;\n                            return i;\n                        }\n                    }\n                    s_n = 0;\n                    return 0;\n                }\n                else {\n                    for (i = this._firstIndex; i < this._realNumItems; i += this._curLineItemCount) {\n                        pos3 = pos2 + this._virtualItems[i].width + this._columnGap;\n                        if (pos3 > s_n) {\n                            s_n = pos2;\n                            return i;\n                        }\n                        pos2 = pos3;\n                    }\n                    s_n = pos2;\n                    return this._realNumItems - this._curLineItemCount;\n                }\n            }\n            else {\n                pos2 = 0;\n                for (i = 0; i < this._realNumItems; i += this._curLineItemCount) {\n                    pos3 = pos2 + this._virtualItems[i].width + this._columnGap;\n                    if (pos3 > s_n) {\n                        s_n = pos2;\n                        return i;\n                    }\n                    pos2 = pos3;\n                }\n                s_n = pos2;\n                return this._realNumItems - this._curLineItemCount;\n            }\n        };\n        GList.prototype.getIndexOnPos3 = function (forceUpdate) {\n            if (this._realNumItems < this._curLineItemCount) {\n                s_n = 0;\n                return 0;\n            }\n            var viewWidth = this.viewWidth;\n            var page = Math.floor(s_n / viewWidth);\n            var startIndex = page * (this._curLineItemCount * this._curLineItemCount2);\n            var pos2 = page * viewWidth;\n            var i;\n            var pos3;\n            for (i = 0; i < this._curLineItemCount; i++) {\n                pos3 = pos2 + this._virtualItems[startIndex + i].width + this._columnGap;\n                if (pos3 > s_n) {\n                    s_n = pos2;\n                    return startIndex + i;\n                }\n                pos2 = pos3;\n            }\n            s_n = pos2;\n            return startIndex + this._curLineItemCount - 1;\n        };\n        GList.prototype.handleScroll = function (forceUpdate) {\n            if (this._eventLocked)\n                return;\n            if (this._layout == fgui.ListLayoutType.SingleColumn || this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                var enterCounter = 0;\n                while (this.handleScroll1(forceUpdate)) {\n                    enterCounter++;\n                    forceUpdate = false;\n                    if (enterCounter > 20) {\n                        console.log(\"FairyGUI: list will never be filled as the item renderer function always returns a different size.\");\n                        break;\n                    }\n                }\n                this.handleArchOrder1();\n            }\n            else if (this._layout == fgui.ListLayoutType.SingleRow || this._layout == fgui.ListLayoutType.FlowVertical) {\n                enterCounter = 0;\n                while (this.handleScroll2(forceUpdate)) {\n                    enterCounter++;\n                    forceUpdate = false;\n                    if (enterCounter > 20) {\n                        console.log(\"FairyGUI: list will never be filled as the item renderer function always returns a different size.\");\n                        break;\n                    }\n                }\n                this.handleArchOrder2();\n            }\n            else {\n                this.handleScroll3(forceUpdate);\n            }\n            this._boundsChanged = false;\n        };\n        GList.prototype.handleScroll1 = function (forceUpdate) {\n            var pos = this._scrollPane.scrollingPosY;\n            var max = pos + this._scrollPane.viewHeight;\n            var end = max == this._scrollPane.contentHeight;\n            s_n = pos;\n            var newFirstIndex = this.getIndexOnPos1(forceUpdate);\n            pos = s_n;\n            if (newFirstIndex == this._firstIndex && !forceUpdate) {\n                return false;\n            }\n            var oldFirstIndex = this._firstIndex;\n            this._firstIndex = newFirstIndex;\n            var curIndex = newFirstIndex;\n            var forward = oldFirstIndex > newFirstIndex;\n            var childCount = this.numChildren;\n            var lastIndex = oldFirstIndex + childCount - 1;\n            var reuseIndex = forward ? lastIndex : oldFirstIndex;\n            var curX = 0, curY = pos;\n            var needRender;\n            var deltaSize = 0;\n            var firstItemDeltaSize = 0;\n            var url = this.defaultItem;\n            var ii, ii2;\n            var i, j;\n            var partSize = (this._scrollPane.viewWidth - this._columnGap * (this._curLineItemCount - 1)) / this._curLineItemCount;\n            this.itemInfoVer++;\n            while (curIndex < this._realNumItems && (end || curY < max)) {\n                ii = this._virtualItems[curIndex];\n                if (ii.obj == null || forceUpdate) {\n                    if (this.itemProvider != null) {\n                        url = this.itemProvider.call(this.callbackThisObj, curIndex % this._numItems);\n                        if (url == null)\n                            url = this._defaultItem;\n                        url = fgui.UIPackage.normalizeURL(url);\n                    }\n                    if (ii.obj && ii.obj.resourceURL != url) {\n                        if (ii.obj instanceof fgui.GButton)\n                            ii.selected = ii.obj.selected;\n                        this.removeChildToPool(ii.obj);\n                        ii.obj = null;\n                    }\n                }\n                if (ii.obj == null) {\n                    if (forward) {\n                        for (j = reuseIndex; j >= oldFirstIndex; j--) {\n                            ii2 = this._virtualItems[j];\n                            if (ii2.obj && ii2.updateFlag != this.itemInfoVer && ii2.obj.resourceURL == url) {\n                                if (ii2.obj instanceof fgui.GButton)\n                                    ii2.selected = ii2.obj.selected;\n                                ii.obj = ii2.obj;\n                                ii2.obj = null;\n                                if (j == reuseIndex)\n                                    reuseIndex--;\n                                break;\n                            }\n                        }\n                    }\n                    else {\n                        for (j = reuseIndex; j <= lastIndex; j++) {\n                            ii2 = this._virtualItems[j];\n                            if (ii2.obj && ii2.updateFlag != this.itemInfoVer && ii2.obj.resourceURL == url) {\n                                if (ii2.obj instanceof fgui.GButton)\n                                    ii2.selected = ii2.obj.selected;\n                                ii.obj = ii2.obj;\n                                ii2.obj = null;\n                                if (j == reuseIndex)\n                                    reuseIndex++;\n                                break;\n                            }\n                        }\n                    }\n                    if (ii.obj) {\n                        this.setChildIndex(ii.obj, forward ? curIndex - newFirstIndex : this.numChildren);\n                    }\n                    else {\n                        ii.obj = this._pool.getObject(url);\n                        if (forward)\n                            this.addChildAt(ii.obj, curIndex - newFirstIndex);\n                        else\n                            this.addChild(ii.obj);\n                    }\n                    if (ii.obj instanceof fgui.GButton)\n                        ii.obj.selected = ii.selected;\n                    needRender = true;\n                }\n                else\n                    needRender = forceUpdate;\n                if (needRender) {\n                    if (this._autoResizeItem && (this._layout == fgui.ListLayoutType.SingleColumn || this._columnCount > 0))\n                        ii.obj.setSize(partSize, ii.obj.height, true);\n                    this.itemRenderer.call(this.callbackThisObj, curIndex % this._numItems, ii.obj);\n                    if (curIndex % this._curLineItemCount == 0) {\n                        deltaSize += Math.ceil(ii.obj.height) - ii.height;\n                        if (curIndex == newFirstIndex && oldFirstIndex > newFirstIndex) {\n                            firstItemDeltaSize = Math.ceil(ii.obj.height) - ii.height;\n                        }\n                    }\n                    ii.width = Math.ceil(ii.obj.width);\n                    ii.height = Math.ceil(ii.obj.height);\n                }\n                ii.updateFlag = this.itemInfoVer;\n                ii.obj.setXY(curX, curY);\n                if (curIndex == newFirstIndex)\n                    max += ii.height;\n                curX += ii.width + this._columnGap;\n                if (curIndex % this._curLineItemCount == this._curLineItemCount - 1) {\n                    curX = 0;\n                    curY += ii.height + this._lineGap;\n                }\n                curIndex++;\n            }\n            for (i = 0; i < childCount; i++) {\n                ii = this._virtualItems[oldFirstIndex + i];\n                if (ii.updateFlag != this.itemInfoVer && ii.obj) {\n                    if (ii.obj instanceof fgui.GButton)\n                        ii.selected = ii.obj.selected;\n                    this.removeChildToPool(ii.obj);\n                    ii.obj = null;\n                }\n            }\n            childCount = this._children.length;\n            for (i = 0; i < childCount; i++) {\n                var obj = this._virtualItems[newFirstIndex + i].obj;\n                if (this._children[i] != obj)\n                    this.setChildIndex(obj, i);\n            }\n            if (deltaSize != 0 || firstItemDeltaSize != 0)\n                this._scrollPane.changeContentSizeOnScrolling(0, deltaSize, 0, firstItemDeltaSize);\n            if (curIndex > 0 && this.numChildren > 0 && this._container.y <= 0 && this.getChildAt(0).y > -this._container.y)\n                return true;\n            else\n                return false;\n        };\n        GList.prototype.handleScroll2 = function (forceUpdate) {\n            var pos = this._scrollPane.scrollingPosX;\n            var max = pos + this._scrollPane.viewWidth;\n            var end = pos == this._scrollPane.contentWidth;\n            s_n = pos;\n            var newFirstIndex = this.getIndexOnPos2(forceUpdate);\n            pos = s_n;\n            if (newFirstIndex == this._firstIndex && !forceUpdate) {\n                return false;\n            }\n            var oldFirstIndex = this._firstIndex;\n            this._firstIndex = newFirstIndex;\n            var curIndex = newFirstIndex;\n            var forward = oldFirstIndex > newFirstIndex;\n            var childCount = this.numChildren;\n            var lastIndex = oldFirstIndex + childCount - 1;\n            var reuseIndex = forward ? lastIndex : oldFirstIndex;\n            var curX = pos, curY = 0;\n            var needRender;\n            var deltaSize = 0;\n            var firstItemDeltaSize = 0;\n            var url = this.defaultItem;\n            var ii, ii2;\n            var i, j;\n            var partSize = (this._scrollPane.viewHeight - this._lineGap * (this._curLineItemCount - 1)) / this._curLineItemCount;\n            this.itemInfoVer++;\n            while (curIndex < this._realNumItems && (end || curX < max)) {\n                ii = this._virtualItems[curIndex];\n                if (ii.obj == null || forceUpdate) {\n                    if (this.itemProvider != null) {\n                        url = this.itemProvider.call(this.callbackThisObj, curIndex % this._numItems);\n                        if (url == null)\n                            url = this._defaultItem;\n                        url = fgui.UIPackage.normalizeURL(url);\n                    }\n                    if (ii.obj && ii.obj.resourceURL != url) {\n                        if (ii.obj instanceof fgui.GButton)\n                            ii.selected = ii.obj.selected;\n                        this.removeChildToPool(ii.obj);\n                        ii.obj = null;\n                    }\n                }\n                if (ii.obj == null) {\n                    if (forward) {\n                        for (j = reuseIndex; j >= oldFirstIndex; j--) {\n                            ii2 = this._virtualItems[j];\n                            if (ii2.obj && ii2.updateFlag != this.itemInfoVer && ii2.obj.resourceURL == url) {\n                                if (ii2.obj instanceof fgui.GButton)\n                                    ii2.selected = ii2.obj.selected;\n                                ii.obj = ii2.obj;\n                                ii2.obj = null;\n                                if (j == reuseIndex)\n                                    reuseIndex--;\n                                break;\n                            }\n                        }\n                    }\n                    else {\n                        for (j = reuseIndex; j <= lastIndex; j++) {\n                            ii2 = this._virtualItems[j];\n                            if (ii2.obj && ii2.updateFlag != this.itemInfoVer && ii2.obj.resourceURL == url) {\n                                if (ii2.obj instanceof fgui.GButton)\n                                    ii2.selected = ii2.obj.selected;\n                                ii.obj = ii2.obj;\n                                ii2.obj = null;\n                                if (j == reuseIndex)\n                                    reuseIndex++;\n                                break;\n                            }\n                        }\n                    }\n                    if (ii.obj) {\n                        this.setChildIndex(ii.obj, forward ? curIndex - newFirstIndex : this.numChildren);\n                    }\n                    else {\n                        ii.obj = this._pool.getObject(url);\n                        if (forward)\n                            this.addChildAt(ii.obj, curIndex - newFirstIndex);\n                        else\n                            this.addChild(ii.obj);\n                    }\n                    if (ii.obj instanceof fgui.GButton)\n                        ii.obj.selected = ii.selected;\n                    needRender = true;\n                }\n                else\n                    needRender = forceUpdate;\n                if (needRender) {\n                    if (this._autoResizeItem && (this._layout == fgui.ListLayoutType.SingleRow || this._lineCount > 0))\n                        ii.obj.setSize(ii.obj.width, partSize, true);\n                    this.itemRenderer.call(this.callbackThisObj, curIndex % this._numItems, ii.obj);\n                    if (curIndex % this._curLineItemCount == 0) {\n                        deltaSize += Math.ceil(ii.obj.width) - ii.width;\n                        if (curIndex == newFirstIndex && oldFirstIndex > newFirstIndex) {\n                            firstItemDeltaSize = Math.ceil(ii.obj.width) - ii.width;\n                        }\n                    }\n                    ii.width = Math.ceil(ii.obj.width);\n                    ii.height = Math.ceil(ii.obj.height);\n                }\n                ii.updateFlag = this.itemInfoVer;\n                ii.obj.setXY(curX, curY);\n                if (curIndex == newFirstIndex)\n                    max += ii.width;\n                curY += ii.height + this._lineGap;\n                if (curIndex % this._curLineItemCount == this._curLineItemCount - 1) {\n                    curY = 0;\n                    curX += ii.width + this._columnGap;\n                }\n                curIndex++;\n            }\n            for (i = 0; i < childCount; i++) {\n                ii = this._virtualItems[oldFirstIndex + i];\n                if (ii.updateFlag != this.itemInfoVer && ii.obj) {\n                    if (ii.obj instanceof fgui.GButton)\n                        ii.selected = ii.obj.selected;\n                    this.removeChildToPool(ii.obj);\n                    ii.obj = null;\n                }\n            }\n            childCount = this._children.length;\n            for (i = 0; i < childCount; i++) {\n                var obj = this._virtualItems[newFirstIndex + i].obj;\n                if (this._children[i] != obj)\n                    this.setChildIndex(obj, i);\n            }\n            if (deltaSize != 0 || firstItemDeltaSize != 0)\n                this._scrollPane.changeContentSizeOnScrolling(deltaSize, 0, firstItemDeltaSize, 0);\n            if (curIndex > 0 && this.numChildren > 0 && this._container.x <= 0 && this.getChildAt(0).x > -this._container.x)\n                return true;\n            else\n                return false;\n        };\n        GList.prototype.handleScroll3 = function (forceUpdate) {\n            var pos = this._scrollPane.scrollingPosX;\n            s_n = pos;\n            var newFirstIndex = this.getIndexOnPos3(forceUpdate);\n            pos = s_n;\n            if (newFirstIndex == this._firstIndex && !forceUpdate)\n                return;\n            var oldFirstIndex = this._firstIndex;\n            this._firstIndex = newFirstIndex;\n            var reuseIndex = oldFirstIndex;\n            var virtualItemCount = this._virtualItems.length;\n            var pageSize = this._curLineItemCount * this._curLineItemCount2;\n            var startCol = newFirstIndex % this._curLineItemCount;\n            var viewWidth = this.viewWidth;\n            var page = Math.floor(newFirstIndex / pageSize);\n            var startIndex = page * pageSize;\n            var lastIndex = startIndex + pageSize * 2;\n            var needRender;\n            var i;\n            var ii, ii2;\n            var col;\n            var url = this._defaultItem;\n            var partWidth = (this._scrollPane.viewWidth - this._columnGap * (this._curLineItemCount - 1)) / this._curLineItemCount;\n            var partHeight = (this._scrollPane.viewHeight - this._lineGap * (this._curLineItemCount2 - 1)) / this._curLineItemCount2;\n            this.itemInfoVer++;\n            for (i = startIndex; i < lastIndex; i++) {\n                if (i >= this._realNumItems)\n                    continue;\n                col = i % this._curLineItemCount;\n                if (i - startIndex < pageSize) {\n                    if (col < startCol)\n                        continue;\n                }\n                else {\n                    if (col > startCol)\n                        continue;\n                }\n                ii = this._virtualItems[i];\n                ii.updateFlag = this.itemInfoVer;\n            }\n            var lastObj;\n            var insertIndex = 0;\n            for (i = startIndex; i < lastIndex; i++) {\n                if (i >= this._realNumItems)\n                    continue;\n                ii = this._virtualItems[i];\n                if (ii.updateFlag != this.itemInfoVer)\n                    continue;\n                if (ii.obj == null) {\n                    while (reuseIndex < virtualItemCount) {\n                        ii2 = this._virtualItems[reuseIndex];\n                        if (ii2.obj && ii2.updateFlag != this.itemInfoVer) {\n                            if (ii2.obj instanceof fgui.GButton)\n                                ii2.selected = ii2.obj.selected;\n                            ii.obj = ii2.obj;\n                            ii2.obj = null;\n                            break;\n                        }\n                        reuseIndex++;\n                    }\n                    if (insertIndex == -1)\n                        insertIndex = this.getChildIndex(lastObj) + 1;\n                    if (ii.obj == null) {\n                        if (this.itemProvider != null) {\n                            url = this.itemProvider.call(this.callbackThisObj, i % this._numItems);\n                            if (url == null)\n                                url = this._defaultItem;\n                            url = fgui.UIPackage.normalizeURL(url);\n                        }\n                        ii.obj = this._pool.getObject(url);\n                        this.addChildAt(ii.obj, insertIndex);\n                    }\n                    else {\n                        insertIndex = this.setChildIndexBefore(ii.obj, insertIndex);\n                    }\n                    insertIndex++;\n                    if (ii.obj instanceof fgui.GButton)\n                        ii.obj.selected = ii.selected;\n                    needRender = true;\n                }\n                else {\n                    needRender = forceUpdate;\n                    insertIndex = -1;\n                    lastObj = ii.obj;\n                }\n                if (needRender) {\n                    if (this._autoResizeItem) {\n                        if (this._curLineItemCount == this._columnCount && this._curLineItemCount2 == this._lineCount)\n                            ii.obj.setSize(partWidth, partHeight, true);\n                        else if (this._curLineItemCount == this._columnCount)\n                            ii.obj.setSize(partWidth, ii.obj.height, true);\n                        else if (this._curLineItemCount2 == this._lineCount)\n                            ii.obj.setSize(ii.obj.width, partHeight, true);\n                    }\n                    this.itemRenderer.call(this.callbackThisObj, i % this._numItems, ii.obj);\n                    ii.width = Math.ceil(ii.obj.width);\n                    ii.height = Math.ceil(ii.obj.height);\n                }\n            }\n            var borderX = (startIndex / pageSize) * viewWidth;\n            var xx = borderX;\n            var yy = 0;\n            var lineHeight = 0;\n            for (i = startIndex; i < lastIndex; i++) {\n                if (i >= this._realNumItems)\n                    continue;\n                ii = this._virtualItems[i];\n                if (ii.updateFlag == this.itemInfoVer)\n                    ii.obj.setXY(xx, yy);\n                if (ii.height > lineHeight)\n                    lineHeight = ii.height;\n                if (i % this._curLineItemCount == this._curLineItemCount - 1) {\n                    xx = borderX;\n                    yy += lineHeight + this._lineGap;\n                    lineHeight = 0;\n                    if (i == startIndex + pageSize - 1) {\n                        borderX += viewWidth;\n                        xx = borderX;\n                        yy = 0;\n                    }\n                }\n                else\n                    xx += ii.width + this._columnGap;\n            }\n            for (i = reuseIndex; i < virtualItemCount; i++) {\n                ii = this._virtualItems[i];\n                if (ii.updateFlag != this.itemInfoVer && ii.obj) {\n                    if (ii.obj instanceof fgui.GButton)\n                        ii.selected = ii.obj.selected;\n                    this.removeChildToPool(ii.obj);\n                    ii.obj = null;\n                }\n            }\n        };\n        GList.prototype.handleArchOrder1 = function () {\n            if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Arch) {\n                var mid = this._scrollPane.posY + this.viewHeight / 2;\n                var minDist = Number.POSITIVE_INFINITY;\n                var dist = 0;\n                var apexIndex = 0;\n                var cnt = this.numChildren;\n                for (var i = 0; i < cnt; i++) {\n                    var obj = this.getChildAt(i);\n                    if (!this.foldInvisibleItems || obj.visible) {\n                        dist = Math.abs(mid - obj.y - obj.height / 2);\n                        if (dist < minDist) {\n                            minDist = dist;\n                            apexIndex = i;\n                        }\n                    }\n                }\n                this.apexIndex = apexIndex;\n            }\n        };\n        GList.prototype.handleArchOrder2 = function () {\n            if (this._childrenRenderOrder == fgui.ChildrenRenderOrder.Arch) {\n                var mid = this._scrollPane.posX + this.viewWidth / 2;\n                var minDist = Number.POSITIVE_INFINITY;\n                var dist = 0;\n                var apexIndex = 0;\n                var cnt = this.numChildren;\n                for (var i = 0; i < cnt; i++) {\n                    var obj = this.getChildAt(i);\n                    if (!this.foldInvisibleItems || obj.visible) {\n                        dist = Math.abs(mid - obj.x - obj.width / 2);\n                        if (dist < minDist) {\n                            minDist = dist;\n                            apexIndex = i;\n                        }\n                    }\n                }\n                this.apexIndex = apexIndex;\n            }\n        };\n        GList.prototype.handleAlign = function (contentWidth, contentHeight) {\n            var newOffsetX = 0;\n            var newOffsetY = 0;\n            if (contentHeight < this.viewHeight) {\n                if (this._verticalAlign == fgui.VertAlignType.Middle)\n                    newOffsetY = Math.floor((this.viewHeight - contentHeight) / 2);\n                else if (this._verticalAlign == fgui.VertAlignType.Bottom)\n                    newOffsetY = this.viewHeight - contentHeight;\n            }\n            if (contentWidth < this.viewWidth) {\n                if (this._align == fgui.AlignType.Center)\n                    newOffsetX = Math.floor((this.viewWidth - contentWidth) / 2);\n                else if (this._align == fgui.AlignType.Right)\n                    newOffsetX = this.viewWidth - contentWidth;\n            }\n            if (newOffsetX != this._alignOffset.x || newOffsetY != this._alignOffset.y) {\n                this._alignOffset.setTo(newOffsetX, newOffsetY);\n                if (this._scrollPane)\n                    this._scrollPane.adjustMaskContainer();\n                else {\n                    this._container.x = this._margin.left + this._alignOffset.x;\n                    this._container.y = this._margin.top + this._alignOffset.y;\n                }\n            }\n        };\n        GList.prototype.updateBounds = function () {\n            if (this._virtual)\n                return;\n            var i;\n            var child;\n            var curX = 0;\n            var curY = 0;\n            var maxWidth = 0;\n            var maxHeight = 0;\n            var cw = 0, ch = 0;\n            var j = 0;\n            var page = 0;\n            var k = 0;\n            var cnt = this._children.length;\n            var viewWidth = this.viewWidth;\n            var viewHeight = this.viewHeight;\n            var lineSize = 0;\n            var lineStart = 0;\n            var ratio = 0;\n            if (this._layout == fgui.ListLayoutType.SingleColumn) {\n                for (i = 0; i < cnt; i++) {\n                    child = this.getChildAt(i);\n                    if (this.foldInvisibleItems && !child.visible)\n                        continue;\n                    if (curY != 0)\n                        curY += this._lineGap;\n                    child.y = curY;\n                    if (this._autoResizeItem)\n                        child.setSize(viewWidth, child.height, true);\n                    curY += Math.ceil(child.height);\n                    if (child.width > maxWidth)\n                        maxWidth = child.width;\n                }\n                ch = curY;\n                if (ch <= viewHeight && this._autoResizeItem && this._scrollPane && this._scrollPane._displayInDemand && this._scrollPane.vtScrollBar) {\n                    viewWidth += this._scrollPane.vtScrollBar.width;\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        child.setSize(viewWidth, child.height, true);\n                        if (child.width > maxWidth)\n                            maxWidth = child.width;\n                    }\n                }\n                cw = Math.ceil(maxWidth);\n            }\n            else if (this._layout == fgui.ListLayoutType.SingleRow) {\n                for (i = 0; i < cnt; i++) {\n                    child = this.getChildAt(i);\n                    if (this.foldInvisibleItems && !child.visible)\n                        continue;\n                    if (curX != 0)\n                        curX += this._columnGap;\n                    child.x = curX;\n                    if (this._autoResizeItem)\n                        child.setSize(child.width, viewHeight, true);\n                    curX += Math.ceil(child.width);\n                    if (child.height > maxHeight)\n                        maxHeight = child.height;\n                }\n                cw = curX;\n                if (cw <= viewWidth && this._autoResizeItem && this._scrollPane && this._scrollPane._displayInDemand && this._scrollPane.hzScrollBar) {\n                    viewHeight += this._scrollPane.hzScrollBar.height;\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        child.setSize(child.width, viewHeight, true);\n                        if (child.height > maxHeight)\n                            maxHeight = child.height;\n                    }\n                }\n                ch = Math.ceil(maxHeight);\n            }\n            else if (this._layout == fgui.ListLayoutType.FlowHorizontal) {\n                if (this._autoResizeItem && this._columnCount > 0) {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        lineSize += child.sourceWidth;\n                        j++;\n                        if (j == this._columnCount || i == cnt - 1) {\n                            ratio = (viewWidth - lineSize - (j - 1) * this._columnGap) / lineSize;\n                            curX = 0;\n                            for (j = lineStart; j <= i; j++) {\n                                child = this.getChildAt(j);\n                                if (this.foldInvisibleItems && !child.visible)\n                                    continue;\n                                child.setXY(curX, curY);\n                                if (j < i) {\n                                    child.setSize(child.sourceWidth + Math.round(child.sourceWidth * ratio), child.height, true);\n                                    curX += Math.ceil(child.width) + this._columnGap;\n                                }\n                                else {\n                                    child.setSize(viewWidth - curX, child.height, true);\n                                }\n                                if (child.height > maxHeight)\n                                    maxHeight = child.height;\n                            }\n                            curY += Math.ceil(maxHeight) + this._lineGap;\n                            maxHeight = 0;\n                            j = 0;\n                            lineStart = i + 1;\n                            lineSize = 0;\n                        }\n                    }\n                    ch = curY + Math.ceil(maxHeight);\n                    cw = viewWidth;\n                }\n                else {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        if (curX != 0)\n                            curX += this._columnGap;\n                        if (this._columnCount != 0 && j >= this._columnCount\n                            || this._columnCount == 0 && curX + child.width > viewWidth && maxHeight != 0) {\n                            curX = 0;\n                            curY += Math.ceil(maxHeight) + this._lineGap;\n                            maxHeight = 0;\n                            j = 0;\n                        }\n                        child.setXY(curX, curY);\n                        curX += Math.ceil(child.width);\n                        if (curX > maxWidth)\n                            maxWidth = curX;\n                        if (child.height > maxHeight)\n                            maxHeight = child.height;\n                        j++;\n                    }\n                    ch = curY + Math.ceil(maxHeight);\n                    cw = Math.ceil(maxWidth);\n                }\n            }\n            else if (this._layout == fgui.ListLayoutType.FlowVertical) {\n                if (this._autoResizeItem && this._lineCount > 0) {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        lineSize += child.sourceHeight;\n                        j++;\n                        if (j == this._lineCount || i == cnt - 1) {\n                            ratio = (viewHeight - lineSize - (j - 1) * this._lineGap) / lineSize;\n                            curY = 0;\n                            for (j = lineStart; j <= i; j++) {\n                                child = this.getChildAt(j);\n                                if (this.foldInvisibleItems && !child.visible)\n                                    continue;\n                                child.setXY(curX, curY);\n                                if (j < i) {\n                                    child.setSize(child.width, child.sourceHeight + Math.round(child.sourceHeight * ratio), true);\n                                    curY += Math.ceil(child.height) + this._lineGap;\n                                }\n                                else {\n                                    child.setSize(child.width, viewHeight - curY, true);\n                                }\n                                if (child.width > maxWidth)\n                                    maxWidth = child.width;\n                            }\n                            curX += Math.ceil(maxWidth) + this._columnGap;\n                            maxWidth = 0;\n                            j = 0;\n                            lineStart = i + 1;\n                            lineSize = 0;\n                        }\n                    }\n                    cw = curX + Math.ceil(maxWidth);\n                    ch = viewHeight;\n                }\n                else {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        if (curY != 0)\n                            curY += this._lineGap;\n                        if (this._lineCount != 0 && j >= this._lineCount\n                            || this._lineCount == 0 && curY + child.height > viewHeight && maxWidth != 0) {\n                            curY = 0;\n                            curX += Math.ceil(maxWidth) + this._columnGap;\n                            maxWidth = 0;\n                            j = 0;\n                        }\n                        child.setXY(curX, curY);\n                        curY += Math.ceil(child.height);\n                        if (curY > maxHeight)\n                            maxHeight = curY;\n                        if (child.width > maxWidth)\n                            maxWidth = child.width;\n                        j++;\n                    }\n                    cw = curX + Math.ceil(maxWidth);\n                    ch = Math.ceil(maxHeight);\n                }\n            }\n            else {\n                var eachHeight;\n                if (this._autoResizeItem && this._lineCount > 0)\n                    eachHeight = Math.floor((viewHeight - (this._lineCount - 1) * this._lineGap) / this._lineCount);\n                if (this._autoResizeItem && this._columnCount > 0) {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        if (j == 0 && (this._lineCount != 0 && k >= this._lineCount\n                            || this._lineCount == 0 && curY + (this._lineCount > 0 ? eachHeight : child.height) > viewHeight)) {\n                            page++;\n                            curY = 0;\n                            k = 0;\n                        }\n                        lineSize += child.sourceWidth;\n                        j++;\n                        if (j == this._columnCount || i == cnt - 1) {\n                            ratio = (viewWidth - lineSize - (j - 1) * this._columnGap) / lineSize;\n                            curX = 0;\n                            for (j = lineStart; j <= i; j++) {\n                                child = this.getChildAt(j);\n                                if (this.foldInvisibleItems && !child.visible)\n                                    continue;\n                                child.setXY(page * viewWidth + curX, curY);\n                                if (j < i) {\n                                    child.setSize(child.sourceWidth + Math.round(child.sourceWidth * ratio), this._lineCount > 0 ? eachHeight : child.height, true);\n                                    curX += Math.ceil(child.width) + this._columnGap;\n                                }\n                                else {\n                                    child.setSize(viewWidth - curX, this._lineCount > 0 ? eachHeight : child.height, true);\n                                }\n                                if (child.height > maxHeight)\n                                    maxHeight = child.height;\n                            }\n                            curY += Math.ceil(maxHeight) + this._lineGap;\n                            maxHeight = 0;\n                            j = 0;\n                            lineStart = i + 1;\n                            lineSize = 0;\n                            k++;\n                        }\n                    }\n                }\n                else {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n                        if (curX != 0)\n                            curX += this._columnGap;\n                        if (this._autoResizeItem && this._lineCount > 0)\n                            child.setSize(child.width, eachHeight, true);\n                        if (this._columnCount != 0 && j >= this._columnCount\n                            || this._columnCount == 0 && curX + child.width > viewWidth && maxHeight != 0) {\n                            curX = 0;\n                            curY += Math.ceil(maxHeight) + this._lineGap;\n                            maxHeight = 0;\n                            j = 0;\n                            k++;\n                            if (this._lineCount != 0 && k >= this._lineCount\n                                || this._lineCount == 0 && curY + child.height > viewHeight && maxWidth != 0) {\n                                page++;\n                                curY = 0;\n                                k = 0;\n                            }\n                        }\n                        child.setXY(page * viewWidth + curX, curY);\n                        curX += Math.ceil(child.width);\n                        if (curX > maxWidth)\n                            maxWidth = curX;\n                        if (child.height > maxHeight)\n                            maxHeight = child.height;\n                        j++;\n                    }\n                }\n                ch = page > 0 ? viewHeight : curY + Math.ceil(maxHeight);\n                cw = (page + 1) * viewWidth;\n            }\n            this.handleAlign(cw, ch);\n            this.setBounds(0, 0, cw, ch);\n        };\n        GList.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            this._layout = buffer.readByte();\n            this._selectionMode = buffer.readByte();\n            this._align = buffer.readByte();\n            this._verticalAlign = buffer.readByte();\n            this._lineGap = buffer.readShort();\n            this._columnGap = buffer.readShort();\n            this._lineCount = buffer.readShort();\n            this._columnCount = buffer.readShort();\n            this._autoResizeItem = buffer.readBool();\n            this._childrenRenderOrder = buffer.readByte();\n            this._apexIndex = buffer.readShort();\n            if (buffer.readBool()) {\n                this._margin.top = buffer.readInt();\n                this._margin.bottom = buffer.readInt();\n                this._margin.left = buffer.readInt();\n                this._margin.right = buffer.readInt();\n            }\n            var overflow = buffer.readByte();\n            if (overflow == fgui.OverflowType.Scroll) {\n                var savedPos = buffer.position;\n                buffer.seek(beginPos, 7);\n                this.setupScroll(buffer);\n                buffer.position = savedPos;\n            }\n            else\n                this.setupOverflow(overflow);\n            if (buffer.readBool())\n                buffer.skip(8);\n            if (buffer.version >= 2) {\n                this.scrollItemToViewOnClick = buffer.readBool();\n                this.foldInvisibleItems = buffer.readBool();\n            }\n            buffer.seek(beginPos, 8);\n            this._defaultItem = buffer.readS();\n            this.readItems(buffer);\n        };\n        GList.prototype.readItems = function (buffer) {\n            var cnt;\n            var i;\n            var nextPos;\n            var str;\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                str = buffer.readS();\n                if (str == null) {\n                    str = this.defaultItem;\n                    if (!str) {\n                        buffer.position = nextPos;\n                        continue;\n                    }\n                }\n                var obj = this.getFromPool(str);\n                if (obj != null) {\n                    this.addChild(obj);\n                    this.setupItem(buffer, obj);\n                }\n                buffer.position = nextPos;\n            }\n        };\n        GList.prototype.setupItem = function (buffer, obj) {\n            var str;\n            str = buffer.readS();\n            if (str != null)\n                obj.text = str;\n            str = buffer.readS();\n            if (str != null && (obj instanceof fgui.GButton))\n                obj.selectedTitle = str;\n            str = buffer.readS();\n            if (str != null)\n                obj.icon = str;\n            str = buffer.readS();\n            if (str != null && (obj instanceof fgui.GButton))\n                obj.selectedIcon = str;\n            str = buffer.readS();\n            if (str != null)\n                obj.name = str;\n            var cnt;\n            var i;\n            if (obj instanceof fgui.GComponent) {\n                cnt = buffer.readShort();\n                for (i = 0; i < cnt; i++) {\n                    var cc = obj.getController(buffer.readS());\n                    str = buffer.readS();\n                    if (cc)\n                        cc.selectedPageId = str;\n                }\n                if (buffer.version >= 2) {\n                    cnt = buffer.readShort();\n                    for (i = 0; i < cnt; i++) {\n                        var target = buffer.readS();\n                        var propertyId = buffer.readShort();\n                        var value = buffer.readS();\n                        var obj2 = obj.getChildByPath(target);\n                        if (obj2)\n                            obj2.setProp(propertyId, value);\n                    }\n                }\n            }\n        };\n        GList.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 6);\n            var i = buffer.readShort();\n            if (i != -1)\n                this._selectionController = this.parent.getControllerAt(i);\n        };\n        return GList;\n    }(fgui.GComponent));\n    fgui.GList = GList;\n    var s_n = 0;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GObjectPool = (function () {\n        function GObjectPool() {\n            this._count = 0;\n            this._pool = {};\n        }\n        GObjectPool.prototype.clear = function () {\n            for (var i1 in this._pool) {\n                var arr = this._pool[i1];\n                var cnt = arr.length;\n                for (var i = 0; i < cnt; i++)\n                    arr[i].dispose();\n            }\n            this._pool = {};\n            this._count = 0;\n        };\n        Object.defineProperty(GObjectPool.prototype, \"count\", {\n            get: function () {\n                return this._count;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GObjectPool.prototype.getObject = function (url) {\n            url = fgui.UIPackage.normalizeURL(url);\n            if (url == null)\n                return null;\n            var arr = this._pool[url];\n            if (arr && arr.length) {\n                this._count--;\n                return arr.shift();\n            }\n            var child = fgui.UIPackage.createObjectFromURL(url);\n            return child;\n        };\n        GObjectPool.prototype.returnObject = function (obj) {\n            var url = obj.resourceURL;\n            if (!url)\n                return;\n            var arr = this._pool[url];\n            if (arr == null) {\n                arr = new Array();\n                this._pool[url] = arr;\n            }\n            this._count++;\n            arr.push(obj);\n        };\n        return GObjectPool;\n    }());\n    fgui.GObjectPool = GObjectPool;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GLoader = (function (_super_1) {\n        __extends(GLoader, _super_1);\n        function GLoader() {\n            var _this = _super_1.call(this) || this;\n            _this._url = \"\";\n            _this._fill = fgui.LoaderFillType.None;\n            _this._align = fgui.AlignType.Left;\n            _this._verticalAlign = fgui.VertAlignType.Top;\n            _this._showErrorSign = true;\n            return _this;\n        }\n        GLoader.prototype.createDisplayObject = function () {\n            this._container = new fgui.UIContainer();\n            this._container.opaque = true;\n            this.setDisplayObject(this._container);\n            this._content = new fgui.MovieClip();\n            this._container.addChild(this._content);\n        };\n        GLoader.prototype.dispose = function () {\n            if (!this._contentItem) {\n                var texture = this._content.texture;\n                if (texture)\n                    this.freeExternal(texture);\n            }\n            if (this._content2)\n                this._content2.dispose();\n            _super_1.prototype.dispose.call(this);\n        };\n        Object.defineProperty(GLoader.prototype, \"url\", {\n            get: function () {\n                return this._url;\n            },\n            set: function (value) {\n                if (this._url == value)\n                    return;\n                this.clearContent();\n                this._url = value;\n                this.loadContent();\n                this.updateGear(7);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"icon\", {\n            get: function () {\n                return this._url;\n            },\n            set: function (value) {\n                this.url = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"align\", {\n            get: function () {\n                return this._align;\n            },\n            set: function (value) {\n                if (this._align != value) {\n                    this._align = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"verticalAlign\", {\n            get: function () {\n                return this._verticalAlign;\n            },\n            set: function (value) {\n                if (this._verticalAlign != value) {\n                    this._verticalAlign = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"fill\", {\n            get: function () {\n                return this._fill;\n            },\n            set: function (value) {\n                if (this._fill != value) {\n                    this._fill = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"shrinkOnly\", {\n            get: function () {\n                return this._shrinkOnly;\n            },\n            set: function (value) {\n                if (this._shrinkOnly != value) {\n                    this._shrinkOnly = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"autoSize\", {\n            get: function () {\n                return this._autoSize;\n            },\n            set: function (value) {\n                if (this._autoSize != value) {\n                    this._autoSize = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"playing\", {\n            get: function () {\n                return this._content.playing;\n            },\n            set: function (value) {\n                if (this._content.playing != value) {\n                    this._content.playing = value;\n                    this.updateGear(5);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"frame\", {\n            get: function () {\n                return this._content.frame;\n            },\n            set: function (value) {\n                if (this._content.frame != value) {\n                    this._content.frame = value;\n                    this.updateGear(5);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"color\", {\n            get: function () {\n                return this._content.color;\n            },\n            set: function (value) {\n                if (this._content.color != value) {\n                    this._content.color = value;\n                    this.updateGear(4);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"showErrorSign\", {\n            get: function () {\n                return this._showErrorSign;\n            },\n            set: function (value) {\n                this._showErrorSign = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"content\", {\n            get: function () {\n                return this._content;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"component\", {\n            get: function () {\n                return this._content2;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"texture\", {\n            get: function () {\n                return this._content.texture;\n            },\n            set: function (value) {\n                this.url = null;\n                this._content.frames = null;\n                this._content.texture = value;\n                if (value) {\n                    this.sourceWidth = value.textureWidth;\n                    this.sourceHeight = value.textureHeight;\n                }\n                else {\n                    this.sourceWidth = this.sourceHeight = 0;\n                }\n                this.updateLayout();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"fillMethod\", {\n            get: function () {\n                return this._content.fillMethod;\n            },\n            set: function (value) {\n                this._content.fillMethod = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"fillOrigin\", {\n            get: function () {\n                return this._content.fillOrigin;\n            },\n            set: function (value) {\n                this._content.fillOrigin = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"fillClockwise\", {\n            get: function () {\n                return this._content.fillClockwise;\n            },\n            set: function (value) {\n                this._content.fillClockwise = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader.prototype, \"fillAmount\", {\n            get: function () {\n                return this._content.fillAmount;\n            },\n            set: function (value) {\n                this._content.fillAmount = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GLoader.prototype.loadContent = function () {\n            if (!this._url)\n                return;\n            if (fgui.ToolSet.startsWith(this._url, \"ui://\"))\n                this.loadFromPackage(this._url);\n            else\n                this.loadExternal();\n        };\n        GLoader.prototype.loadFromPackage = function (itemURL) {\n            this._contentItem = fgui.UIPackage.getItemByURL(itemURL);\n            if (this._contentItem) {\n                this._contentItem = this._contentItem.getBranch();\n                this.sourceWidth = this._contentItem.width;\n                this.sourceHeight = this._contentItem.height;\n                this._contentItem = this._contentItem.getHighResolution();\n                this._contentItem.load();\n                if (this._autoSize)\n                    this.setSize(this.sourceWidth, this.sourceHeight);\n                if (this._contentItem.type == fgui.PackageItemType.Image) {\n                    if (this._contentItem.asset == null) {\n                        this.setErrorState();\n                    }\n                    else {\n                        this._content.texture = this._contentItem.asset;\n                        this._content.scale9Grid = this._contentItem.scale9Grid;\n                        if (this._contentItem.scaleByTile)\n                            this._content.fillMode = egret.BitmapFillMode.REPEAT;\n                        else\n                            this._content.fillMode = egret.BitmapFillMode.SCALE;\n                        this.updateLayout();\n                    }\n                }\n                else if (this._contentItem.type == fgui.PackageItemType.MovieClip) {\n                    this._content.interval = this._contentItem.interval;\n                    this._content.swing = this._contentItem.swing;\n                    this._content.repeatDelay = this._contentItem.repeatDelay;\n                    this._content.frames = this._contentItem.frames;\n                    this.updateLayout();\n                }\n                else if (this._contentItem.type == fgui.PackageItemType.Component) {\n                    var obj = fgui.UIPackage.createObjectFromURL(itemURL);\n                    if (!obj)\n                        this.setErrorState();\n                    else if (!(obj instanceof fgui.GComponent)) {\n                        obj.dispose();\n                        this.setErrorState();\n                    }\n                    else {\n                        this._content2 = obj.asCom;\n                        this._container.addChild(this._content2.displayObject);\n                        this.updateLayout();\n                    }\n                }\n                else\n                    this.setErrorState();\n            }\n            else\n                this.setErrorState();\n        };\n        GLoader.prototype.loadExternal = function () {\n            RES.getResByUrl(this._url, this.__getResCompleted, this);\n        };\n        GLoader.prototype.freeExternal = function (texture) {\n        };\n        GLoader.prototype.onExternalLoadSuccess = function (texture) {\n            this._content.texture = texture;\n            this._content.scale9Grid = null;\n            this._content.fillMode = egret.BitmapFillMode.SCALE;\n            this.sourceWidth = texture.textureWidth;\n            this.sourceHeight = texture.textureHeight;\n            this.updateLayout();\n        };\n        GLoader.prototype.onExternalLoadFailed = function () {\n            this.setErrorState();\n        };\n        GLoader.prototype.__getResCompleted = function (res, key) {\n            if (res instanceof egret.Texture)\n                this.onExternalLoadSuccess(res);\n            else\n                this.onExternalLoadFailed();\n        };\n        GLoader.prototype.setErrorState = function () {\n            if (!this._showErrorSign)\n                return;\n            if (this._errorSign == null) {\n                if (fgui.UIConfig.loaderErrorSign != null) {\n                    this._errorSign = GLoader._errorSignPool.getObject(fgui.UIConfig.loaderErrorSign);\n                }\n            }\n            if (this._errorSign) {\n                this._errorSign.setSize(this.width, this.height);\n                this._container.addChild(this._errorSign.displayObject);\n            }\n        };\n        GLoader.prototype.clearErrorState = function () {\n            if (this._errorSign) {\n                this._container.removeChild(this._errorSign.displayObject);\n                GLoader._errorSignPool.returnObject(this._errorSign);\n                this._errorSign = null;\n            }\n        };\n        GLoader.prototype.updateLayout = function () {\n            if (!this._content2 && !this._content) {\n                if (this._autoSize) {\n                    this._updatingLayout = true;\n                    this.setSize(50, 30);\n                    this._updatingLayout = false;\n                }\n                return;\n            }\n            var cw = this.sourceWidth;\n            var ch = this.sourceHeight;\n            if (this._autoSize) {\n                this._updatingLayout = true;\n                if (cw == 0)\n                    cw = 50;\n                if (ch == 0)\n                    ch = 30;\n                this.setSize(cw, ch);\n                this._updatingLayout = false;\n                if (cw == this._width && ch == this._height) {\n                    if (this._content2) {\n                        this._content2.setXY(0, 0);\n                        this._content2.setScale(1, 1);\n                    }\n                    else {\n                        this._content.x = 0;\n                        this._content.y = 0;\n                        this._content.width = cw;\n                        this._content.height = ch;\n                    }\n                    return;\n                }\n            }\n            var sx = 1, sy = 1;\n            if (this._fill != fgui.LoaderFillType.None) {\n                sx = this.width / this.sourceWidth;\n                sy = this.height / this.sourceHeight;\n                if (sx != 1 || sy != 1) {\n                    if (this._fill == fgui.LoaderFillType.ScaleMatchHeight)\n                        sx = sy;\n                    else if (this._fill == fgui.LoaderFillType.ScaleMatchWidth)\n                        sy = sx;\n                    else if (this._fill == fgui.LoaderFillType.Scale) {\n                        if (sx > sy)\n                            sx = sy;\n                        else\n                            sy = sx;\n                    }\n                    else if (this._fill == fgui.LoaderFillType.ScaleNoBorder) {\n                        if (sx > sy)\n                            sy = sx;\n                        else\n                            sx = sy;\n                    }\n                    if (this._shrinkOnly) {\n                        if (sx > 1)\n                            sx = 1;\n                        if (sy > 1)\n                            sy = 1;\n                    }\n                    cw = this.sourceWidth * sx;\n                    ch = this.sourceHeight * sy;\n                }\n            }\n            if (this._content2) {\n                this._content2.setScale(sx, sy);\n            }\n            else {\n                this._content.width = cw;\n                this._content.height = ch;\n            }\n            var nx, ny;\n            if (this._align == fgui.AlignType.Center)\n                nx = Math.floor((this.width - cw) / 2);\n            else if (this._align == fgui.AlignType.Right)\n                nx = this.width - cw;\n            else\n                nx = 0;\n            if (this._verticalAlign == fgui.VertAlignType.Middle)\n                ny = Math.floor((this.height - ch) / 2);\n            else if (this._verticalAlign == fgui.VertAlignType.Bottom)\n                ny = this.height - ch;\n            else\n                ny = 0;\n            if (this._content2)\n                this._content2.setXY(nx, ny);\n            else {\n                this._content.x = nx;\n                this._content.y = ny;\n            }\n        };\n        GLoader.prototype.clearContent = function () {\n            this.clearErrorState();\n            if (!this._contentItem && this._content.texture) {\n                this.freeExternal(this._content.texture);\n            }\n            this._content.texture = null;\n            this._content.frames = null;\n            if (this._content2) {\n                this._container.removeChild(this._content2.displayObject);\n                this._content2.dispose();\n                this._content2 = null;\n            }\n            this._contentItem = null;\n        };\n        GLoader.prototype.handleSizeChanged = function () {\n            _super_1.prototype.handleSizeChanged.call(this);\n            if (!this._updatingLayout)\n                this.updateLayout();\n        };\n        GLoader.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    return this.color;\n                case fgui.ObjectPropID.Playing:\n                    return this.playing;\n                case fgui.ObjectPropID.Frame:\n                    return this.frame;\n                case fgui.ObjectPropID.TimeScale:\n                    return this._content.timeScale;\n                default:\n                    return _super_1.prototype.getProp.call(this, index);\n            }\n        };\n        GLoader.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    this.color = value;\n                    break;\n                case fgui.ObjectPropID.Playing:\n                    this.playing = value;\n                    break;\n                case fgui.ObjectPropID.Frame:\n                    this.frame = value;\n                    break;\n                case fgui.ObjectPropID.TimeScale:\n                    this._content.timeScale = value;\n                    break;\n                case fgui.ObjectPropID.DeltaTime:\n                    this._content.advance(value);\n                    break;\n                default:\n                    _super_1.prototype.setProp.call(this, index, value);\n                    break;\n            }\n        };\n        GLoader.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            this._url = buffer.readS();\n            this._align = buffer.readByte();\n            this._verticalAlign = buffer.readByte();\n            this._fill = buffer.readByte();\n            this._shrinkOnly = buffer.readBool();\n            this._autoSize = buffer.readBool();\n            this._showErrorSign = buffer.readBool();\n            this._content.playing = buffer.readBool();\n            this._content.frame = buffer.readInt();\n            if (buffer.readBool())\n                this.color = buffer.readColor();\n            this._content.fillMethod = buffer.readByte();\n            if (this._content.fillMethod != 0) {\n                this._content.fillOrigin = buffer.readByte();\n                this._content.fillClockwise = buffer.readBool();\n                this._content.fillAmount = buffer.readFloat();\n            }\n            if (this._url)\n                this.loadContent();\n        };\n        GLoader._errorSignPool = new fgui.GObjectPool();\n        return GLoader;\n    }(fgui.GObject));\n    fgui.GLoader = GLoader;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GLoader3D = (function (_super_1) {\n        __extends(GLoader3D, _super_1);\n        function GLoader3D() {\n            var _this = _super_1.call(this) || this;\n            _this._frame = 0;\n            _this._playing = true;\n            _this._url = \"\";\n            _this._fill = fgui.LoaderFillType.None;\n            _this._align = fgui.AlignType.Left;\n            _this._verticalAlign = fgui.VertAlignType.Top;\n            _this._color = 0xFFFFFF;\n            return _this;\n        }\n        GLoader3D.prototype.createDisplayObject = function () {\n            var d = new fgui.UIContainer();\n            d.opaque = true;\n            this.setDisplayObject(d);\n            this._container = new egret.DisplayObjectContainer();\n            d.addChild(this._container);\n        };\n        GLoader3D.prototype.dispose = function () {\n            _super_1.prototype.dispose.call(this);\n        };\n        Object.defineProperty(GLoader3D.prototype, \"url\", {\n            get: function () {\n                return this._url;\n            },\n            set: function (value) {\n                if (this._url == value)\n                    return;\n                this._url = value;\n                this.loadContent();\n                this.updateGear(7);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"icon\", {\n            get: function () {\n                return this._url;\n            },\n            set: function (value) {\n                this.url = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"align\", {\n            get: function () {\n                return this._align;\n            },\n            set: function (value) {\n                if (this._align != value) {\n                    this._align = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"verticalAlign\", {\n            get: function () {\n                return this._verticalAlign;\n            },\n            set: function (value) {\n                if (this._verticalAlign != value) {\n                    this._verticalAlign = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"fill\", {\n            get: function () {\n                return this._fill;\n            },\n            set: function (value) {\n                if (this._fill != value) {\n                    this._fill = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"shrinkOnly\", {\n            get: function () {\n                return this._shrinkOnly;\n            },\n            set: function (value) {\n                if (this._shrinkOnly != value) {\n                    this._shrinkOnly = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"autoSize\", {\n            get: function () {\n                return this._autoSize;\n            },\n            set: function (value) {\n                if (this._autoSize != value) {\n                    this._autoSize = value;\n                    this.updateLayout();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"playing\", {\n            get: function () {\n                return this._playing;\n            },\n            set: function (value) {\n                if (this._playing != value) {\n                    this._playing = value;\n                    this.updateGear(5);\n                    this.onChange();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"frame\", {\n            get: function () {\n                return this._frame;\n            },\n            set: function (value) {\n                if (this._frame != value) {\n                    this._frame = value;\n                    this.updateGear(5);\n                    this.onChange();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"animationName\", {\n            get: function () {\n                return this._animationName;\n            },\n            set: function (value) {\n                if (this._animationName != value) {\n                    this._animationName = value;\n                    this.onChange();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"skinName\", {\n            get: function () {\n                return this._skinName;\n            },\n            set: function (value) {\n                if (this._skinName != value) {\n                    this._skinName = value;\n                    this.onChange();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"loop\", {\n            get: function () {\n                return this._loop;\n            },\n            set: function (value) {\n                if (this._loop != value) {\n                    this._loop = value;\n                    this.onChange();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"color\", {\n            get: function () {\n                return this._color;\n            },\n            set: function (value) {\n                if (this._color != value) {\n                    this._color = value;\n                    this.updateGear(4);\n                    if (this._content)\n                        this._content.tint = value;\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GLoader3D.prototype, \"content\", {\n            get: function () {\n                return this._content;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GLoader3D.prototype.loadContent = function () {\n            this.clearContent();\n            if (!this._url)\n                return;\n            if (fgui.ToolSet.startsWith(this._url, \"ui://\"))\n                this.loadFromPackage(this._url);\n            else\n                this.loadExternal();\n        };\n        GLoader3D.prototype.loadFromPackage = function (itemURL) {\n            this._contentItem = fgui.UIPackage.getItemByURL(itemURL);\n            if (this._contentItem) {\n                this._contentItem = this._contentItem.getBranch();\n                this.sourceWidth = this._contentItem.width;\n                this.sourceHeight = this._contentItem.height;\n                this._contentItem = this._contentItem.getHighResolution();\n                if (this._autoSize)\n                    this.setSize(this.sourceWidth, this.sourceHeight);\n                if (this._contentItem.type == fgui.PackageItemType.Spine || this._contentItem.type == fgui.PackageItemType.DragonBones)\n                    this._contentItem.owner.getItemAssetAsync(this._contentItem, this.onLoaded.bind(this));\n            }\n        };\n        GLoader3D.prototype.onLoaded = function (err, item) {\n            if (this._contentItem != item)\n                return;\n            if (err)\n                console.warn(err);\n            if (!this._contentItem.asset)\n                return;\n            if (this._contentItem.type == fgui.PackageItemType.DragonBones) {\n                var asset = this._contentItem.asset;\n                this.setDragonBones(this._contentItem.armatureName, asset.data.name, asset.atlasData.name, this._skinName, this._contentItem.skeletonAnchor);\n            }\n        };\n        GLoader3D.prototype.setDragonBones = function (armatureName, dragonBonesName, skinName, textureAtlasName, anchor) {\n            this.url = null;\n            var egretFactory = dragonBones.EgretFactory.factory;\n            this._content = egretFactory.buildArmatureDisplay(armatureName, dragonBonesName, skinName, textureAtlasName);\n            this._container.addChild(this._content);\n            this._content.x = anchor.x;\n            this._content.y = anchor.y;\n            this._content.tint = this._color;\n            this.onChangeDragonBones();\n            this.updateLayout();\n        };\n        GLoader3D.prototype.onChange = function () {\n            this.onChangeDragonBones();\n        };\n        GLoader3D.prototype.onChangeDragonBones = function () {\n            if (!(this._content instanceof dragonBones.EgretArmatureDisplay))\n                return;\n            if (this._animationName) {\n                if (this._playing)\n                    this._content.animation.play(this._animationName, this._loop ? 0 : 1);\n                else\n                    this._content.animation.gotoAndStopByFrame(this._animationName, this._frame);\n            }\n            else\n                this._content.animation.reset();\n        };\n        GLoader3D.prototype.loadExternal = function () {\n        };\n        GLoader3D.prototype.updateLayout = function () {\n            var cw = this.sourceWidth;\n            var ch = this.sourceHeight;\n            if (this._autoSize) {\n                this._updatingLayout = true;\n                if (cw == 0)\n                    cw = 50;\n                if (ch == 0)\n                    ch = 30;\n                this.setSize(cw, ch);\n                this._updatingLayout = false;\n                if (cw == this._width && ch == this._height) {\n                    this._container.scaleX = this._container.scaleY = 1;\n                    this._container.x = this._container.y = 0;\n                    return;\n                }\n            }\n            var sx = 1, sy = 1;\n            if (this._fill != fgui.LoaderFillType.None) {\n                sx = this.width / this.sourceWidth;\n                sy = this.height / this.sourceHeight;\n                if (sx != 1 || sy != 1) {\n                    if (this._fill == fgui.LoaderFillType.ScaleMatchHeight)\n                        sx = sy;\n                    else if (this._fill == fgui.LoaderFillType.ScaleMatchWidth)\n                        sy = sx;\n                    else if (this._fill == fgui.LoaderFillType.Scale) {\n                        if (sx > sy)\n                            sx = sy;\n                        else\n                            sy = sx;\n                    }\n                    else if (this._fill == fgui.LoaderFillType.ScaleNoBorder) {\n                        if (sx > sy)\n                            sy = sx;\n                        else\n                            sx = sy;\n                    }\n                    if (this._shrinkOnly) {\n                        if (sx > 1)\n                            sx = 1;\n                        if (sy > 1)\n                            sy = 1;\n                    }\n                    cw = this.sourceWidth * sx;\n                    ch = this.sourceHeight * sy;\n                }\n            }\n            this._container.scaleX = sx;\n            this._container.scaleY = sy;\n            var nx, ny;\n            if (this._align == fgui.AlignType.Center)\n                nx = Math.floor((this.width - cw) / 2);\n            else if (this._align == fgui.AlignType.Right)\n                nx = this.width - cw;\n            else\n                nx = 0;\n            if (this._verticalAlign == fgui.VertAlignType.Middle)\n                ny = Math.floor((this.height - ch) / 2);\n            else if (this._verticalAlign == fgui.VertAlignType.Bottom)\n                ny = this.height - ch;\n            else\n                ny = 0;\n            this._container.x = nx;\n            this._container.y = ny;\n        };\n        GLoader3D.prototype.clearContent = function () {\n            this._contentItem = null;\n            if (this._content) {\n                this._container.removeChild(this._content);\n                if ('dispose' in this._content)\n                    this._content.dispose();\n                this._content = null;\n            }\n        };\n        GLoader3D.prototype.handleSizeChanged = function () {\n            _super_1.prototype.handleSizeChanged.call(this);\n            if (!this._updatingLayout)\n                this.updateLayout();\n        };\n        GLoader3D.prototype.handleGrayedChanged = function () {\n        };\n        GLoader3D.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    return this.color;\n                case fgui.ObjectPropID.Playing:\n                    return this.playing;\n                case fgui.ObjectPropID.Frame:\n                    return this.frame;\n                case fgui.ObjectPropID.TimeScale:\n                    return 1;\n                default:\n                    return _super_1.prototype.getProp.call(this, index);\n            }\n        };\n        GLoader3D.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    this.color = value;\n                    break;\n                case fgui.ObjectPropID.Playing:\n                    this.playing = value;\n                    break;\n                case fgui.ObjectPropID.Frame:\n                    this.frame = value;\n                    break;\n                case fgui.ObjectPropID.TimeScale:\n                    break;\n                case fgui.ObjectPropID.DeltaTime:\n                    break;\n                default:\n                    _super_1.prototype.setProp.call(this, index, value);\n                    break;\n            }\n        };\n        GLoader3D.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            this._url = buffer.readS();\n            this._align = buffer.readByte();\n            this._verticalAlign = buffer.readByte();\n            this._fill = buffer.readByte();\n            this._shrinkOnly = buffer.readBool();\n            this._autoSize = buffer.readBool();\n            this._animationName = buffer.readS();\n            this._skinName = buffer.readS();\n            this._playing = buffer.readBool();\n            this._frame = buffer.readInt();\n            this._loop = buffer.readBool();\n            if (buffer.readBool())\n                this.color = buffer.readColor();\n            if (this._url)\n                this.loadContent();\n        };\n        return GLoader3D;\n    }(fgui.GObject));\n    fgui.GLoader3D = GLoader3D;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GMovieClip = (function (_super_1) {\n        __extends(GMovieClip, _super_1);\n        function GMovieClip() {\n            return _super_1.call(this) || this;\n        }\n        Object.defineProperty(GMovieClip.prototype, \"color\", {\n            get: function () {\n                return this._content.color;\n            },\n            set: function (value) {\n                if (this._content.color != value) {\n                    this._content.color = value;\n                    this.updateGear(4);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GMovieClip.prototype.createDisplayObject = function () {\n            this._content = new fgui.MovieClip();\n            this._content.touchEnabled = false;\n            this.setDisplayObject(this._content);\n        };\n        Object.defineProperty(GMovieClip.prototype, \"playing\", {\n            get: function () {\n                return this._content.playing;\n            },\n            set: function (value) {\n                if (this._content.playing != value) {\n                    this._content.playing = value;\n                    this.updateGear(5);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GMovieClip.prototype, \"frame\", {\n            get: function () {\n                return this._content.frame;\n            },\n            set: function (value) {\n                if (this._content.frame != value) {\n                    this._content.frame = value;\n                    this.updateGear(5);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GMovieClip.prototype, \"timeScale\", {\n            get: function () {\n                return this._content.timeScale;\n            },\n            set: function (value) {\n                this._content.timeScale = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GMovieClip.prototype.rewind = function () {\n            this._content.rewind();\n        };\n        GMovieClip.prototype.syncStatus = function (anotherMc) {\n            this._content.syncStatus(anotherMc._content);\n        };\n        GMovieClip.prototype.advance = function (timeInMiniseconds) {\n            this._content.advance(timeInMiniseconds);\n        };\n        GMovieClip.prototype.setPlaySettings = function (start, end, times, endAt, endCallback, callbackObj) {\n            this._content.setPlaySettings(start, end, times, endAt, endCallback, callbackObj);\n        };\n        GMovieClip.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    return this.color;\n                case fgui.ObjectPropID.Playing:\n                    return this.playing;\n                case fgui.ObjectPropID.Frame:\n                    return this.frame;\n                case fgui.ObjectPropID.TimeScale:\n                    return this.timeScale;\n                default:\n                    return _super_1.prototype.getProp.call(this, index);\n            }\n        };\n        GMovieClip.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    this.color = value;\n                    break;\n                case fgui.ObjectPropID.Playing:\n                    this.playing = value;\n                    break;\n                case fgui.ObjectPropID.Frame:\n                    this.frame = value;\n                    break;\n                case fgui.ObjectPropID.TimeScale:\n                    this.timeScale = value;\n                    break;\n                case fgui.ObjectPropID.DeltaTime:\n                    this.advance(value);\n                    break;\n                default:\n                    _super_1.prototype.setProp.call(this, index, value);\n                    break;\n            }\n        };\n        GMovieClip.prototype.constructFromResource = function () {\n            var contentItem = this.packageItem.getBranch();\n            this.sourceWidth = contentItem.width;\n            this.sourceHeight = contentItem.height;\n            this.initWidth = this.sourceWidth;\n            this.initHeight = this.sourceHeight;\n            this.setSize(this.sourceWidth, this.sourceHeight);\n            contentItem = contentItem.getHighResolution();\n            contentItem.load();\n            this._content.interval = contentItem.interval;\n            this._content.swing = contentItem.swing;\n            this._content.repeatDelay = contentItem.repeatDelay;\n            this._content.frames = contentItem.frames;\n            this._content.smoothing = contentItem.smoothing;\n        };\n        GMovieClip.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            if (buffer.readBool())\n                this.color = buffer.readColor();\n            buffer.readByte();\n            this._content.frame = buffer.readInt();\n            this._content.playing = buffer.readBool();\n        };\n        return GMovieClip;\n    }(fgui.GObject));\n    fgui.GMovieClip = GMovieClip;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GProgressBar = (function (_super_1) {\n        __extends(GProgressBar, _super_1);\n        function GProgressBar() {\n            var _this = _super_1.call(this) || this;\n            _this._min = 0;\n            _this._max = 0;\n            _this._value = 0;\n            _this._barMaxWidth = 0;\n            _this._barMaxHeight = 0;\n            _this._barMaxWidthDelta = 0;\n            _this._barMaxHeightDelta = 0;\n            _this._barStartX = 0;\n            _this._barStartY = 0;\n            _this._titleType = fgui.ProgressTitleType.Percent;\n            _this._value = 50;\n            _this._max = 100;\n            return _this;\n        }\n        Object.defineProperty(GProgressBar.prototype, \"titleType\", {\n            get: function () {\n                return this._titleType;\n            },\n            set: function (value) {\n                if (this._titleType != value) {\n                    this._titleType = value;\n                    this.update(this._value);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GProgressBar.prototype, \"min\", {\n            get: function () {\n                return this._min;\n            },\n            set: function (value) {\n                if (this._min != value) {\n                    this._min = value;\n                    this.update(this._value);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GProgressBar.prototype, \"max\", {\n            get: function () {\n                return this._max;\n            },\n            set: function (value) {\n                if (this._max != value) {\n                    this._max = value;\n                    this.update(this._value);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GProgressBar.prototype, \"value\", {\n            get: function () {\n                return this._value;\n            },\n            set: function (value) {\n                if (this._value != value) {\n                    fgui.GTween.kill(this, false, this.update);\n                    this._value = value;\n                    this.update(value);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GProgressBar.prototype.tweenValue = function (value, duration) {\n            var oldValule;\n            var tweener = fgui.GTween.getTween(this, this.update);\n            if (tweener) {\n                oldValule = tweener.value.x;\n                tweener.kill();\n            }\n            else\n                oldValule = this._value;\n            this._value = value;\n            return fgui.GTween.to(oldValule, this._value, duration).setTarget(this, this.update).setEase(fgui.EaseType.Linear);\n        };\n        GProgressBar.prototype.update = function (newValue) {\n            var percent = fgui.ToolSet.clamp01((newValue - this._min) / (this._max - this._min));\n            if (this._titleObject) {\n                switch (this._titleType) {\n                    case fgui.ProgressTitleType.Percent:\n                        this._titleObject.text = Math.floor(percent * 100) + \"%\";\n                        break;\n                    case fgui.ProgressTitleType.ValueAndMax:\n                        this._titleObject.text = Math.floor(newValue) + \"/\" + Math.floor(this._max);\n                        break;\n                    case fgui.ProgressTitleType.Value:\n                        this._titleObject.text = \"\" + Math.floor(newValue);\n                        break;\n                    case fgui.ProgressTitleType.Max:\n                        this._titleObject.text = \"\" + Math.floor(this._max);\n                        break;\n                }\n            }\n            var fullWidth = this.width - this._barMaxWidthDelta;\n            var fullHeight = this.height - this._barMaxHeightDelta;\n            if (!this._reverse) {\n                if (this._barObjectH) {\n                    if (!this.setFillAmount(this._barObjectH, percent))\n                        this._barObjectH.width = Math.round(fullWidth * percent);\n                }\n                if (this._barObjectV) {\n                    if (!this.setFillAmount(this._barObjectV, percent))\n                        this._barObjectV.height = Math.round(fullHeight * percent);\n                }\n            }\n            else {\n                if (this._barObjectH) {\n                    if (!this.setFillAmount(this._barObjectH, 1 - percent)) {\n                        this._barObjectH.width = Math.round(fullWidth * percent);\n                        this._barObjectH.x = this._barStartX + (fullWidth - this._barObjectH.width);\n                    }\n                }\n                if (this._barObjectV) {\n                    if (!this.setFillAmount(this._barObjectV, 1 - percent)) {\n                        this._barObjectV.height = Math.round(fullHeight * percent);\n                        this._barObjectV.y = this._barStartY + (fullHeight - this._barObjectV.height);\n                    }\n                }\n            }\n            if (this._aniObject)\n                this._aniObject.setProp(fgui.ObjectPropID.Frame, Math.floor(percent * 100));\n        };\n        GProgressBar.prototype.setFillAmount = function (bar, percent) {\n            if (((bar instanceof fgui.GImage) || (bar instanceof fgui.GLoader)) && bar.fillMethod != fgui.FillMethod.None) {\n                bar.fillAmount = percent;\n                return true;\n            }\n            else\n                return false;\n        };\n        GProgressBar.prototype.constructExtension = function (buffer) {\n            buffer.seek(0, 6);\n            this._titleType = buffer.readByte();\n            this._reverse = buffer.readBool();\n            this._titleObject = this.getChild(\"title\");\n            this._barObjectH = this.getChild(\"bar\");\n            this._barObjectV = this.getChild(\"bar_v\");\n            this._aniObject = this.getChild(\"ani\");\n            if (this._barObjectH) {\n                this._barMaxWidth = this._barObjectH.width;\n                this._barMaxWidthDelta = this.width - this._barMaxWidth;\n                this._barStartX = this._barObjectH.x;\n            }\n            if (this._barObjectV) {\n                this._barMaxHeight = this._barObjectV.height;\n                this._barMaxHeightDelta = this.height - this._barMaxHeight;\n                this._barStartY = this._barObjectV.y;\n            }\n        };\n        GProgressBar.prototype.handleSizeChanged = function () {\n            _super_1.prototype.handleSizeChanged.call(this);\n            if (this._barObjectH)\n                this._barMaxWidth = this.width - this._barMaxWidthDelta;\n            if (this._barObjectV)\n                this._barMaxHeight = this.height - this._barMaxHeightDelta;\n            if (!this._underConstruct)\n                this.update(this._value);\n        };\n        GProgressBar.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            if (!buffer.seek(beginPos, 6)) {\n                this.update(this._value);\n                return;\n            }\n            if (buffer.readByte() != this.packageItem.objectType) {\n                this.update(this._value);\n                return;\n            }\n            this._value = buffer.readInt();\n            this._max = buffer.readInt();\n            if (buffer.version >= 2)\n                this._min = buffer.readInt();\n            this.update(this._value);\n        };\n        return GProgressBar;\n    }(fgui.GComponent));\n    fgui.GProgressBar = GProgressBar;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GTextField = (function (_super_1) {\n        __extends(GTextField, _super_1);\n        function GTextField() {\n            var _this = _super_1.call(this) || this;\n            _this._fontSize = 0;\n            _this._leading = 0;\n            _this._letterSpacing = 0;\n            _this._textWidth = 0;\n            _this._textHeight = 0;\n            _this._fontSize = 12;\n            _this._align = fgui.AlignType.Left;\n            _this._verticalAlign = fgui.VertAlignType.Top;\n            _this._text = \"\";\n            _this._leading = 3;\n            _this._color = 0;\n            _this._autoSize = fgui.AutoSizeType.Both;\n            _this._widthAutoSize = true;\n            _this._heightAutoSize = true;\n            return _this;\n        }\n        GTextField.prototype.createDisplayObject = function () {\n            this._textField = new egret.TextField();\n            this._textField.touchEnabled = false;\n            this.setDisplayObject(this._textField);\n        };\n        GTextField.prototype.switchBitmapMode = function (val) {\n            if (val && this.displayObject == this._textField) {\n                if (this._bitmapContainer == null)\n                    this._bitmapContainer = new egret.Sprite();\n                this.switchDisplayObject(this._bitmapContainer);\n            }\n            else if (!val && this.displayObject == this._bitmapContainer)\n                this.switchDisplayObject(this._textField);\n        };\n        GTextField.prototype.dispose = function () {\n            _super_1.prototype.dispose.call(this);\n            this._bitmapFont = null;\n            this._requireRender = false;\n        };\n        Object.defineProperty(GTextField.prototype, \"text\", {\n            get: function () {\n                return this._text;\n            },\n            set: function (value) {\n                this._text = value;\n                if (this._text == null)\n                    this._text = \"\";\n                this.updateGear(6);\n                if (this.parent && this.parent._underConstruct)\n                    this.renderNow();\n                else\n                    this.render();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTextField.prototype.updateTextFieldText = function () {\n            var text2 = this._text;\n            if (this._templateVars)\n                text2 = this.parseTemplate(text2);\n            if (this._ubbEnabled) {\n                var arr = GTextField._htmlParser.parser(fgui.UBBParser.inst.parse(fgui.ToolSet.encodeHTML(text2)));\n                if (this._underline) {\n                    for (var i = 0; i < arr.length; i++) {\n                        var element = arr[i];\n                        if (element.style)\n                            element.style.underline = true;\n                        else\n                            element.style = { underline: true };\n                    }\n                }\n                this._textField.textFlow = arr;\n            }\n            else if (this._underline) {\n                var arr = new Array(1);\n                arr[0] = { text: text2, style: { underline: true } };\n                this._textField.textFlow = arr;\n            }\n            else\n                this._textField.text = text2;\n        };\n        Object.defineProperty(GTextField.prototype, \"font\", {\n            get: function () {\n                return this._font;\n            },\n            set: function (value) {\n                if (this._font != value) {\n                    this._font = value;\n                    this.updateTextFormat();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"fontSize\", {\n            get: function () {\n                return this._fontSize;\n            },\n            set: function (value) {\n                if (value < 0)\n                    return;\n                if (this._fontSize != value) {\n                    this._fontSize = value;\n                    this.updateTextFormat();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"color\", {\n            get: function () {\n                return this._color;\n            },\n            set: function (value) {\n                if (this._color != value) {\n                    this._color = value;\n                    this.updateGear(4);\n                    this.updateTextFormat();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"align\", {\n            get: function () {\n                return this._align;\n            },\n            set: function (value) {\n                if (this._align != value) {\n                    this._align = value;\n                    this._textField.textAlign = this.getAlignTypeString(this._align);\n                    if (this._bitmapFont && !this._underConstruct)\n                        this.render();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"verticalAlign\", {\n            get: function () {\n                return this._verticalAlign;\n            },\n            set: function (value) {\n                if (this._verticalAlign != value) {\n                    this._verticalAlign = value;\n                    this._textField.verticalAlign = this.getVertAlignTypeString(this._verticalAlign);\n                    if (this._bitmapFont && !this._underConstruct)\n                        this.render();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTextField.prototype.getAlignTypeString = function (type) {\n            return type == fgui.AlignType.Left ? egret.HorizontalAlign.LEFT :\n                (type == fgui.AlignType.Center ? egret.HorizontalAlign.CENTER : egret.HorizontalAlign.RIGHT);\n        };\n        GTextField.prototype.getVertAlignTypeString = function (type) {\n            return type == fgui.VertAlignType.Top ? egret.VerticalAlign.TOP :\n                (type == fgui.VertAlignType.Middle ? egret.VerticalAlign.MIDDLE : egret.VerticalAlign.BOTTOM);\n        };\n        Object.defineProperty(GTextField.prototype, \"leading\", {\n            get: function () {\n                return this._leading;\n            },\n            set: function (value) {\n                if (this._leading != value) {\n                    this._leading = value;\n                    this.updateTextFormat();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"letterSpacing\", {\n            get: function () {\n                return this._letterSpacing;\n            },\n            set: function (value) {\n                if (this._letterSpacing != value) {\n                    this._letterSpacing = value;\n                    this.updateTextFormat();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"underline\", {\n            get: function () {\n                return this._underline;\n            },\n            set: function (value) {\n                this._underline = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"bold\", {\n            get: function () {\n                return this._textField.bold;\n            },\n            set: function (value) {\n                this._textField.bold = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"italic\", {\n            get: function () {\n                return this._textField.italic;\n            },\n            set: function (value) {\n                this._textField.italic = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"singleLine\", {\n            get: function () {\n                return !this._textField.multiline;\n            },\n            set: function (value) {\n                value = !value;\n                if (this._textField.multiline != value) {\n                    this._textField.multiline = value;\n                    this.render();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"stroke\", {\n            get: function () {\n                return this._textField.stroke;\n            },\n            set: function (value) {\n                this._textField.stroke = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"strokeColor\", {\n            get: function () {\n                return this._textField.strokeColor;\n            },\n            set: function (value) {\n                this._textField.strokeColor = value;\n                this.updateGear(4);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"ubbEnabled\", {\n            get: function () {\n                return this._ubbEnabled;\n            },\n            set: function (value) {\n                if (this._ubbEnabled != value) {\n                    this._ubbEnabled = value;\n                    this.render();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"autoSize\", {\n            get: function () {\n                return this._autoSize;\n            },\n            set: function (value) {\n                if (this._autoSize != value) {\n                    this._autoSize = value;\n                    this._widthAutoSize = value == fgui.AutoSizeType.Both;\n                    this._heightAutoSize = value == fgui.AutoSizeType.Both || value == fgui.AutoSizeType.Height;\n                    this.render();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextField.prototype, \"textWidth\", {\n            get: function () {\n                if (this._requireRender)\n                    this.renderNow();\n                return this._textWidth;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTextField.prototype.ensureSizeCorrect = function () {\n            if (this._sizeDirty && this._requireRender)\n                this.renderNow();\n        };\n        GTextField.prototype.updateTextFormat = function () {\n            this._textField.size = this._fontSize;\n            this._bitmapFont = null;\n            if (fgui.ToolSet.startsWith(this._font, \"ui://\")) {\n                var pi = fgui.UIPackage.getItemByURL(this._font);\n                if (pi)\n                    this._bitmapFont = pi.owner.getItemAsset(pi);\n            }\n            if (this._bitmapFont == null) {\n                if (this._font)\n                    this._textField.fontFamily = this._font;\n                else\n                    this._textField.fontFamily = fgui.UIConfig.defaultFont;\n            }\n            if (this.grayed)\n                this._textField.textColor = 0xAAAAAA;\n            else\n                this._textField.textColor = this._color;\n            this._textField.lineSpacing = this._leading;\n            if (!this._underConstruct)\n                this.render();\n        };\n        GTextField.prototype.render = function () {\n            if (!this._requireRender) {\n                this._requireRender = true;\n                egret.callLater(this.__render, this);\n            }\n            if (!this._sizeDirty && (this._widthAutoSize || this._heightAutoSize)) {\n                this._sizeDirty = true;\n                this.dispatchEventWith(fgui.GObject.SIZE_DELAY_CHANGE);\n            }\n        };\n        GTextField.prototype.__render = function () {\n            if (this._requireRender)\n                this.renderNow();\n        };\n        GTextField.prototype.renderNow = function (updateBounds) {\n            if (updateBounds === void 0) { updateBounds = true; }\n            this._requireRender = false;\n            this._sizeDirty = false;\n            if (this._bitmapFont) {\n                this.renderWithBitmapFont(updateBounds);\n                return;\n            }\n            this.switchBitmapMode(false);\n            this._textField.width = this._widthAutoSize ? (this.maxWidth <= 0 ? 10000 : this.maxWidth) : Math.ceil(this.width);\n            this.updateTextFieldText();\n            this._textWidth = Math.ceil(this._textField.textWidth);\n            if (this._textWidth > 0)\n                this._textWidth += 4;\n            this._textHeight = Math.ceil(this._textField.textHeight);\n            if (this._textHeight > 0)\n                this._textHeight += 4;\n            var w, h = 0;\n            if (this._widthAutoSize) {\n                w = this._textWidth;\n                this._textField.width = w;\n            }\n            else\n                w = this.width;\n            if (this._heightAutoSize) {\n                h = this._textHeight;\n                if (this._textField.height != this._textHeight)\n                    this._textField.height = this._textHeight;\n            }\n            else {\n                h = this.height;\n                if (this._textHeight > h)\n                    this._textHeight = h;\n            }\n            if (updateBounds) {\n                this._updatingSize = true;\n                this.setSize(w, h);\n                this._updatingSize = false;\n            }\n        };\n        GTextField.prototype.renderWithBitmapFont = function (updateBounds) {\n            this.switchBitmapMode(true);\n            if (!this._bitmapPool)\n                this._bitmapPool = [];\n            var cnt = this._bitmapContainer.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                var obj = this._bitmapContainer.getChildAt(i);\n                this._bitmapPool.push(obj);\n            }\n            this._bitmapContainer.removeChildren();\n            if (!this._lines)\n                this._lines = new Array();\n            else\n                returnList(this._lines);\n            var letterSpacing = this._letterSpacing;\n            var lineSpacing = this._leading - 1;\n            var rectWidth = this.width - GUTTER_X * 2;\n            var lineWidth = 0, lineHeight = 0, lineTextHeight = 0;\n            var glyphWidth = 0, glyphHeight = 0;\n            var wordChars = 0, wordStart = 0, wordEnd = 0;\n            var lastLineHeight = 0;\n            var lineBuffer = \"\";\n            var lineY = GUTTER_Y;\n            var line;\n            var wordWrap = !this._widthAutoSize && this._textField.multiline;\n            var fontScale = this._bitmapFont.resizable ? this._fontSize / this._bitmapFont.size : 1;\n            var tint = this._bitmapFont.tint;\n            this._textWidth = 0;\n            this._textHeight = 0;\n            var text2 = this._text;\n            if (this._templateVars)\n                text2 = this.parseTemplate(text2);\n            var textLength = text2.length;\n            for (var offset = 0; offset < textLength; ++offset) {\n                var ch = text2.charAt(offset);\n                var cc = ch.charCodeAt(0);\n                if (cc == 10) {\n                    lineBuffer += ch;\n                    line = borrow();\n                    line.width = lineWidth;\n                    if (lineTextHeight == 0) {\n                        if (lastLineHeight == 0)\n                            lastLineHeight = this._fontSize;\n                        if (lineHeight == 0)\n                            lineHeight = lastLineHeight;\n                        lineTextHeight = lineHeight;\n                    }\n                    line.height = lineHeight;\n                    lastLineHeight = lineHeight;\n                    line.textHeight = lineTextHeight;\n                    line.text = lineBuffer;\n                    line.y = lineY;\n                    lineY += (line.height + lineSpacing);\n                    if (line.width > this._textWidth)\n                        this._textWidth = line.width;\n                    this._lines.push(line);\n                    lineBuffer = \"\";\n                    lineWidth = 0;\n                    lineHeight = 0;\n                    lineTextHeight = 0;\n                    wordChars = 0;\n                    wordStart = 0;\n                    wordEnd = 0;\n                    continue;\n                }\n                if (cc >= 65 && cc <= 90 || cc >= 97 && cc <= 122) {\n                    if (wordChars == 0)\n                        wordStart = lineWidth;\n                    wordChars++;\n                }\n                else {\n                    if (wordChars > 0)\n                        wordEnd = lineWidth;\n                    wordChars = 0;\n                }\n                if (cc == 32) {\n                    glyphWidth = Math.ceil(this._fontSize / 2);\n                    glyphHeight = this._fontSize;\n                }\n                else {\n                    var glyph = this._bitmapFont.glyphs[ch];\n                    if (glyph) {\n                        glyphWidth = Math.ceil(glyph.advance * fontScale);\n                        glyphHeight = Math.ceil(glyph.lineHeight * fontScale);\n                    }\n                    else {\n                        glyphWidth = 0;\n                        glyphHeight = 0;\n                    }\n                }\n                if (glyphHeight > lineTextHeight)\n                    lineTextHeight = glyphHeight;\n                if (glyphHeight > lineHeight)\n                    lineHeight = glyphHeight;\n                if (lineWidth != 0)\n                    lineWidth += letterSpacing;\n                lineWidth += glyphWidth;\n                if (!wordWrap || lineWidth <= rectWidth) {\n                    lineBuffer += ch;\n                }\n                else {\n                    line = borrow();\n                    line.height = lineHeight;\n                    line.textHeight = lineTextHeight;\n                    if (lineBuffer.length == 0) {\n                        line.text = ch;\n                    }\n                    else if (wordChars > 0 && wordEnd > 0) {\n                        lineBuffer += ch;\n                        var len = lineBuffer.length - wordChars;\n                        line.text = fgui.ToolSet.trimRight(lineBuffer.substr(0, len));\n                        line.width = wordEnd;\n                        lineBuffer = lineBuffer.substr(len);\n                        lineWidth -= wordStart;\n                    }\n                    else {\n                        line.text = lineBuffer;\n                        line.width = lineWidth - (glyphWidth + letterSpacing);\n                        lineBuffer = ch;\n                        lineWidth = glyphWidth;\n                        lineHeight = glyphHeight;\n                        lineTextHeight = glyphHeight;\n                    }\n                    line.y = lineY;\n                    lineY += (line.height + lineSpacing);\n                    if (line.width > this._textWidth)\n                        this._textWidth = line.width;\n                    wordChars = 0;\n                    wordStart = 0;\n                    wordEnd = 0;\n                    this._lines.push(line);\n                }\n            }\n            if (lineBuffer.length > 0) {\n                line = borrow();\n                line.width = lineWidth;\n                if (lineHeight == 0)\n                    lineHeight = lastLineHeight;\n                if (lineTextHeight == 0)\n                    lineTextHeight = lineHeight;\n                line.height = lineHeight;\n                line.textHeight = lineTextHeight;\n                line.text = lineBuffer;\n                line.y = lineY;\n                if (line.width > this._textWidth)\n                    this._textWidth = line.width;\n                this._lines.push(line);\n            }\n            if (this._textWidth > 0)\n                this._textWidth += GUTTER_X * 2;\n            var count = this._lines.length;\n            if (count == 0) {\n                this._textHeight = 0;\n            }\n            else {\n                line = this._lines[this._lines.length - 1];\n                this._textHeight = line.y + line.height + GUTTER_Y;\n            }\n            var w, h = 0;\n            if (this._widthAutoSize) {\n                if (this._textWidth == 0)\n                    w = 0;\n                else\n                    w = this._textWidth;\n            }\n            else\n                w = this.width;\n            if (this._heightAutoSize) {\n                if (this._textHeight == 0)\n                    h = 0;\n                else\n                    h = this._textHeight;\n            }\n            else\n                h = this.height;\n            if (updateBounds) {\n                this._updatingSize = true;\n                this.setSize(w, h);\n                this._updatingSize = false;\n            }\n            if (w == 0 || h == 0)\n                return;\n            var charX = GUTTER_X;\n            var lineIndent = 0;\n            var charIndent = 0;\n            rectWidth = this.width - GUTTER_X * 2;\n            var lineCount = this._lines.length;\n            for (var i = 0; i < lineCount; i++) {\n                line = this._lines[i];\n                charX = GUTTER_X;\n                if (this._align == fgui.AlignType.Center)\n                    lineIndent = (rectWidth - line.width) / 2;\n                else if (this._align == fgui.AlignType.Right)\n                    lineIndent = rectWidth - line.width;\n                else\n                    lineIndent = 0;\n                textLength = line.text.length;\n                for (var j = 0; j < textLength; j++) {\n                    ch = line.text.charAt(j);\n                    cc = ch.charCodeAt(0);\n                    if (cc == 10)\n                        continue;\n                    if (cc == 32) {\n                        charX += letterSpacing + Math.ceil(this._fontSize / 2);\n                        continue;\n                    }\n                    glyph = this._bitmapFont.glyphs[ch];\n                    if (glyph) {\n                        charIndent = (line.height + line.textHeight) / 2 - Math.ceil(glyph.lineHeight * fontScale);\n                        var bm;\n                        if (this._bitmapPool.length)\n                            bm = this._bitmapPool.pop();\n                        else {\n                            bm = new egret.Bitmap();\n                            bm.smoothing = true;\n                        }\n                        bm.x = charX + lineIndent + Math.ceil(glyph.x * fontScale);\n                        bm.y = line.y + charIndent + Math.ceil(glyph.y * fontScale);\n                        bm[\"$backupY\"] = bm.y;\n                        bm.texture = glyph.texture;\n                        bm.scaleX = fontScale;\n                        bm.scaleY = fontScale;\n                        if (tint)\n                            bm.tint = this._color;\n                        else\n                            bm.tint = 0xFFFFFF;\n                        this._bitmapContainer.addChild(bm);\n                        charX += letterSpacing + Math.ceil(glyph.advance * fontScale);\n                    }\n                    else {\n                        charX += letterSpacing;\n                    }\n                }\n            }\n            this.doAlign();\n        };\n        GTextField.prototype.handleSizeChanged = function () {\n            if (this._updatingSize)\n                return;\n            if (this._bitmapFont) {\n                if (!this._widthAutoSize)\n                    this.render();\n                else\n                    this.doAlign();\n            }\n            else {\n                if (this._underConstruct) {\n                    this._textField.width = this.width;\n                    this._textField.height = this.height;\n                }\n                else {\n                    if (!this._widthAutoSize) {\n                        if (!this._heightAutoSize) {\n                            this._textField.width = this.width;\n                            this._textField.height = this.height;\n                        }\n                        else\n                            this._textField.width = this.width;\n                    }\n                }\n            }\n        };\n        GTextField.prototype.parseTemplate = function (template) {\n            var pos1 = 0, pos2, pos3;\n            var tag;\n            var value;\n            var result = \"\";\n            while ((pos2 = template.indexOf(\"{\", pos1)) != -1) {\n                if (pos2 > 0 && template.charCodeAt(pos2 - 1) == 92) {\n                    result += template.substring(pos1, pos2 - 1);\n                    result += \"{\";\n                    pos1 = pos2 + 1;\n                    continue;\n                }\n                result += template.substring(pos1, pos2);\n                pos1 = pos2;\n                pos2 = template.indexOf(\"}\", pos1);\n                if (pos2 == -1)\n                    break;\n                if (pos2 == pos1 + 1) {\n                    result += template.substr(pos1, 2);\n                    pos1 = pos2 + 1;\n                    continue;\n                }\n                tag = template.substring(pos1 + 1, pos2);\n                pos3 = tag.indexOf(\"=\");\n                if (pos3 != -1) {\n                    value = this._templateVars[tag.substring(0, pos3)];\n                    if (value == null)\n                        result += tag.substring(pos3 + 1);\n                    else\n                        result += value;\n                }\n                else {\n                    value = this._templateVars[tag];\n                    if (value != null)\n                        result += value;\n                }\n                pos1 = pos2 + 1;\n            }\n            if (pos1 < template.length)\n                result += template.substr(pos1);\n            return result;\n        };\n        Object.defineProperty(GTextField.prototype, \"templateVars\", {\n            get: function () {\n                return this._templateVars;\n            },\n            set: function (value) {\n                if (!this._templateVars && !value)\n                    return;\n                this._templateVars = value;\n                this.flushVars();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTextField.prototype.setVar = function (name, value) {\n            if (!this._templateVars)\n                this._templateVars = {};\n            this._templateVars[name] = value;\n            return this;\n        };\n        GTextField.prototype.flushVars = function () {\n            this.render();\n        };\n        GTextField.prototype.handleGrayedChanged = function () {\n            _super_1.prototype.handleGrayedChanged.call(this);\n            this.updateTextFormat();\n        };\n        GTextField.prototype.doAlign = function () {\n            var yOffset;\n            if (this._verticalAlign == fgui.VertAlignType.Top || this._textHeight == 0)\n                yOffset = GUTTER_Y;\n            else {\n                var dh = this.height - this._textHeight;\n                if (dh < 0)\n                    dh = 0;\n                if (this._verticalAlign == fgui.VertAlignType.Middle)\n                    yOffset = Math.floor(dh / 2);\n                else\n                    yOffset = Math.floor(dh);\n            }\n            var cnt = this._bitmapContainer.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                var obj = this._bitmapContainer.getChildAt(i);\n                obj.y = obj[\"$backupY\"] + yOffset;\n            }\n        };\n        GTextField.prototype.getProp = function (index) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    return this.color;\n                case fgui.ObjectPropID.OutlineColor:\n                    return this.strokeColor;\n                case fgui.ObjectPropID.FontSize:\n                    return this.fontSize;\n                default:\n                    return _super_1.prototype.getProp.call(this, index);\n            }\n        };\n        GTextField.prototype.setProp = function (index, value) {\n            switch (index) {\n                case fgui.ObjectPropID.Color:\n                    this.color = value;\n                    break;\n                case fgui.ObjectPropID.OutlineColor:\n                    this.strokeColor = value;\n                    break;\n                case fgui.ObjectPropID.FontSize:\n                    this.fontSize = value;\n                    break;\n                default:\n                    _super_1.prototype.setProp.call(this, index, value);\n                    break;\n            }\n        };\n        GTextField.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 5);\n            this._font = buffer.readS();\n            this._fontSize = buffer.readShort();\n            this._color = buffer.readColor();\n            this.align = buffer.readByte();\n            this.verticalAlign = buffer.readByte();\n            this._leading = buffer.readShort();\n            this._letterSpacing = buffer.readShort();\n            this._ubbEnabled = buffer.readBool();\n            this._autoSize = buffer.readByte();\n            this._widthAutoSize = this._autoSize == fgui.AutoSizeType.Both;\n            this._heightAutoSize = this._autoSize == fgui.AutoSizeType.Both || this._autoSize == fgui.AutoSizeType.Height;\n            this._underline = buffer.readBool();\n            this._textField.italic = buffer.readBool();\n            this._textField.bold = buffer.readBool();\n            this._textField.multiline = !buffer.readBool();\n            if (buffer.readBool()) {\n                this._textField.strokeColor = buffer.readColor();\n                this.stroke = buffer.readFloat() + 1;\n            }\n            if (buffer.readBool())\n                buffer.skip(12);\n            if (buffer.readBool())\n                this._templateVars = {};\n        };\n        GTextField.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            this.updateTextFormat();\n            buffer.seek(beginPos, 6);\n            var str = buffer.readS();\n            if (str != null)\n                this.text = str;\n            this._sizeDirty = false;\n        };\n        GTextField._htmlParser = new egret.HtmlTextParser();\n        return GTextField;\n    }(fgui.GObject));\n    fgui.GTextField = GTextField;\n    var pool = [];\n    function borrow() {\n        if (pool.length) {\n            var ret = pool.pop();\n            ret.width = 0;\n            ret.height = 0;\n            ret.textHeight = 0;\n            ret.text = null;\n            ret.y = 0;\n            return ret;\n        }\n        else\n            return {\n                width: 0,\n                height: 0,\n                textHeight: 0,\n                text: null,\n                y: 0\n            };\n    }\n    function returnList(value) {\n        var length = value.length;\n        for (var i = 0; i < length; i++) {\n            var li = value[i];\n            pool.push(li);\n        }\n        value.length = 0;\n    }\n    var GUTTER_X = 2;\n    var GUTTER_Y = 2;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GRichTextField = (function (_super_1) {\n        __extends(GRichTextField, _super_1);\n        function GRichTextField() {\n            var _this = _super_1.call(this) || this;\n            _this._textField.touchEnabled = true;\n            return _this;\n        }\n        GRichTextField.prototype.updateTextFieldText = function () {\n            var text2 = this._text;\n            if (this._templateVars)\n                text2 = this.parseTemplate(text2);\n            var arr;\n            if (this._ubbEnabled)\n                arr = fgui.GTextField._htmlParser.parser(fgui.UBBParser.inst.parse(text2));\n            else\n                arr = fgui.GTextField._htmlParser.parser(text2);\n            if (this._underline) {\n                for (var i = 0; i < arr.length; i++) {\n                    var element = arr[i];\n                    if (element.style)\n                        element.style.underline = true;\n                    else\n                        element.style = { underline: true };\n                }\n            }\n            this._textField.textFlow = arr;\n        };\n        return GRichTextField;\n    }(fgui.GTextField));\n    fgui.GRichTextField = GRichTextField;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GRoot = (function (_super_1) {\n        __extends(GRoot, _super_1);\n        function GRoot() {\n            var _this = _super_1.call(this) || this;\n            if (GRoot._inst == null)\n                GRoot._inst = _this;\n            _this.opaque = false;\n            _this._volumeScale = 1;\n            _this._popupStack = new Array();\n            _this._justClosedPopups = new Array();\n            _this.displayObject.addEventListener(egret.Event.ADDED_TO_STAGE, _this.__addedToStage, _this);\n            return _this;\n        }\n        Object.defineProperty(GRoot, \"inst\", {\n            get: function () {\n                if (GRoot._inst == null)\n                    new GRoot();\n                return GRoot._inst;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GRoot.prototype, \"nativeStage\", {\n            get: function () {\n                return this._nativeStage;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GRoot.prototype.showWindow = function (win) {\n            this.addChild(win);\n            win.requestFocus();\n            if (win.x > this.width)\n                win.x = this.width - win.width;\n            else if (win.x + win.width < 0)\n                win.x = 0;\n            if (win.y > this.height)\n                win.y = this.height - win.height;\n            else if (win.y + win.height < 0)\n                win.y = 0;\n            this.adjustModalLayer();\n        };\n        GRoot.prototype.hideWindow = function (win) {\n            win.hide();\n        };\n        GRoot.prototype.hideWindowImmediately = function (win) {\n            if (win.parent == this)\n                this.removeChild(win);\n            this.adjustModalLayer();\n        };\n        GRoot.prototype.bringToFront = function (win) {\n            var cnt = this.numChildren;\n            var i;\n            if (this._modalLayer.parent != null && !win.modal)\n                i = this.getChildIndex(this._modalLayer) - 1;\n            else\n                i = cnt - 1;\n            for (; i >= 0; i--) {\n                var g = this.getChildAt(i);\n                if (g == win)\n                    return;\n                if (g instanceof fgui.Window)\n                    break;\n            }\n            if (i >= 0)\n                this.setChildIndex(win, i);\n        };\n        GRoot.prototype.showModalWait = function (msg) {\n            if (fgui.UIConfig.globalModalWaiting != null) {\n                if (this._modalWaitPane == null)\n                    this._modalWaitPane = fgui.UIPackage.createObjectFromURL(fgui.UIConfig.globalModalWaiting);\n                this._modalWaitPane.setSize(this.width, this.height);\n                this._modalWaitPane.addRelation(this, fgui.RelationType.Size);\n                this.addChild(this._modalWaitPane);\n                this._modalWaitPane.text = msg;\n            }\n        };\n        GRoot.prototype.closeModalWait = function () {\n            if (this._modalWaitPane != null && this._modalWaitPane.parent != null)\n                this.removeChild(this._modalWaitPane);\n        };\n        GRoot.prototype.closeAllExceptModals = function () {\n            var arr = this._children.slice();\n            var cnt = arr.length;\n            for (var i = 0; i < cnt; i++) {\n                var g = arr[i];\n                if ((g instanceof fgui.Window) && !g.modal)\n                    g.hide();\n            }\n        };\n        GRoot.prototype.closeAllWindows = function () {\n            var arr = this._children.slice();\n            var cnt = arr.length;\n            for (var i = 0; i < cnt; i++) {\n                var g = arr[i];\n                if (g instanceof fgui.Window)\n                    g.hide();\n            }\n        };\n        GRoot.prototype.getTopWindow = function () {\n            var cnt = this.numChildren;\n            for (var i = cnt - 1; i >= 0; i--) {\n                var g = this.getChildAt(i);\n                if (g instanceof fgui.Window) {\n                    return g;\n                }\n            }\n            return null;\n        };\n        Object.defineProperty(GRoot.prototype, \"modalLayer\", {\n            get: function () {\n                return this._modalLayer;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GRoot.prototype, \"hasModalWindow\", {\n            get: function () {\n                return this._modalLayer.parent != null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GRoot.prototype, \"modalWaiting\", {\n            get: function () {\n                return this._modalWaitPane && this._modalWaitPane.inContainer;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GRoot.prototype.showPopup = function (popup, target, dir) {\n            if (this._popupStack.length > 0) {\n                var k = this._popupStack.indexOf(popup);\n                if (k != -1) {\n                    for (var i = this._popupStack.length - 1; i >= k; i--)\n                        this.removeChild(this._popupStack.pop());\n                }\n            }\n            this._popupStack.push(popup);\n            if (target) {\n                var p = target;\n                while (p) {\n                    if (p.parent == this) {\n                        if (popup.sortingOrder < p.sortingOrder) {\n                            popup.sortingOrder = p.sortingOrder;\n                        }\n                        break;\n                    }\n                    p = p.parent;\n                }\n            }\n            this.addChild(popup);\n            this.adjustModalLayer();\n            var pos;\n            var sizeW = 0, sizeH = 0;\n            if (target) {\n                pos = target.localToRoot();\n                sizeW = target.width;\n                sizeH = target.height;\n            }\n            else {\n                pos = this.globalToLocal(GRoot.mouseX, GRoot.mouseY);\n            }\n            var xx, yy;\n            xx = pos.x;\n            if (xx + popup.width > this.width)\n                xx = xx + sizeW - popup.width;\n            yy = pos.y + sizeH;\n            if (((dir === undefined || dir === fgui.PopupDirection.Auto) && pos.y + popup.height > this.height)\n                || dir === false || dir === fgui.PopupDirection.Up) {\n                yy = pos.y - popup.height - 1;\n                if (yy < 0) {\n                    yy = 0;\n                    xx += sizeW / 2;\n                }\n            }\n            popup.x = xx;\n            popup.y = yy;\n        };\n        GRoot.prototype.togglePopup = function (popup, target, dir) {\n            if (this._justClosedPopups.indexOf(popup) != -1)\n                return;\n            this.showPopup(popup, target, dir);\n        };\n        GRoot.prototype.hidePopup = function (popup) {\n            if (popup) {\n                var k = this._popupStack.indexOf(popup);\n                if (k != -1) {\n                    for (var i = this._popupStack.length - 1; i >= k; i--)\n                        this.closePopup(this._popupStack.pop());\n                }\n            }\n            else {\n                var cnt = this._popupStack.length;\n                for (i = cnt - 1; i >= 0; i--)\n                    this.closePopup(this._popupStack[i]);\n                this._popupStack.length = 0;\n            }\n        };\n        Object.defineProperty(GRoot.prototype, \"hasAnyPopup\", {\n            get: function () {\n                return this._popupStack.length != 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GRoot.prototype.closePopup = function (target) {\n            if (target.parent) {\n                if (target instanceof fgui.Window)\n                    target.hide();\n                else\n                    this.removeChild(target);\n            }\n        };\n        GRoot.prototype.showTooltips = function (msg) {\n            if (this._defaultTooltipWin == null) {\n                var resourceURL = fgui.UIConfig.tooltipsWin;\n                if (!resourceURL) {\n                    console.error(\"UIConfig.tooltipsWin not defined\");\n                    return;\n                }\n                this._defaultTooltipWin = fgui.UIPackage.createObjectFromURL(resourceURL);\n            }\n            this._defaultTooltipWin.text = msg;\n            this.showTooltipsWin(this._defaultTooltipWin);\n        };\n        GRoot.prototype.showTooltipsWin = function (tooltipWin, position) {\n            this.hideTooltips();\n            this._tooltipWin = tooltipWin;\n            var xx = 0;\n            var yy = 0;\n            if (!position) {\n                xx = GRoot.mouseX + 10;\n                yy = GRoot.mouseY + 20;\n            }\n            else {\n                xx = position.x;\n                yy = position.y;\n            }\n            var pt = this.globalToLocal(xx, yy);\n            xx = pt.x;\n            yy = pt.y;\n            if (xx + this._tooltipWin.width > this.width) {\n                xx = xx - this._tooltipWin.width - 1;\n                if (xx < 0)\n                    xx = 10;\n            }\n            if (yy + this._tooltipWin.height > this.height) {\n                yy = yy - this._tooltipWin.height - 1;\n                if (xx - this._tooltipWin.width - 1 > 0)\n                    xx = xx - this._tooltipWin.width - 1;\n                if (yy < 0)\n                    yy = 10;\n            }\n            this._tooltipWin.x = xx;\n            this._tooltipWin.y = yy;\n            this.addChild(this._tooltipWin);\n        };\n        GRoot.prototype.hideTooltips = function () {\n            if (this._tooltipWin) {\n                if (this._tooltipWin.parent)\n                    this.removeChild(this._tooltipWin);\n                this._tooltipWin = null;\n            }\n        };\n        GRoot.prototype.getObjectUnderPoint = function (globalX, globalY) {\n            var ret = this._nativeStage.$hitTest(globalX, globalY);\n            if (ret)\n                return fgui.ToolSet.displayObjectToGObject(ret);\n            else\n                return null;\n        };\n        Object.defineProperty(GRoot.prototype, \"focus\", {\n            get: function () {\n                return null;\n            },\n            set: function (value) {\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GRoot.prototype.setFocus = function (value) {\n        };\n        Object.defineProperty(GRoot.prototype, \"volumeScale\", {\n            get: function () {\n                return this._volumeScale;\n            },\n            set: function (value) {\n                this._volumeScale = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GRoot.prototype.playOneShotSound = function (sound, volumeScale) {\n            volumeScale = volumeScale || 1;\n            var vs = this._volumeScale * volumeScale;\n            var channel = sound.play(0, 1);\n            channel.volume = vs;\n        };\n        GRoot.prototype.adjustModalLayer = function () {\n            var cnt = this.numChildren;\n            if (this._modalWaitPane && this._modalWaitPane.parent)\n                this.setChildIndex(this._modalWaitPane, cnt - 1);\n            for (var i = cnt - 1; i >= 0; i--) {\n                var g = this.getChildAt(i);\n                if ((g instanceof fgui.Window) && g.modal) {\n                    if (this._modalLayer.parent == null)\n                        this.addChildAt(this._modalLayer, i);\n                    else\n                        this.setChildIndexBefore(this._modalLayer, i);\n                    return;\n                }\n            }\n            if (this._modalLayer.parent)\n                this.removeChild(this._modalLayer);\n        };\n        GRoot.prototype.__addedToStage = function (evt) {\n            this.displayObject.removeEventListener(egret.Event.ADDED_TO_STAGE, this.__addedToStage, this);\n            this._nativeStage = this.displayObject.stage;\n            this._nativeStage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__stageMouseDownCapture, this, true);\n            this._nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__stageMouseUpCapture, this, true);\n            this._nativeStage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__stageMouseMoveCapture, this, true);\n            this._modalLayer = new fgui.GGraph();\n            this._modalLayer.setSize(this.width, this.height);\n            this._modalLayer.drawRect(0, 0, 0, fgui.UIConfig.modalLayerColor, fgui.UIConfig.modalLayerAlpha);\n            this._modalLayer.addRelation(this, fgui.RelationType.Size);\n            this.displayObject.stage.addEventListener(egret.Event.RESIZE, this.__winResize, this);\n            this.__winResize(null);\n        };\n        GRoot.prototype.__stageMouseDownCapture = function (evt) {\n            GRoot.mouseX = evt.stageX;\n            GRoot.mouseY = evt.stageY;\n            GRoot.touchDown = true;\n            if (this._tooltipWin)\n                this.hideTooltips();\n            this._justClosedPopups.length = 0;\n            if (this._popupStack.length > 0) {\n                var mc = (evt.target);\n                while (mc != this.displayObject.stage && mc) {\n                    if (mc[\"$owner\"]) {\n                        var pindex = this._popupStack.indexOf(mc[\"$owner\"]);\n                        if (pindex != -1) {\n                            for (var i = this._popupStack.length - 1; i > pindex; i--) {\n                                var popup = this._popupStack.pop();\n                                this.closePopup(popup);\n                                this._justClosedPopups.push(popup);\n                            }\n                            return;\n                        }\n                    }\n                    mc = mc.parent;\n                }\n                var cnt = this._popupStack.length;\n                for (i = cnt - 1; i >= 0; i--) {\n                    popup = this._popupStack[i];\n                    this.closePopup(popup);\n                    this._justClosedPopups.push(popup);\n                }\n                this._popupStack.length = 0;\n            }\n        };\n        GRoot.prototype.__stageMouseMoveCapture = function (evt) {\n            GRoot.mouseX = evt.stageX;\n            GRoot.mouseY = evt.stageY;\n        };\n        GRoot.prototype.__stageMouseUpCapture = function (evt) {\n            GRoot.touchDown = false;\n        };\n        GRoot.prototype.__winResize = function (evt) {\n            this.setSize(this._nativeStage.stageWidth, this._nativeStage.stageHeight);\n        };\n        GRoot.prototype.updateContentScaleLevel = function () {\n            var ss = 1;\n            if (ss >= 3.5)\n                GRoot.contentScaleLevel = 3;\n            else if (ss >= 2.5)\n                GRoot.contentScaleLevel = 2;\n            else if (ss >= 1.5)\n                GRoot.contentScaleLevel = 1;\n            else\n                GRoot.contentScaleLevel = 0;\n        };\n        GRoot.contentScaleLevel = 0;\n        GRoot.contentScaleFactor = 1;\n        return GRoot;\n    }(fgui.GComponent));\n    fgui.GRoot = GRoot;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GScrollBar = (function (_super_1) {\n        __extends(GScrollBar, _super_1);\n        function GScrollBar() {\n            var _this = _super_1.call(this) || this;\n            _this._dragOffset = new egret.Point();\n            _this._scrollPerc = 0;\n            return _this;\n        }\n        GScrollBar.prototype.setScrollPane = function (target, vertical) {\n            this._target = target;\n            this._vertical = vertical;\n        };\n        GScrollBar.prototype.setDisplayPerc = function (value) {\n            if (this._vertical) {\n                if (!this._fixedGripSize)\n                    this._grip.height = Math.floor(value * this._bar.height);\n                this._grip.y = this._bar.y + (this._bar.height - this._grip.height) * this._scrollPerc;\n            }\n            else {\n                if (!this._fixedGripSize)\n                    this._grip.width = Math.floor(value * this._bar.width);\n                this._grip.x = this._bar.x + (this._bar.width - this._grip.width) * this._scrollPerc;\n            }\n            this._grip.visible = value != 0 && value != 1;\n        };\n        GScrollBar.prototype.setScrollPerc = function (val) {\n            this._scrollPerc = val;\n            if (this._vertical)\n                this._grip.y = this._bar.y + (this._bar.height - this._grip.height) * this._scrollPerc;\n            else\n                this._grip.x = this._bar.x + (this._bar.width - this._grip.width) * this._scrollPerc;\n        };\n        Object.defineProperty(GScrollBar.prototype, \"minSize\", {\n            get: function () {\n                if (this._vertical)\n                    return (this._arrowButton1 ? this._arrowButton1.height : 0) + (this._arrowButton2 ? this._arrowButton2.height : 0);\n                else\n                    return (this._arrowButton1 ? this._arrowButton1.width : 0) + (this._arrowButton2 ? this._arrowButton2.width : 0);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GScrollBar.prototype, \"gripDragging\", {\n            get: function () {\n                return this._gripDragging;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GScrollBar.prototype.constructExtension = function (buffer) {\n            buffer.seek(0, 6);\n            this._fixedGripSize = buffer.readBool();\n            this._grip = this.getChild(\"grip\");\n            if (!this._grip) {\n                console.error(\"需要定义grip\");\n                return;\n            }\n            this._bar = this.getChild(\"bar\");\n            if (!this._bar) {\n                console.error(\"需要定义bar\");\n                return;\n            }\n            this._arrowButton1 = this.getChild(\"arrow1\");\n            this._arrowButton2 = this.getChild(\"arrow2\");\n            this._grip.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__gripMouseDown, this);\n            if (this._arrowButton1)\n                this._arrowButton1.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__arrowButton1Click, this);\n            if (this._arrowButton2)\n                this._arrowButton2.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__arrowButton2Click, this);\n            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__barMouseDown, this);\n        };\n        GScrollBar.prototype.__gripMouseDown = function (evt) {\n            this._gripDragging = true;\n            this._target.updateScrollBarVisible();\n            evt.stopPropagation();\n            this.globalToLocal(evt.stageX, evt.stageY, this._dragOffset);\n            this._dragOffset.x -= this._grip.x;\n            this._dragOffset.y -= this._grip.y;\n            this._grip.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__gripMouseMove, this);\n            this._grip.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.__gripMouseUp, this);\n        };\n        GScrollBar.prototype.__gripMouseMove = function (evt) {\n            if (!this.onStage)\n                return;\n            var pt = this.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            if (this._vertical) {\n                var curY = pt.y - this._dragOffset.y;\n                this._target.setPercY((curY - this._bar.y) / (this._bar.height - this._grip.height), false);\n            }\n            else {\n                var curX = pt.x - this._dragOffset.x;\n                this._target.setPercX((curX - this._bar.x) / (this._bar.width - this._grip.width), false);\n            }\n        };\n        GScrollBar.prototype.__gripMouseUp = function (evt) {\n            var st = evt.currentTarget;\n            st.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__gripMouseMove, this);\n            st.removeEventListener(egret.TouchEvent.TOUCH_END, this.__gripMouseUp, this);\n            if (this.onStage)\n                return;\n            this._gripDragging = false;\n            this._target.updateScrollBarVisible();\n        };\n        GScrollBar.prototype.__arrowButton1Click = function (evt) {\n            evt.stopPropagation();\n            if (this._vertical)\n                this._target.scrollUp();\n            else\n                this._target.scrollLeft();\n        };\n        GScrollBar.prototype.__arrowButton2Click = function (evt) {\n            evt.stopPropagation();\n            if (this._vertical)\n                this._target.scrollDown();\n            else\n                this._target.scrollRight();\n        };\n        GScrollBar.prototype.__barMouseDown = function (evt) {\n            var pt = this._grip.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            if (this._vertical) {\n                if (pt.y < 0)\n                    this._target.scrollUp(4);\n                else\n                    this._target.scrollDown(4);\n            }\n            else {\n                if (pt.x < 0)\n                    this._target.scrollLeft(4);\n                else\n                    this._target.scrollRight(4);\n            }\n        };\n        return GScrollBar;\n    }(fgui.GComponent));\n    fgui.GScrollBar = GScrollBar;\n    var s_vec2 = new egret.Point();\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GSlider = (function (_super_1) {\n        __extends(GSlider, _super_1);\n        function GSlider() {\n            var _this = _super_1.call(this) || this;\n            _this._min = 0;\n            _this._max = 0;\n            _this._value = 0;\n            _this._barMaxWidth = 0;\n            _this._barMaxHeight = 0;\n            _this._barMaxWidthDelta = 0;\n            _this._barMaxHeightDelta = 0;\n            _this._clickPercent = 0;\n            _this._barStartX = 0;\n            _this._barStartY = 0;\n            _this.changeOnClick = true;\n            _this.canDrag = true;\n            _this._titleType = fgui.ProgressTitleType.Percent;\n            _this._value = 50;\n            _this._max = 100;\n            _this._clickPos = new egret.Point();\n            return _this;\n        }\n        Object.defineProperty(GSlider.prototype, \"titleType\", {\n            get: function () {\n                return this._titleType;\n            },\n            set: function (value) {\n                this._titleType = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GSlider.prototype, \"wholeNumbers\", {\n            get: function () {\n                return this._wholeNumbers;\n            },\n            set: function (value) {\n                if (this._wholeNumbers != value) {\n                    this._wholeNumbers = value;\n                    this.update();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GSlider.prototype, \"min\", {\n            get: function () {\n                return this._min;\n            },\n            set: function (value) {\n                if (this._min != value) {\n                    this._min = value;\n                    this.update();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GSlider.prototype, \"max\", {\n            get: function () {\n                return this._max;\n            },\n            set: function (value) {\n                if (this._max != value) {\n                    this._max = value;\n                    this.update();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GSlider.prototype, \"value\", {\n            get: function () {\n                return this._value;\n            },\n            set: function (value) {\n                if (this._value != value) {\n                    this._value = value;\n                    this.update();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GSlider.prototype.update = function () {\n            this.updateWithPercent((this._value - this._min) / (this._max - this._min));\n        };\n        GSlider.prototype.updateWithPercent = function (percent, manual) {\n            percent = fgui.ToolSet.clamp01(percent);\n            if (manual) {\n                var newValue = fgui.ToolSet.clamp(this._min + (this._max - this._min) * percent, this._min, this._max);\n                if (this._wholeNumbers) {\n                    newValue = Math.round(newValue);\n                    percent = fgui.ToolSet.clamp01((newValue - this._min) / (this._max - this._min));\n                }\n                if (newValue != this._value) {\n                    this._value = newValue;\n                    this.dispatchEvent(new fgui.StateChangeEvent(fgui.StateChangeEvent.CHANGED));\n                }\n            }\n            if (this._titleObject) {\n                switch (this._titleType) {\n                    case fgui.ProgressTitleType.Percent:\n                        this._titleObject.text = Math.floor(percent * 100) + \"%\";\n                        break;\n                    case fgui.ProgressTitleType.ValueAndMax:\n                        this._titleObject.text = this._value + \"/\" + this._max;\n                        break;\n                    case fgui.ProgressTitleType.Value:\n                        this._titleObject.text = \"\" + this._value;\n                        break;\n                    case fgui.ProgressTitleType.Max:\n                        this._titleObject.text = \"\" + this._max;\n                        break;\n                }\n            }\n            var fullWidth = this.width - this._barMaxWidthDelta;\n            var fullHeight = this.height - this._barMaxHeightDelta;\n            if (!this._reverse) {\n                if (this._barObjectH)\n                    this._barObjectH.width = Math.round(fullWidth * percent);\n                if (this._barObjectV)\n                    this._barObjectV.height = Math.round(fullHeight * percent);\n            }\n            else {\n                if (this._barObjectH) {\n                    this._barObjectH.width = Math.round(fullWidth * percent);\n                    this._barObjectH.x = this._barStartX + (fullWidth - this._barObjectH.width);\n                }\n                if (this._barObjectV) {\n                    this._barObjectV.height = Math.round(fullHeight * percent);\n                    this._barObjectV.y = this._barStartY + (fullHeight - this._barObjectV.height);\n                }\n            }\n        };\n        GSlider.prototype.constructExtension = function (buffer) {\n            buffer.seek(0, 6);\n            this._titleType = buffer.readByte();\n            this._reverse = buffer.readBool();\n            if (buffer.version >= 2) {\n                this._wholeNumbers = buffer.readBool();\n                this.changeOnClick = buffer.readBool();\n            }\n            this._titleObject = (this.getChild(\"title\"));\n            this._barObjectH = this.getChild(\"bar\");\n            this._barObjectV = this.getChild(\"bar_v\");\n            this._gripObject = this.getChild(\"grip\");\n            if (this._barObjectH) {\n                this._barMaxWidth = this._barObjectH.width;\n                this._barMaxWidthDelta = this.width - this._barMaxWidth;\n                this._barStartX = this._barObjectH.x;\n            }\n            if (this._barObjectV) {\n                this._barMaxHeight = this._barObjectV.height;\n                this._barMaxHeightDelta = this.height - this._barMaxHeight;\n                this._barStartY = this._barObjectV.y;\n            }\n            if (this._gripObject) {\n                this._gripObject.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__gripMouseDown, this);\n            }\n            this.displayObject.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__barMouseDown, this);\n        };\n        GSlider.prototype.handleSizeChanged = function () {\n            _super_1.prototype.handleSizeChanged.call(this);\n            if (this._barObjectH)\n                this._barMaxWidth = this.width - this._barMaxWidthDelta;\n            if (this._barObjectV)\n                this._barMaxHeight = this.height - this._barMaxHeightDelta;\n            if (!this._underConstruct)\n                this.update();\n        };\n        GSlider.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            if (!buffer.seek(beginPos, 6)) {\n                this.update();\n                return;\n            }\n            if (buffer.readByte() != this.packageItem.objectType) {\n                this.update();\n                return;\n            }\n            this._value = buffer.readInt();\n            this._max = buffer.readInt();\n            if (buffer.version >= 2)\n                this._min = buffer.readInt();\n            this.update();\n        };\n        GSlider.prototype.__gripMouseDown = function (evt) {\n            this.canDrag = true;\n            evt.stopPropagation();\n            this._clickPos = this.globalToLocal(evt.stageX, evt.stageY);\n            this._clickPercent = fgui.ToolSet.clamp01((this._value - this._min) / (this._max - this._min));\n            this._gripObject.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__gripMouseMove, this);\n            this._gripObject.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.__gripMouseUp, this);\n        };\n        GSlider.prototype.__gripMouseMove = function (evt) {\n            if (!this.canDrag) {\n                return;\n            }\n            var pt = this.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            var deltaX = pt.x - this._clickPos.x;\n            var deltaY = pt.y - this._clickPos.y;\n            if (this._reverse) {\n                deltaX = -deltaX;\n                deltaY = -deltaY;\n            }\n            var percent;\n            if (this._barObjectH)\n                percent = this._clickPercent + deltaX / this._barMaxWidth;\n            else\n                percent = this._clickPercent + deltaY / this._barMaxHeight;\n            this.updateWithPercent(percent, true);\n        };\n        GSlider.prototype.__gripMouseUp = function (evt) {\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__gripMouseMove, this);\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_END, this.__gripMouseUp, this);\n        };\n        GSlider.prototype.__barMouseDown = function (evt) {\n            if (!this.changeOnClick)\n                return;\n            var pt = this._gripObject.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            var percent = fgui.ToolSet.clamp01((this._value - this._min) / (this._max - this._min));\n            var delta;\n            if (this._barObjectH)\n                delta = pt.x / this._barMaxWidth;\n            if (this._barObjectV)\n                delta = pt.y / this._barMaxHeight;\n            if (this._reverse)\n                percent -= delta;\n            else\n                percent += delta;\n            this.updateWithPercent(percent, true);\n        };\n        return GSlider;\n    }(fgui.GComponent));\n    fgui.GSlider = GSlider;\n    var s_vec2 = new egret.Point();\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GTextInput = (function (_super_1) {\n        __extends(GTextInput, _super_1);\n        function GTextInput() {\n            var _this = _super_1.call(this) || this;\n            _this._widthAutoSize = false;\n            _this._heightAutoSize = false;\n            _this.displayObject.touchChildren = true;\n            _this._textField.type = egret.TextFieldType.INPUT;\n            _this._textField.addEventListener(egret.Event.CHANGE, _this.__textChanged, _this);\n            _this._textField.addEventListener(egret.FocusEvent.FOCUS_IN, _this.__focusIn, _this);\n            _this._textField.addEventListener(egret.FocusEvent.FOCUS_OUT, _this.__focusOut, _this);\n            return _this;\n        }\n        GTextInput.prototype.dispose = function () {\n            _super_1.prototype.dispose.call(this);\n        };\n        Object.defineProperty(GTextInput.prototype, \"editable\", {\n            get: function () {\n                return this._textField.type == egret.TextFieldType.INPUT;\n            },\n            set: function (val) {\n                if (val)\n                    this._textField.type = egret.TextFieldType.INPUT;\n                else\n                    this._textField.type = egret.TextFieldType.DYNAMIC;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextInput.prototype, \"maxLength\", {\n            get: function () {\n                return this._textField.maxChars;\n            },\n            set: function (val) {\n                this._textField.maxChars = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextInput.prototype, \"promptText\", {\n            get: function () {\n                return this._promptText;\n            },\n            set: function (val) {\n                this._promptText = val;\n                this.updateTextFieldText();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextInput.prototype, \"restrict\", {\n            get: function () {\n                return this._textField.restrict;\n            },\n            set: function (value) {\n                this._textField.restrict = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextInput.prototype, \"password\", {\n            get: function () {\n                return this._password;\n            },\n            set: function (val) {\n                if (this._password != val) {\n                    this._password = val;\n                    this._textField.displayAsPassword = this._password;\n                    if (val)\n                        this._textField.inputType = egret.TextFieldInputType.PASSWORD;\n                    else\n                        this._textField.inputType = egret.TextFieldInputType.TEXT;\n                    this.render();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTextInput.prototype, \"verticalAlign\", {\n            get: function () {\n                return this._verticalAlign;\n            },\n            set: function (value) {\n                if (this._verticalAlign != value) {\n                    this._verticalAlign = value;\n                    this.updateVertAlign();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTextInput.prototype.updateVertAlign = function () {\n            switch (this._verticalAlign) {\n                case fgui.VertAlignType.Top:\n                    this._textField.verticalAlign = egret.VerticalAlign.TOP;\n                    break;\n                case fgui.VertAlignType.Middle:\n                    this._textField.verticalAlign = egret.VerticalAlign.MIDDLE;\n                    break;\n                case fgui.VertAlignType.Bottom:\n                    this._textField.verticalAlign = egret.VerticalAlign.BOTTOM;\n                    break;\n            }\n        };\n        GTextInput.prototype.updateTextFieldText = function () {\n            if (!this._text && this._promptText) {\n                this._textField.displayAsPassword = false;\n                this._textField.textFlow = (new egret.HtmlTextParser).parser(fgui.UBBParser.inst.parse(this._promptText));\n            }\n            else {\n                this._textField.displayAsPassword = this._password;\n                if (this._ubbEnabled)\n                    this._textField.textFlow = (new egret.HtmlTextParser).parser(fgui.UBBParser.inst.parse(fgui.ToolSet.encodeHTML(this._text)));\n                else\n                    this._textField.text = this._text;\n            }\n        };\n        GTextInput.prototype.handleSizeChanged = function () {\n            if (!this._updatingSize) {\n                this._textField.width = Math.ceil(this.width);\n                this._textField.height = Math.ceil(this.height);\n            }\n        };\n        GTextInput.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 4);\n            var str = buffer.readS();\n            if (str != null)\n                this._promptText = str;\n            str = buffer.readS();\n            if (str != null)\n                this._textField.restrict = str;\n            var iv = buffer.readInt();\n            if (iv != 0)\n                this._textField.maxChars = iv;\n            iv = buffer.readInt();\n            if (iv != 0) {\n            }\n            if (buffer.readBool())\n                this.password = true;\n            this.updateVertAlign();\n        };\n        GTextInput.prototype.setup_afterAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_afterAdd.call(this, buffer, beginPos);\n            if (!this._text && this._promptText) {\n                this._textField.displayAsPassword = false;\n                this._textField.textFlow = (new egret.HtmlTextParser).parser(fgui.UBBParser.inst.parse(fgui.ToolSet.encodeHTML(this._promptText)));\n            }\n        };\n        GTextInput.prototype.__textChanged = function (evt) {\n            this._text = this._textField.text;\n        };\n        GTextInput.prototype.__focusIn = function (evt) {\n            if (!this._text && this._promptText) {\n                this._textField.displayAsPassword = this._password;\n                this._textField.text = \"\";\n            }\n        };\n        GTextInput.prototype.__focusOut = function (evt) {\n            this._text = this._textField.text;\n            if (!this._text && this._promptText) {\n                this._textField.displayAsPassword = false;\n                this._textField.textFlow = (new egret.HtmlTextParser).parser(fgui.UBBParser.inst.parse(fgui.ToolSet.encodeHTML(this._promptText)));\n            }\n        };\n        return GTextInput;\n    }(fgui.GTextField));\n    fgui.GTextInput = GTextInput;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GTree = (function (_super_1) {\n        __extends(GTree, _super_1);\n        function GTree() {\n            var _this = _super_1.call(this) || this;\n            _this._indent = 15;\n            _this._rootNode = new fgui.GTreeNode(true);\n            _this._rootNode._setTree(_this);\n            _this._rootNode.expanded = true;\n            return _this;\n        }\n        Object.defineProperty(GTree.prototype, \"rootNode\", {\n            get: function () {\n                return this._rootNode;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTree.prototype, \"indent\", {\n            get: function () {\n                return this._indent;\n            },\n            set: function (value) {\n                this._indent = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTree.prototype, \"clickToExpand\", {\n            get: function () {\n                return this._clickToExpand;\n            },\n            set: function (value) {\n                this._clickToExpand = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTree.prototype.getSelectedNode = function () {\n            if (this.selectedIndex != -1)\n                return this.getChildAt(this.selectedIndex)._treeNode;\n            else\n                return null;\n        };\n        GTree.prototype.getSelectedNodes = function (result) {\n            if (!result)\n                result = new Array();\n            s_list.length = 0;\n            _super_1.prototype.getSelection.call(this, s_list);\n            var cnt = s_list.length;\n            var ret = new Array();\n            for (var i = 0; i < cnt; i++) {\n                var node = this.getChildAt(s_list[i])._treeNode;\n                ret.push(node);\n            }\n            return ret;\n        };\n        GTree.prototype.selectNode = function (node, scrollItToView) {\n            var parentNode = node.parent;\n            while (parentNode && parentNode != this._rootNode) {\n                parentNode.expanded = true;\n                parentNode = parentNode.parent;\n            }\n            if (!node._cell)\n                return;\n            this.addSelection(this.getChildIndex(node._cell), scrollItToView);\n        };\n        GTree.prototype.unselectNode = function (node) {\n            if (!node._cell)\n                return;\n            this.removeSelection(this.getChildIndex(node._cell));\n        };\n        GTree.prototype.expandAll = function (folderNode) {\n            if (!folderNode)\n                folderNode = this._rootNode;\n            folderNode.expanded = true;\n            var cnt = folderNode.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                var node = folderNode.getChildAt(i);\n                if (node.isFolder)\n                    this.expandAll(node);\n            }\n        };\n        GTree.prototype.collapseAll = function (folderNode) {\n            if (!folderNode)\n                folderNode = this._rootNode;\n            if (folderNode != this._rootNode)\n                folderNode.expanded = false;\n            var cnt = folderNode.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                var node = folderNode.getChildAt(i);\n                if (node.isFolder)\n                    this.collapseAll(node);\n            }\n        };\n        GTree.prototype.createCell = function (node) {\n            var child = this.getFromPool(node._resURL ? node._resURL : this.defaultItem);\n            if (!(child instanceof fgui.GComponent))\n                throw new Error(\"cannot create tree node object.\");\n            child._treeNode = node;\n            node._cell = child;\n            var indentObj = child.getChild(\"indent\");\n            if (indentObj != null)\n                indentObj.width = (node.level - 1) * this._indent;\n            var cc;\n            cc = child.getController(\"expanded\");\n            if (cc) {\n                cc.addEventListener(fgui.StateChangeEvent.CHANGED, this.__expandedStateChanged, this);\n                cc.selectedIndex = node.expanded ? 1 : 0;\n            }\n            cc = child.getController(\"leaf\");\n            if (cc)\n                cc.selectedIndex = node.isFolder ? 0 : 1;\n            if (node.isFolder)\n                child.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__cellMouseDown, this);\n            if (this.treeNodeRender)\n                this.treeNodeRender.call(this.callbackThisObj, node, child);\n        };\n        GTree.prototype._afterInserted = function (node) {\n            if (!node._cell)\n                this.createCell(node);\n            var index = this.getInsertIndexForNode(node);\n            this.addChildAt(node._cell, index);\n            if (this.treeNodeRender)\n                this.treeNodeRender.call(this.callbackThisObj, node, node._cell);\n            if (node.isFolder && node.expanded)\n                this.checkChildren(node, index);\n        };\n        GTree.prototype.getInsertIndexForNode = function (node) {\n            var prevNode = node.getPrevSibling();\n            if (prevNode == null)\n                prevNode = node.parent;\n            var insertIndex = this.getChildIndex(prevNode._cell) + 1;\n            var myLevel = node.level;\n            var cnt = this.numChildren;\n            for (var i = insertIndex; i < cnt; i++) {\n                var testNode = this.getChildAt(i)._treeNode;\n                if (testNode.level <= myLevel)\n                    break;\n                insertIndex++;\n            }\n            return insertIndex;\n        };\n        GTree.prototype._afterRemoved = function (node) {\n            this.removeNode(node);\n        };\n        GTree.prototype._afterExpanded = function (node) {\n            if (node == this._rootNode) {\n                this.checkChildren(this._rootNode, 0);\n                return;\n            }\n            if (this.treeNodeWillExpand != null)\n                this.treeNodeWillExpand.call(this.callbackThisObj, node, true);\n            if (node._cell == null)\n                return;\n            if (this.treeNodeRender)\n                this.treeNodeRender.call(this.callbackThisObj, node, node._cell);\n            var cc = node._cell.getController(\"expanded\");\n            if (cc)\n                cc.selectedIndex = 1;\n            if (node._cell.parent)\n                this.checkChildren(node, this.getChildIndex(node._cell));\n        };\n        GTree.prototype._afterCollapsed = function (node) {\n            if (node == this._rootNode) {\n                this.checkChildren(this._rootNode, 0);\n                return;\n            }\n            if (this.treeNodeWillExpand)\n                this.treeNodeWillExpand.call(this.callbackThisObj, node, false);\n            if (node._cell == null)\n                return;\n            if (this.treeNodeRender)\n                this.treeNodeRender.call(this.callbackThisObj, node, node._cell);\n            var cc = node._cell.getController(\"expanded\");\n            if (cc)\n                cc.selectedIndex = 0;\n            if (node._cell.parent)\n                this.hideFolderNode(node);\n        };\n        GTree.prototype._afterMoved = function (node) {\n            var startIndex = this.getChildIndex(node._cell);\n            var endIndex;\n            if (node.isFolder)\n                endIndex = this.getFolderEndIndex(startIndex, node.level);\n            else\n                endIndex = startIndex + 1;\n            var insertIndex = this.getInsertIndexForNode(node);\n            var i;\n            var cnt = endIndex - startIndex;\n            var obj;\n            if (insertIndex < startIndex) {\n                for (i = 0; i < cnt; i++) {\n                    obj = this.getChildAt(startIndex + i);\n                    this.setChildIndex(obj, insertIndex + i);\n                }\n            }\n            else {\n                for (i = 0; i < cnt; i++) {\n                    obj = this.getChildAt(startIndex);\n                    this.setChildIndex(obj, insertIndex);\n                }\n            }\n        };\n        GTree.prototype.getFolderEndIndex = function (startIndex, level) {\n            var cnt = this.numChildren;\n            for (var i = startIndex + 1; i < cnt; i++) {\n                var node = this.getChildAt(i)._treeNode;\n                if (node.level <= level)\n                    return i;\n            }\n            return cnt;\n        };\n        GTree.prototype.checkChildren = function (folderNode, index) {\n            var cnt = folderNode.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                index++;\n                var node = folderNode.getChildAt(i);\n                if (node._cell == null)\n                    this.createCell(node);\n                if (!node._cell.parent)\n                    this.addChildAt(node._cell, index);\n                if (node.isFolder && node.expanded)\n                    index = this.checkChildren(node, index);\n            }\n            return index;\n        };\n        GTree.prototype.hideFolderNode = function (folderNode) {\n            var cnt = folderNode.numChildren;\n            for (var i = 0; i < cnt; i++) {\n                var node = folderNode.getChildAt(i);\n                if (node._cell)\n                    this.removeChild(node._cell);\n                if (node.isFolder && node.expanded)\n                    this.hideFolderNode(node);\n            }\n        };\n        GTree.prototype.removeNode = function (node) {\n            if (node._cell) {\n                if (node._cell.parent)\n                    this.removeChild(node._cell);\n                this.returnToPool(node._cell);\n                node._cell._treeNode = null;\n                node._cell = null;\n            }\n            if (node.isFolder) {\n                var cnt = node.numChildren;\n                for (var i = 0; i < cnt; i++) {\n                    var node2 = node.getChildAt(i);\n                    this.removeNode(node2);\n                }\n            }\n        };\n        GTree.prototype.__cellMouseDown = function (evt) {\n            var node = evt.currentTarget._treeNode;\n            this._expandedStatusInEvt = node.expanded;\n        };\n        GTree.prototype.__expandedStateChanged = function (evt) {\n            var cc = evt.currentTarget;\n            var node = cc.parent._treeNode;\n            node.expanded = cc.selectedIndex == 1;\n        };\n        GTree.prototype.dispatchItemEvent = function (evt) {\n            if (this._clickToExpand != 0) {\n                var node = evt.itemObject._treeNode;\n                if (node && node.isFolder && this._expandedStatusInEvt == node.expanded) {\n                    if (this._clickToExpand == 2) {\n                    }\n                    else\n                        node.expanded = !node.expanded;\n                }\n            }\n            _super_1.prototype.dispatchItemEvent.call(this, evt);\n        };\n        GTree.prototype.setup_beforeAdd = function (buffer, beginPos) {\n            _super_1.prototype.setup_beforeAdd.call(this, buffer, beginPos);\n            buffer.seek(beginPos, 9);\n            this._indent = buffer.readInt();\n            this._clickToExpand = buffer.readByte();\n        };\n        GTree.prototype.readItems = function (buffer) {\n            var cnt;\n            var i;\n            var nextPos;\n            var str;\n            var isFolder;\n            var lastNode;\n            var level;\n            var prevLevel = 0;\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                str = buffer.readS();\n                if (str == null) {\n                    str = this.defaultItem;\n                    if (!str) {\n                        buffer.position = nextPos;\n                        continue;\n                    }\n                }\n                isFolder = buffer.readBool();\n                level = buffer.readByte();\n                var node = new fgui.GTreeNode(isFolder, str);\n                node.expanded = true;\n                if (i == 0)\n                    this._rootNode.addChild(node);\n                else {\n                    if (level > prevLevel)\n                        lastNode.addChild(node);\n                    else if (level < prevLevel) {\n                        for (var j = level; j <= prevLevel; j++)\n                            lastNode = lastNode.parent;\n                        lastNode.addChild(node);\n                    }\n                    else\n                        lastNode.parent.addChild(node);\n                }\n                lastNode = node;\n                prevLevel = level;\n                this.setupItem(buffer, node.cell);\n                buffer.position = nextPos;\n            }\n        };\n        return GTree;\n    }(fgui.GList));\n    fgui.GTree = GTree;\n    var s_list = new Array();\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GTreeNode = (function () {\n        function GTreeNode(hasChild, resURL) {\n            this._level = 0;\n            this._resURL = resURL;\n            if (hasChild)\n                this._children = new Array();\n        }\n        Object.defineProperty(GTreeNode.prototype, \"expanded\", {\n            get: function () {\n                return this._expanded;\n            },\n            set: function (value) {\n                if (!this._children)\n                    return;\n                if (this._expanded != value) {\n                    this._expanded = value;\n                    if (this._tree) {\n                        if (this._expanded)\n                            this._tree._afterExpanded(this);\n                        else\n                            this._tree._afterCollapsed(this);\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTreeNode.prototype, \"isFolder\", {\n            get: function () {\n                return this._children != null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTreeNode.prototype, \"parent\", {\n            get: function () {\n                return this._parent;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTreeNode.prototype, \"text\", {\n            get: function () {\n                if (this._cell)\n                    return this._cell.text;\n                else\n                    return null;\n            },\n            set: function (value) {\n                if (this._cell)\n                    this._cell.text = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTreeNode.prototype, \"icon\", {\n            get: function () {\n                if (this._cell)\n                    return this._cell.icon;\n                else\n                    return null;\n            },\n            set: function (value) {\n                if (this._cell)\n                    this._cell.icon = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTreeNode.prototype, \"cell\", {\n            get: function () {\n                return this._cell;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTreeNode.prototype, \"level\", {\n            get: function () {\n                return this._level;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTreeNode.prototype._setLevel = function (value) {\n            this._level = value;\n        };\n        GTreeNode.prototype.addChild = function (child) {\n            this.addChildAt(child, this._children.length);\n            return child;\n        };\n        GTreeNode.prototype.addChildAt = function (child, index) {\n            if (!child)\n                throw new Error(\"child is null\");\n            var numChildren = this._children.length;\n            if (index >= 0 && index <= numChildren) {\n                if (child._parent == this) {\n                    this.setChildIndex(child, index);\n                }\n                else {\n                    if (child._parent)\n                        child._parent.removeChild(child);\n                    var cnt = this._children.length;\n                    if (index == cnt)\n                        this._children.push(child);\n                    else\n                        this._children.splice(index, 0, child);\n                    child._parent = this;\n                    child._level = this._level + 1;\n                    child._setTree(this._tree);\n                    if (this._tree && this == this._tree.rootNode || this._cell && this._cell.parent && this._expanded)\n                        this._tree._afterInserted(child);\n                }\n                return child;\n            }\n            else {\n                throw new RangeError(\"Invalid child index\");\n            }\n        };\n        GTreeNode.prototype.removeChild = function (child) {\n            var childIndex = this._children.indexOf(child);\n            if (childIndex != -1) {\n                this.removeChildAt(childIndex);\n            }\n            return child;\n        };\n        GTreeNode.prototype.removeChildAt = function (index) {\n            if (index >= 0 && index < this.numChildren) {\n                var child = this._children[index];\n                this._children.splice(index, 1);\n                child._parent = null;\n                if (this._tree) {\n                    child._setTree(null);\n                    this._tree._afterRemoved(child);\n                }\n                return child;\n            }\n            else {\n                throw \"Invalid child index\";\n            }\n        };\n        GTreeNode.prototype.removeChildren = function (beginIndex, endIndex) {\n            beginIndex = beginIndex || 0;\n            if (endIndex == null)\n                endIndex = -1;\n            if (endIndex < 0 || endIndex >= this.numChildren)\n                endIndex = this.numChildren - 1;\n            for (var i = beginIndex; i <= endIndex; ++i)\n                this.removeChildAt(beginIndex);\n        };\n        GTreeNode.prototype.getChildAt = function (index) {\n            if (index >= 0 && index < this.numChildren)\n                return this._children[index];\n            else\n                throw \"Invalid child index\";\n        };\n        GTreeNode.prototype.getChildIndex = function (child) {\n            return this._children.indexOf(child);\n        };\n        GTreeNode.prototype.getPrevSibling = function () {\n            if (this._parent == null)\n                return null;\n            var i = this._parent._children.indexOf(this);\n            if (i <= 0)\n                return null;\n            return this._parent._children[i - 1];\n        };\n        GTreeNode.prototype.getNextSibling = function () {\n            if (this._parent == null)\n                return null;\n            var i = this._parent._children.indexOf(this);\n            if (i < 0 || i >= this._parent._children.length - 1)\n                return null;\n            return this._parent._children[i + 1];\n        };\n        GTreeNode.prototype.setChildIndex = function (child, index) {\n            var oldIndex = this._children.indexOf(child);\n            if (oldIndex == -1)\n                throw \"Not a child of this container\";\n            var cnt = this._children.length;\n            if (index < 0)\n                index = 0;\n            else if (index > cnt)\n                index = cnt;\n            if (oldIndex == index)\n                return;\n            this._children.splice(oldIndex, 1);\n            this._children.splice(index, 0, child);\n            if (this._tree && this == this._tree.rootNode || this._cell && this._cell.parent && this._expanded)\n                this._tree._afterMoved(child);\n        };\n        GTreeNode.prototype.swapChildren = function (child1, child2) {\n            var index1 = this._children.indexOf(child1);\n            var index2 = this._children.indexOf(child2);\n            if (index1 == -1 || index2 == -1)\n                throw \"Not a child of this container\";\n            this.swapChildrenAt(index1, index2);\n        };\n        GTreeNode.prototype.swapChildrenAt = function (index1, index2) {\n            var child1 = this._children[index1];\n            var child2 = this._children[index2];\n            this.setChildIndex(child1, index2);\n            this.setChildIndex(child2, index1);\n        };\n        Object.defineProperty(GTreeNode.prototype, \"numChildren\", {\n            get: function () {\n                return this._children.length;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTreeNode.prototype.expandToRoot = function () {\n            var p = this;\n            while (p) {\n                p.expanded = true;\n                p = p.parent;\n            }\n        };\n        Object.defineProperty(GTreeNode.prototype, \"tree\", {\n            get: function () {\n                return this._tree;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTreeNode.prototype._setTree = function (value) {\n            this._tree = value;\n            if (this._tree && this._tree.treeNodeWillExpand && this._expanded)\n                this._tree.treeNodeWillExpand(this, true);\n            if (this._children) {\n                var cnt = this._children.length;\n                for (var i = 0; i < cnt; i++) {\n                    var node = this._children[i];\n                    node._level = this._level + 1;\n                    node._setTree(value);\n                }\n            }\n        };\n        return GTreeNode;\n    }());\n    fgui.GTreeNode = GTreeNode;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var Margin = (function () {\n        function Margin() {\n            this.left = 0;\n            this.right = 0;\n            this.top = 0;\n            this.bottom = 0;\n        }\n        Margin.prototype.copy = function (source) {\n            this.top = source.top;\n            this.bottom = source.bottom;\n            this.left = source.left;\n            this.right = source.right;\n        };\n        return Margin;\n    }());\n    fgui.Margin = Margin;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var PixelHitTest = (function () {\n        function PixelHitTest(data, offsetX, offsetY) {\n            this._data = data;\n            this.offsetX = offsetX;\n            this.offsetY = offsetY;\n            this.scaleX = 1;\n            this.scaleY = 1;\n        }\n        PixelHitTest.prototype.contains = function (x, y) {\n            x = Math.floor((x / this.scaleX - this.offsetX) * this._data.scale);\n            y = Math.floor((y / this.scaleY - this.offsetY) * this._data.scale);\n            if (x < 0 || y < 0 || x >= this._data.pixelWidth)\n                return false;\n            var pos = y * this._data.pixelWidth + x;\n            var pos2 = Math.floor(pos / 8);\n            var pos3 = pos % 8;\n            if (pos2 >= 0 && pos2 < this._data.pixels.length)\n                return ((this._data.pixels[pos2] >> pos3) & 0x1) == 1;\n            else\n                return false;\n        };\n        return PixelHitTest;\n    }());\n    fgui.PixelHitTest = PixelHitTest;\n    var PixelHitTestData = (function () {\n        function PixelHitTestData() {\n        }\n        PixelHitTestData.prototype.load = function (ba) {\n            ba.readInt();\n            this.pixelWidth = ba.readInt();\n            this.scale = 1 / ba.readByte();\n            var len = ba.readInt();\n            this.pixels = [];\n            for (var i = 0; i < len; i++) {\n                var j = ba.readByte();\n                if (j < 0)\n                    j += 256;\n                this.pixels[i] = j;\n            }\n        };\n        return PixelHitTestData;\n    }());\n    fgui.PixelHitTestData = PixelHitTestData;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var PackageItem = (function () {\n        function PackageItem() {\n            this.width = 0;\n            this.height = 0;\n        }\n        PackageItem.prototype.load = function () {\n            return this.owner.getItemAsset(this);\n        };\n        PackageItem.prototype.getBranch = function () {\n            if (this.branches && this.owner._branchIndex != -1) {\n                var itemId = this.branches[this.owner._branchIndex];\n                if (itemId)\n                    return this.owner.getItemById(itemId);\n            }\n            return this;\n        };\n        PackageItem.prototype.getHighResolution = function () {\n            if (this.highResolution && fgui.GRoot.contentScaleLevel > 0) {\n                var itemId = this.highResolution[fgui.GRoot.contentScaleLevel - 1];\n                if (itemId)\n                    return this.owner.getItemById(itemId);\n            }\n            return this;\n        };\n        PackageItem.prototype.toString = function () {\n            return this.name;\n        };\n        return PackageItem;\n    }());\n    fgui.PackageItem = PackageItem;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var PopupMenu = (function () {\n        function PopupMenu(resourceURL) {\n            if (!resourceURL) {\n                resourceURL = fgui.UIConfig.popupMenu;\n                if (!resourceURL)\n                    throw \"UIConfig.popupMenu not defined\";\n            }\n            this._contentPane = fgui.UIPackage.createObjectFromURL(resourceURL).asCom;\n            this._contentPane.addEventListener(egret.Event.ADDED_TO_STAGE, this.__addedToStage, this);\n            this._list = (this._contentPane.getChild(\"list\"));\n            this._list.removeChildrenToPool();\n            this._list.addRelation(this._contentPane, fgui.RelationType.Width);\n            this._list.removeRelation(this._contentPane, fgui.RelationType.Height);\n            this._contentPane.addRelation(this._list, fgui.RelationType.Height);\n            this._list.addEventListener(fgui.ItemEvent.CLICK, this.__clickItem, this);\n        }\n        PopupMenu.prototype.dispose = function () {\n            this._contentPane.dispose();\n        };\n        PopupMenu.prototype.addItem = function (caption, callback) {\n            var item = this._list.addItemFromPool().asButton;\n            item.title = caption;\n            item.data = callback;\n            item.grayed = false;\n            var c = item.getController(\"checked\");\n            if (c)\n                c.selectedIndex = 0;\n            return item;\n        };\n        PopupMenu.prototype.addItemAt = function (caption, index, callback) {\n            var item = this._list.getFromPool().asButton;\n            this._list.addChildAt(item, index);\n            item.title = caption;\n            item.data = callback;\n            item.grayed = false;\n            var c = item.getController(\"checked\");\n            if (c)\n                c.selectedIndex = 0;\n            return item;\n        };\n        PopupMenu.prototype.addSeperator = function () {\n            if (fgui.UIConfig.popupMenu_seperator == null)\n                throw \"UIConfig.popupMenu_seperator not defined\";\n            this.list.addItemFromPool(fgui.UIConfig.popupMenu_seperator);\n        };\n        PopupMenu.prototype.getItemName = function (index) {\n            var item = this._list.getChildAt(index);\n            return item.name;\n        };\n        PopupMenu.prototype.setItemText = function (name, caption) {\n            var item = this._list.getChild(name).asButton;\n            item.title = caption;\n        };\n        PopupMenu.prototype.setItemVisible = function (name, visible) {\n            var item = this._list.getChild(name).asButton;\n            if (item.visible != visible) {\n                item.visible = visible;\n                this._list.setBoundsChangedFlag();\n            }\n        };\n        PopupMenu.prototype.setItemGrayed = function (name, grayed) {\n            var item = this._list.getChild(name).asButton;\n            item.grayed = grayed;\n        };\n        PopupMenu.prototype.setItemCheckable = function (name, checkable) {\n            var item = this._list.getChild(name).asButton;\n            var c = item.getController(\"checked\");\n            if (c) {\n                if (checkable) {\n                    if (c.selectedIndex == 0)\n                        c.selectedIndex = 1;\n                }\n                else\n                    c.selectedIndex = 0;\n            }\n        };\n        PopupMenu.prototype.setItemChecked = function (name, checked) {\n            var item = this._list.getChild(name).asButton;\n            var c = item.getController(\"checked\");\n            if (c)\n                c.selectedIndex = checked ? 2 : 1;\n        };\n        PopupMenu.prototype.isItemChecked = function (name) {\n            var item = this._list.getChild(name).asButton;\n            var c = item.getController(\"checked\");\n            if (c)\n                return c.selectedIndex == 2;\n            else\n                return false;\n        };\n        PopupMenu.prototype.removeItem = function (name) {\n            var item = this._list.getChild(name);\n            if (item) {\n                var index = this._list.getChildIndex(item);\n                this._list.removeChildToPoolAt(index);\n                return true;\n            }\n            else\n                return false;\n        };\n        PopupMenu.prototype.clearItems = function () {\n            this._list.removeChildrenToPool();\n        };\n        Object.defineProperty(PopupMenu.prototype, \"itemCount\", {\n            get: function () {\n                return this._list.numChildren;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(PopupMenu.prototype, \"contentPane\", {\n            get: function () {\n                return this._contentPane;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(PopupMenu.prototype, \"list\", {\n            get: function () {\n                return this._list;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        PopupMenu.prototype.show = function (target, dir) {\n            var r = target ? target.root : fgui.GRoot.inst;\n            r.showPopup(this.contentPane, (target instanceof fgui.GRoot) ? null : target, dir);\n        };\n        PopupMenu.prototype.__clickItem = function (evt) {\n            fgui.GTimers.inst.add(100, 1, this.__clickItem2, this, evt);\n        };\n        PopupMenu.prototype.__clickItem2 = function (evt) {\n            var item = evt.itemObject.asButton;\n            if (item == null)\n                return;\n            if (item.grayed) {\n                this._list.selectedIndex = -1;\n                return;\n            }\n            var c = item.getController(\"checked\");\n            if (c && c.selectedIndex != 0) {\n                if (c.selectedIndex == 1)\n                    c.selectedIndex = 2;\n                else\n                    c.selectedIndex = 1;\n            }\n            var r = (this._contentPane.parent);\n            r.hidePopup(this.contentPane);\n            if (item.data != null) {\n                if (item.data.length == 1)\n                    item.data(evt);\n                else\n                    item.data();\n            }\n        };\n        PopupMenu.prototype.__addedToStage = function (evt) {\n            this._list.selectedIndex = -1;\n            this._list.resizeToFit(100000, 10);\n        };\n        return PopupMenu;\n    }());\n    fgui.PopupMenu = PopupMenu;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var RelationItem = (function () {\n        function RelationItem(owner) {\n            this._owner = owner;\n            this._defs = new Array();\n        }\n        Object.defineProperty(RelationItem.prototype, \"owner\", {\n            get: function () {\n                return this._owner;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(RelationItem.prototype, \"target\", {\n            get: function () {\n                return this._target;\n            },\n            set: function (value) {\n                if (this._target != value) {\n                    if (this._target)\n                        this.releaseRefTarget(this._target);\n                    this._target = value;\n                    if (this._target)\n                        this.addRefTarget(this._target);\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        RelationItem.prototype.add = function (relationType, usePercent) {\n            if (relationType == fgui.RelationType.Size) {\n                this.add(fgui.RelationType.Width, usePercent);\n                this.add(fgui.RelationType.Height, usePercent);\n                return;\n            }\n            var length = this._defs.length;\n            for (var i = 0; i < length; i++) {\n                var def = this._defs[i];\n                if (def.type == relationType)\n                    return;\n            }\n            this.internalAdd(relationType, usePercent);\n        };\n        RelationItem.prototype.internalAdd = function (relationType, usePercent) {\n            if (relationType == fgui.RelationType.Size) {\n                this.internalAdd(fgui.RelationType.Width, usePercent);\n                this.internalAdd(fgui.RelationType.Height, usePercent);\n                return;\n            }\n            var info = new RelationDef();\n            info.percent = usePercent;\n            info.type = relationType;\n            info.axis = (relationType <= fgui.RelationType.Right_Right || relationType == fgui.RelationType.Width || relationType >= fgui.RelationType.LeftExt_Left && relationType <= fgui.RelationType.RightExt_Right) ? 0 : 1;\n            this._defs.push(info);\n            if (usePercent || relationType == fgui.RelationType.Left_Center || relationType == fgui.RelationType.Center_Center || relationType == fgui.RelationType.Right_Center\n                || relationType == fgui.RelationType.Top_Middle || relationType == fgui.RelationType.Middle_Middle || relationType == fgui.RelationType.Bottom_Middle)\n                this._owner.pixelSnapping = true;\n        };\n        RelationItem.prototype.remove = function (relationType) {\n            if (relationType === void 0) { relationType = 0; }\n            if (relationType == fgui.RelationType.Size) {\n                this.remove(fgui.RelationType.Width);\n                this.remove(fgui.RelationType.Height);\n                return;\n            }\n            var dc = this._defs.length;\n            for (var k = 0; k < dc; k++) {\n                if (this._defs[k].type == relationType) {\n                    this._defs.splice(k, 1);\n                    break;\n                }\n            }\n        };\n        RelationItem.prototype.copyFrom = function (source) {\n            this.target = source.target;\n            this._defs.length = 0;\n            var length = source._defs.length;\n            for (var i = 0; i < length; i++) {\n                var info = source._defs[i];\n                var info2 = new RelationDef();\n                info2.copyFrom(info);\n                this._defs.push(info2);\n            }\n        };\n        RelationItem.prototype.dispose = function () {\n            if (this._target) {\n                this.releaseRefTarget(this._target);\n                this._target = null;\n            }\n        };\n        Object.defineProperty(RelationItem.prototype, \"isEmpty\", {\n            get: function () {\n                return this._defs.length == 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        RelationItem.prototype.applyOnSelfResized = function (dWidth, dHeight, applyPivot) {\n            var ox = this._owner.x;\n            var oy = this._owner.y;\n            var length = this._defs.length;\n            for (var i = 0; i < length; i++) {\n                var info = this._defs[i];\n                switch (info.type) {\n                    case fgui.RelationType.Center_Center:\n                        this._owner.x -= (0.5 - (applyPivot ? this._owner.pivotX : 0)) * dWidth;\n                        break;\n                    case fgui.RelationType.Right_Center:\n                    case fgui.RelationType.Right_Left:\n                    case fgui.RelationType.Right_Right:\n                        this._owner.x -= (1 - (applyPivot ? this._owner.pivotX : 0)) * dWidth;\n                        break;\n                    case fgui.RelationType.Middle_Middle:\n                        this._owner.y -= (0.5 - (applyPivot ? this._owner.pivotY : 0)) * dHeight;\n                        break;\n                    case fgui.RelationType.Bottom_Middle:\n                    case fgui.RelationType.Bottom_Top:\n                    case fgui.RelationType.Bottom_Bottom:\n                        this._owner.y -= (1 - (applyPivot ? this._owner.pivotY : 0)) * dHeight;\n                        break;\n                }\n            }\n            if (ox != this._owner.x || oy != this._owner.y) {\n                ox = this._owner.x - ox;\n                oy = this._owner.y - oy;\n                this._owner.updateGearFromRelations(1, ox, oy);\n                if (this._owner.parent) {\n                    var len = this._owner.parent._transitions.length;\n                    if (len > 0) {\n                        for (var i = 0; i < len; ++i) {\n                            this._owner.parent._transitions[i].updateFromRelations(this._owner.id, ox, oy);\n                        }\n                    }\n                }\n            }\n        };\n        RelationItem.prototype.applyOnXYChanged = function (info, dx, dy) {\n            var tmp;\n            switch (info.type) {\n                case fgui.RelationType.Left_Left:\n                case fgui.RelationType.Left_Center:\n                case fgui.RelationType.Left_Right:\n                case fgui.RelationType.Center_Center:\n                case fgui.RelationType.Right_Left:\n                case fgui.RelationType.Right_Center:\n                case fgui.RelationType.Right_Right:\n                    this._owner.x += dx;\n                    break;\n                case fgui.RelationType.Top_Top:\n                case fgui.RelationType.Top_Middle:\n                case fgui.RelationType.Top_Bottom:\n                case fgui.RelationType.Middle_Middle:\n                case fgui.RelationType.Bottom_Top:\n                case fgui.RelationType.Bottom_Middle:\n                case fgui.RelationType.Bottom_Bottom:\n                    this._owner.y += dy;\n                    break;\n                case fgui.RelationType.Width:\n                case fgui.RelationType.Height:\n                    break;\n                case fgui.RelationType.LeftExt_Left:\n                case fgui.RelationType.LeftExt_Right:\n                    if (this._owner != this._target.parent) {\n                        tmp = this._owner.xMin;\n                        this._owner.width = this._owner._rawWidth - dx;\n                        this._owner.xMin = tmp + dx;\n                    }\n                    else\n                        this._owner.width = this._owner._rawWidth - dx;\n                    break;\n                case fgui.RelationType.RightExt_Left:\n                case fgui.RelationType.RightExt_Right:\n                    if (this._owner != this._target.parent) {\n                        tmp = this._owner.xMin;\n                        this._owner.width = this._owner._rawWidth + dx;\n                        this._owner.xMin = tmp;\n                    }\n                    else\n                        this._owner.width = this._owner._rawWidth + dx;\n                    break;\n                case fgui.RelationType.TopExt_Top:\n                case fgui.RelationType.TopExt_Bottom:\n                    if (this._owner != this._target.parent) {\n                        tmp = this._owner.yMin;\n                        this._owner.height = this._owner._rawHeight - dy;\n                        this._owner.yMin = tmp + dy;\n                    }\n                    else\n                        this._owner.height = this._owner._rawHeight - dy;\n                    break;\n                case fgui.RelationType.BottomExt_Top:\n                case fgui.RelationType.BottomExt_Bottom:\n                    if (this._owner != this._target.parent) {\n                        tmp = this._owner.yMin;\n                        this._owner.height = this._owner._rawHeight + dy;\n                        this._owner.yMin = tmp;\n                    }\n                    else\n                        this._owner.height = this._owner._rawHeight + dy;\n                    break;\n            }\n        };\n        RelationItem.prototype.applyOnSizeChanged = function (info) {\n            var pos = 0, pivot = 0, delta = 0;\n            var v, tmp;\n            if (info.axis == 0) {\n                if (this._target != this._owner.parent) {\n                    pos = this._target.x;\n                    if (this._target.pivotAsAnchor)\n                        pivot = this._target.pivotX;\n                }\n                if (info.percent) {\n                    if (this._targetWidth != 0)\n                        delta = this._target._width / this._targetWidth;\n                }\n                else\n                    delta = this._target._width - this._targetWidth;\n            }\n            else {\n                if (this._target != this._owner.parent) {\n                    pos = this._target.y;\n                    if (this._target.pivotAsAnchor)\n                        pivot = this._target.pivotY;\n                }\n                if (info.percent) {\n                    if (this._targetHeight != 0)\n                        delta = this._target._height / this._targetHeight;\n                }\n                else\n                    delta = this._target._height - this._targetHeight;\n            }\n            switch (info.type) {\n                case fgui.RelationType.Left_Left:\n                    if (info.percent)\n                        this._owner.xMin = pos + (this._owner.xMin - pos) * delta;\n                    else if (pivot != 0)\n                        this._owner.x += delta * (-pivot);\n                    break;\n                case fgui.RelationType.Left_Center:\n                    if (info.percent)\n                        this._owner.xMin = pos + (this._owner.xMin - pos) * delta;\n                    else\n                        this._owner.x += delta * (0.5 - pivot);\n                    break;\n                case fgui.RelationType.Left_Right:\n                    if (info.percent)\n                        this._owner.xMin = pos + (this._owner.xMin - pos) * delta;\n                    else\n                        this._owner.x += delta * (1 - pivot);\n                    break;\n                case fgui.RelationType.Center_Center:\n                    if (info.percent)\n                        this._owner.xMin = pos + (this._owner.xMin + this._owner._rawWidth * 0.5 - pos) * delta - this._owner._rawWidth * 0.5;\n                    else\n                        this._owner.x += delta * (0.5 - pivot);\n                    break;\n                case fgui.RelationType.Right_Left:\n                    if (info.percent)\n                        this._owner.xMin = pos + (this._owner.xMin + this._owner._rawWidth - pos) * delta - this._owner._rawWidth;\n                    else if (pivot != 0)\n                        this._owner.x += delta * (-pivot);\n                    break;\n                case fgui.RelationType.Right_Center:\n                    if (info.percent)\n                        this._owner.xMin = pos + (this._owner.xMin + this._owner._rawWidth - pos) * delta - this._owner._rawWidth;\n                    else\n                        this._owner.x += delta * (0.5 - pivot);\n                    break;\n                case fgui.RelationType.Right_Right:\n                    if (info.percent)\n                        this._owner.xMin = pos + (this._owner.xMin + this._owner._rawWidth - pos) * delta - this._owner._rawWidth;\n                    else\n                        this._owner.x += delta * (1 - pivot);\n                    break;\n                case fgui.RelationType.Top_Top:\n                    if (info.percent)\n                        this._owner.yMin = pos + (this._owner.yMin - pos) * delta;\n                    else if (pivot != 0)\n                        this._owner.y += delta * (-pivot);\n                    break;\n                case fgui.RelationType.Top_Middle:\n                    if (info.percent)\n                        this._owner.yMin = pos + (this._owner.yMin - pos) * delta;\n                    else\n                        this._owner.y += delta * (0.5 - pivot);\n                    break;\n                case fgui.RelationType.Top_Bottom:\n                    if (info.percent)\n                        this._owner.yMin = pos + (this._owner.yMin - pos) * delta;\n                    else\n                        this._owner.y += delta * (1 - pivot);\n                    break;\n                case fgui.RelationType.Middle_Middle:\n                    if (info.percent)\n                        this._owner.yMin = pos + (this._owner.yMin + this._owner._rawHeight * 0.5 - pos) * delta - this._owner._rawHeight * 0.5;\n                    else\n                        this._owner.y += delta * (0.5 - pivot);\n                    break;\n                case fgui.RelationType.Bottom_Top:\n                    if (info.percent)\n                        this._owner.yMin = pos + (this._owner.yMin + this._owner._rawHeight - pos) * delta - this._owner._rawHeight;\n                    else if (pivot != 0)\n                        this._owner.y += delta * (-pivot);\n                    break;\n                case fgui.RelationType.Bottom_Middle:\n                    if (info.percent)\n                        this._owner.yMin = pos + (this._owner.yMin + this._owner._rawHeight - pos) * delta - this._owner._rawHeight;\n                    else\n                        this._owner.y += delta * (0.5 - pivot);\n                    break;\n                case fgui.RelationType.Bottom_Bottom:\n                    if (info.percent)\n                        this._owner.yMin = pos + (this._owner.yMin + this._owner._rawHeight - pos) * delta - this._owner._rawHeight;\n                    else\n                        this._owner.y += delta * (1 - pivot);\n                    break;\n                case fgui.RelationType.Width:\n                    if (this._owner._underConstruct && this._owner == this._target.parent)\n                        v = this._owner.sourceWidth - this._target.initWidth;\n                    else\n                        v = this._owner._rawWidth - this._targetWidth;\n                    if (info.percent)\n                        v = v * delta;\n                    if (this._target == this._owner.parent) {\n                        if (this._owner.pivotAsAnchor) {\n                            tmp = this._owner.xMin;\n                            this._owner.setSize(this._target._width + v, this._owner._rawHeight, true);\n                            this._owner.xMin = tmp;\n                        }\n                        else\n                            this._owner.setSize(this._target._width + v, this._owner._rawHeight, true);\n                    }\n                    else\n                        this._owner.width = this._target._width + v;\n                    break;\n                case fgui.RelationType.Height:\n                    if (this._owner._underConstruct && this._owner == this._target.parent)\n                        v = this._owner.sourceHeight - this._target.initHeight;\n                    else\n                        v = this._owner._rawHeight - this._targetHeight;\n                    if (info.percent)\n                        v = v * delta;\n                    if (this._target == this._owner.parent) {\n                        if (this._owner.pivotAsAnchor) {\n                            tmp = this._owner.yMin;\n                            this._owner.setSize(this._owner._rawWidth, this._target._height + v, true);\n                            this._owner.yMin = tmp;\n                        }\n                        else\n                            this._owner.setSize(this._owner._rawWidth, this._target._height + v, true);\n                    }\n                    else\n                        this._owner.height = this._target._height + v;\n                    break;\n                case fgui.RelationType.LeftExt_Left:\n                    tmp = this._owner.xMin;\n                    if (info.percent)\n                        v = pos + (tmp - pos) * delta - tmp;\n                    else\n                        v = delta * (-pivot);\n                    this._owner.width = this._owner._rawWidth - v;\n                    this._owner.xMin = tmp + v;\n                    break;\n                case fgui.RelationType.LeftExt_Right:\n                    tmp = this._owner.xMin;\n                    if (info.percent)\n                        v = pos + (tmp - pos) * delta - tmp;\n                    else\n                        v = delta * (1 - pivot);\n                    this._owner.width = this._owner._rawWidth - v;\n                    this._owner.xMin = tmp + v;\n                    break;\n                case fgui.RelationType.RightExt_Left:\n                    tmp = this._owner.xMin;\n                    if (info.percent)\n                        v = pos + (tmp + this._owner._rawWidth - pos) * delta - (tmp + this._owner._rawWidth);\n                    else\n                        v = delta * (-pivot);\n                    this._owner.width = this._owner._rawWidth + v;\n                    this._owner.xMin = tmp;\n                    break;\n                case fgui.RelationType.RightExt_Right:\n                    tmp = this._owner.xMin;\n                    if (info.percent) {\n                        if (this._owner == this._target.parent) {\n                            if (this._owner._underConstruct)\n                                this._owner.width = pos + this._target._width - this._target._width * pivot +\n                                    (this._owner.sourceWidth - pos - this._target.initWidth + this._target.initWidth * pivot) * delta;\n                            else\n                                this._owner.width = pos + (this._owner._rawWidth - pos) * delta;\n                        }\n                        else {\n                            v = pos + (tmp + this._owner._rawWidth - pos) * delta - (tmp + this._owner._rawWidth);\n                            this._owner.width = this._owner._rawWidth + v;\n                            this._owner.xMin = tmp;\n                        }\n                    }\n                    else {\n                        if (this._owner == this._target.parent) {\n                            if (this._owner._underConstruct)\n                                this._owner.width = this._owner.sourceWidth + (this._target._width - this._target.initWidth) * (1 - pivot);\n                            else\n                                this._owner.width = this._owner._rawWidth + delta * (1 - pivot);\n                        }\n                        else {\n                            v = delta * (1 - pivot);\n                            this._owner.width = this._owner._rawWidth + v;\n                            this._owner.xMin = tmp;\n                        }\n                    }\n                    break;\n                case fgui.RelationType.TopExt_Top:\n                    tmp = this._owner.yMin;\n                    if (info.percent)\n                        v = pos + (tmp - pos) * delta - tmp;\n                    else\n                        v = delta * (-pivot);\n                    this._owner.height = this._owner._rawHeight - v;\n                    this._owner.yMin = tmp + v;\n                    break;\n                case fgui.RelationType.TopExt_Bottom:\n                    tmp = this._owner.yMin;\n                    if (info.percent)\n                        v = pos + (tmp - pos) * delta - tmp;\n                    else\n                        v = delta * (1 - pivot);\n                    this._owner.height = this._owner._rawHeight - v;\n                    this._owner.yMin = tmp + v;\n                    break;\n                case fgui.RelationType.BottomExt_Top:\n                    tmp = this._owner.yMin;\n                    if (info.percent)\n                        v = pos + (tmp + this._owner._rawHeight - pos) * delta - (tmp + this._owner._rawHeight);\n                    else\n                        v = delta * (-pivot);\n                    this._owner.height = this._owner._rawHeight + v;\n                    this._owner.yMin = tmp;\n                    break;\n                case fgui.RelationType.BottomExt_Bottom:\n                    tmp = this._owner.yMin;\n                    if (info.percent) {\n                        if (this._owner == this._target.parent) {\n                            if (this._owner._underConstruct)\n                                this._owner.height = pos + this._target._height - this._target._height * pivot +\n                                    (this._owner.sourceHeight - pos - this._target.initHeight + this._target.initHeight * pivot) * delta;\n                            else\n                                this._owner.height = pos + (this._owner._rawHeight - pos) * delta;\n                        }\n                        else {\n                            v = pos + (tmp + this._owner._rawHeight - pos) * delta - (tmp + this._owner._rawHeight);\n                            this._owner.height = this._owner._rawHeight + v;\n                            this._owner.yMin = tmp;\n                        }\n                    }\n                    else {\n                        if (this._owner == this._target.parent) {\n                            if (this._owner._underConstruct)\n                                this._owner.height = this._owner.sourceHeight + (this._target._height - this._target.initHeight) * (1 - pivot);\n                            else\n                                this._owner.height = this._owner._rawHeight + delta * (1 - pivot);\n                        }\n                        else {\n                            v = delta * (1 - pivot);\n                            this._owner.height = this._owner._rawHeight + v;\n                            this._owner.yMin = tmp;\n                        }\n                    }\n                    break;\n            }\n        };\n        RelationItem.prototype.addRefTarget = function (target) {\n            if (target != this._owner.parent)\n                target.addEventListener(fgui.GObject.XY_CHANGED, this.__targetXYChanged, this);\n            target.addEventListener(fgui.GObject.SIZE_CHANGED, this.__targetSizeChanged, this);\n            target.addEventListener(fgui.GObject.SIZE_DELAY_CHANGE, this.__targetSizeWillChange, this);\n            this._targetX = this._target.x;\n            this._targetY = this._target.y;\n            this._targetWidth = this._target._width;\n            this._targetHeight = this._target._height;\n        };\n        RelationItem.prototype.releaseRefTarget = function (target) {\n            target.removeEventListener(fgui.GObject.XY_CHANGED, this.__targetXYChanged, this);\n            target.removeEventListener(fgui.GObject.SIZE_CHANGED, this.__targetSizeChanged, this);\n            target.removeEventListener(fgui.GObject.SIZE_DELAY_CHANGE, this.__targetSizeWillChange, this);\n        };\n        RelationItem.prototype.__targetXYChanged = function (evt) {\n            if (this._owner.relations.handling != null || this._owner.group != null && this._owner.group._updating) {\n                this._targetX = this._target.x;\n                this._targetY = this._target.y;\n                return;\n            }\n            this._owner.relations.handling = this._target;\n            var ox = this._owner.x;\n            var oy = this._owner.y;\n            var dx = this._target.x - this._targetX;\n            var dy = this._target.y - this._targetY;\n            var length = this._defs.length;\n            for (var i = 0; i < length; i++) {\n                var info = this._defs[i];\n                this.applyOnXYChanged(info, dx, dy);\n            }\n            this._targetX = this._target.x;\n            this._targetY = this._target.y;\n            if (ox != this._owner.x || oy != this._owner.y) {\n                ox = this._owner.x - ox;\n                oy = this._owner.y - oy;\n                this._owner.updateGearFromRelations(1, ox, oy);\n                if (this._owner.parent) {\n                    var len = this._owner.parent._transitions.length;\n                    if (len > 0) {\n                        for (var i = 0; i < len; ++i) {\n                            this._owner.parent._transitions[i].updateFromRelations(this._owner.id, ox, oy);\n                        }\n                    }\n                }\n            }\n            this._owner.relations.handling = null;\n        };\n        RelationItem.prototype.__targetSizeChanged = function (evt) {\n            if (this._owner.relations.handling != null)\n                return;\n            this._owner.relations.handling = this._target;\n            var ox = this._owner.x;\n            var oy = this._owner.y;\n            var ow = this._owner._rawWidth;\n            var oh = this._owner._rawHeight;\n            var length = this._defs.length;\n            for (var i = 0; i < length; i++) {\n                var info = this._defs[i];\n                this.applyOnSizeChanged(info);\n            }\n            this._targetWidth = this._target._width;\n            this._targetHeight = this._target._height;\n            if (ox != this._owner.x || oy != this._owner.y) {\n                ox = this._owner.x - ox;\n                oy = this._owner.y - oy;\n                this._owner.updateGearFromRelations(1, ox, oy);\n                if (this._owner.parent) {\n                    var len = this._owner.parent._transitions.length;\n                    if (len > 0) {\n                        for (var i = 0; i < len; ++i) {\n                            this._owner.parent._transitions[i].updateFromRelations(this._owner.id, ox, oy);\n                        }\n                    }\n                }\n            }\n            if (ow != this._owner._rawWidth || oh != this._owner._rawHeight) {\n                ow = this._owner._rawWidth - ow;\n                oh = this._owner._rawHeight - oh;\n                this._owner.updateGearFromRelations(2, ow, oh);\n            }\n            this._owner.relations.handling = null;\n        };\n        RelationItem.prototype.__targetSizeWillChange = function (evt) {\n            this._owner.relations.sizeDirty = true;\n        };\n        return RelationItem;\n    }());\n    fgui.RelationItem = RelationItem;\n    var RelationDef = (function () {\n        function RelationDef() {\n        }\n        RelationDef.prototype.copyFrom = function (source) {\n            this.percent = source.percent;\n            this.type = source.type;\n            this.axis = source.axis;\n        };\n        return RelationDef;\n    }());\n    fgui.RelationDef = RelationDef;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var Relations = (function () {\n        function Relations(owner) {\n            this._owner = owner;\n            this._items = new Array();\n        }\n        Relations.prototype.add = function (target, relationType, usePercent) {\n            var length = this._items.length;\n            for (var i = 0; i < length; i++) {\n                var item = this._items[i];\n                if (item.target == target) {\n                    item.add(relationType, usePercent);\n                    return;\n                }\n            }\n            var newItem = new fgui.RelationItem(this._owner);\n            newItem.target = target;\n            newItem.add(relationType, usePercent);\n            this._items.push(newItem);\n        };\n        Relations.prototype.remove = function (target, relationType) {\n            relationType = relationType || 0;\n            var cnt = this._items.length;\n            var i = 0;\n            while (i < cnt) {\n                var item = this._items[i];\n                if (item.target == target) {\n                    item.remove(relationType);\n                    if (item.isEmpty) {\n                        item.dispose();\n                        this._items.splice(i, 1);\n                        cnt--;\n                    }\n                    else\n                        i++;\n                }\n                else\n                    i++;\n            }\n        };\n        Relations.prototype.contains = function (target) {\n            var length = this._items.length;\n            for (var i = 0; i < length; i++) {\n                var item = this._items[i];\n                if (item.target == target)\n                    return true;\n            }\n            return false;\n        };\n        Relations.prototype.clearFor = function (target) {\n            var cnt = this._items.length;\n            var i = 0;\n            while (i < cnt) {\n                var item = this._items[i];\n                if (item.target == target) {\n                    item.dispose();\n                    this._items.splice(i, 1);\n                    cnt--;\n                }\n                else\n                    i++;\n            }\n        };\n        Relations.prototype.clearAll = function () {\n            var length = this._items.length;\n            for (var i = 0; i < length; i++) {\n                var item = this._items[i];\n                item.dispose();\n            }\n            this._items.length = 0;\n        };\n        Relations.prototype.copyFrom = function (source) {\n            this.clearAll();\n            var arr = source._items;\n            var length = arr.length;\n            for (var i = 0; i < length; i++) {\n                var ri = arr[i];\n                var item = new fgui.RelationItem(this._owner);\n                item.copyFrom(ri);\n                this._items.push(item);\n            }\n        };\n        Relations.prototype.dispose = function () {\n            this.clearAll();\n        };\n        Relations.prototype.onOwnerSizeChanged = function (dWidth, dHeight, applyPivot) {\n            if (this._items.length == 0)\n                return;\n            var length = this._items.length;\n            for (var i = 0; i < length; i++) {\n                var item = this._items[i];\n                item.applyOnSelfResized(dWidth, dHeight, applyPivot);\n            }\n        };\n        Relations.prototype.ensureRelationsSizeCorrect = function () {\n            if (this._items.length == 0)\n                return;\n            this.sizeDirty = false;\n            var length = this._items.length;\n            for (var i = 0; i < length; i++) {\n                var item = this._items[i];\n                item.target.ensureSizeCorrect();\n            }\n        };\n        Object.defineProperty(Relations.prototype, \"empty\", {\n            get: function () {\n                return this._items.length == 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Relations.prototype.setup = function (buffer, parentToChild) {\n            var cnt = buffer.readByte();\n            var target;\n            for (var i = 0; i < cnt; i++) {\n                var targetIndex = buffer.readShort();\n                if (targetIndex == -1)\n                    target = this._owner.parent;\n                else if (parentToChild)\n                    target = this._owner.getChildAt(targetIndex);\n                else\n                    target = this._owner.parent.getChildAt(targetIndex);\n                var newItem = new fgui.RelationItem(this._owner);\n                newItem.target = target;\n                this._items.push(newItem);\n                var cnt2 = buffer.readByte();\n                for (var j = 0; j < cnt2; j++) {\n                    var rt = buffer.readByte();\n                    var usePercent = buffer.readBool();\n                    newItem.internalAdd(rt, usePercent);\n                }\n            }\n        };\n        return Relations;\n    }());\n    fgui.Relations = Relations;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ScrollPane = (function (_super_1) {\n        __extends(ScrollPane, _super_1);\n        function ScrollPane(owner) {\n            var _this = _super_1.call(this) || this;\n            _this._owner = owner;\n            _this._maskContainer = new egret.DisplayObjectContainer();\n            _this._owner._rootContainer.addChild(_this._maskContainer);\n            _this._container = _this._owner._container;\n            _this._container.x = 0;\n            _this._container.y = 0;\n            _this._maskContainer.addChild(_this._container);\n            _this._scrollBarMargin = new fgui.Margin();\n            _this._xPos = 0;\n            _this._yPos = 0;\n            _this._aniFlag = 0;\n            _this._tweening = 0;\n            _this._footerLockedSize = 0;\n            _this._headerLockedSize = 0;\n            _this._viewSize = new egret.Point();\n            _this._contentSize = new egret.Point();\n            _this._pageSize = new egret.Point(1, 1);\n            _this._overlapSize = new egret.Point();\n            _this._tweenTime = new egret.Point();\n            _this._tweenStart = new egret.Point();\n            _this._tweenDuration = new egret.Point();\n            _this._tweenChange = new egret.Point();\n            _this._velocity = new egret.Point();\n            _this._containerPos = new egret.Point();\n            _this._beginTouchPos = new egret.Point();\n            _this._lastTouchPos = new egret.Point();\n            _this._lastTouchGlobalPos = new egret.Point();\n            _this._scrollStep = fgui.UIConfig.defaultScrollStep;\n            _this._decelerationRate = fgui.UIConfig.defaultScrollDecelerationRate;\n            _this._owner.addEventListener(egret.TouchEvent.TOUCH_BEGIN, _this.__touchBegin, _this);\n            return _this;\n        }\n        ScrollPane.prototype.setup = function (buffer) {\n            this._scrollType = buffer.readByte();\n            var scrollBarDisplay = buffer.readByte();\n            var flags = buffer.readInt();\n            if (buffer.readBool()) {\n                this._scrollBarMargin.top = buffer.readInt();\n                this._scrollBarMargin.bottom = buffer.readInt();\n                this._scrollBarMargin.left = buffer.readInt();\n                this._scrollBarMargin.right = buffer.readInt();\n            }\n            var vtScrollBarRes = buffer.readS();\n            var hzScrollBarRes = buffer.readS();\n            var headerRes = buffer.readS();\n            var footerRes = buffer.readS();\n            if ((flags & 1) != 0)\n                this._displayOnLeft = true;\n            if ((flags & 2) != 0)\n                this._snapToItem = true;\n            if ((flags & 4) != 0)\n                this._displayInDemand = true;\n            if ((flags & 8) != 0)\n                this._pageMode = true;\n            if (flags & 16)\n                this._touchEffect = true;\n            else if (flags & 32)\n                this._touchEffect = false;\n            else\n                this._touchEffect = fgui.UIConfig.defaultScrollTouchEffect;\n            if (flags & 64)\n                this._bouncebackEffect = true;\n            else if (flags & 128)\n                this._bouncebackEffect = false;\n            else\n                this._bouncebackEffect = fgui.UIConfig.defaultScrollBounceEffect;\n            if ((flags & 256) != 0)\n                this._inertiaDisabled = true;\n            if ((flags & 512) == 0)\n                this._maskContainer.scrollRect = new egret.Rectangle();\n            if ((flags & 1024) != 0)\n                this._floating = true;\n            if ((flags & 2048) != 0)\n                this._dontClipMargin = true;\n            if (scrollBarDisplay == fgui.ScrollBarDisplayType.Default)\n                scrollBarDisplay = fgui.UIConfig.defaultScrollBarDisplay;\n            if (scrollBarDisplay != fgui.ScrollBarDisplayType.Hidden) {\n                if (this._scrollType == fgui.ScrollType.Both || this._scrollType == fgui.ScrollType.Vertical) {\n                    var res = vtScrollBarRes ? vtScrollBarRes : fgui.UIConfig.verticalScrollBar;\n                    if (res) {\n                        this._vtScrollBar = fgui.UIPackage.createObjectFromURL(res);\n                        if (!this._vtScrollBar)\n                            throw \"cannot create scrollbar from \" + res;\n                        this._vtScrollBar.setScrollPane(this, true);\n                        this._owner._rootContainer.addChild(this._vtScrollBar.displayObject);\n                    }\n                }\n                if (this._scrollType == fgui.ScrollType.Both || this._scrollType == fgui.ScrollType.Horizontal) {\n                    var res = hzScrollBarRes ? hzScrollBarRes : fgui.UIConfig.horizontalScrollBar;\n                    if (res) {\n                        this._hzScrollBar = fgui.UIPackage.createObjectFromURL(res);\n                        if (!this._hzScrollBar)\n                            throw \"cannot create scrollbar from \" + res;\n                        this._hzScrollBar.setScrollPane(this, false);\n                        this._owner._rootContainer.addChild(this._hzScrollBar.displayObject);\n                    }\n                }\n                if (scrollBarDisplay == fgui.ScrollBarDisplayType.Auto)\n                    this._scrollBarDisplayAuto = true;\n                if (this._scrollBarDisplayAuto) {\n                    if (this._vtScrollBar)\n                        this._vtScrollBar.displayObject.visible = false;\n                    if (this._hzScrollBar)\n                        this._hzScrollBar.displayObject.visible = false;\n                }\n            }\n            if (headerRes) {\n                this._header = fgui.UIPackage.createObjectFromURL(headerRes);\n                if (!this._header)\n                    throw \"cannot create scrollPane header from \" + headerRes;\n            }\n            if (footerRes) {\n                this._footer = fgui.UIPackage.createObjectFromURL(footerRes);\n                if (!this._footer)\n                    throw \"cannot create scrollPane footer from \" + footerRes;\n            }\n            if (this._header || this._footer)\n                this._refreshBarAxis = (this._scrollType == fgui.ScrollType.Both || this._scrollType == fgui.ScrollType.Vertical) ? \"y\" : \"x\";\n            this.setSize(this._owner.width, this._owner.height);\n        };\n        ScrollPane.prototype.dispose = function () {\n            if (this._tweening != 0)\n                fgui.GTimers.inst.remove(this.tweenUpdate, this);\n            delete this._pageController;\n            if (this._hzScrollBar)\n                this._hzScrollBar.dispose();\n            if (this._vtScrollBar)\n                this._vtScrollBar.dispose();\n            if (this._header)\n                this._header.dispose();\n            if (this._footer)\n                this._footer.dispose();\n        };\n        Object.defineProperty(ScrollPane.prototype, \"owner\", {\n            get: function () {\n                return this._owner;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"hzScrollBar\", {\n            get: function () {\n                return this._hzScrollBar;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"vtScrollBar\", {\n            get: function () {\n                return this._vtScrollBar;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"header\", {\n            get: function () {\n                return this._header;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"footer\", {\n            get: function () {\n                return this._footer;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"bouncebackEffect\", {\n            get: function () {\n                return this._bouncebackEffect;\n            },\n            set: function (sc) {\n                this._bouncebackEffect = sc;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"touchEffect\", {\n            get: function () {\n                return this._touchEffect;\n            },\n            set: function (sc) {\n                this._touchEffect = sc;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"scrollStep\", {\n            get: function () {\n                return this._scrollStep;\n            },\n            set: function (val) {\n                this._scrollStep = val;\n                if (this._scrollStep == 0)\n                    this._scrollStep = fgui.UIConfig.defaultScrollStep;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"decelerationRate\", {\n            get: function () {\n                return this._decelerationRate;\n            },\n            set: function (val) {\n                this._decelerationRate = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"snapToItem\", {\n            get: function () {\n                return this._snapToItem;\n            },\n            set: function (value) {\n                this._snapToItem = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"isDragged\", {\n            get: function () {\n                return this._dragged;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"percX\", {\n            get: function () {\n                return this._overlapSize.x == 0 ? 0 : this._xPos / this._overlapSize.x;\n            },\n            set: function (value) {\n                this.setPercX(value, false);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ScrollPane.prototype.setPercX = function (value, ani) {\n            if (ani === void 0) { ani = false; }\n            this._owner.ensureBoundsCorrect();\n            this.setPosX(this._overlapSize.x * fgui.ToolSet.clamp01(value), ani);\n        };\n        Object.defineProperty(ScrollPane.prototype, \"percY\", {\n            get: function () {\n                return this._overlapSize.y == 0 ? 0 : this._yPos / this._overlapSize.y;\n            },\n            set: function (value) {\n                this.setPercY(value, false);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ScrollPane.prototype.setPercY = function (value, ani) {\n            if (ani === void 0) { ani = false; }\n            this._owner.ensureBoundsCorrect();\n            this.setPosY(this._overlapSize.y * fgui.ToolSet.clamp01(value), ani);\n        };\n        Object.defineProperty(ScrollPane.prototype, \"posX\", {\n            get: function () {\n                return this._xPos;\n            },\n            set: function (value) {\n                this.setPosX(value, false);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ScrollPane.prototype.setPosX = function (value, ani) {\n            this._owner.ensureBoundsCorrect();\n            if (this._loop == 1)\n                value = this.loopCheckingNewPos(value, \"x\");\n            value = fgui.ToolSet.clamp(value, 0, this._overlapSize.x);\n            if (value != this._xPos) {\n                this._xPos = value;\n                this.posChanged(ani);\n            }\n        };\n        Object.defineProperty(ScrollPane.prototype, \"posY\", {\n            get: function () {\n                return this._yPos;\n            },\n            set: function (value) {\n                this.setPosY(value, false);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ScrollPane.prototype.setPosY = function (value, ani) {\n            this._owner.ensureBoundsCorrect();\n            if (this._loop == 1)\n                value = this.loopCheckingNewPos(value, \"y\");\n            value = fgui.ToolSet.clamp(value, 0, this._overlapSize.y);\n            if (value != this._yPos) {\n                this._yPos = value;\n                this.posChanged(ani);\n            }\n        };\n        Object.defineProperty(ScrollPane.prototype, \"contentWidth\", {\n            get: function () {\n                return this._contentSize.x;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"contentHeight\", {\n            get: function () {\n                return this._contentSize.y;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"viewWidth\", {\n            get: function () {\n                return this._viewSize.x;\n            },\n            set: function (value) {\n                value = value + this._owner.margin.left + this._owner.margin.right;\n                if (this._vtScrollBar && !this._floating)\n                    value += this._vtScrollBar.width;\n                this._owner.width = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"viewHeight\", {\n            get: function () {\n                return this._viewSize.y;\n            },\n            set: function (value) {\n                value = value + this._owner.margin.top + this._owner.margin.bottom;\n                if (this._hzScrollBar && !this._floating)\n                    value += this._hzScrollBar.height;\n                this._owner.height = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"currentPageX\", {\n            get: function () {\n                if (!this._pageMode)\n                    return 0;\n                var page = Math.floor(this._xPos / this._pageSize.x);\n                if (this._xPos - page * this._pageSize.x > this._pageSize.x * 0.5)\n                    page++;\n                return page;\n            },\n            set: function (value) {\n                this.setCurrentPageX(value, false);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"currentPageY\", {\n            get: function () {\n                if (!this._pageMode)\n                    return 0;\n                var page = Math.floor(this._yPos / this._pageSize.y);\n                if (this._yPos - page * this._pageSize.y > this._pageSize.y * 0.5)\n                    page++;\n                return page;\n            },\n            set: function (value) {\n                this.setCurrentPageY(value, false);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ScrollPane.prototype.setCurrentPageX = function (value, ani) {\n            if (!this._pageMode)\n                return;\n            this._owner.ensureBoundsCorrect();\n            if (this._overlapSize.x > 0)\n                this.setPosX(value * this._pageSize.x, ani);\n        };\n        ScrollPane.prototype.setCurrentPageY = function (value, ani) {\n            if (!this._pageMode)\n                return;\n            this._owner.ensureBoundsCorrect();\n            if (this._overlapSize.y > 0)\n                this.setPosY(value * this._pageSize.y, ani);\n        };\n        Object.defineProperty(ScrollPane.prototype, \"isBottomMost\", {\n            get: function () {\n                return this._yPos == this._overlapSize.y || this._overlapSize.y == 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"isRightMost\", {\n            get: function () {\n                return this._xPos == this._overlapSize.x || this._overlapSize.x == 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"pageController\", {\n            get: function () {\n                return this._pageController;\n            },\n            set: function (value) {\n                this._pageController = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"scrollingPosX\", {\n            get: function () {\n                return fgui.ToolSet.clamp(-this._container.x, 0, this._overlapSize.x);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(ScrollPane.prototype, \"scrollingPosY\", {\n            get: function () {\n                return fgui.ToolSet.clamp(-this._container.y, 0, this._overlapSize.y);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        ScrollPane.prototype.scrollTop = function (ani) {\n            this.setPercY(0, ani);\n        };\n        ScrollPane.prototype.scrollBottom = function (ani) {\n            this.setPercY(1, ani);\n        };\n        ScrollPane.prototype.scrollUp = function (ratio, ani) {\n            ratio = ratio || 1;\n            if (this._pageMode)\n                this.setPosY(this._yPos - this._pageSize.y * ratio, ani);\n            else\n                this.setPosY(this._yPos - this._scrollStep * ratio, ani);\n        };\n        ScrollPane.prototype.scrollDown = function (ratio, ani) {\n            ratio = ratio || 1;\n            if (this._pageMode)\n                this.setPosY(this._yPos + this._pageSize.y * ratio, ani);\n            else\n                this.setPosY(this._yPos + this._scrollStep * ratio, ani);\n        };\n        ScrollPane.prototype.scrollLeft = function (ratio, ani) {\n            ratio = ratio || 1;\n            if (this._pageMode)\n                this.setPosX(this._xPos - this._pageSize.x * ratio, ani);\n            else\n                this.setPosX(this._xPos - this._scrollStep * ratio, ani);\n        };\n        ScrollPane.prototype.scrollRight = function (ratio, ani) {\n            ratio = ratio || 1;\n            if (this._pageMode)\n                this.setPosX(this._xPos + this._pageSize.x * ratio, ani);\n            else\n                this.setPosX(this._xPos + this._scrollStep * ratio, ani);\n        };\n        ScrollPane.prototype.scrollToView = function (target, ani, setFirst) {\n            this._owner.ensureBoundsCorrect();\n            if (this._needRefresh)\n                this.refresh();\n            var rect;\n            if (target instanceof fgui.GObject) {\n                if (target.parent != this._owner) {\n                    target.parent.localToGlobalRect(target.x, target.y, target.width, target.height, s_rect);\n                    rect = this._owner.globalToLocalRect(s_rect.x, s_rect.y, s_rect.width, s_rect.height, s_rect);\n                }\n                else {\n                    rect = s_rect;\n                    rect.setTo(target.x, target.y, target.width, target.height);\n                }\n            }\n            else\n                rect = target;\n            if (this._overlapSize.y > 0) {\n                var bottom = this._yPos + this._viewSize.y;\n                if (setFirst || rect.y <= this._yPos || rect.height >= this._viewSize.y) {\n                    if (this._pageMode)\n                        this.setPosY(Math.floor(rect.y / this._pageSize.y) * this._pageSize.y, ani);\n                    else\n                        this.setPosY(rect.y, ani);\n                }\n                else if (rect.y + rect.height > bottom) {\n                    if (this._pageMode)\n                        this.setPosY(Math.floor(rect.y / this._pageSize.y) * this._pageSize.y, ani);\n                    else if (rect.height <= this._viewSize.y / 2)\n                        this.setPosY(rect.y + rect.height * 2 - this._viewSize.y, ani);\n                    else\n                        this.setPosY(rect.y + rect.height - this._viewSize.y, ani);\n                }\n            }\n            if (this._overlapSize.x > 0) {\n                var right = this._xPos + this._viewSize.x;\n                if (setFirst || rect.x <= this._xPos || rect.width >= this._viewSize.x) {\n                    if (this._pageMode)\n                        this.setPosX(Math.floor(rect.x / this._pageSize.x) * this._pageSize.x, ani);\n                    else\n                        this.setPosX(rect.x, ani);\n                }\n                else if (rect.x + rect.width > right) {\n                    if (this._pageMode)\n                        this.setPosX(Math.floor(rect.x / this._pageSize.x) * this._pageSize.x, ani);\n                    else if (rect.width <= this._viewSize.x / 2)\n                        this.setPosX(rect.x + rect.width * 2 - this._viewSize.x, ani);\n                    else\n                        this.setPosX(rect.x + rect.width - this._viewSize.x, ani);\n                }\n            }\n            if (!ani && this._needRefresh)\n                this.refresh();\n        };\n        ScrollPane.prototype.isChildInView = function (obj) {\n            if (this._overlapSize.y > 0) {\n                var dist = obj.y + this._container.y;\n                if (dist < -obj.height || dist > this._viewSize.y)\n                    return false;\n            }\n            if (this._overlapSize.x > 0) {\n                dist = obj.x + this._container.x;\n                if (dist < -obj.width || dist > this._viewSize.x)\n                    return false;\n            }\n            return true;\n        };\n        ScrollPane.prototype.cancelDragging = function () {\n            this._owner.displayObject.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__touchMove, this);\n            this._owner.displayObject.removeEventListener(egret.TouchEvent.TOUCH_END, this.__touchEnd, this);\n            this._owner.displayObject.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.__touchTap, this);\n            if (ScrollPane.draggingPane == this)\n                ScrollPane.draggingPane = null;\n            _gestureFlag = 0;\n            this._dragged = false;\n            this._maskContainer.touchChildren = true;\n        };\n        ScrollPane.prototype.lockHeader = function (size) {\n            if (this._headerLockedSize == size)\n                return;\n            this._headerLockedSize = size;\n            if (!this._refreshEventDispatching && this._container[this._refreshBarAxis] >= 0) {\n                this._tweenStart.setTo(this._container.x, this._container.y);\n                this._tweenChange.setTo(0, 0);\n                this._tweenChange[this._refreshBarAxis] = this._headerLockedSize - this._tweenStart[this._refreshBarAxis];\n                this._tweenDuration.setTo(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT);\n                this.startTween(2);\n            }\n        };\n        ScrollPane.prototype.lockFooter = function (size) {\n            if (this._footerLockedSize == size)\n                return;\n            this._footerLockedSize = size;\n            if (!this._refreshEventDispatching && this._container[this._refreshBarAxis] <= -this._overlapSize[this._refreshBarAxis]) {\n                this._tweenStart.setTo(this._container.x, this._container.y);\n                this._tweenChange.setTo(0, 0);\n                var max = this._overlapSize[this._refreshBarAxis];\n                if (max == 0)\n                    max = Math.max(this._contentSize[this._refreshBarAxis] + this._footerLockedSize - this._viewSize[this._refreshBarAxis], 0);\n                else\n                    max += this._footerLockedSize;\n                this._tweenChange[this._refreshBarAxis] = -max - this._tweenStart[this._refreshBarAxis];\n                this._tweenDuration.setTo(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT);\n                this.startTween(2);\n            }\n        };\n        ScrollPane.prototype.onOwnerSizeChanged = function () {\n            this.setSize(this._owner.width, this._owner.height);\n            this.posChanged(false);\n        };\n        ScrollPane.prototype.handleControllerChanged = function (c) {\n            if (this._pageController == c) {\n                if (this._scrollType == fgui.ScrollType.Horizontal)\n                    this.setCurrentPageX(c.selectedIndex, true);\n                else\n                    this.setCurrentPageY(c.selectedIndex, true);\n            }\n        };\n        ScrollPane.prototype.updatePageController = function () {\n            if (this._pageController && !this._pageController.changing) {\n                var index;\n                if (this._scrollType == fgui.ScrollType.Horizontal)\n                    index = this.currentPageX;\n                else\n                    index = this.currentPageY;\n                if (index < this._pageController.pageCount) {\n                    var c = this._pageController;\n                    this._pageController = null;\n                    c.selectedIndex = index;\n                    this._pageController = c;\n                }\n            }\n        };\n        ScrollPane.prototype.adjustMaskContainer = function () {\n            var mx = 0, my = 0;\n            if (this._dontClipMargin) {\n                if (this._displayOnLeft && this._vtScrollBar && !this._floating)\n                    mx = this._vtScrollBar.width;\n            }\n            else {\n                if (this._displayOnLeft && this._vtScrollBar && !this._floating)\n                    mx = this._owner.margin.left + this._vtScrollBar.width;\n                else\n                    mx = this._owner.margin.left;\n                my = this._owner.margin.top;\n            }\n            this._maskContainer.x = mx;\n            this._maskContainer.y = my;\n            mx = this._owner._alignOffset.x;\n            my = this._owner._alignOffset.y;\n            if (mx != 0 || my != 0 || this._dontClipMargin) {\n                if (!this._alignContainer) {\n                    this._alignContainer = new egret.DisplayObjectContainer();\n                    this._maskContainer.addChild(this._alignContainer);\n                    this._alignContainer.addChild(this._container);\n                }\n            }\n            if (this._alignContainer) {\n                if (this._dontClipMargin) {\n                    mx += this._owner.margin.left;\n                    my += this._owner.margin.top;\n                }\n                this._alignContainer.x = mx;\n                this._alignContainer.y = my;\n            }\n        };\n        ScrollPane.prototype.setSize = function (aWidth, aHeight) {\n            this.adjustMaskContainer();\n            if (this._hzScrollBar) {\n                this._hzScrollBar.y = aHeight - this._hzScrollBar.height;\n                if (this._vtScrollBar && !this._vScrollNone) {\n                    this._hzScrollBar.width = aWidth - this._vtScrollBar.width - this._scrollBarMargin.left - this._scrollBarMargin.right;\n                    if (this._displayOnLeft)\n                        this._hzScrollBar.x = this._scrollBarMargin.left + this._vtScrollBar.width;\n                    else\n                        this._hzScrollBar.x = this._scrollBarMargin.left;\n                }\n                else {\n                    this._hzScrollBar.width = aWidth - this._scrollBarMargin.left - this._scrollBarMargin.right;\n                    this._hzScrollBar.x = this._scrollBarMargin.left;\n                }\n            }\n            if (this._vtScrollBar) {\n                if (!this._displayOnLeft)\n                    this._vtScrollBar.x = aWidth - this._vtScrollBar.width;\n                if (this._hzScrollBar)\n                    this._vtScrollBar.height = aHeight - this._hzScrollBar.height - this._scrollBarMargin.top - this._scrollBarMargin.bottom;\n                else\n                    this._vtScrollBar.height = aHeight - this._scrollBarMargin.top - this._scrollBarMargin.bottom;\n                this._vtScrollBar.y = this._scrollBarMargin.top;\n            }\n            this._viewSize.x = aWidth;\n            this._viewSize.y = aHeight;\n            if (this._hzScrollBar && !this._floating)\n                this._viewSize.y -= this._hzScrollBar.height;\n            if (this._vtScrollBar && !this._floating)\n                this._viewSize.x -= this._vtScrollBar.width;\n            this._viewSize.x -= (this._owner.margin.left + this._owner.margin.right);\n            this._viewSize.y -= (this._owner.margin.top + this._owner.margin.bottom);\n            this._viewSize.x = Math.max(1, this._viewSize.x);\n            this._viewSize.y = Math.max(1, this._viewSize.y);\n            this._pageSize.x = this._viewSize.x;\n            this._pageSize.y = this._viewSize.y;\n            this.handleSizeChanged();\n        };\n        ScrollPane.prototype.setContentSize = function (aWidth, aHeight) {\n            if (this._contentSize.x == aWidth && this._contentSize.y == aHeight)\n                return;\n            this._contentSize.x = aWidth;\n            this._contentSize.y = aHeight;\n            this.handleSizeChanged();\n        };\n        ScrollPane.prototype.changeContentSizeOnScrolling = function (deltaWidth, deltaHeight, deltaPosX, deltaPosY) {\n            var isRightmost = this._xPos == this._overlapSize.x;\n            var isBottom = this._yPos == this._overlapSize.y;\n            this._contentSize.x += deltaWidth;\n            this._contentSize.y += deltaHeight;\n            this.handleSizeChanged();\n            if (this._tweening == 1) {\n                if (deltaWidth != 0 && isRightmost && this._tweenChange.x < 0) {\n                    this._xPos = this._overlapSize.x;\n                    this._tweenChange.x = -this._xPos - this._tweenStart.x;\n                }\n                if (deltaHeight != 0 && isBottom && this._tweenChange.y < 0) {\n                    this._yPos = this._overlapSize.y;\n                    this._tweenChange.y = -this._yPos - this._tweenStart.y;\n                }\n            }\n            else if (this._tweening == 2) {\n                if (deltaPosX != 0) {\n                    this._container.x -= deltaPosX;\n                    this._tweenStart.x -= deltaPosX;\n                    this._xPos = -this._container.x;\n                }\n                if (deltaPosY != 0) {\n                    this._container.y -= deltaPosY;\n                    this._tweenStart.y -= deltaPosY;\n                    this._yPos = -this._container.y;\n                }\n            }\n            else if (this._dragged) {\n                if (deltaPosX != 0) {\n                    this._container.x -= deltaPosX;\n                    this._containerPos.x -= deltaPosX;\n                    this._xPos = -this._container.x;\n                }\n                if (deltaPosY != 0) {\n                    this._container.y -= deltaPosY;\n                    this._containerPos.y -= deltaPosY;\n                    this._yPos = -this._container.y;\n                }\n            }\n            else {\n                if (deltaWidth != 0 && isRightmost) {\n                    this._xPos = this._overlapSize.x;\n                    this._container.x = -this._xPos;\n                }\n                if (deltaHeight != 0 && isBottom) {\n                    this._yPos = this._overlapSize.y;\n                    this._container.y = -this._yPos;\n                }\n            }\n            if (this._pageMode)\n                this.updatePageController();\n        };\n        ScrollPane.prototype.handleSizeChanged = function () {\n            if (this._displayInDemand) {\n                this._vScrollNone = this._contentSize.y <= this._viewSize.y;\n                this._hScrollNone = this._contentSize.x <= this._viewSize.x;\n            }\n            if (this._vtScrollBar) {\n                if (this._contentSize.y == 0)\n                    this._vtScrollBar.setDisplayPerc(0);\n                else\n                    this._vtScrollBar.setDisplayPerc(Math.min(1, this._viewSize.y / this._contentSize.y));\n            }\n            if (this._hzScrollBar) {\n                if (this._contentSize.x == 0)\n                    this._hzScrollBar.setDisplayPerc(0);\n                else\n                    this._hzScrollBar.setDisplayPerc(Math.min(1, this._viewSize.x / this._contentSize.x));\n            }\n            this.updateScrollBarVisible();\n            var rect = this._maskContainer.scrollRect;\n            if (rect) {\n                rect.width = this._viewSize.x;\n                rect.height = this._viewSize.y;\n                if (this._vScrollNone && this._vtScrollBar)\n                    rect.width += this._vtScrollBar.width;\n                if (this._hScrollNone && this._hzScrollBar)\n                    rect.height += this._hzScrollBar.height;\n                if (this._dontClipMargin) {\n                    rect.width += (this._owner.margin.left + this._owner.margin.right);\n                    rect.height += (this._owner.margin.top + this._owner.margin.bottom);\n                }\n                this._maskContainer.scrollRect = rect;\n            }\n            if (this._scrollType == fgui.ScrollType.Horizontal || this._scrollType == fgui.ScrollType.Both)\n                this._overlapSize.x = Math.ceil(Math.max(0, this._contentSize.x - this._viewSize.x));\n            else\n                this._overlapSize.x = 0;\n            if (this._scrollType == fgui.ScrollType.Vertical || this._scrollType == fgui.ScrollType.Both)\n                this._overlapSize.y = Math.ceil(Math.max(0, this._contentSize.y - this._viewSize.y));\n            else\n                this._overlapSize.y = 0;\n            this._xPos = fgui.ToolSet.clamp(this._xPos, 0, this._overlapSize.x);\n            this._yPos = fgui.ToolSet.clamp(this._yPos, 0, this._overlapSize.y);\n            if (this._refreshBarAxis != null) {\n                var max = this._overlapSize[this._refreshBarAxis];\n                if (max == 0)\n                    max = Math.max(this._contentSize[this._refreshBarAxis] + this._footerLockedSize - this._viewSize[this._refreshBarAxis], 0);\n                else\n                    max += this._footerLockedSize;\n                if (this._refreshBarAxis == \"x\") {\n                    this._container.x = fgui.ToolSet.clamp(this._container.x, -max, this._headerLockedSize);\n                    this._container.y = fgui.ToolSet.clamp(this._container.y, -this._overlapSize.y, 0);\n                }\n                else {\n                    this._container.x = fgui.ToolSet.clamp(this._container.x, -this._overlapSize.x, 0);\n                    this._container.y = fgui.ToolSet.clamp(this._container.y, -max, this._headerLockedSize);\n                }\n                if (this._header) {\n                    if (this._refreshBarAxis == \"x\")\n                        this._header.height = this._viewSize.y;\n                    else\n                        this._header.width = this._viewSize.x;\n                }\n                if (this._footer) {\n                    if (this._refreshBarAxis == \"y\")\n                        this._footer.height = this._viewSize.y;\n                    else\n                        this._footer.width = this._viewSize.x;\n                }\n            }\n            else {\n                this._container.x = fgui.ToolSet.clamp(this._container.x, -this._overlapSize.x, 0);\n                this._container.y = fgui.ToolSet.clamp(this._container.y, -this._overlapSize.y, 0);\n            }\n            this.updateScrollBarPos();\n            if (this._pageMode)\n                this.updatePageController();\n        };\n        ScrollPane.prototype.posChanged = function (ani) {\n            if (this._aniFlag == 0)\n                this._aniFlag = ani ? 1 : -1;\n            else if (this._aniFlag == 1 && !ani)\n                this._aniFlag = -1;\n            this._needRefresh = true;\n            fgui.GTimers.inst.callLater(this.refresh, this);\n            if (this._tweening != 0)\n                this.killTween();\n        };\n        ScrollPane.prototype.refresh = function () {\n            this._needRefresh = false;\n            fgui.GTimers.inst.remove(this.refresh, this);\n            if (this._pageMode || this._snapToItem) {\n                sEndPos.setTo(-this._xPos, -this._yPos);\n                this.alignPosition(sEndPos, false);\n                this._xPos = -sEndPos.x;\n                this._yPos = -sEndPos.y;\n            }\n            this.refresh2();\n            this.dispatchEventWith(ScrollPane.SCROLL);\n            if (this._needRefresh) {\n                this._needRefresh = false;\n                fgui.GTimers.inst.remove(this.refresh, this);\n                this.refresh2();\n            }\n            this.updateScrollBarPos();\n            this._aniFlag = 0;\n        };\n        ScrollPane.prototype.refresh2 = function () {\n            if (this._aniFlag == 1 && !this._dragged) {\n                var posX;\n                var posY;\n                if (this._overlapSize.x > 0)\n                    posX = -Math.floor(this._xPos);\n                else {\n                    if (this._container.x != 0)\n                        this._container.x = 0;\n                    posX = 0;\n                }\n                if (this._overlapSize.y > 0)\n                    posY = -Math.floor(this._yPos);\n                else {\n                    if (this._container.y != 0)\n                        this._container.y = 0;\n                    posY = 0;\n                }\n                if (posX != this._container.x || posY != this._container.y) {\n                    this._tweenDuration.setTo(TWEEN_TIME_GO, TWEEN_TIME_GO);\n                    this._tweenStart.setTo(this._container.x, this._container.y);\n                    this._tweenChange.setTo(posX - this._tweenStart.x, posY - this._tweenStart.y);\n                    this.startTween(1);\n                }\n                else if (this._tweening != 0)\n                    this.killTween();\n            }\n            else {\n                if (this._tweening != 0)\n                    this.killTween();\n                this._container.x = Math.floor(-this._xPos);\n                this._container.y = Math.floor(-this._yPos);\n                this.loopCheckingCurrent();\n            }\n            if (this._pageMode)\n                this.updatePageController();\n        };\n        ScrollPane.prototype.__touchBegin = function (evt) {\n            if (!this._touchEffect)\n                return;\n            if (this._tweening != 0) {\n                this.killTween();\n                this._dragged = true;\n            }\n            else\n                this._dragged = false;\n            var pt = this._owner.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            this._containerPos.setTo(this._container.x, this._container.y);\n            this._beginTouchPos.setTo(pt.x, pt.y);\n            this._lastTouchPos.setTo(pt.x, pt.y);\n            this._lastTouchGlobalPos.setTo(evt.stageX, evt.stageY);\n            this._isHoldAreaDone = false;\n            this._velocity.setTo(0, 0);\n            this._velocityScale = 1;\n            this._lastMoveTime = egret.getTimer() / 1000;\n            this._owner.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__touchMove, this);\n            this._owner.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.__touchEnd, this);\n            this._owner.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_TAP, this.__touchTap, this);\n        };\n        ScrollPane.prototype.__touchMove = function (evt) {\n            if (this._owner.displayObject.stage == null)\n                return;\n            if (!this._touchEffect)\n                return;\n            if (ScrollPane.draggingPane && ScrollPane.draggingPane != this || fgui.GObject.draggingObject)\n                return;\n            var pt = this._owner.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            var sensitivity = fgui.UIConfig.touchScrollSensitivity;\n            var diff, diff2;\n            var sv, sh, st;\n            if (this._scrollType == fgui.ScrollType.Vertical) {\n                if (!this._isHoldAreaDone) {\n                    _gestureFlag |= 1;\n                    diff = Math.abs(this._beginTouchPos.y - pt.y);\n                    if (diff < sensitivity)\n                        return;\n                    if ((_gestureFlag & 2) != 0) {\n                        diff2 = Math.abs(this._beginTouchPos.x - pt.x);\n                        if (diff < diff2)\n                            return;\n                    }\n                }\n                sv = true;\n            }\n            else if (this._scrollType == fgui.ScrollType.Horizontal) {\n                if (!this._isHoldAreaDone) {\n                    _gestureFlag |= 2;\n                    diff = Math.abs(this._beginTouchPos.x - pt.x);\n                    if (diff < sensitivity)\n                        return;\n                    if ((_gestureFlag & 1) != 0) {\n                        diff2 = Math.abs(this._beginTouchPos.y - pt.y);\n                        if (diff < diff2)\n                            return;\n                    }\n                }\n                sh = true;\n            }\n            else {\n                _gestureFlag = 3;\n                if (!this._isHoldAreaDone) {\n                    diff = Math.abs(this._beginTouchPos.y - pt.y);\n                    if (diff < sensitivity) {\n                        diff = Math.abs(this._beginTouchPos.x - pt.x);\n                        if (diff < sensitivity)\n                            return;\n                    }\n                }\n                sv = sh = true;\n            }\n            var newPosX = Math.floor(this._containerPos.x + pt.x - this._beginTouchPos.x);\n            var newPosY = Math.floor(this._containerPos.y + pt.y - this._beginTouchPos.y);\n            if (sv) {\n                if (newPosY > 0) {\n                    if (!this._bouncebackEffect)\n                        this._container.y = 0;\n                    else if (this._header && this._header.maxHeight != 0)\n                        this._container.y = Math.floor(Math.min(newPosY * 0.5, this._header.maxHeight));\n                    else\n                        this._container.y = Math.floor(Math.min(newPosY * 0.5, this._viewSize.y * PULL_RATIO));\n                }\n                else if (newPosY < -this._overlapSize.y) {\n                    if (!this._bouncebackEffect)\n                        this._container.y = -this._overlapSize.y;\n                    else if (this._footer && this._footer.maxHeight > 0)\n                        this._container.y = Math.floor(Math.max((newPosY + this._overlapSize.y) * 0.5, -this._footer.maxHeight) - this._overlapSize.y);\n                    else\n                        this._container.y = Math.floor(Math.max((newPosY + this._overlapSize.y) * 0.5, -this._viewSize.y * PULL_RATIO) - this._overlapSize.y);\n                }\n                else\n                    this._container.y = newPosY;\n            }\n            if (sh) {\n                if (newPosX > 0) {\n                    if (!this._bouncebackEffect)\n                        this._container.x = 0;\n                    else if (this._header && this._header.maxWidth != 0)\n                        this._container.x = Math.floor(Math.min(newPosX * 0.5, this._header.maxWidth));\n                    else\n                        this._container.x = Math.floor(Math.min(newPosX * 0.5, this._viewSize.x * PULL_RATIO));\n                }\n                else if (newPosX < 0 - this._overlapSize.x) {\n                    if (!this._bouncebackEffect)\n                        this._container.x = -this._overlapSize.x;\n                    else if (this._footer && this._footer.maxWidth > 0)\n                        this._container.x = Math.floor(Math.max((newPosX + this._overlapSize.x) * 0.5, -this._footer.maxWidth) - this._overlapSize.x);\n                    else\n                        this._container.x = Math.floor(Math.max((newPosX + this._overlapSize.x) * 0.5, -this._viewSize.x * PULL_RATIO) - this._overlapSize.x);\n                }\n                else\n                    this._container.x = newPosX;\n            }\n            var now = egret.getTimer() / 1000;\n            var deltaTime = Math.max(now - this._lastMoveTime, 1 / 60);\n            var deltaPositionX = pt.x - this._lastTouchPos.x;\n            var deltaPositionY = pt.y - this._lastTouchPos.y;\n            if (!sh)\n                deltaPositionX = 0;\n            if (!sv)\n                deltaPositionY = 0;\n            if (deltaTime != 0) {\n                var frameRate = this._owner.displayObject.stage.frameRate;\n                var elapsed = deltaTime * frameRate - 1;\n                if (elapsed > 1) {\n                    var factor = Math.pow(0.833, elapsed);\n                    this._velocity.x = this._velocity.x * factor;\n                    this._velocity.y = this._velocity.y * factor;\n                }\n                this._velocity.x = fgui.ToolSet.lerp(this._velocity.x, deltaPositionX * 60 / frameRate / deltaTime, deltaTime * 10);\n                this._velocity.y = fgui.ToolSet.lerp(this._velocity.y, deltaPositionY * 60 / frameRate / deltaTime, deltaTime * 10);\n            }\n            var deltaGlobalPositionX = this._lastTouchGlobalPos.x - evt.stageX;\n            var deltaGlobalPositionY = this._lastTouchGlobalPos.y - evt.stageY;\n            if (deltaPositionX != 0)\n                this._velocityScale = Math.abs(deltaGlobalPositionX / deltaPositionX);\n            else if (deltaPositionY != 0)\n                this._velocityScale = Math.abs(deltaGlobalPositionY / deltaPositionY);\n            this._lastTouchPos.setTo(pt.x, pt.y);\n            this._lastTouchGlobalPos.setTo(evt.stageX, evt.stageY);\n            this._lastMoveTime = now;\n            if (this._overlapSize.x > 0)\n                this._xPos = fgui.ToolSet.clamp(-this._container.x, 0, this._overlapSize.x);\n            if (this._overlapSize.y > 0)\n                this._yPos = fgui.ToolSet.clamp(-this._container.y, 0, this._overlapSize.y);\n            if (this._loop != 0) {\n                newPosX = this._container.x;\n                newPosY = this._container.y;\n                if (this.loopCheckingCurrent()) {\n                    this._containerPos.x += this._container.x - newPosX;\n                    this._containerPos.y += this._container.y - newPosY;\n                }\n            }\n            ScrollPane.draggingPane = this;\n            this._isHoldAreaDone = true;\n            this._dragged = true;\n            this._maskContainer.touchChildren = false;\n            this.updateScrollBarPos();\n            this.updateScrollBarVisible();\n            if (this._pageMode)\n                this.updatePageController();\n            this.dispatchEventWith(ScrollPane.SCROLL);\n        };\n        ScrollPane.prototype.__touchEnd = function (evt) {\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__touchMove, this);\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_END, this.__touchEnd, this);\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.__touchTap, this);\n            if (ScrollPane.draggingPane == this)\n                ScrollPane.draggingPane = null;\n            _gestureFlag = 0;\n            if (!this._dragged || !this._touchEffect || this._owner.displayObject.stage == null) {\n                this._dragged = false;\n                this._maskContainer.touchChildren = true;\n                return;\n            }\n            this._dragged = false;\n            this._maskContainer.touchChildren = true;\n            this._tweenStart.setTo(this._container.x, this._container.y);\n            sEndPos.setTo(this._tweenStart.x, this._tweenStart.y);\n            var flag = false;\n            if (this._container.x > 0) {\n                sEndPos.x = 0;\n                flag = true;\n            }\n            else if (this._container.x < -this._overlapSize.x) {\n                sEndPos.x = -this._overlapSize.x;\n                flag = true;\n            }\n            if (this._container.y > 0) {\n                sEndPos.y = 0;\n                flag = true;\n            }\n            else if (this._container.y < -this._overlapSize.y) {\n                sEndPos.y = -this._overlapSize.y;\n                flag = true;\n            }\n            if (flag) {\n                this._tweenChange.setTo(sEndPos.x - this._tweenStart.x, sEndPos.y - this._tweenStart.y);\n                if (this._tweenChange.x < -fgui.UIConfig.touchDragSensitivity || this._tweenChange.y < -fgui.UIConfig.touchDragSensitivity) {\n                    this._refreshEventDispatching = true;\n                    this.dispatchEventWith(ScrollPane.PULL_DOWN_RELEASE);\n                    this._refreshEventDispatching = false;\n                }\n                else if (this._tweenChange.x > fgui.UIConfig.touchDragSensitivity || this._tweenChange.y > fgui.UIConfig.touchDragSensitivity) {\n                    this._refreshEventDispatching = true;\n                    this.dispatchEventWith(ScrollPane.PULL_UP_RELEASE);\n                    this._refreshEventDispatching = false;\n                }\n                if (this._headerLockedSize > 0 && sEndPos[this._refreshBarAxis] == 0) {\n                    sEndPos[this._refreshBarAxis] = this._headerLockedSize;\n                    this._tweenChange.x = sEndPos.x - this._tweenStart.x;\n                    this._tweenChange.y = sEndPos.y - this._tweenStart.y;\n                }\n                else if (this._footerLockedSize > 0 && sEndPos[this._refreshBarAxis] == -this._overlapSize[this._refreshBarAxis]) {\n                    var max = this._overlapSize[this._refreshBarAxis];\n                    if (max == 0)\n                        max = Math.max(this._contentSize[this._refreshBarAxis] + this._footerLockedSize - this._viewSize[this._refreshBarAxis], 0);\n                    else\n                        max += this._footerLockedSize;\n                    sEndPos[this._refreshBarAxis] = -max;\n                    this._tweenChange.x = sEndPos.x - this._tweenStart.x;\n                    this._tweenChange.y = sEndPos.y - this._tweenStart.y;\n                }\n                this._tweenDuration.setTo(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT);\n            }\n            else {\n                if (!this._inertiaDisabled) {\n                    var frameRate = this._owner.displayObject.stage.frameRate;\n                    var elapsed = (egret.getTimer() / 1000 - this._lastMoveTime) * frameRate - 1;\n                    if (elapsed > 1) {\n                        var factor = Math.pow(0.833, elapsed);\n                        this._velocity.x = this._velocity.x * factor;\n                        this._velocity.y = this._velocity.y * factor;\n                    }\n                    this.updateTargetAndDuration(this._tweenStart, sEndPos);\n                }\n                else\n                    this._tweenDuration.setTo(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT);\n                sOldChange.setTo(sEndPos.x - this._tweenStart.x, sEndPos.y - this._tweenStart.y);\n                this.loopCheckingTarget(sEndPos);\n                if (this._pageMode || this._snapToItem)\n                    this.alignPosition(sEndPos, true);\n                this._tweenChange.x = sEndPos.x - this._tweenStart.x;\n                this._tweenChange.y = sEndPos.y - this._tweenStart.y;\n                if (this._tweenChange.x == 0 && this._tweenChange.y == 0) {\n                    this.updateScrollBarVisible();\n                    return;\n                }\n                if (this._pageMode || this._snapToItem) {\n                    this.fixDuration(\"x\", sOldChange.x);\n                    this.fixDuration(\"y\", sOldChange.y);\n                }\n            }\n            this.startTween(2);\n        };\n        ScrollPane.prototype.__touchTap = function (evt) {\n            this._dragged = false;\n        };\n        ScrollPane.prototype.updateScrollBarPos = function () {\n            if (this._vtScrollBar)\n                this._vtScrollBar.setScrollPerc(this._overlapSize.y == 0 ? 0 : fgui.ToolSet.clamp(-this._container.y, 0, this._overlapSize.y) / this._overlapSize.y);\n            if (this._hzScrollBar)\n                this._hzScrollBar.setScrollPerc(this._overlapSize.x == 0 ? 0 : fgui.ToolSet.clamp(-this._container.x, 0, this._overlapSize.x) / this._overlapSize.x);\n            this.checkRefreshBar();\n        };\n        ScrollPane.prototype.updateScrollBarVisible = function () {\n            if (this._vtScrollBar) {\n                if (this._viewSize.y <= this._vtScrollBar.minSize || this._vScrollNone)\n                    this._vtScrollBar.displayObject.visible = false;\n                else\n                    this.updateScrollBarVisible2(this._vtScrollBar);\n            }\n            if (this._hzScrollBar) {\n                if (this._viewSize.x <= this._hzScrollBar.minSize || this._hScrollNone)\n                    this._hzScrollBar.displayObject.visible = false;\n                else\n                    this.updateScrollBarVisible2(this._hzScrollBar);\n            }\n        };\n        ScrollPane.prototype.updateScrollBarVisible2 = function (bar) {\n            if (this._scrollBarDisplayAuto)\n                fgui.GTween.kill(bar, false, \"alpha\");\n            if (this._scrollBarDisplayAuto && this._tweening == 0 && !this._dragged && !bar.gripDragging) {\n                if (bar.displayObject.visible)\n                    fgui.GTween.to(1, 0, 0.5).setDelay(0.5).onComplete(this.__barTweenComplete, this).setTarget(bar, \"alpha\");\n            }\n            else {\n                bar.alpha = 1;\n                bar.displayObject.visible = true;\n            }\n        };\n        ScrollPane.prototype.__barTweenComplete = function (tweener) {\n            var bar = (tweener.target);\n            bar.alpha = 1;\n            bar.displayObject.visible = false;\n        };\n        ScrollPane.prototype.getLoopPartSize = function (division, axis) {\n            return (this._contentSize[axis] + (axis == \"x\" ? this._owner.columnGap : this._owner.lineGap)) / division;\n        };\n        ScrollPane.prototype.loopCheckingCurrent = function () {\n            var changed = false;\n            if (this._loop == 1 && this._overlapSize.x > 0) {\n                if (this._xPos < 0.001) {\n                    this._xPos += this.getLoopPartSize(2, \"x\");\n                    changed = true;\n                }\n                else if (this._xPos >= this._overlapSize.x) {\n                    this._xPos -= this.getLoopPartSize(2, \"x\");\n                    changed = true;\n                }\n            }\n            else if (this._loop == 2 && this._overlapSize.y > 0) {\n                if (this._yPos < 0.001) {\n                    this._yPos += this.getLoopPartSize(2, \"y\");\n                    changed = true;\n                }\n                else if (this._yPos >= this._overlapSize.y) {\n                    this._yPos -= this.getLoopPartSize(2, \"y\");\n                    changed = true;\n                }\n            }\n            if (changed) {\n                this._container.x = Math.floor(-this._xPos);\n                this._container.y = Math.floor(-this._yPos);\n            }\n            return changed;\n        };\n        ScrollPane.prototype.loopCheckingTarget = function (endPos) {\n            if (this._loop == 1)\n                this.loopCheckingTarget2(endPos, \"x\");\n            if (this._loop == 2)\n                this.loopCheckingTarget2(endPos, \"y\");\n        };\n        ScrollPane.prototype.loopCheckingTarget2 = function (endPos, axis) {\n            var halfSize;\n            var tmp;\n            if (endPos[axis] > 0) {\n                halfSize = this.getLoopPartSize(2, axis);\n                tmp = this._tweenStart[axis] - halfSize;\n                if (tmp <= 0 && tmp >= -this._overlapSize[axis]) {\n                    endPos[axis] -= halfSize;\n                    this._tweenStart[axis] = tmp;\n                }\n            }\n            else if (endPos[axis] < -this._overlapSize[axis]) {\n                halfSize = this.getLoopPartSize(2, axis);\n                tmp = this._tweenStart[axis] + halfSize;\n                if (tmp <= 0 && tmp >= -this._overlapSize[axis]) {\n                    endPos[axis] += halfSize;\n                    this._tweenStart[axis] = tmp;\n                }\n            }\n        };\n        ScrollPane.prototype.loopCheckingNewPos = function (value, axis) {\n            if (this._overlapSize[axis] == 0)\n                return value;\n            var pos = axis == \"x\" ? this._xPos : this._yPos;\n            var changed = false;\n            var v;\n            if (value < 0.001) {\n                value += this.getLoopPartSize(2, axis);\n                if (value > pos) {\n                    v = this.getLoopPartSize(6, axis);\n                    v = Math.ceil((value - pos) / v) * v;\n                    pos = fgui.ToolSet.clamp(pos + v, 0, this._overlapSize[axis]);\n                    changed = true;\n                }\n            }\n            else if (value >= this._overlapSize[axis]) {\n                value -= this.getLoopPartSize(2, axis);\n                if (value < pos) {\n                    v = this.getLoopPartSize(6, axis);\n                    v = Math.ceil((pos - value) / v) * v;\n                    pos = fgui.ToolSet.clamp(pos - v, 0, this._overlapSize[axis]);\n                    changed = true;\n                }\n            }\n            if (changed) {\n                if (axis == \"x\")\n                    this._container.x = -Math.floor(pos);\n                else\n                    this._container.y = -Math.floor(pos);\n            }\n            return value;\n        };\n        ScrollPane.prototype.alignPosition = function (pos, inertialScrolling) {\n            if (this._pageMode) {\n                pos.x = this.alignByPage(pos.x, \"x\", inertialScrolling);\n                pos.y = this.alignByPage(pos.y, \"y\", inertialScrolling);\n            }\n            else if (this._snapToItem) {\n                var pt = this._owner.getSnappingPosition(-pos.x, -pos.y, s_vec2);\n                if (pos.x < 0 && pos.x > -this._overlapSize.x)\n                    pos.x = -pt.x;\n                if (pos.y < 0 && pos.y > -this._overlapSize.y)\n                    pos.y = -pt.y;\n            }\n        };\n        ScrollPane.prototype.alignByPage = function (pos, axis, inertialScrolling) {\n            var page;\n            if (pos > 0)\n                page = 0;\n            else if (pos < -this._overlapSize[axis])\n                page = Math.ceil(this._contentSize[axis] / this._pageSize[axis]) - 1;\n            else {\n                page = Math.floor(-pos / this._pageSize[axis]);\n                var change = inertialScrolling ? (pos - this._containerPos[axis]) : (pos - this._container[axis]);\n                var testPageSize = Math.min(this._pageSize[axis], this._contentSize[axis] - (page + 1) * this._pageSize[axis]);\n                var delta = -pos - page * this._pageSize[axis];\n                if (Math.abs(change) > this._pageSize[axis]) {\n                    if (delta > testPageSize * 0.5)\n                        page++;\n                }\n                else {\n                    if (delta > testPageSize * (change < 0 ? 0.3 : 0.7))\n                        page++;\n                }\n                pos = -page * this._pageSize[axis];\n                if (pos < -this._overlapSize[axis])\n                    pos = -this._overlapSize[axis];\n            }\n            if (inertialScrolling) {\n                var oldPos = this._tweenStart[axis];\n                var oldPage;\n                if (oldPos > 0)\n                    oldPage = 0;\n                else if (oldPos < -this._overlapSize[axis])\n                    oldPage = Math.ceil(this._contentSize[axis] / this._pageSize[axis]) - 1;\n                else\n                    oldPage = Math.floor(-oldPos / this._pageSize[axis]);\n                var startPage = Math.floor(-this._containerPos[axis] / this._pageSize[axis]);\n                if (Math.abs(page - startPage) > 1 && Math.abs(oldPage - startPage) <= 1) {\n                    if (page > startPage)\n                        page = startPage + 1;\n                    else\n                        page = startPage - 1;\n                    pos = -page * this._pageSize[axis];\n                }\n            }\n            return pos;\n        };\n        ScrollPane.prototype.updateTargetAndDuration = function (orignPos, resultPos) {\n            resultPos.x = this.updateTargetAndDuration2(orignPos.x, \"x\");\n            resultPos.y = this.updateTargetAndDuration2(orignPos.y, \"y\");\n        };\n        ScrollPane.prototype.updateTargetAndDuration2 = function (pos, axis) {\n            var v = this._velocity[axis];\n            var duration = 0;\n            if (pos > 0)\n                pos = 0;\n            else if (pos < -this._overlapSize[axis])\n                pos = -this._overlapSize[axis];\n            else {\n                var isMobile = egret.Capabilities.isMobile;\n                var v2 = Math.abs(v) * this._velocityScale;\n                if (isMobile)\n                    v2 *= 1136 / Math.max(this._owner.displayObject.stage.stageWidth, this._owner.displayObject.stage.stageHeight);\n                var ratio = 0;\n                if (this._pageMode || !isMobile) {\n                    if (v2 > 500)\n                        ratio = Math.pow((v2 - 500) / 500, 2);\n                }\n                else {\n                    if (v2 > 1000)\n                        ratio = Math.pow((v2 - 1000) / 1000, 2);\n                }\n                if (ratio != 0) {\n                    if (ratio > 1)\n                        ratio = 1;\n                    v2 *= ratio;\n                    v *= ratio;\n                    this._velocity[axis] = v;\n                    duration = Math.log(60 / v2) / Math.log(this._decelerationRate) / 60;\n                    var change = Math.floor(v * duration * 0.4);\n                    pos += change;\n                }\n            }\n            if (duration < TWEEN_TIME_DEFAULT)\n                duration = TWEEN_TIME_DEFAULT;\n            this._tweenDuration[axis] = duration;\n            return pos;\n        };\n        ScrollPane.prototype.fixDuration = function (axis, oldChange) {\n            if (this._tweenChange[axis] == 0 || Math.abs(this._tweenChange[axis]) >= Math.abs(oldChange))\n                return;\n            var newDuration = Math.abs(this._tweenChange[axis] / oldChange) * this._tweenDuration[axis];\n            if (newDuration < TWEEN_TIME_DEFAULT)\n                newDuration = TWEEN_TIME_DEFAULT;\n            this._tweenDuration[axis] = newDuration;\n        };\n        ScrollPane.prototype.startTween = function (type) {\n            this._tweenTime.setTo(0, 0);\n            this._tweening = type;\n            fgui.GTimers.inst.add(1, 0, this.tweenUpdate, this);\n            this.updateScrollBarVisible();\n        };\n        ScrollPane.prototype.killTween = function () {\n            if (this._tweening == 1) {\n                this._container.x = this._tweenStart.x + this._tweenChange.x;\n                this._container.y = this._tweenStart.y + this._tweenChange.y;\n                this.dispatchEventWith(ScrollPane.SCROLL);\n            }\n            this._tweening = 0;\n            fgui.GTimers.inst.remove(this.tweenUpdate, this);\n            this.updateScrollBarVisible();\n            this.dispatchEventWith(ScrollPane.SCROLL_END);\n        };\n        ScrollPane.prototype.checkRefreshBar = function () {\n            if (this._header == null && this._footer == null)\n                return;\n            var pos = this._container[this._refreshBarAxis];\n            if (this._header) {\n                if (pos > 0) {\n                    if (this._header.displayObject.parent == null)\n                        this._maskContainer.addChildAt(this._header.displayObject, 0);\n                    var pt = s_vec2;\n                    pt.setTo(this._header.width, this._header.height);\n                    pt[this._refreshBarAxis] = pos;\n                    this._header.setSize(pt.x, pt.y);\n                }\n                else {\n                    if (this._header.displayObject.parent)\n                        this._maskContainer.removeChild(this._header.displayObject);\n                }\n            }\n            if (this._footer) {\n                var max = this._overlapSize[this._refreshBarAxis];\n                if (pos < -max || max == 0 && this._footerLockedSize > 0) {\n                    if (this._footer.displayObject.parent == null)\n                        this._maskContainer.addChildAt(this._footer.displayObject, 0);\n                    pt = s_vec2;\n                    pt.setTo(this._footer.x, this._footer.y);\n                    if (max > 0)\n                        pt[this._refreshBarAxis] = pos + this._contentSize[this._refreshBarAxis];\n                    else\n                        pt[this._refreshBarAxis] = Math.max(Math.min(pos + this._viewSize[this._refreshBarAxis], this._viewSize[this._refreshBarAxis] - this._footerLockedSize), this._viewSize[this._refreshBarAxis] - this._contentSize[this._refreshBarAxis]);\n                    this._footer.setXY(pt.x, pt.y);\n                    pt.setTo(this._footer.width, this._footer.height);\n                    if (max > 0)\n                        pt[this._refreshBarAxis] = -max - pos;\n                    else\n                        pt[this._refreshBarAxis] = this._viewSize[this._refreshBarAxis] - this._footer[this._refreshBarAxis];\n                    this._footer.setSize(pt.x, pt.y);\n                }\n                else {\n                    if (this._footer.displayObject.parent)\n                        this._maskContainer.removeChild(this._footer.displayObject);\n                }\n            }\n        };\n        ScrollPane.prototype.tweenUpdate = function (timestamp) {\n            var nx = this.runTween(\"x\");\n            var ny = this.runTween(\"y\");\n            this._container.x = nx;\n            this._container.y = ny;\n            if (this._tweening == 2) {\n                if (this._overlapSize.x > 0)\n                    this._xPos = fgui.ToolSet.clamp(-nx, 0, this._overlapSize.x);\n                if (this._overlapSize.y > 0)\n                    this._yPos = fgui.ToolSet.clamp(-ny, 0, this._overlapSize.y);\n                if (this._pageMode)\n                    this.updatePageController();\n            }\n            if (this._tweenChange.x == 0 && this._tweenChange.y == 0) {\n                this._tweening = 0;\n                fgui.GTimers.inst.remove(this.tweenUpdate, this);\n                this.loopCheckingCurrent();\n                this.updateScrollBarPos();\n                this.updateScrollBarVisible();\n                this.dispatchEventWith(ScrollPane.SCROLL);\n                this.dispatchEventWith(ScrollPane.SCROLL_END);\n            }\n            else {\n                this.updateScrollBarPos();\n                this.dispatchEventWith(ScrollPane.SCROLL);\n            }\n            return true;\n        };\n        ScrollPane.prototype.runTween = function (axis) {\n            var newValue;\n            if (this._tweenChange[axis] != 0) {\n                this._tweenTime[axis] += fgui.GTimers.deltaTime / 1000;\n                if (this._tweenTime[axis] >= this._tweenDuration[axis]) {\n                    newValue = this._tweenStart[axis] + this._tweenChange[axis];\n                    this._tweenChange[axis] = 0;\n                }\n                else {\n                    var ratio = easeFunc(this._tweenTime[axis], this._tweenDuration[axis]);\n                    newValue = this._tweenStart[axis] + Math.floor(this._tweenChange[axis] * ratio);\n                }\n                var threshold1 = 0;\n                var threshold2 = -this._overlapSize[axis];\n                if (this._headerLockedSize > 0 && this._refreshBarAxis == axis)\n                    threshold1 = this._headerLockedSize;\n                if (this._footerLockedSize > 0 && this._refreshBarAxis == axis) {\n                    var max = this._overlapSize[this._refreshBarAxis];\n                    if (max == 0)\n                        max = Math.max(this._contentSize[this._refreshBarAxis] + this._footerLockedSize - this._viewSize[this._refreshBarAxis], 0);\n                    else\n                        max += this._footerLockedSize;\n                    threshold2 = -max;\n                }\n                if (this._tweening == 2 && this._bouncebackEffect) {\n                    if (newValue > 20 + threshold1 && this._tweenChange[axis] > 0\n                        || newValue > threshold1 && this._tweenChange[axis] == 0) {\n                        this._tweenTime[axis] = 0;\n                        this._tweenDuration[axis] = TWEEN_TIME_DEFAULT;\n                        this._tweenChange[axis] = -newValue + threshold1;\n                        this._tweenStart[axis] = newValue;\n                    }\n                    else if (newValue < threshold2 - 20 && this._tweenChange[axis] < 0\n                        || newValue < threshold2 && this._tweenChange[axis] == 0) {\n                        this._tweenTime[axis] = 0;\n                        this._tweenDuration[axis] = TWEEN_TIME_DEFAULT;\n                        this._tweenChange[axis] = threshold2 - newValue;\n                        this._tweenStart[axis] = newValue;\n                    }\n                }\n                else {\n                    if (newValue > threshold1) {\n                        newValue = threshold1;\n                        this._tweenChange[axis] = 0;\n                    }\n                    else if (newValue < threshold2) {\n                        newValue = threshold2;\n                        this._tweenChange[axis] = 0;\n                    }\n                }\n            }\n            else\n                newValue = this._container[axis];\n            return newValue;\n        };\n        ScrollPane.SCROLL = \"__scroll\";\n        ScrollPane.SCROLL_END = \"__scrollEnd\";\n        ScrollPane.PULL_DOWN_RELEASE = \"pullDownRelease\";\n        ScrollPane.PULL_UP_RELEASE = \"pullUpRelease\";\n        return ScrollPane;\n    }(egret.EventDispatcher));\n    fgui.ScrollPane = ScrollPane;\n    var _gestureFlag = 0;\n    var TWEEN_TIME_GO = 0.5;\n    var TWEEN_TIME_DEFAULT = 0.3;\n    var PULL_RATIO = 0.5;\n    var s_vec2 = new egret.Point();\n    var s_rect = new egret.Rectangle();\n    var sEndPos = new egret.Point();\n    var sOldChange = new egret.Point();\n    function easeFunc(t, d) {\n        return (t = t / d - 1) * t * t + 1;\n    }\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var Transition = (function () {\n        function Transition(owner) {\n            this._ownerBaseX = 0;\n            this._ownerBaseY = 0;\n            this._totalTimes = 0;\n            this._totalTasks = 0;\n            this._options = 0;\n            this._totalDuration = 0;\n            this._autoPlayTimes = 1;\n            this._autoPlayDelay = 0;\n            this._timeScale = 1;\n            this._startTime = 0;\n            this._endTime = 0;\n            this._owner = owner;\n            this._items = new Array();\n        }\n        Transition.prototype.play = function (onComplete, onCompleteObj, onCompleteParam, times, delay, startTime, endTime) {\n            this._play(onComplete, onCompleteObj, onCompleteParam, times, delay, startTime, endTime, false);\n        };\n        Transition.prototype.playReverse = function (onComplete, onCompleteObj, onCompleteParam, times, delay) {\n            this._play(onComplete, onCompleteObj, onCompleteParam, times, delay, 0, -1, true);\n        };\n        Transition.prototype.changePlayTimes = function (value) {\n            this._totalTimes = value;\n        };\n        Transition.prototype.setAutoPlay = function (value, times, delay) {\n            if (times == undefined)\n                times = -1;\n            if (delay == undefined)\n                delay = 0;\n            if (this._autoPlay != value) {\n                this._autoPlay = value;\n                this._autoPlayTimes = times;\n                this._autoPlayDelay = delay;\n                if (this._autoPlay) {\n                    if (this._owner.onStage)\n                        this.play(null, null, this._autoPlayTimes, this._autoPlayDelay);\n                }\n                else {\n                    if (!this._owner.onStage)\n                        this.stop(false, true);\n                }\n            }\n        };\n        Transition.prototype._play = function (onComplete, onCompleteCaller, onCompleteParam, times, delay, startTime, endTime, reversed) {\n            if (times == undefined)\n                times = 1;\n            if (delay == undefined)\n                delay = 0;\n            if (startTime == undefined)\n                startTime = 0;\n            if (endTime == undefined)\n                endTime = -1;\n            this.stop(true, true);\n            this._totalTimes = times;\n            this._reversed = reversed;\n            this._startTime = startTime;\n            this._endTime = endTime;\n            this._playing = true;\n            this._paused = false;\n            this._onComplete = onComplete;\n            this._onCompleteParam = onCompleteParam;\n            this._onCompleteCaller = onCompleteCaller;\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (!item.target) {\n                    if (item.targetId)\n                        item.target = this._owner.getChildById(item.targetId);\n                    else\n                        item.target = this._owner;\n                }\n                else if (item.target != this._owner && item.target.parent != this._owner)\n                    item.target = null;\n                if (item.target && item.type == ActionType.Transition) {\n                    var trans = item.target.getTransition(item.value.transName);\n                    if (trans == this)\n                        trans = null;\n                    if (trans) {\n                        if (item.value.playTimes == 0) {\n                            var j;\n                            for (j = i - 1; j >= 0; j--) {\n                                var item2 = this._items[j];\n                                if (item2.type == ActionType.Transition) {\n                                    if (item2.value.trans == trans) {\n                                        item2.value.stopTime = item.time - item2.time;\n                                        break;\n                                    }\n                                }\n                            }\n                            if (j < 0)\n                                item.value.stopTime = 0;\n                            else\n                                trans = null;\n                        }\n                        else\n                            item.value.stopTime = -1;\n                    }\n                    item.value.trans = trans;\n                }\n            }\n            if (delay == 0)\n                this.onDelayedPlay();\n            else\n                fgui.GTween.delayedCall(delay).setTarget(this).onComplete(this.onDelayedPlay, this);\n        };\n        Transition.prototype.stop = function (setToComplete, processCallback) {\n            if (setToComplete == undefined)\n                setToComplete = true;\n            if (!this._playing)\n                return;\n            this._playing = false;\n            this._totalTasks = 0;\n            this._totalTimes = 0;\n            var func = this._onComplete;\n            var param = this._onCompleteParam;\n            var thisObj = this._onCompleteCaller;\n            this._onComplete = null;\n            this._onCompleteParam = null;\n            this._onCompleteCaller = null;\n            fgui.GTween.kill(this);\n            var cnt = this._items.length;\n            if (this._reversed) {\n                for (var i = cnt - 1; i >= 0; i--) {\n                    var item = this._items[i];\n                    if (!item.target)\n                        continue;\n                    this.stopItem(item, setToComplete);\n                }\n            }\n            else {\n                for (i = 0; i < cnt; i++) {\n                    item = this._items[i];\n                    if (!item.target)\n                        continue;\n                    this.stopItem(item, setToComplete);\n                }\n            }\n            if (processCallback && func != null) {\n                func.call(thisObj, param);\n            }\n        };\n        Transition.prototype.stopItem = function (item, setToComplete) {\n            if (item.displayLockToken != 0) {\n                item.target.releaseDisplayLock(item.displayLockToken);\n                item.displayLockToken = 0;\n            }\n            if (item.tweener) {\n                item.tweener.kill(setToComplete);\n                item.tweener = null;\n                if (item.type == ActionType.Shake && !setToComplete) {\n                    item.target._gearLocked = true;\n                    item.target.setXY(item.target.x - item.value.lastOffsetX, item.target.y - item.value.lastOffsetY);\n                    item.target._gearLocked = false;\n                }\n            }\n            if (item.type == ActionType.Transition) {\n                var trans = item.value.trans;\n                if (trans)\n                    trans.stop(setToComplete, false);\n            }\n        };\n        Transition.prototype.setPaused = function (paused) {\n            if (!this._playing || this._paused == paused)\n                return;\n            this._paused = paused;\n            var tweener = fgui.GTween.getTween(this);\n            if (tweener)\n                tweener.setPaused(paused);\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (!item.target)\n                    continue;\n                if (item.type == ActionType.Transition) {\n                    if (item.value.trans)\n                        item.value.trans.setPaused(paused);\n                }\n                else if (item.type == ActionType.Animation) {\n                    if (paused) {\n                        item.value.flag = item.target.getProp(fgui.ObjectPropID.Playing);\n                        item.target.setProp(fgui.ObjectPropID.Playing, false);\n                    }\n                    else\n                        item.target.setProp(fgui.ObjectPropID.Playing, item.value.flag);\n                }\n                if (item.tweener)\n                    item.tweener.setPaused(paused);\n            }\n        };\n        Transition.prototype.dispose = function () {\n            if (this._playing)\n                fgui.GTween.kill(this);\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (item.tweener) {\n                    item.tweener.kill();\n                    item.tweener = null;\n                }\n                item.target = null;\n                item.hook = null;\n                if (item.tweenConfig)\n                    item.tweenConfig.endHook = null;\n            }\n            this._items.length = 0;\n            this._playing = false;\n            this._onComplete = null;\n            this._onCompleteCaller = null;\n            this._onCompleteParam = null;\n        };\n        Object.defineProperty(Transition.prototype, \"playing\", {\n            get: function () {\n                return this._playing;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Transition.prototype.setValue = function (label) {\n            var args = [];\n            for (var _i = 1; _i < arguments.length; _i++) {\n                args[_i - 1] = arguments[_i];\n            }\n            var cnt = this._items.length;\n            var value;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (item.label == label) {\n                    if (item.tweenConfig)\n                        value = item.tweenConfig.startValue;\n                    else\n                        value = item.value;\n                }\n                else if (item.tweenConfig && item.tweenConfig.endLabel == label) {\n                    value = item.tweenConfig.endValue;\n                }\n                else\n                    continue;\n                switch (item.type) {\n                    case ActionType.XY:\n                    case ActionType.Size:\n                    case ActionType.Pivot:\n                    case ActionType.Scale:\n                    case ActionType.Skew:\n                        value.b1 = true;\n                        value.b2 = true;\n                        value.f1 = parseFloat(args[0]);\n                        value.f2 = parseFloat(args[1]);\n                        break;\n                    case ActionType.Alpha:\n                        value.f1 = parseFloat(args[0]);\n                        break;\n                    case ActionType.Rotation:\n                        value.f1 = parseFloat(args[0]);\n                        break;\n                    case ActionType.Color:\n                        value.f1 = parseFloat(args[0]);\n                        break;\n                    case ActionType.Animation:\n                        value.frame = parseInt(args[0]);\n                        if (args.length > 1)\n                            value.playing = args[1];\n                        break;\n                    case ActionType.Visible:\n                        value.visible = args[0];\n                        break;\n                    case ActionType.Sound:\n                        value.sound = args[0];\n                        if (args.length > 1)\n                            value.volume = parseFloat(args[1]);\n                        break;\n                    case ActionType.Transition:\n                        value.transName = args[0];\n                        if (args.length > 1)\n                            value.playTimes = parseInt(args[1]);\n                        break;\n                    case ActionType.Shake:\n                        value.amplitude = parseFloat(args[0]);\n                        if (args.length > 1)\n                            value.duration = parseFloat(args[1]);\n                        break;\n                    case ActionType.ColorFilter:\n                        value.f1 = parseFloat(args[0]);\n                        value.f2 = parseFloat(args[1]);\n                        value.f3 = parseFloat(args[2]);\n                        value.f4 = parseFloat(args[3]);\n                        break;\n                    case ActionType.Text:\n                    case ActionType.Icon:\n                        value.text = args[0];\n                        break;\n                }\n            }\n        };\n        Transition.prototype.setHook = function (label, callback, caller) {\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (item.label == label) {\n                    item.hook = callback;\n                    item.hookCaller = caller;\n                    break;\n                }\n                else if (item.tweenConfig && item.tweenConfig.endLabel == label) {\n                    item.tweenConfig.endHook = callback;\n                    item.tweenConfig.endHookCaller = caller;\n                    break;\n                }\n            }\n        };\n        Transition.prototype.clearHooks = function () {\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                item.hook = null;\n                item.hookCaller = null;\n                if (item.tweenConfig) {\n                    item.tweenConfig.endHook = null;\n                    item.tweenConfig.endHookCaller = null;\n                }\n            }\n        };\n        Transition.prototype.setTarget = function (label, newTarget) {\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (item.label == label) {\n                    item.targetId = (newTarget == this._owner || !newTarget) ? \"\" : newTarget.id;\n                    if (this._playing) {\n                        if (item.targetId.length > 0)\n                            item.target = this._owner.getChildById(item.targetId);\n                        else\n                            item.target = this._owner;\n                    }\n                    else\n                        item.target = null;\n                }\n            }\n        };\n        Transition.prototype.setDuration = function (label, value) {\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (item.tweenConfig && item.label == label)\n                    item.tweenConfig.duration = value;\n            }\n        };\n        Transition.prototype.getLabelTime = function (label) {\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (item.label == label)\n                    return item.time;\n                else if (item.tweenConfig && item.tweenConfig.endLabel == label)\n                    return item.time + item.tweenConfig.duration;\n            }\n            return Number.NaN;\n        };\n        Object.defineProperty(Transition.prototype, \"timeScale\", {\n            get: function () {\n                return this._timeScale;\n            },\n            set: function (value) {\n                if (this._timeScale != value) {\n                    this._timeScale = value;\n                    if (this._playing) {\n                        var cnt = this._items.length;\n                        for (var i = 0; i < cnt; i++) {\n                            var item = this._items[i];\n                            if (item.tweener)\n                                item.tweener.setTimeScale(value);\n                            else if (item.type == ActionType.Transition) {\n                                if (item.value.trans)\n                                    item.value.trans.timeScale = value;\n                            }\n                            else if (item.type == ActionType.Animation) {\n                                if (item.target)\n                                    item.target.setProp(fgui.ObjectPropID.TimeScale, value);\n                            }\n                        }\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Transition.prototype.updateFromRelations = function (targetId, dx, dy) {\n            var cnt = this._items.length;\n            if (cnt == 0)\n                return;\n            for (var i = 0; i < cnt; i++) {\n                var item = this._items[i];\n                if (item.type == ActionType.XY && item.targetId == targetId) {\n                    if (item.tweenConfig) {\n                        item.tweenConfig.startValue.f1 += dx;\n                        item.tweenConfig.startValue.f2 += dy;\n                        item.tweenConfig.endValue.f1 += dx;\n                        item.tweenConfig.endValue.f2 += dy;\n                    }\n                    else {\n                        item.value.f1 += dx;\n                        item.value.f2 += dy;\n                    }\n                }\n            }\n        };\n        Transition.prototype.onOwnerAddedToStage = function () {\n            if (this._autoPlay && !this._playing)\n                this.play(null, null, null, this._autoPlayTimes, this._autoPlayDelay);\n        };\n        Transition.prototype.onOwnerRemovedFromStage = function () {\n            if ((this._options & OPTION_AUTO_STOP_DISABLED) == 0)\n                this.stop((this._options & OPTION_AUTO_STOP_AT_END) != 0 ? true : false, false);\n        };\n        Transition.prototype.onDelayedPlay = function () {\n            this.internalPlay();\n            this._playing = this._totalTasks > 0;\n            if (this._playing) {\n                if ((this._options & OPTION_IGNORE_DISPLAY_CONTROLLER) != 0) {\n                    var cnt = this._items.length;\n                    for (var i = 0; i < cnt; i++) {\n                        var item = this._items[i];\n                        if (item.target && item.target != this._owner)\n                            item.displayLockToken = item.target.addDisplayLock();\n                    }\n                }\n            }\n            else if (this._onComplete != null) {\n                var func = this._onComplete;\n                var param = this._onCompleteParam;\n                var thisObj = this._onCompleteCaller;\n                this._onComplete = null;\n                this._onCompleteParam = null;\n                this._onCompleteCaller = null;\n                func.call(thisObj, param);\n            }\n        };\n        Transition.prototype.internalPlay = function () {\n            this._ownerBaseX = this._owner.x;\n            this._ownerBaseY = this._owner.y;\n            this._totalTasks = 1;\n            var cnt = this._items.length;\n            var item;\n            var needSkipAnimations = false;\n            var i;\n            if (!this._reversed) {\n                for (i = 0; i < cnt; i++) {\n                    item = this._items[i];\n                    if (!item.target)\n                        continue;\n                    if (item.type == ActionType.Animation && this._startTime != 0 && item.time <= this._startTime) {\n                        needSkipAnimations = true;\n                        item.value.flag = false;\n                    }\n                    else\n                        this.playItem(item);\n                }\n            }\n            else {\n                for (i = cnt - 1; i >= 0; i--) {\n                    item = this._items[i];\n                    if (!item.target)\n                        continue;\n                    this.playItem(item);\n                }\n            }\n            if (needSkipAnimations)\n                this.skipAnimations();\n            this._totalTasks--;\n        };\n        Transition.prototype.playItem = function (item) {\n            var time;\n            if (item.tweenConfig) {\n                if (this._reversed)\n                    time = (this._totalDuration - item.time - item.tweenConfig.duration);\n                else\n                    time = item.time;\n                if (this._endTime == -1 || time <= this._endTime) {\n                    var startValue;\n                    var endValue;\n                    if (this._reversed) {\n                        startValue = item.tweenConfig.endValue;\n                        endValue = item.tweenConfig.startValue;\n                    }\n                    else {\n                        startValue = item.tweenConfig.startValue;\n                        endValue = item.tweenConfig.endValue;\n                    }\n                    item.value.b1 = startValue.b1 || endValue.b1;\n                    item.value.b2 = startValue.b2 || endValue.b2;\n                    switch (item.type) {\n                        case ActionType.XY:\n                        case ActionType.Size:\n                        case ActionType.Scale:\n                        case ActionType.Skew:\n                            item.tweener = fgui.GTween.to2(startValue.f1, startValue.f2, endValue.f1, endValue.f2, item.tweenConfig.duration);\n                            break;\n                        case ActionType.Alpha:\n                        case ActionType.Rotation:\n                            item.tweener = fgui.GTween.to(startValue.f1, endValue.f1, item.tweenConfig.duration);\n                            break;\n                        case ActionType.Color:\n                            item.tweener = fgui.GTween.toColor(startValue.f1, endValue.f1, item.tweenConfig.duration);\n                            break;\n                        case ActionType.ColorFilter:\n                            item.tweener = fgui.GTween.to4(startValue.f1, startValue.f2, startValue.f3, startValue.f4, endValue.f1, endValue.f2, endValue.f3, endValue.f4, item.tweenConfig.duration);\n                            break;\n                    }\n                    item.tweener.setDelay(time)\n                        .setEase(item.tweenConfig.easeType)\n                        .setRepeat(item.tweenConfig.repeat, item.tweenConfig.yoyo)\n                        .setTimeScale(this._timeScale)\n                        .setTarget(item)\n                        .onStart(this.onTweenStart, this)\n                        .onUpdate(this.onTweenUpdate, this)\n                        .onComplete(this.onTweenComplete, this);\n                    if (this._endTime >= 0)\n                        item.tweener.setBreakpoint(this._endTime - time);\n                    this._totalTasks++;\n                }\n            }\n            else if (item.type == ActionType.Shake) {\n                if (this._reversed)\n                    time = (this._totalDuration - item.time - item.value.duration);\n                else\n                    time = item.time;\n                item.value.offsetX = item.value.offsetY = 0;\n                item.value.lastOffsetX = item.value.lastOffsetY = 0;\n                item.tweener = fgui.GTween.shake(0, 0, item.value.amplitude, item.value.duration)\n                    .setDelay(time)\n                    .setTimeScale(this._timeScale)\n                    .setTarget(item)\n                    .onUpdate(this.onTweenUpdate, this)\n                    .onComplete(this.onTweenComplete, this);\n                if (this._endTime >= 0)\n                    item.tweener.setBreakpoint(this._endTime - item.time);\n                this._totalTasks++;\n            }\n            else {\n                if (this._reversed)\n                    time = (this._totalDuration - item.time);\n                else\n                    time = item.time;\n                if (time <= this._startTime) {\n                    this.applyValue(item);\n                    this.callHook(item, false);\n                }\n                else if (this._endTime == -1 || time <= this._endTime) {\n                    this._totalTasks++;\n                    item.tweener = fgui.GTween.delayedCall(time)\n                        .setTimeScale(this._timeScale)\n                        .setTarget(item)\n                        .onComplete(this.onDelayedPlayItem, this);\n                }\n            }\n            if (item.tweener != null)\n                item.tweener.seek(this._startTime);\n        };\n        Transition.prototype.skipAnimations = function () {\n            var frame;\n            var playStartTime;\n            var playTotalTime;\n            var value;\n            var target;\n            var item;\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                item = this._items[i];\n                if (item.type != ActionType.Animation || item.time > this._startTime)\n                    continue;\n                value = item.value;\n                if (value.flag)\n                    continue;\n                target = item.target;\n                frame = target.getProp(fgui.ObjectPropID.Frame);\n                playStartTime = target.getProp(fgui.ObjectPropID.Playing) ? 0 : -1;\n                playTotalTime = 0;\n                for (var j = i; j < cnt; j++) {\n                    item = this._items[j];\n                    if (item.type != ActionType.Animation || item.target != target || item.time > this._startTime)\n                        continue;\n                    value = item.value;\n                    value.flag = true;\n                    if (value.frame != -1) {\n                        frame = value.frame;\n                        if (value.playing)\n                            playStartTime = item.time;\n                        else\n                            playStartTime = -1;\n                        playTotalTime = 0;\n                    }\n                    else {\n                        if (value.playing) {\n                            if (playStartTime < 0)\n                                playStartTime = item.time;\n                        }\n                        else {\n                            if (playStartTime >= 0)\n                                playTotalTime += (item.time - playStartTime);\n                            playStartTime = -1;\n                        }\n                    }\n                    this.callHook(item, false);\n                }\n                if (playStartTime >= 0)\n                    playTotalTime += (this._startTime - playStartTime);\n                target.setProp(fgui.ObjectPropID.Playing, playStartTime >= 0);\n                target.setProp(fgui.ObjectPropID.Frame, frame);\n                if (playTotalTime > 0)\n                    target.setProp(fgui.ObjectPropID.DeltaTime, playTotalTime * 1000);\n            }\n        };\n        Transition.prototype.onDelayedPlayItem = function (tweener) {\n            var item = tweener.target;\n            item.tweener = null;\n            this._totalTasks--;\n            this.applyValue(item);\n            this.callHook(item, false);\n            this.checkAllComplete();\n        };\n        Transition.prototype.onTweenStart = function (tweener) {\n            var item = tweener.target;\n            if (item.type == ActionType.XY || item.type == ActionType.Size) {\n                var startValue;\n                var endValue;\n                if (this._reversed) {\n                    startValue = item.tweenConfig.endValue;\n                    endValue = item.tweenConfig.startValue;\n                }\n                else {\n                    startValue = item.tweenConfig.startValue;\n                    endValue = item.tweenConfig.endValue;\n                }\n                if (item.type == ActionType.XY) {\n                    if (item.target != this._owner) {\n                        if (!startValue.b1)\n                            tweener.startValue.x = item.target.x;\n                        else if (startValue.b3)\n                            tweener.startValue.x = startValue.f1 * this._owner.width;\n                        if (!startValue.b2)\n                            tweener.startValue.y = item.target.y;\n                        else if (startValue.b3)\n                            tweener.startValue.y = startValue.f2 * this._owner.height;\n                        if (!endValue.b1)\n                            tweener.endValue.x = tweener.startValue.x;\n                        else if (endValue.b3)\n                            tweener.endValue.x = endValue.f1 * this._owner.width;\n                        if (!endValue.b2)\n                            tweener.endValue.y = tweener.startValue.y;\n                        else if (endValue.b3)\n                            tweener.endValue.y = endValue.f2 * this._owner.height;\n                    }\n                    else {\n                        if (!startValue.b1)\n                            tweener.startValue.x = item.target.x - this._ownerBaseX;\n                        if (!startValue.b2)\n                            tweener.startValue.y = item.target.y - this._ownerBaseY;\n                        if (!endValue.b1)\n                            tweener.endValue.x = tweener.startValue.x;\n                        if (!endValue.b2)\n                            tweener.endValue.y = tweener.startValue.y;\n                    }\n                }\n                else {\n                    if (!startValue.b1)\n                        tweener.startValue.x = item.target.width;\n                    if (!startValue.b2)\n                        tweener.startValue.y = item.target.height;\n                    if (!endValue.b1)\n                        tweener.endValue.x = tweener.startValue.x;\n                    if (!endValue.b2)\n                        tweener.endValue.y = tweener.startValue.y;\n                }\n                if (item.tweenConfig.path) {\n                    item.value.b1 = item.value.b2 = true;\n                    tweener.setPath(item.tweenConfig.path);\n                }\n            }\n            this.callHook(item, false);\n        };\n        Transition.prototype.onTweenUpdate = function (tweener) {\n            var item = tweener.target;\n            switch (item.type) {\n                case ActionType.XY:\n                case ActionType.Size:\n                case ActionType.Scale:\n                case ActionType.Skew:\n                    item.value.f1 = tweener.value.x;\n                    item.value.f2 = tweener.value.y;\n                    if (item.tweenConfig.path) {\n                        item.value.f1 += tweener.startValue.x;\n                        item.value.f2 += tweener.startValue.y;\n                    }\n                    break;\n                case ActionType.Alpha:\n                case ActionType.Rotation:\n                    item.value.f1 = tweener.value.x;\n                    break;\n                case ActionType.Color:\n                    item.value.f1 = tweener.value.color;\n                    break;\n                case ActionType.ColorFilter:\n                    item.value.f1 = tweener.value.x;\n                    item.value.f2 = tweener.value.y;\n                    item.value.f3 = tweener.value.z;\n                    item.value.f4 = tweener.value.w;\n                    break;\n                case ActionType.Shake:\n                    item.value.offsetX = tweener.deltaValue.x;\n                    item.value.offsetY = tweener.deltaValue.y;\n                    break;\n            }\n            this.applyValue(item);\n        };\n        Transition.prototype.onTweenComplete = function (tweener) {\n            var item = tweener.target;\n            item.tweener = null;\n            this._totalTasks--;\n            if (tweener.allCompleted)\n                this.callHook(item, true);\n            this.checkAllComplete();\n        };\n        Transition.prototype.onPlayTransCompleted = function (item) {\n            this._totalTasks--;\n            this.checkAllComplete();\n        };\n        Transition.prototype.callHook = function (item, tweenEnd) {\n            if (tweenEnd) {\n                if (item.tweenConfig && item.tweenConfig.endHook)\n                    item.tweenConfig.endHook.call(item.tweenConfig.endHookCaller);\n            }\n            else {\n                if (item.time >= this._startTime && item.hook != null)\n                    item.hook.call(item.hookCaller);\n            }\n        };\n        Transition.prototype.checkAllComplete = function () {\n            if (this._playing && this._totalTasks == 0) {\n                if (this._totalTimes < 0) {\n                    this.internalPlay();\n                    if (this._totalTasks == 0)\n                        fgui.GTween.delayedCall(0).setTarget(this).onComplete(this.checkAllComplete, this);\n                }\n                else {\n                    this._totalTimes--;\n                    if (this._totalTimes > 0) {\n                        this.internalPlay();\n                        if (this._totalTasks == 0)\n                            fgui.GTween.delayedCall(0).setTarget(this).onComplete(this.checkAllComplete, this);\n                    }\n                    else {\n                        this._playing = false;\n                        var cnt = this._items.length;\n                        for (var i = 0; i < cnt; i++) {\n                            var item = this._items[i];\n                            if (item.target && item.displayLockToken != 0) {\n                                item.target.releaseDisplayLock(item.displayLockToken);\n                                item.displayLockToken = 0;\n                            }\n                        }\n                        if (this._onComplete != null) {\n                            var func = this._onComplete;\n                            var param = this._onCompleteParam;\n                            var thisObj = this._onCompleteCaller;\n                            this._onComplete = null;\n                            this._onCompleteParam = null;\n                            this._onCompleteCaller = null;\n                            func.call(thisObj, param);\n                        }\n                    }\n                }\n            }\n        };\n        Transition.prototype.applyValue = function (item) {\n            item.target._gearLocked = true;\n            var value = item.value;\n            switch (item.type) {\n                case ActionType.XY:\n                    if (item.target == this._owner) {\n                        if (value.b1 && value.b2)\n                            item.target.setXY(value.f1 + this._ownerBaseX, value.f2 + this._ownerBaseY);\n                        else if (value.b1)\n                            item.target.x = value.f1 + this._ownerBaseX;\n                        else\n                            item.target.y = value.f2 + this._ownerBaseY;\n                    }\n                    else {\n                        if (value.b3) {\n                            if (value.b1 && value.b2)\n                                item.target.setXY(value.f1 * this._owner.width, value.f2 * this._owner.height);\n                            else if (value.b1)\n                                item.target.x = value.f1 * this._owner.width;\n                            else if (value.b2)\n                                item.target.y = value.f2 * this._owner.height;\n                        }\n                        else {\n                            if (value.b1 && value.b2)\n                                item.target.setXY(value.f1, value.f2);\n                            else if (value.b1)\n                                item.target.x = value.f1;\n                            else if (value.b2)\n                                item.target.y = value.f2;\n                        }\n                    }\n                    break;\n                case ActionType.Size:\n                    if (!value.b1)\n                        value.f1 = item.target.width;\n                    if (!value.b2)\n                        value.f2 = item.target.height;\n                    item.target.setSize(value.f1, value.f2);\n                    break;\n                case ActionType.Pivot:\n                    item.target.setPivot(value.f1, value.f2, item.target.pivotAsAnchor);\n                    break;\n                case ActionType.Alpha:\n                    item.target.alpha = value.f1;\n                    break;\n                case ActionType.Rotation:\n                    item.target.rotation = value.f1;\n                    break;\n                case ActionType.Scale:\n                    item.target.setScale(value.f1, value.f2);\n                    break;\n                case ActionType.Skew:\n                    item.target.setSkew(value.f1, value.f2);\n                    break;\n                case ActionType.Color:\n                    item.target.setProp(fgui.ObjectPropID.Color, value.f1);\n                    break;\n                case ActionType.Animation:\n                    if (value.frame >= 0)\n                        item.target.setProp(fgui.ObjectPropID.Frame, value.frame);\n                    item.target.setProp(fgui.ObjectPropID.Playing, value.playing);\n                    item.target.setProp(fgui.ObjectPropID.TimeScale, this._timeScale);\n                    break;\n                case ActionType.Visible:\n                    item.target.visible = value.visible;\n                    break;\n                case ActionType.Transition:\n                    if (this._playing) {\n                        var trans = value.trans;\n                        if (trans) {\n                            this._totalTasks++;\n                            var startTime = this._startTime > item.time ? (this._startTime - item.time) : 0;\n                            var endTime = this._endTime >= 0 ? (this._endTime - item.time) : -1;\n                            if (value.stopTime >= 0 && (endTime < 0 || endTime > value.stopTime))\n                                endTime = value.stopTime;\n                            trans.timeScale = this._timeScale;\n                            trans._play(this.onPlayTransCompleted, this, item, value.playTimes, 0, startTime, endTime, this._reversed);\n                        }\n                    }\n                    break;\n                case ActionType.Sound:\n                    if (this._playing && item.time >= this._startTime) {\n                        if (!value.audioClip) {\n                            var pi = fgui.UIPackage.getItemByURL(value.sound);\n                            if (pi)\n                                value.audioClip = pi.owner.getItemAsset(pi);\n                        }\n                        if (value.audioClip)\n                            fgui.GRoot.inst.playOneShotSound(value.audioClip, value.volume);\n                    }\n                    break;\n                case ActionType.Shake:\n                    item.target.setXY(item.target.x - value.lastOffsetX + value.offsetX, item.target.y - value.lastOffsetY + value.offsetY);\n                    value.lastOffsetX = value.offsetX;\n                    value.lastOffsetY = value.offsetY;\n                    break;\n                case ActionType.ColorFilter:\n                    {\n                        fgui.ToolSet.setColorFilter(item.target.displayObject, [value.f1, value.f2, value.f3, value.f4]);\n                        break;\n                    }\n                case ActionType.Text:\n                    item.target.text = value.text;\n                    break;\n                case ActionType.Icon:\n                    item.target.icon = value.text;\n                    break;\n            }\n            item.target._gearLocked = false;\n        };\n        Transition.prototype.setup = function (buffer) {\n            this.name = buffer.readS();\n            this._options = buffer.readInt();\n            this._autoPlay = buffer.readBool();\n            this._autoPlayTimes = buffer.readInt();\n            this._autoPlayDelay = buffer.readFloat();\n            var cnt = buffer.readShort();\n            for (var i = 0; i < cnt; i++) {\n                var dataLen = buffer.readShort();\n                var curPos = buffer.position;\n                buffer.seek(curPos, 0);\n                var item = new Item(buffer.readByte());\n                this._items[i] = item;\n                item.time = buffer.readFloat();\n                var targetId = buffer.readShort();\n                if (targetId < 0)\n                    item.targetId = \"\";\n                else\n                    item.targetId = this._owner.getChildAt(targetId).id;\n                item.label = buffer.readS();\n                if (buffer.readBool()) {\n                    buffer.seek(curPos, 1);\n                    item.tweenConfig = new TweenConfig();\n                    item.tweenConfig.duration = buffer.readFloat();\n                    if (item.time + item.tweenConfig.duration > this._totalDuration)\n                        this._totalDuration = item.time + item.tweenConfig.duration;\n                    item.tweenConfig.easeType = buffer.readByte();\n                    item.tweenConfig.repeat = buffer.readInt();\n                    item.tweenConfig.yoyo = buffer.readBool();\n                    item.tweenConfig.endLabel = buffer.readS();\n                    buffer.seek(curPos, 2);\n                    this.decodeValue(item, buffer, item.tweenConfig.startValue);\n                    buffer.seek(curPos, 3);\n                    this.decodeValue(item, buffer, item.tweenConfig.endValue);\n                    if (buffer.version >= 2) {\n                        var pathLen = buffer.readInt();\n                        if (pathLen > 0) {\n                            item.tweenConfig.path = new fgui.GPath();\n                            var pts = new Array();\n                            for (var j = 0; j < pathLen; j++) {\n                                var curveType = buffer.readByte();\n                                switch (curveType) {\n                                    case fgui.CurveType.Bezier:\n                                        pts.push(fgui.GPathPoint.newBezierPoint(buffer.readFloat(), buffer.readFloat(), buffer.readFloat(), buffer.readFloat()));\n                                        break;\n                                    case fgui.CurveType.CubicBezier:\n                                        pts.push(fgui.GPathPoint.newCubicBezierPoint(buffer.readFloat(), buffer.readFloat(), buffer.readFloat(), buffer.readFloat(), buffer.readFloat(), buffer.readFloat()));\n                                        break;\n                                    default:\n                                        pts.push(fgui.GPathPoint.newPoint(buffer.readFloat(), buffer.readFloat(), curveType));\n                                        break;\n                                }\n                            }\n                            item.tweenConfig.path.create(pts);\n                        }\n                    }\n                }\n                else {\n                    if (item.time > this._totalDuration)\n                        this._totalDuration = item.time;\n                    buffer.seek(curPos, 2);\n                    this.decodeValue(item, buffer, item.value);\n                }\n                buffer.position = curPos + dataLen;\n            }\n        };\n        Transition.prototype.decodeValue = function (item, buffer, value) {\n            switch (item.type) {\n                case ActionType.XY:\n                case ActionType.Size:\n                case ActionType.Pivot:\n                case ActionType.Skew:\n                    value.b1 = buffer.readBool();\n                    value.b2 = buffer.readBool();\n                    value.f1 = buffer.readFloat();\n                    value.f2 = buffer.readFloat();\n                    if (buffer.version >= 2 && item.type == ActionType.XY)\n                        value.b3 = buffer.readBool();\n                    break;\n                case ActionType.Alpha:\n                case ActionType.Rotation:\n                    value.f1 = buffer.readFloat();\n                    break;\n                case ActionType.Scale:\n                    value.f1 = buffer.readFloat();\n                    value.f2 = buffer.readFloat();\n                    break;\n                case ActionType.Color:\n                    value.f1 = buffer.readColor();\n                    break;\n                case ActionType.Animation:\n                    value.playing = buffer.readBool();\n                    value.frame = buffer.readInt();\n                    break;\n                case ActionType.Visible:\n                    value.visible = buffer.readBool();\n                    break;\n                case ActionType.Sound:\n                    value.sound = buffer.readS();\n                    value.volume = buffer.readFloat();\n                    break;\n                case ActionType.Transition:\n                    value.transName = buffer.readS();\n                    value.playTimes = buffer.readInt();\n                    break;\n                case ActionType.Shake:\n                    value.amplitude = buffer.readFloat();\n                    value.duration = buffer.readFloat();\n                    break;\n                case ActionType.ColorFilter:\n                    value.f1 = buffer.readFloat();\n                    value.f2 = buffer.readFloat();\n                    value.f3 = buffer.readFloat();\n                    value.f4 = buffer.readFloat();\n                    break;\n                case ActionType.Text:\n                case ActionType.Icon:\n                    value.text = buffer.readS();\n                    break;\n            }\n        };\n        return Transition;\n    }());\n    fgui.Transition = Transition;\n    var OPTION_IGNORE_DISPLAY_CONTROLLER = 1;\n    var OPTION_AUTO_STOP_DISABLED = 2;\n    var OPTION_AUTO_STOP_AT_END = 4;\n    var ActionType = (function () {\n        function ActionType() {\n        }\n        ActionType.XY = 0;\n        ActionType.Size = 1;\n        ActionType.Scale = 2;\n        ActionType.Pivot = 3;\n        ActionType.Alpha = 4;\n        ActionType.Rotation = 5;\n        ActionType.Color = 6;\n        ActionType.Animation = 7;\n        ActionType.Visible = 8;\n        ActionType.Sound = 9;\n        ActionType.Transition = 10;\n        ActionType.Shake = 11;\n        ActionType.ColorFilter = 12;\n        ActionType.Skew = 13;\n        ActionType.Text = 14;\n        ActionType.Icon = 15;\n        ActionType.Unknown = 16;\n        return ActionType;\n    }());\n    var Item = (function () {\n        function Item(type) {\n            this.type = type;\n            this.value = {};\n            this.displayLockToken = 0;\n        }\n        return Item;\n    }());\n    var TweenConfig = (function () {\n        function TweenConfig() {\n            this.duration = 0;\n            this.repeat = 0;\n            this.easeType = fgui.EaseType.QuadOut;\n            this.startValue = { b1: true, b2: true };\n            this.endValue = { b1: true, b2: true };\n        }\n        return TweenConfig;\n    }());\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var TranslationHelper = (function () {\n        function TranslationHelper() {\n        }\n        TranslationHelper.loadFromXML = function (source) {\n            var strings = {};\n            TranslationHelper.strings = strings;\n            var xml = egret.XML.parse(source);\n            var nodes = xml.children;\n            var length1 = nodes.length;\n            for (var i1 = 0; i1 < length1; i1++) {\n                var cxml = nodes[i1];\n                if (cxml.name == \"string\") {\n                    var key = cxml.attributes.name;\n                    var text = cxml.children.length > 0 ? cxml.children[0].text : \"\";\n                    var i = key.indexOf(\"-\");\n                    if (i == -1)\n                        continue;\n                    var key2 = key.substr(0, i);\n                    var key3 = key.substr(i + 1);\n                    var col = strings[key2];\n                    if (!col) {\n                        col = {};\n                        strings[key2] = col;\n                    }\n                    col[key3] = text;\n                }\n            }\n        };\n        TranslationHelper.translateComponent = function (item) {\n            if (TranslationHelper.strings == null)\n                return;\n            var compStrings = TranslationHelper.strings[item.owner.id + item.id];\n            if (compStrings == null)\n                return;\n            var elementId, value;\n            var buffer = item.rawData;\n            var nextPos;\n            var itemCount;\n            var i, j, k;\n            var dataLen;\n            var curPos;\n            var valueCnt;\n            var page;\n            buffer.seek(0, 2);\n            var childCount = buffer.readShort();\n            for (i = 0; i < childCount; i++) {\n                dataLen = buffer.readShort();\n                curPos = buffer.position;\n                buffer.seek(curPos, 0);\n                var baseType = buffer.readByte();\n                var type = baseType;\n                buffer.skip(4);\n                elementId = buffer.readS();\n                if (type == fgui.ObjectType.Component) {\n                    if (buffer.seek(curPos, 6))\n                        type = buffer.readByte();\n                }\n                buffer.seek(curPos, 1);\n                if ((value = compStrings[elementId + \"-tips\"]) != null)\n                    buffer.writeS(value);\n                buffer.seek(curPos, 2);\n                var gearCnt = buffer.readShort();\n                for (j = 0; j < gearCnt; j++) {\n                    nextPos = buffer.readShort();\n                    nextPos += buffer.position;\n                    if (buffer.readByte() == 6) {\n                        buffer.skip(2);\n                        valueCnt = buffer.readShort();\n                        for (k = 0; k < valueCnt; k++) {\n                            page = buffer.readS();\n                            if (page != null) {\n                                if ((value = compStrings[elementId + \"-texts_\" + k]) != null)\n                                    buffer.writeS(value);\n                                else\n                                    buffer.skip(2);\n                            }\n                        }\n                        if (buffer.readBool() && (value = compStrings[elementId + \"-texts_def\"]) != null)\n                            buffer.writeS(value);\n                    }\n                    if (baseType == fgui.ObjectType.Component && buffer.version >= 2) {\n                        buffer.seek(curPos, 4);\n                        buffer.skip(2);\n                        buffer.skip(4 * buffer.readShort());\n                        var cpCount = buffer.readShort();\n                        for (var k = 0; k < cpCount; k++) {\n                            var target = buffer.readS();\n                            var propertyId = buffer.readShort();\n                            if (propertyId == 0 && (value = compStrings[elementId + \"-cp-\" + target]) != null)\n                                buffer.writeS(value);\n                            else\n                                buffer.skip(2);\n                        }\n                    }\n                    buffer.position = nextPos;\n                }\n                switch (type) {\n                    case fgui.ObjectType.Text:\n                    case fgui.ObjectType.RichText:\n                    case fgui.ObjectType.InputText:\n                        {\n                            if ((value = compStrings[elementId]) != null) {\n                                buffer.seek(curPos, 6);\n                                buffer.writeS(value);\n                            }\n                            if ((value = compStrings[elementId + \"-prompt\"]) != null) {\n                                buffer.seek(curPos, 4);\n                                buffer.writeS(value);\n                            }\n                            break;\n                        }\n                    case fgui.ObjectType.List:\n                    case fgui.ObjectType.Tree:\n                        {\n                            buffer.seek(curPos, 8);\n                            buffer.skip(2);\n                            itemCount = buffer.readShort();\n                            for (j = 0; j < itemCount; j++) {\n                                nextPos = buffer.readShort();\n                                nextPos += buffer.position;\n                                buffer.skip(2);\n                                if (type == fgui.ObjectType.Tree)\n                                    buffer.skip(2);\n                                if ((value = compStrings[elementId + \"-\" + j]) != null)\n                                    buffer.writeS(value);\n                                else\n                                    buffer.skip(2);\n                                if ((value = compStrings[elementId + \"-\" + j + \"-0\"]) != null)\n                                    buffer.writeS(value);\n                                else\n                                    buffer.skip(2);\n                                if (buffer.version >= 2) {\n                                    buffer.skip(6);\n                                    buffer.skip(buffer.readUnsignedShort() * 4);\n                                    var cpCount = buffer.readUnsignedShort();\n                                    for (var k = 0; k < cpCount; k++) {\n                                        var target = buffer.readS();\n                                        var propertyId = buffer.readUnsignedShort();\n                                        if (propertyId == 0 && (value = compStrings[elementId + \"-\" + j + \"-\" + target]) != null)\n                                            buffer.writeS(value);\n                                        else\n                                            buffer.skip(2);\n                                    }\n                                }\n                                buffer.position = nextPos;\n                            }\n                            break;\n                        }\n                    case fgui.ObjectType.Label:\n                        {\n                            if (buffer.seek(curPos, 6) && buffer.readByte() == type) {\n                                if ((value = compStrings[elementId]) != null)\n                                    buffer.writeS(value);\n                                else\n                                    buffer.skip(2);\n                                buffer.skip(2);\n                                if (buffer.readBool())\n                                    buffer.skip(4);\n                                buffer.skip(4);\n                                if (buffer.readBool() && (value = compStrings[elementId + \"-prompt\"]) != null)\n                                    buffer.writeS(value);\n                            }\n                            break;\n                        }\n                    case fgui.ObjectType.Button:\n                        {\n                            if (buffer.seek(curPos, 6) && buffer.readByte() == type) {\n                                if ((value = compStrings[elementId]) != null)\n                                    buffer.writeS(value);\n                                else\n                                    buffer.skip(2);\n                                if ((value = compStrings[elementId + \"-0\"]) != null)\n                                    buffer.writeS(value);\n                            }\n                            break;\n                        }\n                    case fgui.ObjectType.ComboBox:\n                        {\n                            if (buffer.seek(curPos, 6) && buffer.readByte() == type) {\n                                itemCount = buffer.readShort();\n                                for (j = 0; j < itemCount; j++) {\n                                    nextPos = buffer.readShort();\n                                    nextPos += buffer.position;\n                                    if ((value = compStrings[elementId + \"-\" + j]) != null)\n                                        buffer.writeS(value);\n                                    buffer.position = nextPos;\n                                }\n                                if ((value = compStrings[elementId]) != null)\n                                    buffer.writeS(value);\n                            }\n                            break;\n                        }\n                }\n                buffer.position = curPos + dataLen;\n            }\n        };\n        return TranslationHelper;\n    }());\n    fgui.TranslationHelper = TranslationHelper;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var UIConfig = (function () {\n        function UIConfig() {\n        }\n        UIConfig.defaultFont = \"SimSun\";\n        UIConfig.modalLayerColor = 0x333333;\n        UIConfig.modalLayerAlpha = 0.2;\n        UIConfig.buttonSoundVolumeScale = 1;\n        UIConfig.defaultScrollStep = 25;\n        UIConfig.defaultScrollDecelerationRate = 0.967;\n        UIConfig.defaultScrollBarDisplay = fgui.ScrollBarDisplayType.Visible;\n        UIConfig.defaultScrollTouchEffect = true;\n        UIConfig.defaultScrollBounceEffect = true;\n        UIConfig.defaultComboBoxVisibleItemCount = 10;\n        UIConfig.touchScrollSensitivity = 20;\n        UIConfig.touchDragSensitivity = 10;\n        UIConfig.clickDragSensitivity = 2;\n        UIConfig.bringWindowToFrontOnClick = true;\n        UIConfig.frameTimeForAsyncUIConstruction = 2;\n        return UIConfig;\n    }());\n    fgui.UIConfig = UIConfig;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var UIObjectFactory = (function () {\n        function UIObjectFactory() {\n        }\n        UIObjectFactory.setExtension = function (url, type) {\n            if (url == null)\n                throw \"Invaild url: \" + url;\n            var pi = fgui.UIPackage.getItemByURL(url);\n            if (pi)\n                pi.extensionType = type;\n            UIObjectFactory.extensions[url] = type;\n        };\n        UIObjectFactory.setPackageItemExtension = function (url, type) {\n            UIObjectFactory.setExtension(url, type);\n        };\n        UIObjectFactory.setLoaderExtension = function (type) {\n            UIObjectFactory.loaderType = type;\n        };\n        UIObjectFactory.resolvePackageItemExtension = function (pi) {\n            var extensionType = UIObjectFactory.extensions[\"ui://\" + pi.owner.id + pi.id];\n            if (!extensionType)\n                extensionType = UIObjectFactory.extensions[\"ui://\" + pi.owner.name + \"/\" + pi.name];\n            if (extensionType)\n                pi.extensionType = extensionType;\n        };\n        UIObjectFactory.newObject = function (type, userClass) {\n            var obj;\n            if (typeof type === 'number') {\n                switch (type) {\n                    case fgui.ObjectType.Image:\n                        return new fgui.GImage();\n                    case fgui.ObjectType.MovieClip:\n                        return new fgui.GMovieClip();\n                    case fgui.ObjectType.Component:\n                        return new fgui.GComponent();\n                    case fgui.ObjectType.Text:\n                        return new fgui.GTextField();\n                    case fgui.ObjectType.RichText:\n                        return new fgui.GRichTextField();\n                    case fgui.ObjectType.InputText:\n                        return new fgui.GTextInput();\n                    case fgui.ObjectType.Group:\n                        return new fgui.GGroup();\n                    case fgui.ObjectType.List:\n                        return new fgui.GList();\n                    case fgui.ObjectType.Graph:\n                        return new fgui.GGraph();\n                    case fgui.ObjectType.Loader:\n                        if (UIObjectFactory.loaderType)\n                            return new UIObjectFactory.loaderType();\n                        else\n                            return new fgui.GLoader();\n                    case fgui.ObjectType.Button:\n                        return new fgui.GButton();\n                    case fgui.ObjectType.Label:\n                        return new fgui.GLabel();\n                    case fgui.ObjectType.ProgressBar:\n                        return new fgui.GProgressBar();\n                    case fgui.ObjectType.Slider:\n                        return new fgui.GSlider();\n                    case fgui.ObjectType.ScrollBar:\n                        return new fgui.GScrollBar();\n                    case fgui.ObjectType.ComboBox:\n                        return new fgui.GComboBox();\n                    case fgui.ObjectType.Tree:\n                        return new fgui.GTree();\n                    case fgui.ObjectType.Loader3D:\n                        return new fgui.GLoader3D();\n                    default:\n                        return null;\n                }\n            }\n            else {\n                if (type.type == fgui.PackageItemType.Component) {\n                    if (userClass)\n                        obj = new userClass();\n                    else if (type.extensionType)\n                        obj = new type.extensionType();\n                    else\n                        obj = UIObjectFactory.newObject(type.objectType);\n                }\n                else\n                    obj = UIObjectFactory.newObject(type.objectType);\n                if (obj)\n                    obj.packageItem = type;\n            }\n            return obj;\n        };\n        UIObjectFactory.extensions = {};\n        return UIObjectFactory;\n    }());\n    fgui.UIObjectFactory = UIObjectFactory;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var UIPackage = (function () {\n        function UIPackage() {\n            this._items = [];\n            this._itemsById = {};\n            this._itemsByName = {};\n            this._sprites = {};\n            this._dependencies = [];\n            this._branches = [];\n            this._branchIndex = -1;\n        }\n        Object.defineProperty(UIPackage, \"branch\", {\n            get: function () {\n                return UIPackage._branch;\n            },\n            set: function (value) {\n                UIPackage._branch = value;\n                for (var pkgId in UIPackage._instById) {\n                    var pkg = UIPackage._instById[pkgId];\n                    if (pkg._branches) {\n                        pkg._branchIndex = pkg._branches.indexOf(value);\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        UIPackage.getVar = function (key) {\n            return UIPackage._vars[key];\n        };\n        UIPackage.setVar = function (key, value) {\n            UIPackage._vars[key] = value;\n        };\n        UIPackage.getById = function (id) {\n            return UIPackage._instById[id];\n        };\n        UIPackage.getByName = function (name) {\n            return UIPackage._instByName[name];\n        };\n        UIPackage.loadPackage = function (resKey) {\n            return __awaiter(this, void 0, void 0, function () {\n                var _this = this;\n                return __generator(this, function (_a) {\n                    return [2, new Promise(function (resolve) { return __awaiter(_this, void 0, void 0, function () {\n                            var pkg, asset, cnt, tasks, i, pi;\n                            return __generator(this, function (_a) {\n                                switch (_a.label) {\n                                    case 0:\n                                        pkg = UIPackage._instById[resKey];\n                                        if (pkg) {\n                                            resolve(pkg);\n                                            return [2];\n                                        }\n                                        return [4, RES.getResAsync(getAssetResKey(resKey, \"fui\"))];\n                                    case 1:\n                                        asset = _a.sent();\n                                        pkg = new UIPackage();\n                                        pkg._resKey = resKey;\n                                        pkg.loadPackage(new fgui.ByteBuffer(asset));\n                                        cnt = pkg._items.length;\n                                        tasks = [];\n                                        for (i = 0; i < cnt; i++) {\n                                            pi = pkg._items[i];\n                                            if (pi.type == fgui.PackageItemType.Atlas || pi.type == fgui.PackageItemType.Sound) {\n                                                tasks.push(RES.getResAsync(pi.file));\n                                            }\n                                        }\n                                        if (!(tasks.length > 0)) return [3, 3];\n                                        return [4, Promise.all(tasks)];\n                                    case 2:\n                                        _a.sent();\n                                        _a.label = 3;\n                                    case 3:\n                                        UIPackage._instById[pkg.id] = pkg;\n                                        UIPackage._instByName[pkg.name] = pkg;\n                                        UIPackage._instById[pkg._resKey] = pkg;\n                                        resolve(pkg);\n                                        return [2];\n                                }\n                            });\n                        }); })];\n                });\n            });\n        };\n        UIPackage.addPackage = function (resKey, descData) {\n            if (!descData) {\n                descData = RES.getRes(resKey);\n                if (!descData)\n                    throw \"Resource '\" + resKey + \"' not found, please check default.res.json!\";\n            }\n            var pkg = new UIPackage();\n            pkg._resKey = resKey;\n            pkg.loadPackage(new fgui.ByteBuffer(descData));\n            UIPackage._instById[pkg.id] = pkg;\n            UIPackage._instByName[pkg.name] = pkg;\n            UIPackage._instById[resKey] = pkg;\n            return pkg;\n        };\n        UIPackage.removePackage = function (packageIdOrName) {\n            var pkg = UIPackage._instById[packageIdOrName];\n            if (!pkg)\n                pkg = UIPackage._instByName[packageIdOrName];\n            if (!pkg)\n                throw new Error(\"unknown package: \" + packageIdOrName);\n            pkg.dispose();\n            delete UIPackage._instById[pkg.id];\n            delete UIPackage._instByName[pkg.name];\n            delete UIPackage._instById[pkg._resKey];\n            if (pkg._customId != null)\n                delete UIPackage._instById[pkg._customId];\n        };\n        UIPackage.createObject = function (pkgName, resName, userClass) {\n            var pkg = UIPackage.getByName(pkgName);\n            if (pkg)\n                return pkg.createObject(resName, userClass);\n            else\n                return null;\n        };\n        UIPackage.createObjectFromURL = function (url, userClass) {\n            var pi = UIPackage.getItemByURL(url);\n            if (pi)\n                return pi.owner.internalCreateObject(pi, userClass);\n            else\n                return null;\n        };\n        UIPackage.getItemURL = function (pkgName, resName) {\n            var pkg = UIPackage.getByName(pkgName);\n            if (!pkg)\n                return null;\n            var pi = pkg._itemsByName[resName];\n            if (!pi)\n                return null;\n            return \"ui://\" + pkg.id + pi.id;\n        };\n        UIPackage.getItemByURL = function (url) {\n            var pos1 = url.indexOf(\"//\");\n            if (pos1 == -1)\n                return null;\n            var pos2 = url.indexOf(\"/\", pos1 + 2);\n            if (pos2 == -1) {\n                if (url.length > 13) {\n                    var pkgId = url.substr(5, 8);\n                    var pkg = UIPackage.getById(pkgId);\n                    if (pkg != null) {\n                        var srcId = url.substr(13);\n                        return pkg.getItemById(srcId);\n                    }\n                }\n            }\n            else {\n                var pkgName = url.substr(pos1 + 2, pos2 - pos1 - 2);\n                pkg = UIPackage.getByName(pkgName);\n                if (pkg != null) {\n                    var srcName = url.substr(pos2 + 1);\n                    return pkg.getItemByName(srcName);\n                }\n            }\n            return null;\n        };\n        UIPackage.normalizeURL = function (url) {\n            if (url == null)\n                return null;\n            var pos1 = url.indexOf(\"//\");\n            if (pos1 == -1)\n                return null;\n            var pos2 = url.indexOf(\"/\", pos1 + 2);\n            if (pos2 == -1)\n                return url;\n            var pkgName = url.substr(pos1 + 2, pos2 - pos1 - 2);\n            var srcName = url.substr(pos2 + 1);\n            return UIPackage.getItemURL(pkgName, srcName);\n        };\n        UIPackage.setStringsSource = function (source) {\n            fgui.TranslationHelper.loadFromXML(source);\n        };\n        UIPackage.prototype.loadPackage = function (buffer) {\n            if (buffer.readUnsignedInt() != 0x46475549)\n                throw \"FairyGUI: old package format found in '\" + this._resKey + \"'\";\n            buffer.version = buffer.readInt();\n            var compressed = buffer.readBool();\n            this._id = buffer.readUTF();\n            this._name = buffer.readUTF();\n            buffer.skip(20);\n            if (compressed) {\n                var buf = new Uint8Array(buffer.buffer, buffer.position, buffer.length - buffer.position);\n                var inflater = new Zlib.RawInflate(buf);\n                var buffer2 = new fgui.ByteBuffer(inflater.decompress());\n                buffer2.version = buffer.version;\n                buffer = buffer2;\n            }\n            var ver2 = buffer.version >= 2;\n            var indexTablePos = buffer.position;\n            var cnt;\n            var i;\n            var nextPos;\n            var str;\n            var branchIncluded;\n            buffer.seek(indexTablePos, 4);\n            cnt = buffer.readInt();\n            var stringTable = new Array(cnt);\n            stringTable.reduceRight;\n            for (i = 0; i < cnt; i++)\n                stringTable[i] = buffer.readUTF();\n            buffer.stringTable = stringTable;\n            buffer.seek(indexTablePos, 0);\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++)\n                this._dependencies.push({ id: buffer.readS(), name: buffer.readS() });\n            if (ver2) {\n                cnt = buffer.readShort();\n                if (cnt > 0) {\n                    this._branches = buffer.readSArray(cnt);\n                    if (UIPackage._branch)\n                        this._branchIndex = this._branches.indexOf(UIPackage._branch);\n                }\n                branchIncluded = cnt > 0;\n            }\n            buffer.seek(indexTablePos, 1);\n            var pi;\n            var path = this._resKey;\n            var pos = path.lastIndexOf('/');\n            var shortPath = pos == -1 ? \"\" : path.substr(0, pos + 1);\n            path = path + \"_\";\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++) {\n                nextPos = buffer.readInt();\n                nextPos += buffer.position;\n                pi = new fgui.PackageItem();\n                pi.owner = this;\n                pi.type = buffer.readByte();\n                pi.id = buffer.readS();\n                pi.name = buffer.readS();\n                buffer.readS();\n                pi.file = buffer.readS();\n                buffer.readBool();\n                pi.width = buffer.readInt();\n                pi.height = buffer.readInt();\n                switch (pi.type) {\n                    case fgui.PackageItemType.Image:\n                        {\n                            pi.objectType = fgui.ObjectType.Image;\n                            var scaleOption = buffer.readByte();\n                            if (scaleOption == 1) {\n                                pi.scale9Grid = new egret.Rectangle();\n                                pi.scale9Grid.x = buffer.readInt();\n                                pi.scale9Grid.y = buffer.readInt();\n                                pi.scale9Grid.width = buffer.readInt();\n                                pi.scale9Grid.height = buffer.readInt();\n                                pi.tileGridIndice = buffer.readInt();\n                            }\n                            else if (scaleOption == 2)\n                                pi.scaleByTile = true;\n                            pi.smoothing = buffer.readBool();\n                            break;\n                        }\n                    case fgui.PackageItemType.MovieClip:\n                        {\n                            pi.smoothing = buffer.readBool();\n                            pi.objectType = fgui.ObjectType.MovieClip;\n                            pi.rawData = buffer.readBuffer();\n                            break;\n                        }\n                    case fgui.PackageItemType.Font:\n                        {\n                            pi.rawData = buffer.readBuffer();\n                            break;\n                        }\n                    case fgui.PackageItemType.Component:\n                        {\n                            var extension = buffer.readByte();\n                            if (extension > 0)\n                                pi.objectType = extension;\n                            else\n                                pi.objectType = fgui.ObjectType.Component;\n                            pi.rawData = buffer.readBuffer();\n                            fgui.UIObjectFactory.resolvePackageItemExtension(pi);\n                            break;\n                        }\n                    case fgui.PackageItemType.Atlas:\n                    case fgui.PackageItemType.Sound:\n                    case fgui.PackageItemType.Misc:\n                        {\n                            var pos_1 = pi.file.lastIndexOf(\".\");\n                            pi.file = path + (pos_1 == -1 ? pi.file : getAssetResKey(pi.file.substring(0, pos_1), pi.file.substring(pos_1 + 1)));\n                            break;\n                        }\n                    case fgui.PackageItemType.Spine:\n                    case fgui.PackageItemType.DragonBones:\n                        {\n                            var pos_2 = pi.file.lastIndexOf(\".\");\n                            pi.file = shortPath + (pos_2 == -1 ? pi.file : pi.file.substring(0, pos_2));\n                            pi.skeletonAnchor = new egret.Point();\n                            pi.skeletonAnchor.x = buffer.readFloat();\n                            pi.skeletonAnchor.y = buffer.readFloat();\n                            break;\n                        }\n                }\n                if (ver2) {\n                    str = buffer.readS();\n                    if (str)\n                        pi.name = str + \"/\" + pi.name;\n                    var branchCnt = buffer.readUnsignedByte();\n                    if (branchCnt > 0) {\n                        if (branchIncluded)\n                            pi.branches = buffer.readSArray(branchCnt);\n                        else\n                            this._itemsById[buffer.readS()] = pi;\n                    }\n                    var highResCnt = buffer.readUnsignedByte();\n                    if (highResCnt > 0)\n                        pi.highResolution = buffer.readSArray(highResCnt);\n                }\n                this._items.push(pi);\n                this._itemsById[pi.id] = pi;\n                if (pi.name != null)\n                    this._itemsByName[pi.name] = pi;\n                buffer.position = nextPos;\n            }\n            buffer.seek(indexTablePos, 2);\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                var itemId = buffer.readS();\n                pi = this._itemsById[buffer.readS()];\n                var sprite = { atlas: pi, rect: new egret.Rectangle(), offset: new egret.Point(), originalSize: new egret.Point() };\n                sprite.rect.x = buffer.readInt();\n                sprite.rect.y = buffer.readInt();\n                sprite.rect.width = buffer.readInt();\n                sprite.rect.height = buffer.readInt();\n                sprite.rotated = buffer.readBool();\n                if (ver2 && buffer.readBool()) {\n                    sprite.offset.x = buffer.readInt();\n                    sprite.offset.y = buffer.readInt();\n                    sprite.originalSize.x = buffer.readInt();\n                    sprite.originalSize.y = buffer.readInt();\n                }\n                else {\n                    sprite.originalSize.x = sprite.rect.width;\n                    sprite.originalSize.y = sprite.rect.height;\n                }\n                this._sprites[itemId] = sprite;\n                buffer.position = nextPos;\n            }\n            if (buffer.seek(indexTablePos, 3)) {\n                cnt = buffer.readShort();\n                for (i = 0; i < cnt; i++) {\n                    nextPos = buffer.readInt();\n                    nextPos += buffer.position;\n                    pi = this._itemsById[buffer.readS()];\n                    if (pi && pi.type == fgui.PackageItemType.Image) {\n                        pi.pixelHitTestData = new fgui.PixelHitTestData();\n                        pi.pixelHitTestData.load(buffer);\n                    }\n                    buffer.position = nextPos;\n                }\n            }\n        };\n        UIPackage.prototype.dispose = function () {\n            var cnt = this._items.length;\n            for (var i = 0; i < cnt; i++) {\n                var pi = this._items[i];\n                if (pi.type == fgui.PackageItemType.Atlas) {\n                    RES.destroyRes(pi.file, false);\n                }\n                else if (pi.type == fgui.PackageItemType.Sound) {\n                }\n            }\n        };\n        Object.defineProperty(UIPackage.prototype, \"id\", {\n            get: function () {\n                return this._id;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(UIPackage.prototype, \"name\", {\n            get: function () {\n                return this._name;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(UIPackage.prototype, \"customId\", {\n            get: function () {\n                return this._customId;\n            },\n            set: function (value) {\n                if (this._customId != null)\n                    delete UIPackage._instById[this._customId];\n                this._customId = value;\n                if (this._customId != null)\n                    UIPackage._instById[this._customId] = this;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        UIPackage.prototype.createObject = function (resName, userClass) {\n            var pi = this._itemsByName[resName];\n            if (pi)\n                return this.internalCreateObject(pi, userClass);\n            else\n                return null;\n        };\n        UIPackage.prototype.internalCreateObject = function (item, userClass) {\n            var g = fgui.UIObjectFactory.newObject(item, userClass);\n            if (g == null)\n                return null;\n            UIPackage._constructing++;\n            g.constructFromResource();\n            UIPackage._constructing--;\n            return g;\n        };\n        UIPackage.prototype.getItemById = function (itemId) {\n            return this._itemsById[itemId];\n        };\n        UIPackage.prototype.getItemByName = function (resName) {\n            return this._itemsByName[resName];\n        };\n        UIPackage.prototype.getItemAssetByName = function (resName) {\n            var pi = this._itemsByName[resName];\n            if (pi == null) {\n                throw \"Resource not found -\" + resName;\n            }\n            return this.getItemAsset(pi);\n        };\n        UIPackage.prototype.getItemAsset = function (item) {\n            switch (item.type) {\n                case fgui.PackageItemType.Image:\n                    if (!item.decoded) {\n                        item.decoded = true;\n                        var sprite = this._sprites[item.id];\n                        if (sprite) {\n                            var atlas = this.getItemAsset(sprite.atlas);\n                            item.asset = new egret.Texture();\n                            item.asset.bitmapData = atlas.bitmapData;\n                            item.asset.$initData(atlas.$bitmapX + sprite.rect.x, atlas.$bitmapY + sprite.rect.y, sprite.rect.width, sprite.rect.height, sprite.offset.x, sprite.offset.y, sprite.originalSize.x, sprite.originalSize.y, atlas.$sourceWidth, atlas.$sourceHeight, sprite.rotated);\n                        }\n                    }\n                    return item.asset;\n                case fgui.PackageItemType.Atlas:\n                case fgui.PackageItemType.Sound:\n                    if (!item.decoded) {\n                        item.decoded = true;\n                        item.asset = RES.getRes(item.file);\n                        if (!item.asset)\n                            console.log(\"Resource '\" + item.file + \"' not found, please check default.res.json!\");\n                    }\n                    return item.asset;\n                case fgui.PackageItemType.Font:\n                    if (!item.decoded) {\n                        item.decoded = true;\n                        this.loadFont(item);\n                    }\n                    return item.bitmapFont;\n                case fgui.PackageItemType.MovieClip:\n                    if (!item.decoded) {\n                        item.decoded = true;\n                        this.loadMovieClip(item);\n                    }\n                    return item.frames;\n                case fgui.PackageItemType.Misc:\n                    if (item.file)\n                        return RES.getRes(item.file);\n                    else\n                        return null;\n                default:\n                    return null;\n            }\n        };\n        UIPackage.prototype.getItemAssetAsync = function (item, onComplete) {\n            if (item.decoded) {\n                onComplete(null, item);\n                return;\n            }\n            if (item.loading) {\n                item.loading.push(onComplete);\n                return;\n            }\n            switch (item.type) {\n                case fgui.PackageItemType.DragonBones:\n                    item.loading = [onComplete];\n                    this.loadDragonBones(item);\n                    break;\n                default:\n                    this.getItemAsset(item);\n                    onComplete(null, item);\n                    break;\n            }\n        };\n        UIPackage.prototype.loadMovieClip = function (item) {\n            var buffer = item.rawData;\n            buffer.seek(0, 0);\n            item.interval = buffer.readInt();\n            item.swing = buffer.readBool();\n            item.repeatDelay = buffer.readInt();\n            buffer.seek(0, 1);\n            var frameCount = buffer.readShort();\n            item.frames = Array(frameCount);\n            var spriteId;\n            var sprite;\n            var fx;\n            var fy;\n            for (var i = 0; i < frameCount; i++) {\n                var nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                var frame = {};\n                fx = buffer.readInt();\n                fy = buffer.readInt();\n                buffer.readInt();\n                buffer.readInt();\n                frame.addDelay = buffer.readInt();\n                spriteId = buffer.readS();\n                if (spriteId != null && (sprite = this._sprites[spriteId]) != null) {\n                    var atlas = this.getItemAsset(sprite.atlas);\n                    frame.texture = new egret.Texture();\n                    frame.texture.bitmapData = atlas.bitmapData;\n                    frame.texture.$initData(atlas.$bitmapX + sprite.rect.x, atlas.$bitmapY + sprite.rect.y, sprite.rect.width, sprite.rect.height, fx, fy, item.width, item.height, atlas.$sourceWidth, atlas.$sourceHeight, sprite.rotated);\n                }\n                item.frames[i] = frame;\n                buffer.position = nextPos;\n            }\n        };\n        UIPackage.prototype.loadFont = function (item) {\n            var font = new fgui.BitmapFont();\n            item.bitmapFont = font;\n            var buffer = item.rawData;\n            buffer.seek(0, 0);\n            font.ttf = buffer.readBool();\n            font.tint = buffer.readBool();\n            font.resizable = buffer.readBool();\n            buffer.readBool();\n            font.size = buffer.readInt();\n            var xadvance = buffer.readInt();\n            var lineHeight = buffer.readInt();\n            var mainTexture;\n            var mainSprite = this._sprites[item.id];\n            if (mainSprite)\n                mainTexture = (this.getItemAsset(mainSprite.atlas));\n            buffer.seek(0, 1);\n            var bg;\n            var cnt = buffer.readInt();\n            for (var i = 0; i < cnt; i++) {\n                var nextPos = buffer.readShort();\n                nextPos += buffer.position;\n                bg = {};\n                var ch = buffer.readChar();\n                font.glyphs[ch] = bg;\n                var img = buffer.readS();\n                var bx = buffer.readInt();\n                var by = buffer.readInt();\n                bg.x = buffer.readInt();\n                bg.y = buffer.readInt();\n                bg.width = buffer.readInt();\n                bg.height = buffer.readInt();\n                bg.advance = buffer.readInt();\n                bg.channel = buffer.readByte();\n                if (bg.channel == 1)\n                    bg.channel = 3;\n                else if (bg.channel == 2)\n                    bg.channel = 2;\n                else if (bg.channel == 3)\n                    bg.channel = 1;\n                if (font.ttf) {\n                    bg.texture = new egret.Texture();\n                    bg.texture.bitmapData = mainTexture.bitmapData;\n                    bg.texture.$initData(mainTexture.$bitmapX + bx + mainSprite.rect.x, mainTexture.$bitmapY + by + mainSprite.rect.y, bg.width, bg.height, mainSprite.offset.x, mainSprite.offset.y, mainSprite.originalSize.x, mainSprite.originalSize.y, mainTexture.$sourceWidth, mainTexture.$sourceHeight, mainSprite.rotated);\n                    bg.lineHeight = lineHeight;\n                }\n                else {\n                    var charImg = this._itemsById[img];\n                    if (charImg) {\n                        this.getItemAsset(charImg);\n                        bg.width = charImg.width;\n                        bg.height = charImg.height;\n                        bg.texture = charImg.asset;\n                    }\n                    if (bg.advance == 0) {\n                        if (xadvance == 0)\n                            bg.advance = bg.x + bg.width;\n                        else\n                            bg.advance = xadvance;\n                    }\n                    bg.lineHeight = bg.y < 0 ? bg.height : (bg.y + bg.height);\n                    if (bg.lineHeight < font.size)\n                        bg.lineHeight = font.size;\n                }\n                buffer.position = nextPos;\n            }\n        };\n        UIPackage.prototype.loadDragonBones = function (item) {\n            var jsonFile = getAssetResKey(item.file, [\"json\", \"dbbin\"]);\n            var str = item.file.replace(\"_ske\", \"_tex\");\n            var atlasFile = getAssetResKey(str, \"json\");\n            var texFile = getAssetResKey(str, \"png\");\n            var task1 = RES.getResAsync(jsonFile);\n            var task2 = RES.getResAsync(atlasFile);\n            var task3 = RES.getResAsync(texFile);\n            Promise.all([task1, task2, task3]).then(function (values) {\n                var egretFactory = dragonBones.EgretFactory.factory;\n                var asset = {\n                    data: egretFactory.parseDragonBonesData(values[0]),\n                    atlasData: egretFactory.parseTextureAtlasData(values[1], values[2])\n                };\n                item.asset = asset;\n                item.armatureName = asset.data.armatureNames[0];\n                var arr = item.loading;\n                delete item.loading;\n                arr.forEach(function (e) { return e(null, item); });\n            }).catch(function (reason) {\n                var arr = item.loading;\n                delete item.loading;\n                arr.forEach(function (e) { return e(reason, item); });\n            });\n        };\n        UIPackage._constructing = 0;\n        UIPackage._instById = {};\n        UIPackage._instByName = {};\n        UIPackage._branch = \"\";\n        UIPackage._vars = {};\n        return UIPackage;\n    }());\n    fgui.UIPackage = UIPackage;\n    function getAssetResKey(file, types) {\n        if (Array.isArray(types)) {\n            for (var i = 0; i < types.length; i++) {\n                var key = file + \"_\" + types[i];\n                if (RES.hasRes(key))\n                    return key;\n            }\n            return file;\n        }\n        else {\n            var key = file + \"_\" + types;\n            if (RES.hasRes(key))\n                return key;\n            return file;\n        }\n    }\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var Window = (function (_super_1) {\n        __extends(Window, _super_1);\n        function Window() {\n            var _this = _super_1.call(this) || this;\n            _this._requestingCmd = 0;\n            _this._uiSources = new Array();\n            _this.bringToFontOnClick = fgui.UIConfig.bringWindowToFrontOnClick;\n            _this.displayObject.addEventListener(egret.Event.ADDED_TO_STAGE, _this.__onShown, _this);\n            _this.displayObject.addEventListener(egret.Event.REMOVED_FROM_STAGE, _this.__onHidden, _this);\n            _this.displayObject.addEventListener(egret.TouchEvent.TOUCH_BEGIN, _this.__mouseDown, _this, true);\n            return _this;\n        }\n        Window.prototype.addUISource = function (source) {\n            this._uiSources.push(source);\n        };\n        Object.defineProperty(Window.prototype, \"contentPane\", {\n            get: function () {\n                return this._contentPane;\n            },\n            set: function (val) {\n                if (this._contentPane != val) {\n                    if (this._contentPane)\n                        this.removeChild(this._contentPane);\n                    this._contentPane = val;\n                    if (this._contentPane) {\n                        this.addChild(this._contentPane);\n                        this.setSize(this._contentPane.width, this._contentPane.height);\n                        this._contentPane.addRelation(this, fgui.RelationType.Size);\n                        this._frame = (this._contentPane.getChild(\"frame\"));\n                        if (this._frame) {\n                            this.closeButton = this._frame.getChild(\"closeButton\");\n                            this.dragArea = this._frame.getChild(\"dragArea\");\n                            this.contentArea = this._frame.getChild(\"contentArea\");\n                        }\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Window.prototype, \"frame\", {\n            get: function () {\n                return this._frame;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Window.prototype, \"closeButton\", {\n            get: function () {\n                return this._closeButton;\n            },\n            set: function (value) {\n                if (this._closeButton)\n                    this._closeButton.removeClickListener(this.closeEventHandler, this);\n                this._closeButton = value;\n                if (this._closeButton)\n                    this._closeButton.addClickListener(this.closeEventHandler, this);\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Window.prototype, \"dragArea\", {\n            get: function () {\n                return this._dragArea;\n            },\n            set: function (value) {\n                if (this._dragArea != value) {\n                    if (this._dragArea) {\n                        this._dragArea.draggable = false;\n                        this._dragArea.removeEventListener(fgui.DragEvent.DRAG_START, this.__dragStart, this);\n                    }\n                    this._dragArea = value;\n                    if (this._dragArea) {\n                        if ((this._dragArea instanceof fgui.GGraph) && this._dragArea.displayObject == null)\n                            this._dragArea.asGraph.drawRect(0, 0, 0, 0, 0);\n                        this._dragArea.draggable = true;\n                        this._dragArea.addEventListener(fgui.DragEvent.DRAG_START, this.__dragStart, this);\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Window.prototype, \"contentArea\", {\n            get: function () {\n                return this._contentArea;\n            },\n            set: function (value) {\n                this._contentArea = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Window.prototype.show = function () {\n            fgui.GRoot.inst.showWindow(this);\n        };\n        Window.prototype.showOn = function (root) {\n            root.showWindow(this);\n        };\n        Window.prototype.hide = function () {\n            if (this.isShowing)\n                this.doHideAnimation();\n        };\n        Window.prototype.hideImmediately = function () {\n            var r = (this.parent instanceof fgui.GRoot) ? this.parent : null;\n            if (!r)\n                r = fgui.GRoot.inst;\n            r.hideWindowImmediately(this);\n        };\n        Window.prototype.centerOn = function (r, restraint) {\n            this.setXY(Math.round((r.width - this.width) / 2), Math.round((r.height - this.height) / 2));\n            if (restraint) {\n                this.addRelation(r, fgui.RelationType.Center_Center);\n                this.addRelation(r, fgui.RelationType.Middle_Middle);\n            }\n        };\n        Window.prototype.toggleStatus = function () {\n            if (this.isTop)\n                this.hide();\n            else\n                this.show();\n        };\n        Object.defineProperty(Window.prototype, \"isShowing\", {\n            get: function () {\n                return this.parent != null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Window.prototype, \"isTop\", {\n            get: function () {\n                return this.parent != null && this.parent.getChildIndex(this) == this.parent.numChildren - 1;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Window.prototype, \"modal\", {\n            get: function () {\n                return this._modal;\n            },\n            set: function (val) {\n                this._modal = val;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Window.prototype.bringToFront = function () {\n            this.root.bringToFront(this);\n        };\n        Window.prototype.showModalWait = function (requestingCmd) {\n            if (requestingCmd != undefined)\n                this._requestingCmd = requestingCmd;\n            if (fgui.UIConfig.windowModalWaiting) {\n                if (!this._modalWaitPane)\n                    this._modalWaitPane = fgui.UIPackage.createObjectFromURL(fgui.UIConfig.windowModalWaiting);\n                this.layoutModalWaitPane();\n                this.addChild(this._modalWaitPane);\n            }\n        };\n        Window.prototype.layoutModalWaitPane = function () {\n            if (this._contentArea) {\n                var pt = this._frame.localToGlobal();\n                pt = this.globalToLocal(pt.x, pt.y, pt);\n                this._modalWaitPane.setXY(pt.x + this._contentArea.x, pt.y + this._contentArea.y);\n                this._modalWaitPane.setSize(this._contentArea.width, this._contentArea.height);\n            }\n            else\n                this._modalWaitPane.setSize(this.width, this.height);\n        };\n        Window.prototype.closeModalWait = function (requestingCmd) {\n            if (requestingCmd != null && requestingCmd != 0) {\n                if (this._requestingCmd != requestingCmd)\n                    return false;\n            }\n            this._requestingCmd = 0;\n            if (this._modalWaitPane && this._modalWaitPane.parent != null)\n                this.removeChild(this._modalWaitPane);\n            return true;\n        };\n        Object.defineProperty(Window.prototype, \"modalWaiting\", {\n            get: function () {\n                return this._modalWaitPane && this._modalWaitPane.parent != null;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Window.prototype.init = function () {\n            if (this._inited || this._loading)\n                return;\n            if (this._uiSources.length > 0) {\n                this._loading = false;\n                var cnt = this._uiSources.length;\n                for (var i = 0; i < cnt; i++) {\n                    var lib = this._uiSources[i];\n                    if (!lib.loaded) {\n                        lib.load(this.__uiLoadComplete, this);\n                        this._loading = true;\n                    }\n                }\n                if (!this._loading)\n                    this._init();\n            }\n            else\n                this._init();\n        };\n        Window.prototype.onInit = function () {\n        };\n        Window.prototype.onShown = function () {\n        };\n        Window.prototype.onHide = function () {\n        };\n        Window.prototype.doShowAnimation = function () {\n            this.onShown();\n        };\n        Window.prototype.doHideAnimation = function () {\n            this.hideImmediately();\n        };\n        Window.prototype.__uiLoadComplete = function () {\n            var cnt = this._uiSources.length;\n            for (var i = 0; i < cnt; i++) {\n                var lib = this._uiSources[i];\n                if (!lib.loaded)\n                    return;\n            }\n            this._loading = false;\n            this._init();\n        };\n        Window.prototype._init = function () {\n            this._inited = true;\n            this.onInit();\n            if (this.isShowing)\n                this.doShowAnimation();\n        };\n        Window.prototype.dispose = function () {\n            this.displayObject.removeEventListener(egret.Event.ADDED_TO_STAGE, this.__onShown, this);\n            this.displayObject.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.__onHidden, this);\n            if (this.parent)\n                this.hideImmediately();\n            _super_1.prototype.dispose.call(this);\n        };\n        Window.prototype.closeEventHandler = function (evt) {\n            this.hide();\n        };\n        Window.prototype.__onShown = function (evt) {\n            if (!this._inited)\n                this.init();\n            else\n                this.doShowAnimation();\n        };\n        Window.prototype.__onHidden = function (evt) {\n            this.closeModalWait();\n            this.onHide();\n        };\n        Window.prototype.__mouseDown = function (evt) {\n            if (this.isShowing && this.bringToFontOnClick)\n                this.bringToFront();\n        };\n        Window.prototype.__dragStart = function (evt) {\n            evt.preventDefault();\n            this.startDrag(evt.touchPointID, evt.stageX, evt.stageY);\n        };\n        return Window;\n    }(fgui.GComponent));\n    fgui.Window = Window;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ControllerAction = (function () {\n        function ControllerAction() {\n        }\n        ControllerAction.createAction = function (type) {\n            switch (type) {\n                case 0:\n                    return new fgui.PlayTransitionAction();\n                case 1:\n                    return new fgui.ChangePageAction();\n            }\n            return null;\n        };\n        ControllerAction.prototype.run = function (controller, prevPage, curPage) {\n            if ((this.fromPage == null || this.fromPage.length == 0 || this.fromPage.indexOf(prevPage) != -1)\n                && (this.toPage == null || this.toPage.length == 0 || this.toPage.indexOf(curPage) != -1))\n                this.enter(controller);\n            else\n                this.leave(controller);\n        };\n        ControllerAction.prototype.enter = function (controller) {\n        };\n        ControllerAction.prototype.leave = function (controller) {\n        };\n        ControllerAction.prototype.setup = function (buffer) {\n            var cnt;\n            var i;\n            cnt = buffer.readShort();\n            this.fromPage = [];\n            for (i = 0; i < cnt; i++)\n                this.fromPage[i] = buffer.readS();\n            cnt = buffer.readShort();\n            this.toPage = [];\n            for (i = 0; i < cnt; i++)\n                this.toPage[i] = buffer.readS();\n        };\n        return ControllerAction;\n    }());\n    fgui.ControllerAction = ControllerAction;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ChangePageAction = (function (_super_1) {\n        __extends(ChangePageAction, _super_1);\n        function ChangePageAction() {\n            return _super_1.call(this) || this;\n        }\n        ChangePageAction.prototype.enter = function (controller) {\n            if (!this.controllerName)\n                return;\n            var gcom;\n            if (this.objectId) {\n                var obj = controller.parent.getChildById(this.objectId);\n                if (obj instanceof fgui.GComponent)\n                    gcom = obj;\n                else\n                    return;\n            }\n            else\n                gcom = controller.parent;\n            if (gcom) {\n                var cc = gcom.getController(this.controllerName);\n                if (cc && cc != controller && !cc.changing) {\n                    if (this.targetPage == \"~1\") {\n                        if (controller.selectedIndex < cc.pageCount)\n                            cc.selectedIndex = controller.selectedIndex;\n                    }\n                    else if (this.targetPage == \"~2\")\n                        cc.selectedPage = controller.selectedPage;\n                    else\n                        cc.selectedPageId = this.targetPage;\n                }\n            }\n        };\n        ChangePageAction.prototype.setup = function (buffer) {\n            _super_1.prototype.setup.call(this, buffer);\n            this.objectId = buffer.readS();\n            this.controllerName = buffer.readS();\n            this.targetPage = buffer.readS();\n        };\n        return ChangePageAction;\n    }(fgui.ControllerAction));\n    fgui.ChangePageAction = ChangePageAction;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var PlayTransitionAction = (function (_super_1) {\n        __extends(PlayTransitionAction, _super_1);\n        function PlayTransitionAction() {\n            var _this = _super_1.call(this) || this;\n            _this.playTimes = 1;\n            _this.delay = 0;\n            _this.stopOnExit = false;\n            return _this;\n        }\n        PlayTransitionAction.prototype.enter = function (controller) {\n            var trans = controller.parent.getTransition(this.transitionName);\n            if (trans) {\n                if (this._currentTransition && this._currentTransition.playing)\n                    trans.changePlayTimes(this.playTimes);\n                else\n                    trans.play(null, null, null, this.playTimes, this.delay);\n                this._currentTransition = trans;\n            }\n        };\n        PlayTransitionAction.prototype.leave = function (controller) {\n            if (this.stopOnExit && this._currentTransition) {\n                this._currentTransition.stop();\n                this._currentTransition = null;\n            }\n        };\n        PlayTransitionAction.prototype.setup = function (buffer) {\n            _super_1.prototype.setup.call(this, buffer);\n            this.transitionName = buffer.readS();\n            this.playTimes = buffer.readInt();\n            this.delay = buffer.readFloat();\n            this.stopOnExit = buffer.readBool();\n        };\n        return PlayTransitionAction;\n    }(fgui.ControllerAction));\n    fgui.PlayTransitionAction = PlayTransitionAction;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var BitmapFont = (function () {\n        function BitmapFont() {\n            this.size = 0;\n            this.glyphs = {};\n        }\n        return BitmapFont;\n    }());\n    fgui.BitmapFont = BitmapFont;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    function fillImage(w, h, method, origin, clockwise, amount) {\n        if (amount <= 0)\n            return null;\n        else if (amount >= 0.9999)\n            return [0, 0, w, 0, w, h, 0, h];\n        var points;\n        switch (method) {\n            case fgui.FillMethod.Horizontal:\n                points = fillHorizontal(w, h, origin, amount);\n                break;\n            case fgui.FillMethod.Vertical:\n                points = fillVertical(w, h, origin, amount);\n                break;\n            case fgui.FillMethod.Radial90:\n                points = fillRadial90(w, h, origin, clockwise, amount);\n                break;\n            case fgui.FillMethod.Radial180:\n                points = fillRadial180(w, h, origin, clockwise, amount);\n                break;\n            case fgui.FillMethod.Radial360:\n                points = fillRadial360(w, h, origin, clockwise, amount);\n                break;\n        }\n        return points;\n    }\n    fgui.fillImage = fillImage;\n    function fillHorizontal(w, h, origin, amount) {\n        var w2 = w * amount;\n        if (origin == fgui.FillOrigin.Left || origin == fgui.FillOrigin.Top)\n            return [0, 0, w2, 0, w2, h, 0, h];\n        else\n            return [w, 0, w, h, w - w2, h, w - w2, 0];\n    }\n    function fillVertical(w, h, origin, amount) {\n        var h2 = h * amount;\n        if (origin == fgui.FillOrigin.Left || origin == fgui.FillOrigin.Top)\n            return [0, 0, 0, h2, w, h2, w, 0];\n        else\n            return [0, h, w, h, w, h - h2, 0, h - h2];\n    }\n    function fillRadial90(w, h, origin, clockwise, amount) {\n        if (clockwise && (origin == fgui.FillOrigin.TopRight || origin == fgui.FillOrigin.BottomLeft)\n            || !clockwise && (origin == fgui.FillOrigin.TopLeft || origin == fgui.FillOrigin.BottomRight)) {\n            amount = 1 - amount;\n        }\n        var v, v2, h2;\n        v = Math.tan(Math.PI / 2 * amount);\n        h2 = w * v;\n        v2 = (h2 - h) / h2;\n        var points;\n        switch (origin) {\n            case fgui.FillOrigin.TopLeft:\n                if (clockwise) {\n                    if (h2 <= h)\n                        points = [0, 0, w, h2, w, 0];\n                    else\n                        points = [0, 0, w * (1 - v2), h, w, h, w, 0];\n                }\n                else {\n                    if (h2 <= h)\n                        points = [0, 0, w, h2, w, h, 0, h];\n                    else\n                        points = [0, 0, w * (1 - v2), h, 0, h];\n                }\n                break;\n            case fgui.FillOrigin.TopRight:\n                if (clockwise) {\n                    if (h2 <= h)\n                        points = [w, 0, 0, h2, 0, h, w, h];\n                    else\n                        points = [w, 0, w * v2, h, w, h];\n                }\n                else {\n                    if (h2 <= h)\n                        points = [w, 0, 0, h2, 0, 0];\n                    else\n                        points = [w, 0, w * v2, h, 0, h, 0, 0];\n                }\n                break;\n            case fgui.FillOrigin.BottomLeft:\n                if (clockwise) {\n                    if (h2 <= h)\n                        points = [0, h, w, h - h2, w, 0, 0, 0];\n                    else\n                        points = [0, h, w * (1 - v2), 0, 0, 0];\n                }\n                else {\n                    if (h2 <= h)\n                        points = [0, h, w, h - h2, w, h];\n                    else\n                        points = [0, h, w * (1 - v2), 0, w, 0, w, h];\n                }\n                break;\n            case fgui.FillOrigin.BottomRight:\n                if (clockwise) {\n                    if (h2 <= h)\n                        points = [w, h, 0, h - h2, 0, h];\n                    else\n                        points = [w, h, w * v2, 0, 0, 0, 0, h];\n                }\n                else {\n                    if (h2 <= h)\n                        points = [w, h, 0, h - h2, 0, 0, w, 0];\n                    else\n                        points = [w, h, w * v2, 0, w, 0];\n                }\n                break;\n        }\n        return points;\n    }\n    function movePoints(points, offsetX, offsetY) {\n        var cnt = points.length;\n        for (var i = 0; i < cnt; i += 2) {\n            points[i] += offsetX;\n            points[i + 1] += offsetY;\n        }\n    }\n    function fillRadial180(w, h, origin, clockwise, amount) {\n        var points;\n        switch (origin) {\n            case fgui.FillOrigin.Top:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial90(w / 2, h, clockwise ? fgui.FillOrigin.TopLeft : fgui.FillOrigin.TopRight, clockwise, amount);\n                    if (clockwise)\n                        movePoints(points, w / 2, 0);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial90(w / 2, h, clockwise ? fgui.FillOrigin.TopRight : fgui.FillOrigin.TopLeft, clockwise, amount);\n                    if (clockwise)\n                        points.push(w, h, w, 0);\n                    else {\n                        movePoints(points, w / 2, 0);\n                        points.push(0, h, 0, 0);\n                    }\n                }\n                break;\n            case fgui.FillOrigin.Bottom:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial90(w / 2, h, clockwise ? fgui.FillOrigin.BottomRight : fgui.FillOrigin.BottomLeft, clockwise, amount);\n                    if (!clockwise)\n                        movePoints(points, w / 2, 0);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial90(w / 2, h, clockwise ? fgui.FillOrigin.BottomLeft : fgui.FillOrigin.BottomRight, clockwise, amount);\n                    if (clockwise) {\n                        movePoints(points, w / 2, 0);\n                        points.push(0, 0, 0, h);\n                    }\n                    else\n                        points.push(w, 0, w, h);\n                }\n                break;\n            case fgui.FillOrigin.Left:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial90(w, h / 2, clockwise ? fgui.FillOrigin.BottomLeft : fgui.FillOrigin.TopLeft, clockwise, amount);\n                    if (!clockwise)\n                        movePoints(points, 0, h / 2);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial90(w, h / 2, clockwise ? fgui.FillOrigin.TopLeft : fgui.FillOrigin.BottomLeft, clockwise, amount);\n                    if (clockwise) {\n                        movePoints(points, 0, h / 2);\n                        points.push(w, 0, 0, 0);\n                    }\n                    else\n                        points.push(w, h, 0, h);\n                }\n                break;\n            case fgui.FillOrigin.Right:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial90(w, h / 2, clockwise ? fgui.FillOrigin.TopRight : fgui.FillOrigin.BottomRight, clockwise, amount);\n                    if (clockwise)\n                        movePoints(points, 0, h / 2);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial90(w, h / 2, clockwise ? fgui.FillOrigin.BottomRight : fgui.FillOrigin.TopRight, clockwise, amount);\n                    if (clockwise)\n                        points.push(0, h, w, h);\n                    else {\n                        movePoints(points, 0, h / 2);\n                        points.push(0, 0, w, 0);\n                    }\n                }\n                break;\n        }\n        return points;\n    }\n    function fillRadial360(w, h, origin, clockwise, amount) {\n        var points;\n        switch (origin) {\n            case fgui.FillOrigin.Top:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial180(w / 2, h, clockwise ? fgui.FillOrigin.Left : fgui.FillOrigin.Right, clockwise, amount);\n                    if (clockwise)\n                        movePoints(points, w / 2, 0);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial180(w / 2, h, clockwise ? fgui.FillOrigin.Right : fgui.FillOrigin.Left, clockwise, amount);\n                    if (clockwise)\n                        points.push(w, h, w, 0, w / 2, 0);\n                    else {\n                        movePoints(points, w / 2, 0);\n                        points.push(0, h, 0, 0, w / 2, 0);\n                    }\n                }\n                break;\n            case fgui.FillOrigin.Bottom:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial180(w / 2, h, clockwise ? fgui.FillOrigin.Right : fgui.FillOrigin.Left, clockwise, amount);\n                    if (!clockwise)\n                        movePoints(points, w / 2, 0);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial180(w / 2, h, clockwise ? fgui.FillOrigin.Left : fgui.FillOrigin.Right, clockwise, amount);\n                    if (clockwise) {\n                        movePoints(points, w / 2, 0);\n                        points.push(0, 0, 0, h, w / 2, h);\n                    }\n                    else\n                        points.push(w, 0, w, h, w / 2, h);\n                }\n                break;\n            case fgui.FillOrigin.Left:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial180(w, h / 2, clockwise ? fgui.FillOrigin.Bottom : fgui.FillOrigin.Top, clockwise, amount);\n                    if (!clockwise)\n                        movePoints(points, 0, h / 2);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial180(w, h / 2, clockwise ? fgui.FillOrigin.Top : fgui.FillOrigin.Bottom, clockwise, amount);\n                    if (clockwise) {\n                        movePoints(points, 0, h / 2);\n                        points.push(w, 0, 0, 0, 0, h / 2);\n                    }\n                    else\n                        points.push(w, h, 0, h, 0, h / 2);\n                }\n                break;\n            case fgui.FillOrigin.Right:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial180(w, h / 2, clockwise ? fgui.FillOrigin.Top : fgui.FillOrigin.Bottom, clockwise, amount);\n                    if (clockwise)\n                        movePoints(points, 0, h / 2);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial180(w, h / 2, clockwise ? fgui.FillOrigin.Bottom : fgui.FillOrigin.Top, clockwise, amount);\n                    if (clockwise)\n                        points.push(0, h, w, h, w, h / 2);\n                    else {\n                        movePoints(points, 0, h / 2);\n                        points.push(0, 0, w, 0, w, h / 2);\n                    }\n                }\n                break;\n        }\n        return points;\n    }\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var Image = (function (_super_1) {\n        __extends(Image, _super_1);\n        function Image() {\n            var _this = _super_1.call(this) || this;\n            _this._fillMethod = 0;\n            _this._fillOrigin = 0;\n            _this._fillAmount = 0;\n            _this._color = 0xFFFFFF;\n            return _this;\n        }\n        Object.defineProperty(Image.prototype, \"color\", {\n            get: function () {\n                return this._color;\n            },\n            set: function (value) {\n                if (this._color != value) {\n                    this._color = value;\n                    if (this.tint == undefined)\n                        fgui.ToolSet.setColorFilter(this, value);\n                    else\n                        this.tint = value;\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Image.prototype.$setX = function (value) {\n            if (this.mask)\n                this.mask.x = value;\n            return _super_1.prototype.$setX.call(this, value);\n        };\n        Image.prototype.$setY = function (value) {\n            if (this.mask)\n                this.mask.y = value;\n            return _super_1.prototype.$setY.call(this, value);\n        };\n        Object.defineProperty(Image.prototype, \"fillMethod\", {\n            get: function () {\n                return this._fillMethod;\n            },\n            set: function (value) {\n                if (this._fillMethod != value) {\n                    this._fillMethod = value;\n                    if (this._fillMethod != 0) {\n                        if (!this._mask) {\n                            this._mask = new egret.Shape();\n                            this._mask.touchEnabled = false;\n                        }\n                        this.mask = this._mask;\n                        this._mask.x = this.x;\n                        this._mask.y = this.y;\n                        this.addEventListener(egret.Event.RESIZE, this.markChanged, this);\n                        this.markChanged();\n                    }\n                    else if (this.mask) {\n                        this._mask.graphics.clear();\n                        this.mask = null;\n                        this.removeEventListener(egret.Event.RESIZE, this.markChanged, this);\n                    }\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Image.prototype, \"fillOrigin\", {\n            get: function () {\n                return this._fillOrigin;\n            },\n            set: function (value) {\n                if (this._fillOrigin != value) {\n                    this._fillOrigin = value;\n                    if (this._fillMethod != 0)\n                        this.markChanged();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Image.prototype, \"fillClockwise\", {\n            get: function () {\n                return this._fillClockwise;\n            },\n            set: function (value) {\n                if (this._fillClockwise != value) {\n                    this._fillClockwise = value;\n                    if (this._fillMethod != 0)\n                        this.markChanged();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(Image.prototype, \"fillAmount\", {\n            get: function () {\n                return this._fillAmount;\n            },\n            set: function (value) {\n                if (this._fillAmount != value) {\n                    this._fillAmount = value;\n                    if (this._fillMethod != 0)\n                        this.markChanged();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Image.prototype.markChanged = function () {\n            if (!this._maskDirtyFlag) {\n                this._maskDirtyFlag = true;\n                fgui.GTimers.inst.callLater(this.doFill, this);\n            }\n        };\n        Image.prototype.doFill = function () {\n            this._maskDirtyFlag = false;\n            if (!this._mask.parent && this.parent)\n                this.parent.addChild(this._mask);\n            var w = this.width;\n            var h = this.height;\n            var g = this._mask.graphics;\n            g.clear();\n            if (w == 0 || h == 0)\n                return;\n            var points = fgui.fillImage(w, h, this._fillMethod, this._fillOrigin, this._fillClockwise, this._fillAmount);\n            if (!points)\n                return;\n            g.beginFill(0, 1);\n            fgui.ToolSet.fillPath(g, points, 0, 0);\n            g.endFill();\n        };\n        return Image;\n    }(egret.Bitmap));\n    fgui.Image = Image;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var MovieClip = (function (_super_1) {\n        __extends(MovieClip, _super_1);\n        function MovieClip() {\n            var _this = _super_1.call(this) || this;\n            _this.interval = 0;\n            _this.repeatDelay = 0;\n            _this.timeScale = 1;\n            _this._playing = true;\n            _this._frameCount = 0;\n            _this._frame = 0;\n            _this._start = 0;\n            _this._end = 0;\n            _this._times = 0;\n            _this._endAt = 0;\n            _this._status = 0;\n            _this._frameElapsed = 0;\n            _this._reversed = false;\n            _this._repeatedCount = 0;\n            _this.touchEnabled = false;\n            _this.setPlaySettings();\n            return _this;\n        }\n        Object.defineProperty(MovieClip.prototype, \"frames\", {\n            get: function () {\n                return this._frames;\n            },\n            set: function (value) {\n                this._frames = value;\n                this.scale9Grid = null;\n                this.fillMode = egret.BitmapFillMode.SCALE;\n                if (this._frames)\n                    this._frameCount = this._frames.length;\n                else\n                    this._frameCount = 0;\n                if (this._end == -1 || this._end > this._frameCount - 1)\n                    this._end = this._frameCount - 1;\n                if (this._endAt == -1 || this._endAt > this._frameCount - 1)\n                    this._endAt = this._frameCount - 1;\n                if (this._frame < 0 || this._frame > this._frameCount - 1)\n                    this._frame = this._frameCount - 1;\n                this.drawFrame();\n                this._frameElapsed = 0;\n                this._repeatedCount = 0;\n                this._reversed = false;\n                this.checkTimer();\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClip.prototype, \"frameCount\", {\n            get: function () {\n                return this._frameCount;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClip.prototype, \"frame\", {\n            get: function () {\n                return this._frame;\n            },\n            set: function (value) {\n                if (this._frame != value) {\n                    if (this._frames && value >= this._frameCount)\n                        value = this._frameCount - 1;\n                    this._frame = value;\n                    this._frameElapsed = 0;\n                    this.drawFrame();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClip.prototype, \"playing\", {\n            get: function () {\n                return this._playing;\n            },\n            set: function (value) {\n                if (this._playing != value) {\n                    this._playing = value;\n                    this.checkTimer();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(MovieClip.prototype, \"smoothing\", {\n            get: function () {\n                return this._smoothing;\n            },\n            set: function (value) {\n                this._smoothing = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        MovieClip.prototype.rewind = function () {\n            this._frame = 0;\n            this._frameElapsed = 0;\n            this._reversed = false;\n            this._repeatedCount = 0;\n            this.drawFrame();\n        };\n        MovieClip.prototype.syncStatus = function (anotherMc) {\n            this._frame = anotherMc._frame;\n            this._frameElapsed = anotherMc._frameElapsed;\n            this._reversed = anotherMc._reversed;\n            this._repeatedCount = anotherMc._repeatedCount;\n            this.drawFrame();\n        };\n        MovieClip.prototype.advance = function (timeInMiniseconds) {\n            var beginFrame = this._frame;\n            var beginReversed = this._reversed;\n            var backupTime = timeInMiniseconds;\n            while (true) {\n                var tt = this.interval + this._frames[this._frame].addDelay;\n                if (this._frame == 0 && this._repeatedCount > 0)\n                    tt += this.repeatDelay;\n                if (timeInMiniseconds < tt) {\n                    this._frameElapsed = 0;\n                    break;\n                }\n                timeInMiniseconds -= tt;\n                if (this.swing) {\n                    if (this._reversed) {\n                        this._frame--;\n                        if (this._frame <= 0) {\n                            this._frame = 0;\n                            this._repeatedCount++;\n                            this._reversed = !this._reversed;\n                        }\n                    }\n                    else {\n                        this._frame++;\n                        if (this._frame > this._frameCount - 1) {\n                            this._frame = Math.max(0, this._frameCount - 2);\n                            this._repeatedCount++;\n                            this._reversed = !this._reversed;\n                        }\n                    }\n                }\n                else {\n                    this._frame++;\n                    if (this._frame > this._frameCount - 1) {\n                        this._frame = 0;\n                        this._repeatedCount++;\n                    }\n                }\n                if (this._frame == beginFrame && this._reversed == beginReversed) {\n                    var roundTime = backupTime - timeInMiniseconds;\n                    timeInMiniseconds -= Math.floor(timeInMiniseconds / roundTime) * roundTime;\n                }\n            }\n            this.drawFrame();\n        };\n        MovieClip.prototype.setPlaySettings = function (start, end, times, endAt, endCallback, callbackObj) {\n            if (start == undefined)\n                start = 0;\n            if (end == undefined)\n                end = -1;\n            if (times == undefined)\n                times = 0;\n            if (endAt == undefined)\n                endAt = -1;\n            this._start = start;\n            this._end = end;\n            if (this._end == -1 || this._end > this._frameCount - 1)\n                this._end = this._frameCount - 1;\n            this._times = times;\n            this._endAt = endAt;\n            if (this._endAt == -1)\n                this._endAt = this._end;\n            this._status = 0;\n            this._callback = endCallback;\n            this._callbackObj = callbackObj;\n            this.frame = start;\n        };\n        MovieClip.prototype.update = function () {\n            if (!this._playing || this._frameCount == 0 || this._status == 3)\n                return;\n            var dt = fgui.GTimers.deltaTime;\n            if (this.timeScale != 1)\n                dt *= this.timeScale;\n            this._frameElapsed += dt;\n            var tt = this.interval + this._frames[this._frame].addDelay;\n            if (this._frame == 0 && this._repeatedCount > 0)\n                tt += this.repeatDelay;\n            if (this._frameElapsed < tt)\n                return;\n            this._frameElapsed -= tt;\n            if (this._frameElapsed > this.interval)\n                this._frameElapsed = this.interval;\n            if (this.swing) {\n                if (this._reversed) {\n                    this._frame--;\n                    if (this._frame <= 0) {\n                        this._frame = 0;\n                        this._repeatedCount++;\n                        this._reversed = !this._reversed;\n                    }\n                }\n                else {\n                    this._frame++;\n                    if (this._frame > this._frameCount - 1) {\n                        this._frame = Math.max(0, this._frameCount - 2);\n                        this._repeatedCount++;\n                        this._reversed = !this._reversed;\n                    }\n                }\n            }\n            else {\n                this._frame++;\n                if (this._frame > this._frameCount - 1) {\n                    this._frame = 0;\n                    this._repeatedCount++;\n                }\n            }\n            if (this._status == 1) {\n                this._frame = this._start;\n                this._frameElapsed = 0;\n                this._status = 0;\n            }\n            else if (this._status == 2) {\n                this._frame = this._endAt;\n                this._frameElapsed = 0;\n                this._status = 3;\n                if (this._callback != null) {\n                    var callback = this._callback;\n                    var caller = this._callbackObj;\n                    this._callback = null;\n                    this._callbackObj = null;\n                    callback.call(caller);\n                }\n            }\n            else {\n                if (this._frame == this._end) {\n                    if (this._times > 0) {\n                        this._times--;\n                        if (this._times == 0)\n                            this._status = 2;\n                        else\n                            this._status = 1;\n                    }\n                    else if (this._start != 0)\n                        this._status = 1;\n                }\n            }\n            this.drawFrame();\n        };\n        MovieClip.prototype.drawFrame = function () {\n            if (this._frameCount > 0 && this._frame < this._frames.length) {\n                var frame = this._frames[this._frame];\n                this.texture = frame.texture;\n            }\n            else\n                this.texture = null;\n        };\n        MovieClip.prototype.checkTimer = function () {\n            if (this._playing && this._frameCount > 0 && this.stage != null)\n                fgui.GTimers.inst.add(1, 0, this.update, this);\n            else\n                fgui.GTimers.inst.remove(this.update, this);\n        };\n        MovieClip.prototype.$onAddToStage = function (stage, nestLevel) {\n            _super_1.prototype.$onAddToStage.call(this, stage, nestLevel);\n            if (this._playing && this._frameCount > 0)\n                fgui.GTimers.inst.add(1, 0, this.update, this);\n        };\n        MovieClip.prototype.$onRemoveFromStage = function () {\n            _super_1.prototype.$onRemoveFromStage.call(this);\n            fgui.GTimers.inst.remove(this.update, this);\n        };\n        return MovieClip;\n    }(fgui.Image));\n    fgui.MovieClip = MovieClip;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var UIContainer = (function (_super_1) {\n        __extends(UIContainer, _super_1);\n        function UIContainer() {\n            var _this = _super_1.call(this) || this;\n            _this.touchEnabled = true;\n            _this.touchChildren = true;\n            return _this;\n        }\n        UIContainer.prototype.cacheHitArea = function (value) {\n            this._cachedHitArea = value;\n            if (value) {\n                if (!this._cachedMatrix)\n                    this._cachedMatrix = new egret.Matrix();\n                this._cachedMatrix.copyFrom(this.$getInvertedConcatenatedMatrix());\n            }\n        };\n        Object.defineProperty(UIContainer.prototype, \"hitArea\", {\n            get: function () {\n                return this._hitArea;\n            },\n            set: function (value) {\n                this._hitArea = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(UIContainer.prototype, \"opaque\", {\n            get: function () {\n                return this._opaque;\n            },\n            set: function (value) {\n                this._opaque = value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        UIContainer.prototype.$hitTest = function (stageX, stageY) {\n            if (!this.$visible)\n                return null;\n            if (this._hitArea) {\n                if (!this.touchEnabled)\n                    return null;\n                if (this._hitArea.$graphics) {\n                    if (!this._hitArea.$graphics.$hitTest(stageX, stageY))\n                        return null;\n                }\n                else {\n                    var m = this._cachedHitArea ? this._cachedMatrix : this.$getInvertedConcatenatedMatrix();\n                    var localX = m.a * stageX + m.c * stageY + m.tx;\n                    var localY = m.b * stageX + m.d * stageY + m.ty;\n                    if (!this._hitArea.contains(localX, localY))\n                        return null;\n                }\n                return this;\n            }\n            var ret = _super_1.prototype.$hitTest.call(this, stageX, stageY);\n            if (ret == this && !this.touchEnabled)\n                return null;\n            if (ret == null && this._opaque) {\n                var m = this._cachedHitArea ? this._cachedMatrix : this.$getInvertedConcatenatedMatrix();\n                var localX = m.a * stageX + m.c * stageY + m.tx;\n                var localY = m.b * stageX + m.d * stageY + m.ty;\n                if (localX >= 0 && localY >= 0 && localX <= this.$explicitWidth && localY <= this.$explicitHeight)\n                    return this;\n                else\n                    return null;\n            }\n            else if (ret == this && !this._opaque)\n                return null;\n            else\n                return ret;\n        };\n        return UIContainer;\n    }(egret.DisplayObjectContainer));\n    fgui.UIContainer = UIContainer;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var DragEvent = (function (_super_1) {\n        __extends(DragEvent, _super_1);\n        function DragEvent(type, stageX, stageY, touchPointID) {\n            if (stageX === void 0) { stageX = 0; }\n            if (stageY === void 0) { stageY = 0; }\n            if (touchPointID === void 0) { touchPointID = -1; }\n            var _this = _super_1.call(this, type, false) || this;\n            _this.touchPointID = 0;\n            _this.stageX = stageX;\n            _this.stageY = stageY;\n            _this.touchPointID = touchPointID;\n            return _this;\n        }\n        DragEvent.prototype.preventDefault = function () {\n            this._prevented = true;\n        };\n        DragEvent.prototype.isDefaultPrevented = function () {\n            return this._prevented;\n        };\n        DragEvent.DRAG_START = \"__dragStart\";\n        DragEvent.DRAG_END = \"__dragEnd\";\n        DragEvent.DRAG_MOVING = \"__dragMoving\";\n        return DragEvent;\n    }(egret.Event));\n    fgui.DragEvent = DragEvent;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var DropEvent = (function (_super_1) {\n        __extends(DropEvent, _super_1);\n        function DropEvent(type, source) {\n            var _this = _super_1.call(this, type, false) || this;\n            _this.source = source;\n            return _this;\n        }\n        DropEvent.DROP = \"__drop\";\n        return DropEvent;\n    }(egret.Event));\n    fgui.DropEvent = DropEvent;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ItemEvent = (function (_super_1) {\n        __extends(ItemEvent, _super_1);\n        function ItemEvent(type, itemObject, stageX, stageY) {\n            if (itemObject === void 0) { itemObject = null; }\n            if (stageX === void 0) { stageX = 0; }\n            if (stageY === void 0) { stageY = 0; }\n            var _this = _super_1.call(this, type, false) || this;\n            _this.itemObject = itemObject;\n            _this.stageX = stageX;\n            _this.stageY = stageY;\n            return _this;\n        }\n        ItemEvent.CLICK = \"___itemClick\";\n        return ItemEvent;\n    }(egret.Event));\n    fgui.ItemEvent = ItemEvent;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var StateChangeEvent = (function (_super_1) {\n        __extends(StateChangeEvent, _super_1);\n        function StateChangeEvent(type) {\n            return _super_1.call(this, type, false) || this;\n        }\n        StateChangeEvent.CHANGED = \"___stateChanged\";\n        return StateChangeEvent;\n    }(egret.Event));\n    fgui.StateChangeEvent = StateChangeEvent;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearBase = (function () {\n        function GearBase(owner) {\n            this._owner = owner;\n        }\n        GearBase.create = function (owner, index) {\n            if (!Classes)\n                Classes = [\n                    fgui.GearDisplay, fgui.GearXY, fgui.GearSize, fgui.GearLook, fgui.GearColor,\n                    fgui.GearAnimation, fgui.GearText, fgui.GearIcon, fgui.GearDisplay2, fgui.GearFontSize\n                ];\n            return new (Classes[index])(owner);\n        };\n        GearBase.prototype.dispose = function () {\n            if (this._tweenConfig && this._tweenConfig._tweener) {\n                this._tweenConfig._tweener.kill();\n                this._tweenConfig._tweener = null;\n            }\n        };\n        Object.defineProperty(GearBase.prototype, \"controller\", {\n            get: function () {\n                return this._controller;\n            },\n            set: function (val) {\n                if (val != this._controller) {\n                    this._controller = val;\n                    if (this._controller)\n                        this.init();\n                }\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GearBase.prototype, \"tweenConfig\", {\n            get: function () {\n                if (!this._tweenConfig)\n                    this._tweenConfig = new GearTweenConfig();\n                return this._tweenConfig;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GearBase.prototype.setup = function (buffer) {\n            this._controller = this._owner.parent.getControllerAt(buffer.readShort());\n            this.init();\n            var i;\n            var page;\n            var cnt = buffer.readShort();\n            if (this instanceof fgui.GearDisplay) {\n                this.pages = buffer.readSArray(cnt);\n            }\n            else if (this instanceof fgui.GearDisplay2) {\n                this.pages = buffer.readSArray(cnt);\n            }\n            else {\n                for (i = 0; i < cnt; i++) {\n                    page = buffer.readS();\n                    if (page == null)\n                        continue;\n                    this.addStatus(page, buffer);\n                }\n                if (buffer.readBool())\n                    this.addStatus(null, buffer);\n            }\n            if (buffer.readBool()) {\n                this._tweenConfig = new GearTweenConfig();\n                this._tweenConfig.easeType = buffer.readByte();\n                this._tweenConfig.duration = buffer.readFloat();\n                this._tweenConfig.delay = buffer.readFloat();\n            }\n            if (buffer.version >= 2) {\n                if (this instanceof fgui.GearXY) {\n                    if (buffer.readBool()) {\n                        this.positionsInPercent = true;\n                        for (i = 0; i < cnt; i++) {\n                            page = buffer.readS();\n                            if (page == null)\n                                continue;\n                            this.addExtStatus(page, buffer);\n                        }\n                        if (buffer.readBool())\n                            this.addExtStatus(null, buffer);\n                    }\n                }\n                else if (this instanceof fgui.GearDisplay2)\n                    this.condition = buffer.readByte();\n            }\n        };\n        GearBase.prototype.updateFromRelations = function (dx, dy) {\n        };\n        GearBase.prototype.addStatus = function (pageId, buffer) {\n        };\n        GearBase.prototype.init = function () {\n        };\n        GearBase.prototype.apply = function () {\n        };\n        GearBase.prototype.updateState = function () {\n        };\n        return GearBase;\n    }());\n    fgui.GearBase = GearBase;\n    var Classes;\n    var GearTweenConfig = (function () {\n        function GearTweenConfig() {\n            this.tween = true;\n            this.easeType = fgui.EaseType.QuadOut;\n            this.duration = 0.3;\n            this.delay = 0;\n        }\n        return GearTweenConfig;\n    }());\n    fgui.GearTweenConfig = GearTweenConfig;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearAnimation = (function (_super_1) {\n        __extends(GearAnimation, _super_1);\n        function GearAnimation(owner) {\n            return _super_1.call(this, owner) || this;\n        }\n        GearAnimation.prototype.init = function () {\n            this._default = {\n                playing: this._owner.getProp(fgui.ObjectPropID.Playing),\n                frame: this._owner.getProp(fgui.ObjectPropID.Frame)\n            };\n            this._storage = {};\n        };\n        GearAnimation.prototype.addStatus = function (pageId, buffer) {\n            var gv;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n            gv.playing = buffer.readBool();\n            gv.frame = buffer.readInt();\n        };\n        GearAnimation.prototype.apply = function () {\n            this._owner._gearLocked = true;\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n            this._owner.setProp(fgui.ObjectPropID.Playing, gv.playing);\n            this._owner.setProp(fgui.ObjectPropID.Frame, gv.frame);\n            this._owner._gearLocked = false;\n        };\n        GearAnimation.prototype.updateState = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n            gv.playing = this._owner.getProp(fgui.ObjectPropID.Playing);\n            gv.frame = this._owner.getProp(fgui.ObjectPropID.Frame);\n        };\n        return GearAnimation;\n    }(fgui.GearBase));\n    fgui.GearAnimation = GearAnimation;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearColor = (function (_super_1) {\n        __extends(GearColor, _super_1);\n        function GearColor(owner) {\n            return _super_1.call(this, owner) || this;\n        }\n        GearColor.prototype.init = function () {\n            this._default = {\n                color: this._owner.getProp(fgui.ObjectPropID.Color),\n                strokeColor: this._owner.getProp(fgui.ObjectPropID.OutlineColor)\n            };\n            this._storage = {};\n        };\n        GearColor.prototype.addStatus = function (pageId, buffer) {\n            var gv;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n            gv.color = buffer.readColor();\n            gv.strokeColor = buffer.readColor();\n        };\n        GearColor.prototype.apply = function () {\n            this._owner._gearLocked = true;\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n            this._owner.setProp(fgui.ObjectPropID.Color, gv.color);\n            this._owner.setProp(fgui.ObjectPropID.OutlineColor, gv.strokeColor);\n            this._owner._gearLocked = false;\n        };\n        GearColor.prototype.updateState = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n            gv.color = this._owner.getProp(fgui.ObjectPropID.Color);\n            gv.strokeColor = this._owner.getProp(fgui.ObjectPropID.OutlineColor);\n        };\n        return GearColor;\n    }(fgui.GearBase));\n    fgui.GearColor = GearColor;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearDisplay = (function (_super_1) {\n        __extends(GearDisplay, _super_1);\n        function GearDisplay(owner) {\n            var _this = _super_1.call(this, owner) || this;\n            _this._displayLockToken = 1;\n            _this._visible = 0;\n            return _this;\n        }\n        GearDisplay.prototype.init = function () {\n            this.pages = null;\n        };\n        GearDisplay.prototype.apply = function () {\n            this._displayLockToken++;\n            if (this._displayLockToken == 0)\n                this._displayLockToken = 1;\n            if (this.pages == null || this.pages.length == 0\n                || this.pages.indexOf(this._controller.selectedPageId) != -1)\n                this._visible = 1;\n            else\n                this._visible = 0;\n        };\n        GearDisplay.prototype.addLock = function () {\n            this._visible++;\n            return this._displayLockToken;\n        };\n        GearDisplay.prototype.releaseLock = function (token) {\n            if (token == this._displayLockToken)\n                this._visible--;\n        };\n        Object.defineProperty(GearDisplay.prototype, \"connected\", {\n            get: function () {\n                return this._controller == null || this._visible > 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        return GearDisplay;\n    }(fgui.GearBase));\n    fgui.GearDisplay = GearDisplay;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearDisplay2 = (function (_super_1) {\n        __extends(GearDisplay2, _super_1);\n        function GearDisplay2(owner) {\n            var _this = _super_1.call(this, owner) || this;\n            _this._visible = 0;\n            return _this;\n        }\n        GearDisplay2.prototype.init = function () {\n            this.pages = null;\n        };\n        GearDisplay2.prototype.apply = function () {\n            if (this.pages == null || this.pages.length == 0\n                || this.pages.indexOf(this._controller.selectedPageId) != -1)\n                this._visible = 1;\n            else\n                this._visible = 0;\n        };\n        GearDisplay2.prototype.evaluate = function (connected) {\n            var v = this._controller == null || this._visible > 0;\n            if (this.condition == 0)\n                v = v && connected;\n            else\n                v = v || connected;\n            return v;\n        };\n        return GearDisplay2;\n    }(fgui.GearBase));\n    fgui.GearDisplay2 = GearDisplay2;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearFontSize = (function (_super_1) {\n        __extends(GearFontSize, _super_1);\n        function GearFontSize(owner) {\n            var _this = _super_1.call(this, owner) || this;\n            _this._default = 0;\n            return _this;\n        }\n        GearFontSize.prototype.init = function () {\n            this._default = this._owner.getProp(fgui.ObjectPropID.FontSize);\n            this._storage = {};\n        };\n        GearFontSize.prototype.addStatus = function (pageId, buffer) {\n            if (pageId == null)\n                this._default = buffer.readInt();\n            else\n                this._storage[pageId] = buffer.readInt();\n        };\n        GearFontSize.prototype.apply = function () {\n            this._owner._gearLocked = true;\n            var data = this._storage[this._controller.selectedPageId];\n            if (data != undefined)\n                this._owner.setProp(fgui.ObjectPropID.FontSize, data);\n            else\n                this._owner.setProp(fgui.ObjectPropID.FontSize, this._default);\n            this._owner._gearLocked = false;\n        };\n        GearFontSize.prototype.updateState = function () {\n            this._storage[this._controller.selectedPageId] = this._owner.getProp(fgui.ObjectPropID.FontSize);\n        };\n        return GearFontSize;\n    }(fgui.GearBase));\n    fgui.GearFontSize = GearFontSize;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearIcon = (function (_super_1) {\n        __extends(GearIcon, _super_1);\n        function GearIcon(owner) {\n            return _super_1.call(this, owner) || this;\n        }\n        GearIcon.prototype.init = function () {\n            this._default = this._owner.icon;\n            this._storage = {};\n        };\n        GearIcon.prototype.addStatus = function (pageId, buffer) {\n            if (pageId == null)\n                this._default = buffer.readS();\n            else\n                this._storage[pageId] = buffer.readS();\n        };\n        GearIcon.prototype.apply = function () {\n            this._owner._gearLocked = true;\n            var data = this._storage[this._controller.selectedPageId];\n            if (data !== undefined)\n                this._owner.icon = data;\n            else\n                this._owner.icon = this._default;\n            this._owner._gearLocked = false;\n        };\n        GearIcon.prototype.updateState = function () {\n            this._storage[this._controller.selectedPageId] = this._owner.icon;\n        };\n        return GearIcon;\n    }(fgui.GearBase));\n    fgui.GearIcon = GearIcon;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearLook = (function (_super_1) {\n        __extends(GearLook, _super_1);\n        function GearLook(owner) {\n            return _super_1.call(this, owner) || this;\n        }\n        GearLook.prototype.init = function () {\n            this._default = {\n                alpha: this._owner.alpha,\n                rotation: this._owner.rotation,\n                grayed: this._owner.grayed,\n                touchable: this._owner.touchable\n            };\n            this._storage = {};\n        };\n        GearLook.prototype.addStatus = function (pageId, buffer) {\n            var gv;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n            gv.alpha = buffer.readFloat();\n            gv.rotation = buffer.readFloat();\n            gv.grayed = buffer.readBool();\n            gv.touchable = buffer.readBool();\n        };\n        GearLook.prototype.apply = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n            if (this._tweenConfig && this._tweenConfig.tween && !fgui.UIPackage._constructing && !fgui.GearBase.disableAllTweenEffect) {\n                this._owner._gearLocked = true;\n                this._owner.grayed = gv.grayed;\n                this._owner.touchable = gv.touchable;\n                this._owner._gearLocked = false;\n                if (this._tweenConfig._tweener) {\n                    if (this._tweenConfig._tweener.endValue.x != gv.alpha || this._tweenConfig._tweener.endValue.y != gv.rotation) {\n                        this._tweenConfig._tweener.kill(true);\n                        this._tweenConfig._tweener = null;\n                    }\n                    else\n                        return;\n                }\n                var a = gv.alpha != this._owner.alpha;\n                var b = gv.rotation != this._owner.rotation;\n                if (a || b) {\n                    if (this._owner.checkGearController(0, this._controller))\n                        this._tweenConfig._displayLockToken = this._owner.addDisplayLock();\n                    this._tweenConfig._tweener = fgui.GTween.to2(this._owner.alpha, this._owner.rotation, gv.alpha, gv.rotation, this._tweenConfig.duration)\n                        .setDelay(this._tweenConfig.delay)\n                        .setEase(this._tweenConfig.easeType)\n                        .setUserData((a ? 1 : 0) + (b ? 2 : 0))\n                        .setTarget(this)\n                        .onUpdate(this.__tweenUpdate, this)\n                        .onComplete(this.__tweenComplete, this);\n                }\n            }\n            else {\n                this._owner._gearLocked = true;\n                this._owner.grayed = gv.grayed;\n                this._owner.touchable = gv.touchable;\n                this._owner.alpha = gv.alpha;\n                this._owner.rotation = gv.rotation;\n                this._owner._gearLocked = false;\n            }\n        };\n        GearLook.prototype.__tweenUpdate = function (tweener) {\n            var flag = tweener.userData;\n            this._owner._gearLocked = true;\n            if ((flag & 1) != 0)\n                this._owner.alpha = tweener.value.x;\n            if ((flag & 2) != 0)\n                this._owner.rotation = tweener.value.y;\n            this._owner._gearLocked = false;\n        };\n        GearLook.prototype.__tweenComplete = function () {\n            if (this._tweenConfig._displayLockToken != 0) {\n                this._owner.releaseDisplayLock(this._tweenConfig._displayLockToken);\n                this._tweenConfig._displayLockToken = 0;\n            }\n            this._tweenConfig._tweener = null;\n        };\n        GearLook.prototype.updateState = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n            gv.alpha = this._owner.alpha;\n            gv.rotation = this._owner.rotation;\n            gv.grayed = this._owner.grayed;\n            gv.touchable = this._owner.touchable;\n        };\n        return GearLook;\n    }(fgui.GearBase));\n    fgui.GearLook = GearLook;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearSize = (function (_super_1) {\n        __extends(GearSize, _super_1);\n        function GearSize(owner) {\n            return _super_1.call(this, owner) || this;\n        }\n        GearSize.prototype.init = function () {\n            this._default = {\n                width: this._owner.width,\n                height: this._owner.height,\n                scaleX: this._owner.scaleX,\n                scaleY: this._owner.scaleY\n            };\n            this._storage = {};\n        };\n        GearSize.prototype.addStatus = function (pageId, buffer) {\n            var gv;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n            gv.width = buffer.readInt();\n            gv.height = buffer.readInt();\n            gv.scaleX = buffer.readFloat();\n            gv.scaleY = buffer.readFloat();\n        };\n        GearSize.prototype.apply = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n            if (this._tweenConfig && this._tweenConfig.tween && !fgui.UIPackage._constructing && !fgui.GearBase.disableAllTweenEffect) {\n                if (this._tweenConfig._tweener) {\n                    if (this._tweenConfig._tweener.endValue.x != gv.width || this._tweenConfig._tweener.endValue.y != gv.height\n                        || this._tweenConfig._tweener.endValue.z != gv.scaleX || this._tweenConfig._tweener.endValue.w != gv.scaleY) {\n                        this._tweenConfig._tweener.kill(true);\n                        this._tweenConfig._tweener = null;\n                    }\n                    else\n                        return;\n                }\n                var a = gv.width != this._owner.width || gv.height != this._owner.height;\n                var b = gv.scaleX != this._owner.scaleX || gv.scaleY != this._owner.scaleY;\n                if (a || b) {\n                    if (this._owner.checkGearController(0, this._controller))\n                        this._tweenConfig._displayLockToken = this._owner.addDisplayLock();\n                    this._tweenConfig._tweener = fgui.GTween.to4(this._owner.width, this._owner.height, this._owner.scaleX, this._owner.scaleY, gv.width, gv.height, gv.scaleX, gv.scaleY, this._tweenConfig.duration)\n                        .setDelay(this._tweenConfig.delay)\n                        .setEase(this._tweenConfig.easeType)\n                        .setUserData((a ? 1 : 0) + (b ? 2 : 0))\n                        .setTarget(this)\n                        .onUpdate(this.__tweenUpdate, this)\n                        .onComplete(this.__tweenComplete, this);\n                }\n            }\n            else {\n                this._owner._gearLocked = true;\n                this._owner.setSize(gv.width, gv.height, this._owner.gearXY.controller == this._controller);\n                this._owner.setScale(gv.scaleX, gv.scaleY);\n                this._owner._gearLocked = false;\n            }\n        };\n        GearSize.prototype.__tweenUpdate = function (tweener) {\n            var flag = tweener.userData;\n            this._owner._gearLocked = true;\n            if ((flag & 1) != 0)\n                this._owner.setSize(tweener.value.x, tweener.value.y, this._owner.checkGearController(1, this._controller));\n            if ((flag & 2) != 0)\n                this._owner.setScale(tweener.value.z, tweener.value.w);\n            this._owner._gearLocked = false;\n        };\n        GearSize.prototype.__tweenComplete = function () {\n            if (this._tweenConfig._displayLockToken != 0) {\n                this._owner.releaseDisplayLock(this._tweenConfig._displayLockToken);\n                this._tweenConfig._displayLockToken = 0;\n            }\n            this._tweenConfig._tweener = null;\n        };\n        GearSize.prototype.updateState = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n            gv.width = this._owner.width;\n            gv.height = this._owner.height;\n            gv.scaleX = this._owner.scaleX;\n            gv.scaleY = this._owner.scaleY;\n        };\n        GearSize.prototype.updateFromRelations = function (dx, dy) {\n            if (this._controller == null || this._storage == null)\n                return;\n            for (var key in this._storage) {\n                var gv = this._storage[key];\n                gv.width += dx;\n                gv.height += dy;\n            }\n            this._default.width += dx;\n            this._default.height += dy;\n            this.updateState();\n        };\n        return GearSize;\n    }(fgui.GearBase));\n    fgui.GearSize = GearSize;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearText = (function (_super_1) {\n        __extends(GearText, _super_1);\n        function GearText(owner) {\n            return _super_1.call(this, owner) || this;\n        }\n        GearText.prototype.init = function () {\n            this._default = this._owner.text;\n            this._storage = {};\n        };\n        GearText.prototype.addStatus = function (pageId, buffer) {\n            if (pageId == null)\n                this._default = buffer.readS();\n            else\n                this._storage[pageId] = buffer.readS();\n        };\n        GearText.prototype.apply = function () {\n            this._owner._gearLocked = true;\n            var data = this._storage[this._controller.selectedPageId];\n            if (data !== undefined)\n                this._owner.text = data;\n            else\n                this._owner.text = this._default;\n            this._owner._gearLocked = false;\n        };\n        GearText.prototype.updateState = function () {\n            this._storage[this._controller.selectedPageId] = this._owner.text;\n        };\n        return GearText;\n    }(fgui.GearBase));\n    fgui.GearText = GearText;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GearXY = (function (_super_1) {\n        __extends(GearXY, _super_1);\n        function GearXY(owner) {\n            return _super_1.call(this, owner) || this;\n        }\n        GearXY.prototype.init = function () {\n            this._default = {\n                x: this._owner.x,\n                y: this._owner.y,\n                px: this._owner.x / this._owner.parent.width,\n                py: this._owner.y / this._owner.parent.height\n            };\n            this._storage = {};\n        };\n        GearXY.prototype.addStatus = function (pageId, buffer) {\n            var gv;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n            gv.x = buffer.readInt();\n            gv.y = buffer.readInt();\n        };\n        GearXY.prototype.addExtStatus = function (pageId, buffer) {\n            var gv;\n            if (pageId == null)\n                gv = this._default;\n            else\n                gv = this._storage[pageId];\n            gv.px = buffer.readFloat();\n            gv.py = buffer.readFloat();\n        };\n        GearXY.prototype.apply = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n            var ex;\n            var ey;\n            if (this.positionsInPercent && this._owner.parent) {\n                ex = gv.px * this._owner.parent.width;\n                ey = gv.py * this._owner.parent.height;\n            }\n            else {\n                ex = gv.x;\n                ey = gv.y;\n            }\n            if (this._tweenConfig && this._tweenConfig.tween && !fgui.UIPackage._constructing && !fgui.GearBase.disableAllTweenEffect) {\n                if (this._tweenConfig._tweener) {\n                    if (this._tweenConfig._tweener.endValue.x != ex || this._tweenConfig._tweener.endValue.y != ey) {\n                        this._tweenConfig._tweener.kill(true);\n                        this._tweenConfig._tweener = null;\n                    }\n                    else\n                        return;\n                }\n                var ox = this._owner.x;\n                var oy = this._owner.y;\n                if (ox != ex || oy != ey) {\n                    if (this._owner.checkGearController(0, this._controller))\n                        this._tweenConfig._displayLockToken = this._owner.addDisplayLock();\n                    this._tweenConfig._tweener = fgui.GTween.to2(ox, oy, ex, ey, this._tweenConfig.duration)\n                        .setDelay(this._tweenConfig.delay)\n                        .setEase(this._tweenConfig.easeType)\n                        .setTarget(this)\n                        .onUpdate(this.__tweenUpdate, this)\n                        .onComplete(this.__tweenComplete, this);\n                }\n            }\n            else {\n                this._owner._gearLocked = true;\n                this._owner.setXY(ex, ey);\n                this._owner._gearLocked = false;\n            }\n        };\n        GearXY.prototype.__tweenUpdate = function (tweener) {\n            this._owner._gearLocked = true;\n            this._owner.setXY(tweener.value.x, tweener.value.y);\n            this._owner._gearLocked = false;\n        };\n        GearXY.prototype.__tweenComplete = function () {\n            if (this._tweenConfig._displayLockToken != 0) {\n                this._owner.releaseDisplayLock(this._tweenConfig._displayLockToken);\n                this._tweenConfig._displayLockToken = 0;\n            }\n            this._tweenConfig._tweener = null;\n        };\n        GearXY.prototype.updateState = function () {\n            var gv = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n            gv.x = this._owner.x;\n            gv.y = this._owner.y;\n            gv.px = this._owner.x / this._owner.parent.width;\n            gv.py = this._owner.y / this._owner.parent.height;\n        };\n        GearXY.prototype.updateFromRelations = function (dx, dy) {\n            if (this._controller == null || this._storage == null || this.positionsInPercent)\n                return;\n            for (var key in this._storage) {\n                var pt = this._storage[key];\n                pt.x += dx;\n                pt.y += dy;\n            }\n            this._default.x += dx;\n            this._default.y += dy;\n            this.updateState();\n        };\n        return GearXY;\n    }(fgui.GearBase));\n    fgui.GearXY = GearXY;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var _PiOver2 = Math.PI * 0.5;\n    var _TwoPi = Math.PI * 2;\n    function evaluateEase(easeType, time, duration, overshootOrAmplitude, period) {\n        switch (easeType) {\n            case fgui.EaseType.Linear:\n                return time / duration;\n            case fgui.EaseType.SineIn:\n                return -Math.cos(time / duration * _PiOver2) + 1;\n            case fgui.EaseType.SineOut:\n                return Math.sin(time / duration * _PiOver2);\n            case fgui.EaseType.SineInOut:\n                return -0.5 * (Math.cos(Math.PI * time / duration) - 1);\n            case fgui.EaseType.QuadIn:\n                return (time /= duration) * time;\n            case fgui.EaseType.QuadOut:\n                return -(time /= duration) * (time - 2);\n            case fgui.EaseType.QuadInOut:\n                if ((time /= duration * 0.5) < 1)\n                    return 0.5 * time * time;\n                return -0.5 * ((--time) * (time - 2) - 1);\n            case fgui.EaseType.CubicIn:\n                return (time /= duration) * time * time;\n            case fgui.EaseType.CubicOut:\n                return ((time = time / duration - 1) * time * time + 1);\n            case fgui.EaseType.CubicInOut:\n                if ((time /= duration * 0.5) < 1)\n                    return 0.5 * time * time * time;\n                return 0.5 * ((time -= 2) * time * time + 2);\n            case fgui.EaseType.QuartIn:\n                return (time /= duration) * time * time * time;\n            case fgui.EaseType.QuartOut:\n                return -((time = time / duration - 1) * time * time * time - 1);\n            case fgui.EaseType.QuartInOut:\n                if ((time /= duration * 0.5) < 1)\n                    return 0.5 * time * time * time * time;\n                return -0.5 * ((time -= 2) * time * time * time - 2);\n            case fgui.EaseType.QuintIn:\n                return (time /= duration) * time * time * time * time;\n            case fgui.EaseType.QuintOut:\n                return ((time = time / duration - 1) * time * time * time * time + 1);\n            case fgui.EaseType.QuintInOut:\n                if ((time /= duration * 0.5) < 1)\n                    return 0.5 * time * time * time * time * time;\n                return 0.5 * ((time -= 2) * time * time * time * time + 2);\n            case fgui.EaseType.ExpoIn:\n                return (time == 0) ? 0 : Math.pow(2, 10 * (time / duration - 1));\n            case fgui.EaseType.ExpoOut:\n                if (time == duration)\n                    return 1;\n                return (-Math.pow(2, -10 * time / duration) + 1);\n            case fgui.EaseType.ExpoInOut:\n                if (time == 0)\n                    return 0;\n                if (time == duration)\n                    return 1;\n                if ((time /= duration * 0.5) < 1)\n                    return 0.5 * Math.pow(2, 10 * (time - 1));\n                return 0.5 * (-Math.pow(2, -10 * --time) + 2);\n            case fgui.EaseType.CircIn:\n                return -(Math.sqrt(1 - (time /= duration) * time) - 1);\n            case fgui.EaseType.CircOut:\n                return Math.sqrt(1 - (time = time / duration - 1) * time);\n            case fgui.EaseType.CircInOut:\n                if ((time /= duration * 0.5) < 1)\n                    return -0.5 * (Math.sqrt(1 - time * time) - 1);\n                return 0.5 * (Math.sqrt(1 - (time -= 2) * time) + 1);\n            case fgui.EaseType.ElasticIn:\n                var s0;\n                if (time == 0)\n                    return 0;\n                if ((time /= duration) == 1)\n                    return 1;\n                if (period == 0)\n                    period = duration * 0.3;\n                if (overshootOrAmplitude < 1) {\n                    overshootOrAmplitude = 1;\n                    s0 = period / 4;\n                }\n                else\n                    s0 = period / _TwoPi * Math.asin(1 / overshootOrAmplitude);\n                return -(overshootOrAmplitude * Math.pow(2, 10 * (time -= 1)) * Math.sin((time * duration - s0) * _TwoPi / period));\n            case fgui.EaseType.ElasticOut:\n                var s1;\n                if (time == 0)\n                    return 0;\n                if ((time /= duration) == 1)\n                    return 1;\n                if (period == 0)\n                    period = duration * 0.3;\n                if (overshootOrAmplitude < 1) {\n                    overshootOrAmplitude = 1;\n                    s1 = period / 4;\n                }\n                else\n                    s1 = period / _TwoPi * Math.asin(1 / overshootOrAmplitude);\n                return (overshootOrAmplitude * Math.pow(2, -10 * time) * Math.sin((time * duration - s1) * _TwoPi / period) + 1);\n            case fgui.EaseType.ElasticInOut:\n                var s;\n                if (time == 0)\n                    return 0;\n                if ((time /= duration * 0.5) == 2)\n                    return 1;\n                if (period == 0)\n                    period = duration * (0.3 * 1.5);\n                if (overshootOrAmplitude < 1) {\n                    overshootOrAmplitude = 1;\n                    s = period / 4;\n                }\n                else\n                    s = period / _TwoPi * Math.asin(1 / overshootOrAmplitude);\n                if (time < 1)\n                    return -0.5 * (overshootOrAmplitude * Math.pow(2, 10 * (time -= 1)) * Math.sin((time * duration - s) * _TwoPi / period));\n                return overshootOrAmplitude * Math.pow(2, -10 * (time -= 1)) * Math.sin((time * duration - s) * _TwoPi / period) * 0.5 + 1;\n            case fgui.EaseType.BackIn:\n                return (time /= duration) * time * ((overshootOrAmplitude + 1) * time - overshootOrAmplitude);\n            case fgui.EaseType.BackOut:\n                return ((time = time / duration - 1) * time * ((overshootOrAmplitude + 1) * time + overshootOrAmplitude) + 1);\n            case fgui.EaseType.BackInOut:\n                if ((time /= duration * 0.5) < 1)\n                    return 0.5 * (time * time * (((overshootOrAmplitude *= (1.525)) + 1) * time - overshootOrAmplitude));\n                return 0.5 * ((time -= 2) * time * (((overshootOrAmplitude *= (1.525)) + 1) * time + overshootOrAmplitude) + 2);\n            case fgui.EaseType.BounceIn:\n                return bounce_easeIn(time, duration);\n            case fgui.EaseType.BounceOut:\n                return bounce_easeOut(time, duration);\n            case fgui.EaseType.BounceInOut:\n                return bounce_easeInOut(time, duration);\n            default:\n                return -(time /= duration) * (time - 2);\n        }\n    }\n    fgui.evaluateEase = evaluateEase;\n    function bounce_easeIn(time, duration) {\n        return 1 - bounce_easeOut(duration - time, duration);\n    }\n    function bounce_easeOut(time, duration) {\n        if ((time /= duration) < (1 / 2.75)) {\n            return (7.5625 * time * time);\n        }\n        if (time < (2 / 2.75)) {\n            return (7.5625 * (time -= (1.5 / 2.75)) * time + 0.75);\n        }\n        if (time < (2.5 / 2.75)) {\n            return (7.5625 * (time -= (2.25 / 2.75)) * time + 0.9375);\n        }\n        return (7.5625 * (time -= (2.625 / 2.75)) * time + 0.984375);\n    }\n    function bounce_easeInOut(time, duration) {\n        if (time < duration * 0.5) {\n            return bounce_easeIn(time * 2, duration) * 0.5;\n        }\n        return bounce_easeOut(time * 2 - duration, duration) * 0.5 + 0.5;\n    }\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var EaseType = (function () {\n        function EaseType() {\n        }\n        EaseType.Linear = 0;\n        EaseType.SineIn = 1;\n        EaseType.SineOut = 2;\n        EaseType.SineInOut = 3;\n        EaseType.QuadIn = 4;\n        EaseType.QuadOut = 5;\n        EaseType.QuadInOut = 6;\n        EaseType.CubicIn = 7;\n        EaseType.CubicOut = 8;\n        EaseType.CubicInOut = 9;\n        EaseType.QuartIn = 10;\n        EaseType.QuartOut = 11;\n        EaseType.QuartInOut = 12;\n        EaseType.QuintIn = 13;\n        EaseType.QuintOut = 14;\n        EaseType.QuintInOut = 15;\n        EaseType.ExpoIn = 16;\n        EaseType.ExpoOut = 17;\n        EaseType.ExpoInOut = 18;\n        EaseType.CircIn = 19;\n        EaseType.CircOut = 20;\n        EaseType.CircInOut = 21;\n        EaseType.ElasticIn = 22;\n        EaseType.ElasticOut = 23;\n        EaseType.ElasticInOut = 24;\n        EaseType.BackIn = 25;\n        EaseType.BackOut = 26;\n        EaseType.BackInOut = 27;\n        EaseType.BounceIn = 28;\n        EaseType.BounceOut = 29;\n        EaseType.BounceInOut = 30;\n        EaseType.Custom = 31;\n        return EaseType;\n    }());\n    fgui.EaseType = EaseType;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GPath = (function () {\n        function GPath() {\n            this._segments = new Array();\n            this._points = new Array();\n        }\n        Object.defineProperty(GPath.prototype, \"length\", {\n            get: function () {\n                return this._fullLength;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GPath.prototype.create = function (pt1, pt2, pt3, pt4) {\n            var points;\n            if (Array.isArray(pt1))\n                points = pt1;\n            else {\n                points = new Array();\n                points.push(pt1);\n                points.push(pt2);\n                if (pt3)\n                    points.push(pt3);\n                if (pt4)\n                    points.push(pt4);\n            }\n            this._segments.length = 0;\n            this._points.length = 0;\n            this._fullLength = 0;\n            var cnt = points.length;\n            if (cnt == 0)\n                return;\n            var splinePoints = s_points;\n            splinePoints.length = 0;\n            var prev = points[0];\n            if (prev.curveType == fgui.CurveType.CRSpline)\n                splinePoints.push(new egret.Point(prev.x, prev.y));\n            for (var i = 1; i < cnt; i++) {\n                var current = points[i];\n                if (prev.curveType != fgui.CurveType.CRSpline) {\n                    var seg = {};\n                    seg.type = prev.curveType;\n                    seg.ptStart = this._points.length;\n                    if (prev.curveType == fgui.CurveType.Straight) {\n                        seg.ptCount = 2;\n                        this._points.push(new egret.Point(prev.x, prev.y));\n                        this._points.push(new egret.Point(current.x, current.y));\n                    }\n                    else if (prev.curveType == fgui.CurveType.Bezier) {\n                        seg.ptCount = 3;\n                        this._points.push(new egret.Point(prev.x, prev.y));\n                        this._points.push(new egret.Point(current.x, current.y));\n                        this._points.push(new egret.Point(prev.control1_x, prev.control1_y));\n                    }\n                    else if (prev.curveType == fgui.CurveType.CubicBezier) {\n                        seg.ptCount = 4;\n                        this._points.push(new egret.Point(prev.x, prev.y));\n                        this._points.push(new egret.Point(current.x, current.y));\n                        this._points.push(new egret.Point(prev.control1_x, prev.control1_y));\n                        this._points.push(new egret.Point(prev.control2_x, prev.control2_y));\n                    }\n                    seg.length = fgui.ToolSet.distance(prev.x, prev.y, current.x, current.y);\n                    this._fullLength += seg.length;\n                    this._segments.push(seg);\n                }\n                if (current.curveType != fgui.CurveType.CRSpline) {\n                    if (splinePoints.length > 0) {\n                        splinePoints.push(new egret.Point(current.x, current.y));\n                        this.createSplineSegment();\n                    }\n                }\n                else\n                    splinePoints.push(new egret.Point(current.x, current.y));\n                prev = current;\n            }\n            if (splinePoints.length > 1)\n                this.createSplineSegment();\n        };\n        GPath.prototype.createSplineSegment = function () {\n            var splinePoints = s_points;\n            var cnt = splinePoints.length;\n            splinePoints.splice(0, 0, splinePoints[0]);\n            splinePoints.push(splinePoints[cnt]);\n            splinePoints.push(splinePoints[cnt]);\n            cnt += 3;\n            var seg = {};\n            seg.type = fgui.CurveType.CRSpline;\n            seg.ptStart = this._points.length;\n            seg.ptCount = cnt;\n            this._points = this._points.concat(splinePoints);\n            seg.length = 0;\n            for (var i = 1; i < cnt; i++) {\n                seg.length += fgui.ToolSet.distance(splinePoints[i - 1].x, splinePoints[i - 1].y, splinePoints[i].x, splinePoints[i].y);\n            }\n            this._fullLength += seg.length;\n            this._segments.push(seg);\n            splinePoints.length = 0;\n        };\n        GPath.prototype.clear = function () {\n            this._segments.length = 0;\n            this._points.length = 0;\n        };\n        GPath.prototype.getPointAt = function (t, result) {\n            if (!result)\n                result = new egret.Point();\n            else\n                result.x = result.y = 0;\n            t = fgui.ToolSet.clamp01(t);\n            var cnt = this._segments.length;\n            if (cnt == 0) {\n                return result;\n            }\n            var seg;\n            if (t == 1) {\n                seg = this._segments[cnt - 1];\n                if (seg.type == fgui.CurveType.Straight) {\n                    result.x = fgui.ToolSet.lerp(this._points[seg.ptStart].x, this._points[seg.ptStart + 1].x, t);\n                    result.y = fgui.ToolSet.lerp(this._points[seg.ptStart].y, this._points[seg.ptStart + 1].y, t);\n                    return result;\n                }\n                else if (seg.type == fgui.CurveType.Bezier || seg.type == fgui.CurveType.CubicBezier)\n                    return this.onBezierCurve(seg.ptStart, seg.ptCount, t, result);\n                else\n                    return this.onCRSplineCurve(seg.ptStart, seg.ptCount, t, result);\n            }\n            var len = t * this._fullLength;\n            for (var i = 0; i < cnt; i++) {\n                seg = this._segments[i];\n                len -= seg.length;\n                if (len < 0) {\n                    t = 1 + len / seg.length;\n                    if (seg.type == fgui.CurveType.Straight) {\n                        result.x = fgui.ToolSet.lerp(this._points[seg.ptStart].x, this._points[seg.ptStart + 1].x, t);\n                        result.y = fgui.ToolSet.lerp(this._points[seg.ptStart].y, this._points[seg.ptStart + 1].y, t);\n                    }\n                    else if (seg.type == fgui.CurveType.Bezier || seg.type == fgui.CurveType.CubicBezier)\n                        result = this.onBezierCurve(seg.ptStart, seg.ptCount, t, result);\n                    else\n                        result = this.onCRSplineCurve(seg.ptStart, seg.ptCount, t, result);\n                    break;\n                }\n            }\n            return result;\n        };\n        Object.defineProperty(GPath.prototype, \"segmentCount\", {\n            get: function () {\n                return this._segments.length;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GPath.prototype.getAnchorsInSegment = function (segmentIndex, points) {\n            if (points == null)\n                points = new Array();\n            var seg = this._segments[segmentIndex];\n            for (var i = 0; i < seg.ptCount; i++)\n                points.push(new egret.Point(this._points[seg.ptStart + i].x, this._points[seg.ptStart + i].y));\n            return points;\n        };\n        GPath.prototype.getPointsInSegment = function (segmentIndex, t0, t1, points, ts, pointDensity) {\n            if (points == null)\n                points = new Array();\n            if (!pointDensity || isNaN(pointDensity))\n                pointDensity = 0.1;\n            if (ts)\n                ts.push(t0);\n            var seg = this._segments[segmentIndex];\n            if (seg.type == fgui.CurveType.Straight) {\n                points.push(new egret.Point(fgui.ToolSet.lerp(this._points[seg.ptStart].x, this._points[seg.ptStart + 1].x, t0), fgui.ToolSet.lerp(this._points[seg.ptStart].y, this._points[seg.ptStart + 1].y, t0)));\n                points.push(new egret.Point(fgui.ToolSet.lerp(this._points[seg.ptStart].x, this._points[seg.ptStart + 1].x, t1), fgui.ToolSet.lerp(this._points[seg.ptStart].y, this._points[seg.ptStart + 1].y, t1)));\n            }\n            else {\n                var func;\n                if (seg.type == fgui.CurveType.Bezier || seg.type == fgui.CurveType.CubicBezier)\n                    func = this.onBezierCurve;\n                else\n                    func = this.onCRSplineCurve;\n                points.push(func.call(this, seg.ptStart, seg.ptCount, t0, new egret.Point()));\n                var SmoothAmount = Math.min(seg.length * pointDensity, 50);\n                for (var j = 0; j <= SmoothAmount; j++) {\n                    var t = j / SmoothAmount;\n                    if (t > t0 && t < t1) {\n                        points.push(func.call(this, seg.ptStart, seg.ptCount, t, new egret.Point()));\n                        if (ts != null)\n                            ts.push(t);\n                    }\n                }\n                points.push(func.call(this, seg.ptStart, seg.ptCount, t1, new egret.Point()));\n            }\n            if (ts != null)\n                ts.push(t1);\n            return points;\n        };\n        GPath.prototype.getAllPoints = function (points, ts, pointDensity) {\n            if (points == null)\n                points = new Array();\n            if (!pointDensity || isNaN(pointDensity))\n                pointDensity = 0.1;\n            var cnt = this._segments.length;\n            for (var i = 0; i < cnt; i++)\n                this.getPointsInSegment(i, 0, 1, points, ts, pointDensity);\n            return points;\n        };\n        GPath.prototype.onCRSplineCurve = function (ptStart, ptCount, t, result) {\n            var adjustedIndex = Math.floor(t * (ptCount - 4)) + ptStart;\n            var p0x = this._points[adjustedIndex].x;\n            var p0y = this._points[adjustedIndex].y;\n            var p1x = this._points[adjustedIndex + 1].x;\n            var p1y = this._points[adjustedIndex + 1].y;\n            var p2x = this._points[adjustedIndex + 2].x;\n            var p2y = this._points[adjustedIndex + 2].y;\n            var p3x = this._points[adjustedIndex + 3].x;\n            var p3y = this._points[adjustedIndex + 3].y;\n            var adjustedT = (t == 1) ? 1 : fgui.ToolSet.repeat(t * (ptCount - 4), 1);\n            var t0 = ((-adjustedT + 2) * adjustedT - 1) * adjustedT * 0.5;\n            var t1 = (((3 * adjustedT - 5) * adjustedT) * adjustedT + 2) * 0.5;\n            var t2 = ((-3 * adjustedT + 4) * adjustedT + 1) * adjustedT * 0.5;\n            var t3 = ((adjustedT - 1) * adjustedT * adjustedT) * 0.5;\n            result.x = p0x * t0 + p1x * t1 + p2x * t2 + p3x * t3;\n            result.y = p0y * t0 + p1y * t1 + p2y * t2 + p3y * t3;\n            return result;\n        };\n        GPath.prototype.onBezierCurve = function (ptStart, ptCount, t, result) {\n            var t2 = 1 - t;\n            var p0x = this._points[ptStart].x;\n            var p0y = this._points[ptStart].y;\n            var p1x = this._points[ptStart + 1].x;\n            var p1y = this._points[ptStart + 1].y;\n            var cp0x = this._points[ptStart + 2].x;\n            var cp0y = this._points[ptStart + 2].y;\n            if (ptCount == 4) {\n                var cp1x = this._points[ptStart + 3].x;\n                var cp1y = this._points[ptStart + 3].y;\n                result.x = t2 * t2 * t2 * p0x + 3 * t2 * t2 * t * cp0x + 3 * t2 * t * t * cp1x + t * t * t * p1x;\n                result.y = t2 * t2 * t2 * p0y + 3 * t2 * t2 * t * cp0y + 3 * t2 * t * t * cp1y + t * t * t * p1y;\n            }\n            else {\n                result.x = t2 * t2 * p0x + 2 * t2 * t * cp0x + t * t * p1x;\n                result.y = t2 * t2 * p0y + 2 * t2 * t * cp0y + t * t * p1y;\n            }\n            return result;\n        };\n        return GPath;\n    }());\n    fgui.GPath = GPath;\n    var s_points = new Array();\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var CurveType;\n    (function (CurveType) {\n        CurveType[CurveType[\"CRSpline\"] = 0] = \"CRSpline\";\n        CurveType[CurveType[\"Bezier\"] = 1] = \"Bezier\";\n        CurveType[CurveType[\"CubicBezier\"] = 2] = \"CubicBezier\";\n        CurveType[CurveType[\"Straight\"] = 3] = \"Straight\";\n    })(CurveType = fgui.CurveType || (fgui.CurveType = {}));\n    var GPathPoint = (function () {\n        function GPathPoint() {\n            this.x = 0;\n            this.y = 0;\n            this.control1_x = 0;\n            this.control1_y = 0;\n            this.control2_x = 0;\n            this.control2_y = 0;\n            this.curveType = 0;\n        }\n        GPathPoint.newPoint = function (x, y, curveType) {\n            if (x === void 0) { x = 0; }\n            if (y === void 0) { y = 0; }\n            if (curveType === void 0) { curveType = 0; }\n            var pt = new GPathPoint();\n            pt.x = x;\n            pt.y = y;\n            pt.control1_x = 0;\n            pt.control1_y = 0;\n            pt.control2_x = 0;\n            pt.control2_y = 0;\n            pt.curveType = curveType;\n            return pt;\n        };\n        GPathPoint.newBezierPoint = function (x, y, control1_x, control1_y) {\n            if (x === void 0) { x = 0; }\n            if (y === void 0) { y = 0; }\n            if (control1_x === void 0) { control1_x = 0; }\n            if (control1_y === void 0) { control1_y = 0; }\n            var pt = new GPathPoint();\n            pt.x = x;\n            pt.y = y;\n            pt.control1_x = control1_x;\n            pt.control1_y = control1_y;\n            pt.control2_x = 0;\n            pt.control2_y = 0;\n            pt.curveType = CurveType.Bezier;\n            return pt;\n        };\n        GPathPoint.newCubicBezierPoint = function (x, y, control1_x, control1_y, control2_x, control2_y) {\n            if (x === void 0) { x = 0; }\n            if (y === void 0) { y = 0; }\n            if (control1_x === void 0) { control1_x = 0; }\n            if (control1_y === void 0) { control1_y = 0; }\n            if (control2_x === void 0) { control2_x = 0; }\n            if (control2_y === void 0) { control2_y = 0; }\n            var pt = new GPathPoint();\n            pt.x = x;\n            pt.y = y;\n            pt.control1_x = control1_x;\n            pt.control1_y = control1_y;\n            pt.control2_x = control2_x;\n            pt.control2_y = control2_y;\n            pt.curveType = CurveType.CubicBezier;\n            return pt;\n        };\n        GPathPoint.prototype.clone = function () {\n            var ret = new GPathPoint();\n            ret.x = this.x;\n            ret.y = this.y;\n            ret.control1_x = this.control1_x;\n            ret.control1_y = this.control1_y;\n            ret.control2_x = this.control2_x;\n            ret.control2_y = this.control2_y;\n            ret.curveType = this.curveType;\n            return ret;\n        };\n        return GPathPoint;\n    }());\n    fgui.GPathPoint = GPathPoint;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GTween = (function () {\n        function GTween() {\n        }\n        GTween.to = function (start, end, duration) {\n            return fgui.TweenManager.createTween()._to(start, end, duration);\n        };\n        GTween.to2 = function (start, start2, end, end2, duration) {\n            return fgui.TweenManager.createTween()._to2(start, start2, end, end2, duration);\n        };\n        GTween.to3 = function (start, start2, start3, end, end2, end3, duration) {\n            return fgui.TweenManager.createTween()._to3(start, start2, start3, end, end2, end3, duration);\n        };\n        GTween.to4 = function (start, start2, start3, start4, end, end2, end3, end4, duration) {\n            return fgui.TweenManager.createTween()._to4(start, start2, start3, start4, end, end2, end3, end4, duration);\n        };\n        GTween.toColor = function (start, end, duration) {\n            return fgui.TweenManager.createTween()._toColor(start, end, duration);\n        };\n        GTween.delayedCall = function (delay) {\n            return fgui.TweenManager.createTween().setDelay(delay);\n        };\n        GTween.shake = function (startX, startY, amplitude, duration) {\n            return fgui.TweenManager.createTween()._shake(startX, startY, amplitude, duration);\n        };\n        GTween.isTweening = function (target, propType) {\n            return fgui.TweenManager.isTweening(target, propType);\n        };\n        GTween.kill = function (target, complete, propType) {\n            fgui.TweenManager.killTweens(target, complete, propType);\n        };\n        GTween.getTween = function (target, propType) {\n            return fgui.TweenManager.getTween(target, propType);\n        };\n        GTween.catchCallbackExceptions = true;\n        return GTween;\n    }());\n    fgui.GTween = GTween;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GTweener = (function () {\n        function GTweener() {\n            this._startValue = new fgui.TweenValue();\n            this._endValue = new fgui.TweenValue();\n            this._value = new fgui.TweenValue();\n            this._deltaValue = new fgui.TweenValue();\n            this._reset();\n        }\n        GTweener.prototype.setDelay = function (value) {\n            this._delay = value;\n            return this;\n        };\n        Object.defineProperty(GTweener.prototype, \"delay\", {\n            get: function () {\n                return this._delay;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTweener.prototype.setDuration = function (value) {\n            this._duration = value;\n            return this;\n        };\n        Object.defineProperty(GTweener.prototype, \"duration\", {\n            get: function () {\n                return this._duration;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTweener.prototype.setBreakpoint = function (value) {\n            this._breakpoint = value;\n            return this;\n        };\n        GTweener.prototype.setEase = function (value) {\n            this._easeType = value;\n            return this;\n        };\n        GTweener.prototype.setEasePeriod = function (value) {\n            this._easePeriod = value;\n            return this;\n        };\n        GTweener.prototype.setEaseOvershootOrAmplitude = function (value) {\n            this._easeOvershootOrAmplitude = value;\n            return this;\n        };\n        GTweener.prototype.setRepeat = function (repeat, yoyo) {\n            this._repeat = repeat;\n            this._yoyo = yoyo;\n            return this;\n        };\n        Object.defineProperty(GTweener.prototype, \"repeat\", {\n            get: function () {\n                return this._repeat;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTweener.prototype.setTimeScale = function (value) {\n            this._timeScale = value;\n            return this;\n        };\n        GTweener.prototype.setSnapping = function (value) {\n            this._snapping = value;\n            return this;\n        };\n        GTweener.prototype.setTarget = function (value, propType) {\n            this._target = value;\n            this._propType = propType;\n            return this;\n        };\n        Object.defineProperty(GTweener.prototype, \"target\", {\n            get: function () {\n                return this._target;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTweener.prototype.setUserData = function (value) {\n            this._userData = value;\n            return this;\n        };\n        Object.defineProperty(GTweener.prototype, \"userData\", {\n            get: function () {\n                return this._userData;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTweener.prototype.setPath = function (value) {\n            this._path = value;\n            return this;\n        };\n        GTweener.prototype.onUpdate = function (callback, caller) {\n            this._onUpdate = callback;\n            this._onUpdateCaller = caller;\n            return this;\n        };\n        GTweener.prototype.onStart = function (callback, caller) {\n            this._onStart = callback;\n            this._onStartCaller = caller;\n            return this;\n        };\n        GTweener.prototype.onComplete = function (callback, caller) {\n            this._onComplete = callback;\n            this._onCompleteCaller = caller;\n            return this;\n        };\n        Object.defineProperty(GTweener.prototype, \"startValue\", {\n            get: function () {\n                return this._startValue;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTweener.prototype, \"endValue\", {\n            get: function () {\n                return this._endValue;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTweener.prototype, \"value\", {\n            get: function () {\n                return this._value;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTweener.prototype, \"deltaValue\", {\n            get: function () {\n                return this._deltaValue;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTweener.prototype, \"normalizedTime\", {\n            get: function () {\n                return this._normalizedTime;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTweener.prototype, \"completed\", {\n            get: function () {\n                return this._ended != 0;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        Object.defineProperty(GTweener.prototype, \"allCompleted\", {\n            get: function () {\n                return this._ended == 1;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        GTweener.prototype.setPaused = function (paused) {\n            this._paused = paused;\n            return this;\n        };\n        GTweener.prototype.seek = function (time) {\n            if (this._killed)\n                return;\n            this._elapsedTime = time;\n            if (this._elapsedTime < this._delay) {\n                if (this._started)\n                    this._elapsedTime = this._delay;\n                else\n                    return;\n            }\n            this.update();\n        };\n        GTweener.prototype.kill = function (complete) {\n            if (this._killed)\n                return;\n            if (complete) {\n                if (this._ended == 0) {\n                    if (this._breakpoint >= 0)\n                        this._elapsedTime = this._delay + this._breakpoint;\n                    else if (this._repeat >= 0)\n                        this._elapsedTime = this._delay + this._duration * (this._repeat + 1);\n                    else\n                        this._elapsedTime = this._delay + this._duration * 2;\n                    this.update();\n                }\n                this.callCompleteCallback();\n            }\n            this._killed = true;\n        };\n        GTweener.prototype._to = function (start, end, duration) {\n            this._valueSize = 1;\n            this._startValue.x = start;\n            this._endValue.x = end;\n            this._value.x = start;\n            this._duration = duration;\n            return this;\n        };\n        GTweener.prototype._to2 = function (start, start2, end, end2, duration) {\n            this._valueSize = 2;\n            this._startValue.x = start;\n            this._endValue.x = end;\n            this._startValue.y = start2;\n            this._endValue.y = end2;\n            this._value.x = start;\n            this._value.y = start2;\n            this._duration = duration;\n            return this;\n        };\n        GTweener.prototype._to3 = function (start, start2, start3, end, end2, end3, duration) {\n            this._valueSize = 3;\n            this._startValue.x = start;\n            this._endValue.x = end;\n            this._startValue.y = start2;\n            this._endValue.y = end2;\n            this._startValue.z = start3;\n            this._endValue.z = end3;\n            this._value.x = start;\n            this._value.y = start2;\n            this._value.z = start3;\n            this._duration = duration;\n            return this;\n        };\n        GTweener.prototype._to4 = function (start, start2, start3, start4, end, end2, end3, end4, duration) {\n            this._valueSize = 4;\n            this._startValue.x = start;\n            this._endValue.x = end;\n            this._startValue.y = start2;\n            this._endValue.y = end2;\n            this._startValue.z = start3;\n            this._endValue.z = end3;\n            this._startValue.w = start4;\n            this._endValue.w = end4;\n            this._value.x = start;\n            this._value.y = start2;\n            this._value.z = start3;\n            this._value.w = start4;\n            this._duration = duration;\n            return this;\n        };\n        GTweener.prototype._toColor = function (start, end, duration) {\n            this._valueSize = 4;\n            this._startValue.color = start;\n            this._endValue.color = end;\n            this._value.color = start;\n            this._duration = duration;\n            return this;\n        };\n        GTweener.prototype._shake = function (startX, startY, amplitude, duration) {\n            this._valueSize = 5;\n            this._startValue.x = startX;\n            this._startValue.y = startY;\n            this._startValue.w = amplitude;\n            this._duration = duration;\n            return this;\n        };\n        GTweener.prototype._init = function () {\n            this._delay = 0;\n            this._duration = 0;\n            this._breakpoint = -1;\n            this._easeType = fgui.EaseType.QuadOut;\n            this._timeScale = 1;\n            this._easePeriod = 0;\n            this._easeOvershootOrAmplitude = 1.70158;\n            this._snapping = false;\n            this._repeat = 0;\n            this._yoyo = false;\n            this._valueSize = 0;\n            this._started = false;\n            this._paused = false;\n            this._killed = false;\n            this._elapsedTime = 0;\n            this._normalizedTime = 0;\n            this._ended = 0;\n        };\n        GTweener.prototype._reset = function () {\n            this._target = null;\n            this._propType = null;\n            this._userData = null;\n            this._path = null;\n            this._onStart = this._onUpdate = this._onComplete = null;\n            this._onStartCaller = this._onUpdateCaller = this._onCompleteCaller = null;\n        };\n        GTweener.prototype._update = function (dt) {\n            if (this._timeScale != 1)\n                dt *= this._timeScale;\n            if (dt == 0)\n                return;\n            if (this._ended != 0) {\n                this.callCompleteCallback();\n                this._killed = true;\n                return;\n            }\n            this._elapsedTime += dt;\n            this.update();\n            if (this._ended != 0) {\n                if (!this._killed) {\n                    this.callCompleteCallback();\n                    this._killed = true;\n                }\n            }\n        };\n        GTweener.prototype.update = function () {\n            this._ended = 0;\n            if (this._valueSize == 0) {\n                if (this._elapsedTime >= this._delay + this._duration)\n                    this._ended = 1;\n                return;\n            }\n            if (!this._started) {\n                if (this._elapsedTime < this._delay)\n                    return;\n                this._started = true;\n                this.callStartCallback();\n                if (this._killed)\n                    return;\n            }\n            var reversed = false;\n            var tt = this._elapsedTime - this._delay;\n            if (this._breakpoint >= 0 && tt >= this._breakpoint) {\n                tt = this._breakpoint;\n                this._ended = 2;\n            }\n            if (this._repeat != 0) {\n                var round = Math.floor(tt / this._duration);\n                tt -= this._duration * round;\n                if (this._yoyo)\n                    reversed = round % 2 == 1;\n                if (this._repeat > 0 && this._repeat - round < 0) {\n                    if (this._yoyo)\n                        reversed = this._repeat % 2 == 1;\n                    tt = this._duration;\n                    this._ended = 1;\n                }\n            }\n            else if (tt >= this._duration) {\n                tt = this._duration;\n                this._ended = 1;\n            }\n            this._normalizedTime = fgui.evaluateEase(this._easeType, reversed ? (this._duration - tt) : tt, this._duration, this._easeOvershootOrAmplitude, this._easePeriod);\n            this._value.setZero();\n            this._deltaValue.setZero();\n            if (this._valueSize == 5) {\n                if (this._ended == 0) {\n                    var r = this._startValue.w * (1 - this._normalizedTime);\n                    var rx = r * (Math.random() > 0.5 ? 1 : -1);\n                    var ry = r * (Math.random() > 0.5 ? 1 : -1);\n                    this._deltaValue.x = rx;\n                    this._deltaValue.y = ry;\n                    this._value.x = this._startValue.x + rx;\n                    this._value.y = this._startValue.y + ry;\n                }\n                else {\n                    this._value.x = this._startValue.x;\n                    this._value.y = this._startValue.y;\n                }\n            }\n            else if (this._path) {\n                var pt = s_vec2;\n                this._path.getPointAt(this._normalizedTime, pt);\n                if (this._snapping) {\n                    pt.x = Math.round(pt.x);\n                    pt.y = Math.round(pt.y);\n                }\n                this._deltaValue.x = pt.x - this._value.x;\n                this._deltaValue.y = pt.y - this._value.y;\n                this._value.x = pt.x;\n                this._value.y = pt.y;\n            }\n            else {\n                for (var i = 0; i < this._valueSize; i++) {\n                    var n1 = this._startValue.getField(i);\n                    var n2 = this._endValue.getField(i);\n                    var f = n1 + (n2 - n1) * this._normalizedTime;\n                    if (this._snapping)\n                        f = Math.round(f);\n                    this._deltaValue.setField(i, f - this._value.getField(i));\n                    this._value.setField(i, f);\n                }\n            }\n            if (this._target != null && this._propType != null) {\n                if (this._propType instanceof Function) {\n                    switch (this._valueSize) {\n                        case 1:\n                            this._propType.call(this._target, this._value.x);\n                            break;\n                        case 2:\n                            this._propType.call(this._target, this._value.x, this._value.y);\n                            break;\n                        case 3:\n                            this._propType.call(this._target, this._value.x, this._value.y, this._value.z);\n                            break;\n                        case 4:\n                            this._propType.call(this._target, this._value.x, this._value.y, this._value.z, this._value.w);\n                            break;\n                        case 5:\n                            this._propType.call(this._target, this._value.color);\n                            break;\n                        case 6:\n                            this._propType.call(this._target, this._value.x, this._value.y);\n                            break;\n                    }\n                }\n                else {\n                    if (this._valueSize == 5)\n                        this._target[this._propType] = this._value.color;\n                    else\n                        this._target[this._propType] = this._value.x;\n                }\n            }\n            this.callUpdateCallback();\n        };\n        GTweener.prototype.callStartCallback = function () {\n            if (this._onStart != null) {\n                try {\n                    this._onStart.call(this._onStartCaller, this);\n                }\n                catch (err) {\n                    console.log(\"FairyGUI: error in start callback > \" + err);\n                }\n            }\n        };\n        GTweener.prototype.callUpdateCallback = function () {\n            if (this._onUpdate != null) {\n                try {\n                    this._onUpdate.call(this._onUpdateCaller, this);\n                }\n                catch (err) {\n                    console.log(\"FairyGUI: error in update callback > \" + err);\n                }\n            }\n        };\n        GTweener.prototype.callCompleteCallback = function () {\n            if (this._onComplete != null) {\n                try {\n                    this._onComplete.call(this._onCompleteCaller, this);\n                }\n                catch (err) {\n                    console.log(\"FairyGUI: error in complete callback > \" + err);\n                }\n            }\n        };\n        return GTweener;\n    }());\n    fgui.GTweener = GTweener;\n    var s_vec2 = new egret.Point();\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var TweenManager = (function () {\n        function TweenManager() {\n        }\n        TweenManager.createTween = function () {\n            if (!_inited) {\n                egret.startTick(TweenManager.update, null);\n                _inited = true;\n                _lastTime = egret.getTimer();\n            }\n            var tweener;\n            var cnt = _tweenerPool.length;\n            if (cnt > 0) {\n                tweener = _tweenerPool.pop();\n            }\n            else\n                tweener = new fgui.GTweener();\n            tweener._init();\n            _activeTweens[_totalActiveTweens++] = tweener;\n            if (_totalActiveTweens == _activeTweens.length)\n                _activeTweens.length = _activeTweens.length + Math.ceil(_activeTweens.length * 0.5);\n            return tweener;\n        };\n        TweenManager.isTweening = function (target, propType) {\n            if (target == null)\n                return false;\n            var anyType = propType == null;\n            for (var i = 0; i < _totalActiveTweens; i++) {\n                var tweener = _activeTweens[i];\n                if (tweener != null && tweener.target == target && !tweener._killed\n                    && (anyType || tweener._propType == propType))\n                    return true;\n            }\n            return false;\n        };\n        TweenManager.killTweens = function (target, completed, propType) {\n            if (target == null)\n                return false;\n            var flag = false;\n            var cnt = _totalActiveTweens;\n            var anyType = propType == null;\n            for (var i = 0; i < cnt; i++) {\n                var tweener = _activeTweens[i];\n                if (tweener != null && tweener.target == target && !tweener._killed\n                    && (anyType || tweener._propType == propType)) {\n                    tweener.kill(completed);\n                    flag = true;\n                }\n            }\n            return flag;\n        };\n        TweenManager.getTween = function (target, propType) {\n            if (target == null)\n                return null;\n            var cnt = _totalActiveTweens;\n            var anyType = propType == null;\n            for (var i = 0; i < cnt; i++) {\n                var tweener = _activeTweens[i];\n                if (tweener != null && tweener.target == target && !tweener._killed\n                    && (anyType || tweener._propType == propType)) {\n                    return tweener;\n                }\n            }\n            return null;\n        };\n        TweenManager.update = function (timestamp) {\n            var dt = timestamp - _lastTime;\n            _lastTime = timestamp;\n            dt /= 1000;\n            var cnt = _totalActiveTweens;\n            var freePosStart = -1;\n            var freePosCount = 0;\n            for (var i = 0; i < cnt; i++) {\n                var tweener = _activeTweens[i];\n                if (tweener == null) {\n                    if (freePosStart == -1)\n                        freePosStart = i;\n                    freePosCount++;\n                }\n                else if (tweener._killed) {\n                    tweener._reset();\n                    _tweenerPool.push(tweener);\n                    _activeTweens[i] = null;\n                    if (freePosStart == -1)\n                        freePosStart = i;\n                    freePosCount++;\n                }\n                else {\n                    if ((tweener._target instanceof fgui.GObject) && (tweener._target).isDisposed)\n                        tweener._killed = true;\n                    else if (!tweener._paused)\n                        tweener._update(dt);\n                    if (freePosStart != -1) {\n                        _activeTweens[freePosStart] = tweener;\n                        _activeTweens[i] = null;\n                        freePosStart++;\n                    }\n                }\n            }\n            if (freePosStart >= 0) {\n                if (_totalActiveTweens != cnt) {\n                    var j = cnt;\n                    cnt = _totalActiveTweens - cnt;\n                    for (i = 0; i < cnt; i++)\n                        _activeTweens[freePosStart++] = _activeTweens[j++];\n                }\n                _totalActiveTweens = freePosStart;\n            }\n            return false;\n        };\n        return TweenManager;\n    }());\n    fgui.TweenManager = TweenManager;\n    var _activeTweens = new Array(30);\n    var _tweenerPool = new Array();\n    var _totalActiveTweens = 0;\n    var _lastTime = 0;\n    var _inited;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var TweenValue = (function () {\n        function TweenValue() {\n            this.x = this.y = this.z = this.w = 0;\n        }\n        Object.defineProperty(TweenValue.prototype, \"color\", {\n            get: function () {\n                return (this.w << 24) + (this.x << 16) + (this.y << 8) + this.z;\n            },\n            set: function (value) {\n                this.x = (value & 0xFF0000) >> 16;\n                this.y = (value & 0x00FF00) >> 8;\n                this.z = (value & 0x0000FF);\n                this.w = (value & 0xFF000000) >> 24;\n            },\n            enumerable: true,\n            configurable: true\n        });\n        TweenValue.prototype.getField = function (index) {\n            switch (index) {\n                case 0:\n                    return this.x;\n                case 1:\n                    return this.y;\n                case 2:\n                    return this.z;\n                case 3:\n                    return this.w;\n                default:\n                    throw new Error(\"Index out of bounds: \" + index);\n            }\n        };\n        TweenValue.prototype.setField = function (index, value) {\n            switch (index) {\n                case 0:\n                    this.x = value;\n                    break;\n                case 1:\n                    this.y = value;\n                    break;\n                case 2:\n                    this.z = value;\n                    break;\n                case 3:\n                    this.w = value;\n                    break;\n                default:\n                    throw new Error(\"Index out of bounds: \" + index);\n            }\n        };\n        TweenValue.prototype.setZero = function () {\n            this.x = this.y = this.z = this.w = 0;\n        };\n        return TweenValue;\n    }());\n    fgui.TweenValue = TweenValue;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ByteBuffer = (function (_super_1) {\n        __extends(ByteBuffer, _super_1);\n        function ByteBuffer(buffer, bufferExtSize) {\n            var _this = _super_1.call(this, buffer, bufferExtSize) || this;\n            _this.version = 0;\n            return _this;\n        }\n        ByteBuffer.prototype.skip = function (count) {\n            this.position += count;\n        };\n        ByteBuffer.prototype.readBool = function () {\n            return this.readByte() == 1;\n        };\n        ByteBuffer.prototype.readS = function () {\n            var index = this.readUnsignedShort();\n            if (index == 65534)\n                return null;\n            else if (index == 65533)\n                return \"\";\n            else\n                return this.stringTable[index];\n        };\n        ByteBuffer.prototype.readSArray = function (cnt) {\n            var ret = new Array(cnt);\n            for (var i = 0; i < cnt; i++)\n                ret[i] = this.readS();\n            return ret;\n        };\n        ByteBuffer.prototype.writeS = function (value) {\n            var index = this.readUnsignedShort();\n            if (index != 65534 && index != 65533)\n                this.stringTable[index] = value;\n        };\n        ByteBuffer.prototype.readColor = function (hasAlpha) {\n            var r = this.readUnsignedByte();\n            var g = this.readUnsignedByte();\n            var b = this.readUnsignedByte();\n            var a = this.readUnsignedByte();\n            return (hasAlpha ? (a << 24) : 0) + (r << 16) + (g << 8) + b;\n        };\n        ByteBuffer.prototype.readChar = function () {\n            var i = this.readUnsignedShort();\n            return String.fromCharCode(i);\n        };\n        ByteBuffer.prototype.readBuffer = function () {\n            var count = this.readUnsignedInt();\n            var ba = new ByteBuffer(new Uint8Array(this.buffer, this.position, count));\n            ba.stringTable = this.stringTable;\n            ba.version = this.version;\n            this.position += count;\n            return ba;\n        };\n        ByteBuffer.prototype.seek = function (indexTablePos, blockIndex) {\n            var tmp = this.position;\n            this.position = indexTablePos;\n            var segCount = this.readByte();\n            if (blockIndex < segCount) {\n                var useShort = this.readByte() == 1;\n                var newPos;\n                if (useShort) {\n                    this.position += 2 * blockIndex;\n                    newPos = this.readUnsignedShort();\n                }\n                else {\n                    this.position += 4 * blockIndex;\n                    newPos = this.readUnsignedInt();\n                }\n                if (newPos > 0) {\n                    this.position = indexTablePos + newPos;\n                    return true;\n                }\n                else {\n                    this.position = tmp;\n                    return false;\n                }\n            }\n            else {\n                this.position = tmp;\n                return false;\n            }\n        };\n        return ByteBuffer;\n    }(egret.ByteArray));\n    fgui.ByteBuffer = ByteBuffer;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ColorMatrix = (function () {\n        function ColorMatrix(p_brightness, p_contrast, p_saturation, p_hue) {\n            this.matrix = new Array(LENGTH);\n            this.reset();\n            if (p_brightness !== undefined || p_contrast !== undefined || p_saturation !== undefined || p_hue !== undefined)\n                this.adjustColor(p_brightness, p_contrast, p_saturation, p_hue);\n        }\n        ColorMatrix.prototype.reset = function () {\n            for (var i = 0; i < LENGTH; i++) {\n                this.matrix[i] = IDENTITY_MATRIX[i];\n            }\n        };\n        ColorMatrix.prototype.invert = function () {\n            this.multiplyMatrix([-1, 0, 0, 0, 255,\n                0, -1, 0, 0, 255,\n                0, 0, -1, 0, 255,\n                0, 0, 0, 1, 0]);\n        };\n        ColorMatrix.prototype.adjustColor = function (p_brightness, p_contrast, p_saturation, p_hue) {\n            this.adjustHue(p_hue || 0);\n            this.adjustContrast(p_contrast || 0);\n            this.adjustBrightness(p_brightness || 0);\n            this.adjustSaturation(p_saturation || 0);\n        };\n        ColorMatrix.prototype.adjustBrightness = function (p_val) {\n            p_val = this.cleanValue(p_val, 1) * 255;\n            this.multiplyMatrix([\n                1, 0, 0, 0, p_val,\n                0, 1, 0, 0, p_val,\n                0, 0, 1, 0, p_val,\n                0, 0, 0, 1, 0\n            ]);\n        };\n        ColorMatrix.prototype.adjustContrast = function (p_val) {\n            p_val = this.cleanValue(p_val, 1);\n            var s = p_val + 1;\n            var o = 128 * (1 - s);\n            this.multiplyMatrix([\n                s, 0, 0, 0, o,\n                0, s, 0, 0, o,\n                0, 0, s, 0, o,\n                0, 0, 0, 1, 0\n            ]);\n        };\n        ColorMatrix.prototype.adjustSaturation = function (p_val) {\n            p_val = this.cleanValue(p_val, 1);\n            p_val += 1;\n            var invSat = 1 - p_val;\n            var invLumR = invSat * LUMA_R;\n            var invLumG = invSat * LUMA_G;\n            var invLumB = invSat * LUMA_B;\n            this.multiplyMatrix([\n                (invLumR + p_val), invLumG, invLumB, 0, 0,\n                invLumR, (invLumG + p_val), invLumB, 0, 0,\n                invLumR, invLumG, (invLumB + p_val), 0, 0,\n                0, 0, 0, 1, 0\n            ]);\n        };\n        ColorMatrix.prototype.adjustHue = function (p_val) {\n            p_val = this.cleanValue(p_val, 1);\n            p_val *= Math.PI;\n            var cos = Math.cos(p_val);\n            var sin = Math.sin(p_val);\n            this.multiplyMatrix([\n                ((LUMA_R + (cos * (1 - LUMA_R))) + (sin * -(LUMA_R))), ((LUMA_G + (cos * -(LUMA_G))) + (sin * -(LUMA_G))), ((LUMA_B + (cos * -(LUMA_B))) + (sin * (1 - LUMA_B))), 0, 0,\n                ((LUMA_R + (cos * -(LUMA_R))) + (sin * 0.143)), ((LUMA_G + (cos * (1 - LUMA_G))) + (sin * 0.14)), ((LUMA_B + (cos * -(LUMA_B))) + (sin * -0.283)), 0, 0,\n                ((LUMA_R + (cos * -(LUMA_R))) + (sin * -((1 - LUMA_R)))), ((LUMA_G + (cos * -(LUMA_G))) + (sin * LUMA_G)), ((LUMA_B + (cos * (1 - LUMA_B))) + (sin * LUMA_B)), 0, 0,\n                0, 0, 0, 1, 0\n            ]);\n        };\n        ColorMatrix.prototype.concat = function (p_matrix) {\n            if (p_matrix.length != LENGTH) {\n                return;\n            }\n            this.multiplyMatrix(p_matrix);\n        };\n        ColorMatrix.prototype.clone = function () {\n            var result = new ColorMatrix();\n            result.copyMatrix(this.matrix);\n            return result;\n        };\n        ColorMatrix.prototype.copyMatrix = function (p_matrix) {\n            var l = LENGTH;\n            for (var i = 0; i < l; i++) {\n                this.matrix[i] = p_matrix[i];\n            }\n        };\n        ColorMatrix.prototype.multiplyMatrix = function (p_matrix) {\n            var col = [];\n            var i = 0;\n            for (var y = 0; y < 4; ++y) {\n                for (var x = 0; x < 5; ++x) {\n                    col[i + x] = p_matrix[i] * this.matrix[x] +\n                        p_matrix[i + 1] * this.matrix[x + 5] +\n                        p_matrix[i + 2] * this.matrix[x + 10] +\n                        p_matrix[i + 3] * this.matrix[x + 15] +\n                        (x == 4 ? p_matrix[i + 4] : 0);\n                }\n                i += 5;\n            }\n            this.copyMatrix(col);\n        };\n        ColorMatrix.prototype.cleanValue = function (p_val, p_limit) {\n            return Math.min(p_limit, Math.max(-p_limit, p_val));\n        };\n        return ColorMatrix;\n    }());\n    fgui.ColorMatrix = ColorMatrix;\n    var IDENTITY_MATRIX = [\n        1, 0, 0, 0, 0,\n        0, 1, 0, 0, 0,\n        0, 0, 1, 0, 0,\n        0, 0, 0, 1, 0\n    ];\n    var LENGTH = IDENTITY_MATRIX.length;\n    var LUMA_R = 0.299;\n    var LUMA_G = 0.587;\n    var LUMA_B = 0.114;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var GTimers = (function () {\n        function GTimers() {\n            this._enumI = 0;\n            this._enumCount = 0;\n            this._lastTime = 0;\n            this._items = new Array();\n            this._itemPool = new Array();\n            this._lastTime = egret.getTimer();\n            GTimers.time = this._lastTime;\n            egret.startTick(this.__timer, this);\n        }\n        GTimers.prototype.getItem = function () {\n            if (this._itemPool.length)\n                return this._itemPool.pop();\n            else\n                return new TimerItem();\n        };\n        GTimers.prototype.findItem = function (callback, thisObj) {\n            var len = this._items.length;\n            for (var i = 0; i < len; i++) {\n                var item = this._items[i];\n                if (item.callback == callback && item.thisObj == thisObj)\n                    return item;\n            }\n            return null;\n        };\n        GTimers.prototype.add = function (delayInMiniseconds, repeat, callback, thisObj, callbackParam) {\n            var item = this.findItem(callback, thisObj);\n            if (!item) {\n                item = this.getItem();\n                item.callback = callback;\n                item.hasParam = callback.length == 1;\n                item.thisObj = thisObj;\n                this._items.push(item);\n            }\n            item.delay = delayInMiniseconds;\n            item.counter = 0;\n            item.repeat = repeat;\n            item.param = callbackParam;\n            item.end = false;\n        };\n        GTimers.prototype.callLater = function (callback, thisObj, callbackParam) {\n            this.add(1, 1, callback, thisObj, callbackParam);\n        };\n        GTimers.prototype.callDelay = function (delay, callback, thisObj, callbackParam) {\n            this.add(delay, 1, callback, thisObj, callbackParam);\n        };\n        GTimers.prototype.exists = function (callback, thisObj) {\n            var item = this.findItem(callback, thisObj);\n            return item != null;\n        };\n        GTimers.prototype.remove = function (callback, thisObj) {\n            var item = this.findItem(callback, thisObj);\n            if (item) {\n                var i = this._items.indexOf(item);\n                this._items.splice(i, 1);\n                if (i < this._enumI)\n                    this._enumI--;\n                this._enumCount--;\n                item.reset();\n                this._itemPool.push(item);\n            }\n        };\n        GTimers.prototype.__timer = function (timeStamp) {\n            GTimers.time = timeStamp;\n            GTimers.deltaTime = timeStamp - this._lastTime;\n            this._lastTime = timeStamp;\n            this._enumI = 0;\n            this._enumCount = this._items.length;\n            while (this._enumI < this._enumCount) {\n                var item = this._items[this._enumI];\n                this._enumI++;\n                if (item.advance(GTimers.deltaTime)) {\n                    if (item.end) {\n                        this._enumI--;\n                        this._enumCount--;\n                        this._items.splice(this._enumI, 1);\n                    }\n                    if (item.hasParam)\n                        item.callback.call(item.thisObj, item.param);\n                    else\n                        item.callback.call(item.thisObj);\n                    if (item.end) {\n                        item.reset();\n                        this._itemPool.push(item);\n                    }\n                }\n            }\n            return false;\n        };\n        GTimers.deltaTime = 0;\n        GTimers.time = 0;\n        GTimers.inst = new GTimers();\n        return GTimers;\n    }());\n    fgui.GTimers = GTimers;\n    var TimerItem = (function () {\n        function TimerItem() {\n            this.delay = 0;\n            this.counter = 0;\n            this.repeat = 0;\n        }\n        TimerItem.prototype.advance = function (elapsed) {\n            this.counter += elapsed;\n            if (this.counter >= this.delay) {\n                this.counter -= this.delay;\n                if (this.counter > this.delay)\n                    this.counter = this.delay;\n                if (this.repeat > 0) {\n                    this.repeat--;\n                    if (this.repeat == 0)\n                        this.end = true;\n                }\n                return true;\n            }\n            else\n                return false;\n        };\n        TimerItem.prototype.reset = function () {\n            this.callback = null;\n            this.thisObj = null;\n            this.param = null;\n        };\n        return TimerItem;\n    }());\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var UBBParser = (function () {\n        function UBBParser() {\n            this._readPos = 0;\n            this.smallFontSize = 12;\n            this.normalFontSize = 14;\n            this.largeFontSize = 16;\n            this.defaultImgWidth = 0;\n            this.defaultImgHeight = 0;\n            this._handlers = {};\n            this._handlers[\"url\"] = this.onTag_URL;\n            this._handlers[\"img\"] = this.onTag_IMG;\n            this._handlers[\"b\"] = this.onTag_Simple;\n            this._handlers[\"i\"] = this.onTag_Simple;\n            this._handlers[\"u\"] = this.onTag_Simple;\n            this._handlers[\"sup\"] = this.onTag_Simple;\n            this._handlers[\"sub\"] = this.onTag_Simple;\n            this._handlers[\"color\"] = this.onTag_COLOR;\n            this._handlers[\"font\"] = this.onTag_FONT;\n            this._handlers[\"size\"] = this.onTag_SIZE;\n        }\n        UBBParser.prototype.onTag_URL = function (tagName, end, attr) {\n            if (!end) {\n                if (attr != null)\n                    return \"<a href=\\\"\" + attr + \"\\\" target=\\\"_blank\\\">\";\n                else {\n                    var href = this.getTagText();\n                    return \"<a href=\\\"\" + href + \"\\\" target=\\\"_blank\\\">\";\n                }\n            }\n            else\n                return \"</a>\";\n        };\n        UBBParser.prototype.onTag_IMG = function (tagName, end, attr) {\n            if (!end) {\n                var src = this.getTagText(true);\n                if (!src)\n                    return null;\n                if (this.defaultImgWidth)\n                    return \"<img src=\\\"\" + src + \"\\\" width=\\\"\" + this.defaultImgWidth + \"\\\" height=\\\"\" + this.defaultImgHeight + \"\\\"/>\";\n                else\n                    return \"<img src=\\\"\" + src + \"\\\"/>\";\n            }\n            else\n                return null;\n        };\n        UBBParser.prototype.onTag_Simple = function (tagName, end, attr) {\n            return end ? (\"</\" + tagName + \">\") : (\"<\" + tagName + \">\");\n        };\n        UBBParser.prototype.onTag_COLOR = function (tagName, end, attr) {\n            if (!end)\n                return \"<font color=\\\"\" + attr + \"\\\">\";\n            else\n                return \"</font>\";\n        };\n        UBBParser.prototype.onTag_FONT = function (tagName, end, attr) {\n            if (!end)\n                return \"<font face=\\\"\" + attr + \"\\\">\";\n            else\n                return \"</font>\";\n        };\n        UBBParser.prototype.onTag_SIZE = function (tagName, end, attr) {\n            if (!end) {\n                if (attr == \"normal\")\n                    attr = \"\" + this.normalFontSize;\n                else if (attr == \"small\")\n                    attr = \"\" + this.smallFontSize;\n                else if (attr == \"large\")\n                    attr = \"\" + this.largeFontSize;\n                else if (attr.length && attr.charAt(0) == \"+\")\n                    attr = \"\" + (this.smallFontSize + parseInt(attr.substr(1)));\n                else if (attr.length && attr.charAt(0) == \"-\")\n                    attr = \"\" + (this.smallFontSize - parseInt(attr.substr(1)));\n                return \"<font size=\\\"\" + attr + \"\\\">\";\n            }\n            else\n                return \"</font>\";\n        };\n        UBBParser.prototype.getTagText = function (remove) {\n            if (remove === void 0) { remove = false; }\n            var pos1 = this._readPos;\n            var pos2;\n            var result = \"\";\n            while ((pos2 = this._text.indexOf(\"[\", pos1)) != -1) {\n                if (this._text.charCodeAt(pos2 - 1) == 92) {\n                    result += this._text.substring(pos1, pos2 - 1);\n                    result += \"[\";\n                    pos1 = pos2 + 1;\n                }\n                else {\n                    result += this._text.substring(pos1, pos2);\n                    break;\n                }\n            }\n            if (pos2 == -1)\n                return null;\n            if (remove)\n                this._readPos = pos2;\n            return result;\n        };\n        UBBParser.prototype.parse = function (text, remove) {\n            this._text = text;\n            var pos1 = 0, pos2, pos3;\n            var end;\n            var tag, attr;\n            var repl;\n            var func;\n            var result = \"\";\n            while ((pos2 = this._text.indexOf(\"[\", pos1)) != -1) {\n                if (pos2 > 0 && this._text.charCodeAt(pos2 - 1) == 92) {\n                    result += this._text.substring(pos1, pos2 - 1);\n                    result += \"[\";\n                    pos1 = pos2 + 1;\n                    continue;\n                }\n                result += this._text.substring(pos1, pos2);\n                pos1 = pos2;\n                pos2 = this._text.indexOf(\"]\", pos1);\n                if (pos2 == -1)\n                    break;\n                end = this._text.charAt(pos1 + 1) == '/';\n                tag = this._text.substring(end ? pos1 + 2 : pos1 + 1, pos2);\n                this._readPos = pos2 + 1;\n                attr = null;\n                repl = null;\n                pos3 = tag.indexOf(\"=\");\n                if (pos3 != -1) {\n                    attr = tag.substring(pos3 + 1);\n                    tag = tag.substring(0, pos3);\n                }\n                tag = tag.toLowerCase();\n                func = this._handlers[tag];\n                if (func != null) {\n                    if (!remove) {\n                        repl = func.call(this, tag, end, attr);\n                        if (repl != null)\n                            result += repl;\n                    }\n                }\n                else\n                    result += this._text.substring(pos1, this._readPos);\n                pos1 = this._readPos;\n            }\n            if (pos1 < this._text.length)\n                result += this._text.substr(pos1);\n            this._text = null;\n            return result;\n        };\n        UBBParser.inst = new UBBParser();\n        return UBBParser;\n    }());\n    fgui.UBBParser = UBBParser;\n})(fgui || (fgui = {}));\n\n(function (fgui) {\n    var ToolSet = (function () {\n        function ToolSet() {\n        }\n        ToolSet.startsWith = function (source, str, ignoreCase) {\n            if (!source)\n                return false;\n            else if (source.length < str.length)\n                return false;\n            else {\n                source = source.substring(0, str.length);\n                if (!ignoreCase)\n                    return source == str;\n                else\n                    return source.toLowerCase() == str.toLowerCase();\n            }\n        };\n        ToolSet.trimRight = function (targetString) {\n            var tempChar = \"\";\n            for (var i = targetString.length - 1; i >= 0; i--) {\n                tempChar = targetString.charAt(i);\n                if (tempChar != \" \" && tempChar != \"\\n\" && tempChar != \"\\r\") {\n                    break;\n                }\n            }\n            return targetString.substring(0, i + 1);\n        };\n        ToolSet.convertToHtmlColor = function (argb, hasAlpha) {\n            var alpha;\n            if (hasAlpha)\n                alpha = (argb >> 24 & 0xFF).toString(16);\n            else\n                alpha = \"\";\n            var red = (argb >> 16 & 0xFF).toString(16);\n            var green = (argb >> 8 & 0xFF).toString(16);\n            var blue = (argb & 0xFF).toString(16);\n            if (alpha.length == 1)\n                alpha = \"0\" + alpha;\n            if (red.length == 1)\n                red = \"0\" + red;\n            if (green.length == 1)\n                green = \"0\" + green;\n            if (blue.length == 1)\n                blue = \"0\" + blue;\n            return \"#\" + alpha + red + green + blue;\n        };\n        ToolSet.convertFromHtmlColor = function (str, hasAlpha) {\n            if (str.length < 1)\n                return 0;\n            if (str.charAt(0) == \"#\")\n                str = str.substr(1);\n            if (str.length == 8)\n                return (parseInt(str.substr(0, 2), 16) << 24) + parseInt(str.substr(2), 16);\n            else if (hasAlpha)\n                return 0xFF000000 + parseInt(str, 16);\n            else\n                return parseInt(str, 16);\n        };\n        ToolSet.displayObjectToGObject = function (obj) {\n            while (obj && !(obj instanceof egret.Stage)) {\n                if (obj[\"$owner\"])\n                    return fgui.GObject.cast(obj);\n                obj = obj.parent;\n            }\n            return null;\n        };\n        ToolSet.encodeHTML = function (str) {\n            if (!str)\n                return \"\";\n            else\n                return str.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\")\n                    .replace(/>/g, \"&gt;\").replace(/'/g, \"&apos;\").replace(/\"/g, \"&quot;\");\n        };\n        ToolSet.clamp = function (value, min, max) {\n            if (value < min)\n                value = min;\n            else if (value > max)\n                value = max;\n            return value;\n        };\n        ToolSet.clamp01 = function (value) {\n            if (value > 1)\n                value = 1;\n            else if (value < 0)\n                value = 0;\n            return value;\n        };\n        ToolSet.lerp = function (start, end, percent) {\n            return (start + percent * (end - start));\n        };\n        ToolSet.repeat = function (t, length) {\n            return t - Math.floor(t / length) * length;\n        };\n        ToolSet.distance = function (x1, y1, x2, y2) {\n            return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));\n        };\n        ToolSet.fillPath = function (ctx, points, px, py) {\n            var cnt = points.length;\n            ctx.moveTo(points[0] + px, points[1] + py);\n            for (var i = 2; i < cnt; i += 2)\n                ctx.lineTo(points[i] + px, points[i + 1] + py);\n            ctx.lineTo(points[0] + px, points[1] + py);\n        };\n        ToolSet.setColorFilter = function (obj, color) {\n            var filter = obj.$_colorFilter_;\n            var filters = obj.filters;\n            var toApplyColor;\n            var toApplyGray;\n            var tp = typeof (color);\n            if (tp == \"boolean\") {\n                toApplyColor = filter ? filter.$_color_ : null;\n                toApplyGray = color;\n            }\n            else {\n                toApplyColor = color == 0xFFFFFF ? null : color;\n                toApplyGray = filter ? filter.$_grayed_ : false;\n            }\n            if ((!toApplyColor && toApplyColor !== 0) && !toApplyGray) {\n                if (filters && filter) {\n                    var i = filters.indexOf(filter);\n                    if (i != -1) {\n                        filters.splice(i, 1);\n                        if (filters.length > 0)\n                            obj.filters = filters;\n                        else\n                            obj.filters = null;\n                    }\n                }\n                return;\n            }\n            if (!filter) {\n                filter = new egret.ColorMatrixFilter();\n                obj.$_colorFilter_ = filter;\n            }\n            if (!filters)\n                filters = [filter];\n            else {\n                var i_1 = filters.indexOf(filter);\n                if (i_1 == -1)\n                    filters.push(filter);\n            }\n            obj.filters = filters;\n            filter.$_color_ = toApplyColor;\n            filter.$_grayed_ = toApplyGray;\n            var mat = filter.matrix;\n            if (toApplyGray) {\n                for (var i_2 = 0; i_2 < 20; i_2++)\n                    mat[i_2] = grayScaleMatrix[i_2];\n            }\n            else if (toApplyColor instanceof Array) {\n                getColorMatrix(toApplyColor[0], toApplyColor[1], toApplyColor[2], toApplyColor[3], mat);\n            }\n            else {\n                for (var i_3 = 0; i_3 < 20; i_3++) {\n                    mat[i_3] = (i_3 == 0 || i_3 == 6 || i_3 == 12 || i_3 == 18) ? 1 : 0;\n                }\n                mat[0] = ((color >> 16) & 0xFF) / 255;\n                mat[6] = ((color >> 8) & 0xFF) / 255;\n                mat[12] = (color & 0xFF) / 255;\n            }\n            filter.matrix = mat;\n        };\n        return ToolSet;\n    }());\n    fgui.ToolSet = ToolSet;\n    var grayScaleMatrix = [\n        0.3, 0.6, 0, 0, 0,\n        0.3, 0.6, 0, 0, 0,\n        0.3, 0.6, 0, 0, 0,\n        0, 0, 0, 1, 0\n    ];\n    var helper = new fgui.ColorMatrix();\n    function getColorMatrix(p_brightness, p_contrast, p_saturation, p_hue, result) {\n        if (!result)\n            result = new Array(fgui.ColorMatrix.length);\n        helper.reset();\n        helper.adjustColor(p_brightness, p_contrast, p_saturation, p_hue);\n        helper.matrix.forEach(function (e, i) { return result[i] = e; });\n    }\n})(fgui || (fgui = {}));\n"
  },
  {
    "path": "source/gulpfile.js",
    "content": "'use strict';\nconst gulp = require(\"gulp\");\nconst minify = require('gulp-minify');\nconst inject = require(\"gulp-inject-string\");\nconst ts = require('gulp-typescript');\nconst tsProject = ts.createProject('tsconfig.json');\n\ngulp.task('buildJs', () => {\n    return tsProject.src()\n        .pipe(tsProject())\n        .js.pipe(inject.replace('var fgui;', ''))\n        .pipe(inject.prepend('window.fgui = {};\\nwindow.fairygui = window.fgui;\\n'))\n        .pipe(inject.replace('var __extends =', 'window.__extends ='))\n        .pipe(minify({ ext: { min: \".min.js\" } }))\n        .pipe(gulp.dest('./bin'));\n});\n\ngulp.task(\"buildDts\", [\"buildJs\"], () => {\n    return tsProject.src()\n        .pipe(tsProject())\n        .dts.pipe(inject.append('import fairygui = fgui;'))\n        .pipe(gulp.dest('./bin'));\n});\n\ngulp.task(\"build\", [\"buildDts\"], () => {\n    return gulp.src('bin/**/*')\n        .pipe(gulp.dest('../demo/libs/fairygui/'))\n});\n"
  },
  {
    "path": "source/lib/assetsmanager.d.ts",
    "content": "declare namespace RES {\n    /**\n     * Version control loading interface\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/version/VersionControl.ts\n     * @language en_US\n     */\n    /**\n     * 版本控制加载的接口\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample extension/version/VersionControl.ts\n     * @language zh_CN\n     */\n    interface IVersionController {\n        /**\n         * Get the version information data.<br/>\n         * Before calling this method requires the application of any resource load, we recommend starting at the application entry class (Main) The first call processing. This method is only responsible for acquiring version information, is not responsible for downloaded resources.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取版本信息数据。<br/>\n         * 这个方法的调用需要在应用程序进行任何资源加载之前，建议在应用程序的入口类（Main）的开始最先进行调用处理。此方法只负责获取版本信息，不负责资源的下载。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        init(): Promise<any>;\n        /**\n         * Get the actual URL of the resource file.<br/>\n         * Because this method needs to be called to control the actual version of the URL have the original resource files were changed, so would like to get the specified resource file the actual URL.<br/>\n         * In the development and debugging phase, this method will directly return value passed.\n         * @param url Url used in the game\n         * @returns Actual loaded url\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取资源文件实际的URL地址。<br/>\n         * 由于版本控制实际已经对原来的资源文件的URL进行了改变，因此想获取指定资源文件实际的URL时需要调用此方法。<br/>\n         * 在开发调试阶段，这个方法会直接返回传入的参数值。\n         * @param url 游戏中使用的url\n         * @returns 实际加载的url\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getVirtualUrl(url: string): string;\n    }\n    /**\n     * Manage version control class\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @event egret.Event.COMPLETE Version control loading is complete when thrown\n     * @event egret.IOErrorEvent.IO_ERROR Version control failed to load when thrown\n     * @includeExample extension/version/VersionControl.ts\n     * @language en_US\n     */\n    /**\n     * 管理版本控制的类\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @event egret.Event.COMPLETE 版本控制加载完成时抛出\n     * @event egret.IOErrorEvent.IO_ERROR 版本控制加载失败时抛出\n     * @includeExample extension/version/VersionControl.ts\n     * @language zh_CN\n     */\n    interface VersionController extends IVersionController {\n    }\n    /**\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    let VersionController: {\n        /**\n         * Constructor initialization\n         * @language en_US\n         */\n        /**\n         * 初始化构造函数\n         * @language zh_CN\n         */\n        new (): VersionController;\n    };\n}\ndeclare type ResourceRootSelector<T extends string> = () => T;\ndeclare type ResourceNameSelector = (file: string) => string;\ndeclare type ResourceMergerSelector = (file: string) => {\n    path: string;\n    alias: string;\n};\ndeclare module RES {\n    /**\n     * Get resource information through file path\n     * @param path file path\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 通过文件路径获取资源信息\n     * @param path 文件路径\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getResourceInfo(path: string): File | null;\n    /**\n    * @private\n    */\n    interface ResourceInfo {\n        url: string;\n        type: string;\n        root: string;\n        crc32?: string;\n        size?: number;\n        extra?: 1 | undefined;\n        name: string;\n        soundType?: string;\n        scale9grid?: string;\n        groupNames?: string[];\n        promise?: Promise<any>;\n    }\n    /**\n    * @private\n    */\n    interface Data {\n        resourceRoot: string;\n        mergeSelector: ResourceMergerSelector | null;\n        fileSystem: FileSystem;\n        groups: {\n            [groupName: string]: string[];\n        };\n        alias: {\n            [aliasName: string]: string;\n        };\n        loadGroup: string[];\n    }\n    /**\n     * @class RES.ResourceConfig\n     * @classdesc\n     * @private\n     */\n    class ResourceConfig {\n        config: Data;\n        constructor();\n        init(): Promise<any>;\n        /**\n         * 根据组名获取组加载项列表\n         * @method RES.ResourceConfig#getGroupByName\n         * @param name {string} 组名\n         * @returns {Array<egret.ResourceItem>}\n         */\n        getGroupByName(name: string): ResourceInfo[];\n        __temp__get__type__via__url(url_or_alias: string): string;\n        getResourceWithSubkey(key: string): {\n            r: ResourceInfo;\n            key: string;\n            subkey: string;\n        } | null;\n        getKeyByAlias(aliasName: string): string;\n        getResource(path_or_alias: string): ResourceInfo | null;\n        /**\n         * 创建自定义的加载资源组,注意：此方法仅在资源配置文件加载完成后执行才有效。\n         * 可以监听ResourceEvent.CONFIG_COMPLETE事件来确认配置加载完成。\n         * @method RES.ResourceConfig#createGroup\n         * @param name {string} 要创建的加载资源组的组名\n         * @param keys {egret.Array<string>} 要包含的键名列表，key对应配置文件里的name属性或sbuKeys属性的一项或一个资源组名。\n         * @param override {boolean} 是否覆盖已经存在的同名资源组,默认false。\n         * @returns {boolean}\n         */\n        createGroup(name: string, keys: Array<string>, override?: boolean): boolean;\n        /**\n         * 添加一个二级键名到配置列表。\n         * @method RES.ResourceConfig#addSubkey\n         * @param subkey {string} 要添加的二级键名\n         * @param name {string} 二级键名所属的资源name属性\n         */\n        addSubkey(subkey: string, name: string): void;\n        addAlias(alias: any, key: any): void;\n        addResourceData(data: {\n            name: string;\n            type: string;\n            url: string;\n            root?: string;\n            extra?: 1 | undefined;\n        }): void;\n        removeResourceData(data: {\n            name: string;\n            type?: string;\n            url: string;\n            root?: string;\n            extra?: 1 | undefined;\n        }): void;\n    }\n}\ndeclare module RES {\n    /**\n     * @class RES.ResourceLoader\n     * @classdesc\n     * @private\n     */\n    class ResourceLoader {\n        /**\n         * 当前组加载的项总个数,key为groupName\n         */\n        private groupTotalDic;\n        /**\n         * 已经加载的项个数,key为groupName\n         */\n        private numLoadedDic;\n        /**\n         * 加载失败的组,key为groupName\n         */\n        private groupErrorDic;\n        private retryTimesDic;\n        maxRetryTimes: number;\n        private reporterDic;\n        private dispatcherDic;\n        private failedList;\n        private loadItemErrorDic;\n        private errorDic;\n        /**\n         * 资源优先级队列，key为资源，value为优先级\n         */\n        private itemListPriorityDic;\n        /**\n         * 资源是否在加载\n         */\n        private itemLoadDic;\n        private promiseHash;\n        /**\n         * 延迟加载队列,getResByUrl ,getResAsync等方法存储队列\n         */\n        private lazyLoadList;\n        pushResItem(resInfo: ResourceInfo): Promise<any>;\n        /**\n         * 加载队列,存储组的队列\n         */\n        pushResGroup(list: ResourceInfo[], groupName: string, priority: number, reporter?: PromiseTaskReporter): Promise<any>;\n        /**\n         * 更新组的优先级顺序\n         * @param list 存储数据的队列\n         * @param priority 优先级\n         */\n        private updatelistPriority(list, priority);\n        /**\n         * 搜索单项资源的优先级\n         * @param item 单项资源\n         */\n        private findPriorityInDic(item);\n        private loadingCount;\n        /**\n         * 最大线程数目\n         */\n        thread: number;\n        /**\n         * 加载下一项资源，线程控制\n         */\n        private loadNextResource();\n        /**\n         * 加载单向资源\n         */\n        private loadSingleResource();\n        /**\n         * 获取下一个待加载项\n         */\n        private getOneResourceInfoInGroup();\n        /**\n         * 设置组的加载进度，同时返回当前组是否加载完成\n         * @param groupName 组名\n         * @param r 加载完成的资源\n         */\n        private setGroupProgress(groupName, r);\n        /**\n         * 加载组的最后一项，同时派发事件\n         * @param groupName 组名\n         * @param lastError 最后一项是否成功，此项为错误信息\n         */\n        private loadGroupEnd(groupName, lastError?);\n        /**\n         * 删除事件派发器，Promise的缓存，返回事件派发器\n         * @param groupName 组名或是root+name\n         */\n        private deleteDispatcher(groupName);\n        /**\n         * 加载资源\n         * @param r 资源信息\n         * @param p 加载处理器\n         */\n        private loadResource(r, p?);\n        /**\n         * 释放资源\n         * @param r 资源信息\n         */\n        unloadResource(r: ResourceInfo): boolean;\n    }\n}\ndeclare module RES {\n}\ndeclare module RES {\n    type GetResAsyncCallback = (value?: any, key?: string) => any;\n    /**\n    * Convert the file name of the resource to the Key value used in the project.\n    * @param url Resource Name.\n    * @returns The key value used in the project\n    * @version Egret 5.2\n    * @platform Web,Native\n    * @language en_US\n    */\n    /**\n     * 将资源的文件名称转换为项目中所使用的Key值。\n     * 在加载合并图集的时候使用，例如图集加载A_json，需要加载对应A_png，这里就是转换的机制\n     * 一般项目中无需更改，只有没有使用默认的key和文件对应的需要修改\n     * @param url 资源名称。\n     * @returns 项目中所用的key值\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function nameSelector(url: any): string;\n    /**\n    * Get the read type of the file.\n    * When using getResByUrl does not specify the type of the read file, it will find the corresponding type according to this method.\n    * File types not found are loaded by default in binary format\n    * @param path file path.\n    * @returns Processor type used to read the file\n    * @version Egret 5.2\n    * @platform Web,Native\n    * @language en_US\n    */\n    /**\n     * 获取文件的读取类型\n     * 在使用getResByUrl没有指定读取文件的类型，会根据这个方法寻找对应的类型\n     * 没有查找到的文件类型以二进制格式默认加载\n     * @param path 文件路径\n     * @returns 读取文件所用的Processor类型\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function typeSelector(path: string): string;\n    /**\n     * Conduct mapping injection with class definition as the value, Deprecated.\n     * @deprecated\n     * @see RES.processor.map\n     * @language en_US\n     */\n    /**\n     * 以类定义为值进行映射注入，已废弃。\n     * @deprecated\n     * @see RES.processor.map\n     * @language zh_CN\n     */\n    function registerAnalyzer(type: string, analyzerClass: any): void;\n    /**\n    * Set whether it is compatible mode\n    * When the value is true, the assetsManager will output the design of Res. When it is false, all the loaded resources will be returned as promises.\n    * The default is false, run in strict assetsManager mode\n    * @version Egret 5.2.9\n    * @platform Web,Native\n    * @language en_US\n    */\n    /**\n     * 设置是否为兼容模式\n     * 当值为true时，assetsManager会以Res的设计输出，当为false时候，所有的加载资源都会以promise的方式返回\n     * 默认是false，以严格assetsManager方式运行\n     * @version Egret 5.2.9\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function setIsCompatible(value: boolean): void;\n    /**\n     * Load configuration file and parse.\n     * @param url The url address of the resource config\n     * @param resourceRoot The root address of the resource config\n     * @returns Promise\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 加载配置文件并解析。\n     * @param url 资源配置的url地址\n     * @param resourceRoot 资源配置的根地址\n     * @returns Promise\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function loadConfig(url: string, resourceRoot: string): Promise<void>;\n    /**\n     * Load a set of resources according to the group name.\n     * @param name Group name to load the resource group.\n     * @param priority Load priority can be negative, the default value is 0.\n     * <br>A low priority group must wait for the high priority group to complete the end of the load to start, and the same priority group will be loaded at the same time.\n     * @param reporter Resource group loading progress prompt\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 根据组名加载一组资源。\n     * @param name 要加载资源组的组名。\n     * @param priority 加载优先级,可以为负数,默认值为 0。\n     * <br>低优先级的组必须等待高优先级组完全加载结束才能开始，同一优先级的组会同时加载。\n     * @param reporter 资源组的加载进度提示\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function loadGroup(name: string, priority?: number, reporter?: PromiseTaskReporter): Promise<void>;\n    /**\n     * Check whether a resource group has been loaded.\n     * @param name Group name。\n     * @returns Is loading or not.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 检查某个资源组是否已经加载完成。\n     * @param name 组名。\n     * @returns 是否正在加载。\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function isGroupLoaded(name: string): boolean;\n    /**\n     * A list of groups of loading is obtained according to the group name.\n     * @param name Group name.\n     * @returns The resource item array of group.\n     * @see RES.ResourceItem\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 根据组名获取组加载项列表。\n     * @param name 组名。\n     * @returns 加载项列表。\n     * @see RES.ResourceItem\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getGroupByName(name: string): Array<ResourceItem>;\n    /**\n     * Create a custom load resource group, note that this method is valid only after the resource configuration file is loaded.\n     * <br>You can monitor the ResourceEvent.CONFIG_COMPLETE event to verify that the configuration is complete.\n     * @param name Group name to create the load resource group.\n     * @param keys To be included in the list of key keys, the corresponding configuration file in the name or sbuKeys property one or a resource group name.\n     * @param override Is the default false for the same name resource group already exists.\n     * @returns Create success or fail.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 创建自定义的加载资源组,注意：此方法仅在资源配置文件加载完成后执行才有效。\n     * <br>可以监听 ResourceEvent.CONFIG_COMPLETE 事件来确认配置加载完成。\n     * @param name 要创建的加载资源组的组名。\n     * @param keys 要包含的键名列表，key 对应配置文件里的 name 属性或 sbuKeys 属性的一项或一个资源组名。\n     * @param override 是否覆盖已经存在的同名资源组,默认 false。\n     * @returns 是否创建成功。\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function createGroup(name: string, keys: Array<string>, override?: boolean): boolean;\n    /**\n     * Check whether the configuration file contains the specified resources.\n     * @param key A sbuKeys attribute or name property in a configuration file.\n     * @returns Whether you have the specified resource\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 检查配置文件里是否含有指定的资源。\n     * @param key 对应配置文件里的 name 属性或 sbuKeys 属性的一项。\n     * @returns 是否拥有指定资源\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function hasRes(key: string): boolean;\n    /**\n     * The synchronization method for obtaining the cache has been loaded with the success of the resource.\n     * <br>The type of resource and the corresponding return value types are as follows:\n     * <br>RES.ResourceItem.TYPE_BIN : ArrayBuffer JavaScript primary object\n     * <br>RES.ResourceItem.TYPE_IMAGE : img Html Object，or egret.BitmapData interface。\n     * <br>RES.ResourceItem.TYPE_JSON : Object\n     * <br>RES.ResourceItem.TYPE_SHEET : Object\n     * <br>  1. If the incoming parameter is the name of the entire SpriteSheet is returned is {image1: Texture, \"image2\": Texture}.\n     * <br>  2. If the incoming is \"sheet.image1\", the return is a single resource.\n     * <br>  3. If the incoming is the name of the \"image1\" single resource, the return is a single resource.\n     * But if there are two SpriteSheet in a single picture of the same name, the return of the image after the load.\n     * <br>RES.ResourceItem.TYPE_SOUND : HtmlSound Html Object\n     * <br>RES.ResourceItem.TYPE_TEXT : string\n     * @param key A subKeys attribute or name property in a configuration file.\n     * @see RES.ResourceItem\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 同步方式获取缓存的已经加载成功的资源。\n     * <br>资源类型和对应的返回值类型关系如下：\n     * <br>RES.ResourceItem.TYPE_BIN : ArrayBuffer JavaScript 原生对象\n     * <br>RES.ResourceItem.TYPE_IMAGE : img Html 对象，或者 egret.BitmapData 接口。\n     * <br>RES.ResourceItem.TYPE_JSON : Object\n     * <br>RES.ResourceItem.TYPE_SHEET : Object\n     * <br>  1. 如果传入的参数是整个 SpriteSheet 的名称返回的是 {\"image1\":Texture,\"image2\":Texture} 这样的格式。\n     * <br>  2. 如果传入的是 \"sheet.image1\"，返回的是单个资源。\n     * <br>  3. 如果传入的是 \"image1\" 单个资源的名称，返回的是单个资源。但是如果有两张 SpriteSheet 中有单个图片资源名称相同，返回的是后加载的那个图片资源。\n     * <br>RES.ResourceItem.TYPE_SOUND : HtmlSound Html 对象\n     * <br>RES.ResourceItem.TYPE_TEXT : string\n     * @param key 对应配置文件里的 name 属性或 subKeys 属性的一项。\n     * @see RES.ResourceItem\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getRes(key: string): any;\n    /**\n     * Asynchronous mode to get the resources in the configuration. As long as the resources exist in the configuration file, you can get it in an asynchronous way.\n     * @param key A sbuKeys attribute or name property in a configuration file.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n    */\n    /**\n     * 异步方式获取配置里的资源。只要是配置文件里存在的资源，都可以通过异步方式获取。\n     * @param key 对应配置文件里的 name 属性或 sbuKeys 属性的一项。\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getResAsync(key: string): Promise<any>;\n    /**\n     * Asynchronous mode to get the resources in the configuration. As long as the resources exist in the configuration file, you can get it in an asynchronous way.\n     * @param key A sbuKeys attribute or name property in a configuration file.\n     * @param compFunc Call back function. Example：compFunc(data,key):void.\n     * @param thisObject This pointer of call back function.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 异步方式获取配置里的资源。只要是配置文件里存在的资源，都可以通过异步方式获取。\n     * @param key 对应配置文件里的 name 属性或 sbuKeys 属性的一项。\n     * @param compFunc 回调函数。示例：compFunc(data,key):void。\n     * @param thisObject 回调函数的 this 引用。\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getResAsync(key: string, compFunc: GetResAsyncCallback, thisObject: any): Promise<any> | void;\n    /**\n     * Access to external resources through the full URL.\n     * @param url The external path to load the file.\n     * @param compFunc Call back function. Example：compFunc(data,url):void。\n     * @param thisObject This pointer of call back function.\n     * @param type File type (optional). Use the static constants defined in the ResourceItem class. If you do not set the file name extension.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 通过完整URL方式获取外部资源。\n     * @param url 要加载文件的外部路径。\n     * @param compFunc 回调函数。示例：compFunc(data,url):void。\n     * @param thisObject 回调函数的 this 引用。\n     * @param type 文件类型(可选)。请使用 ResourceItem 类中定义的静态常量。若不设置将根据文件扩展名生成。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getResByUrl(url: string, compFunc?: Function, thisObject?: any, type?: string): Promise<any>;\n    /**\n     * Destroy a single resource file or a set of resources to the cache data, to return whether to delete success.\n     * @param name Name attribute or resource group name of the load item in the configuration file.\n     * @param force Destruction of a resource group when the other resources groups have the same resource situation whether the resources will be deleted, the default value true.\n     * @returns Are successful destruction.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 销毁单个资源文件或一组资源的缓存数据,返回是否删除成功。\n     * @param name 配置文件中加载项的name属性或资源组名。\n     * @param force 销毁一个资源组时其他资源组有同样资源情况资源是否会被删除，默认值 true。\n     * @see #setMaxRetryTimes\n     * @returns 是否销毁成功。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function destroyRes(name: string, force?: boolean): boolean;\n    /**\n     * Sets the maximum number of concurrent load threads, the default value is 4.\n     * @param thread The number of concurrent loads to be set.\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 设置最大并发加载线程数量，默认值是 4。\n     * @param thread 要设置的并发加载数。\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function setMaxLoadingThread(thread: number): void;\n    /**\n     * Sets the number of retry times when the resource failed to load, and the default value is 3.\n     * @param retry To set the retry count.\n     * @includeExample extension/resource/Resource.ts\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 设置资源加载失败时的重试次数，默认值是 3。\n     * @param retry 要设置的重试次数。\n     * @includeExample extension/resource/Resource.ts\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function setMaxRetryTimes(retry: number): void;\n    /**\n     * Add event listeners, reference ResourceEvent defined constants.\n     * @param type Event name。\n     * @param listener Listener functions for handling events. This function must accept the Event object as its only parameter, and can't return any results,\n     * As shown in the following example: function (evt:Event):void can have any name.\n     * @param thisObject The this object that is bound to a function.\n     * @param useCapture Determine the listener is running on the capture or running on the target and the bubbling phase. Set useCapture to true,\n     * then the listener in the capture phase processing events, but not in the target or the bubbling phase processing events.\n     * If useCapture is false, then the listener only in the target or the bubbling phase processing events.\n     * To listen for events in all three stages, please call addEventListener two times: once the useCapture is set to true, once the useCapture is set to false.\n     * @param priority Event listener priority. Priority is specified by a 32 - bit integer with a symbol. The higher the number, the higher the priority.\n     * All listeners with a priority for n will be processed before the -1 n listener.\n     * If two or more listeners share the same priority, they are processed in accordance with the order of their added. The default priority is 0.\n     * @see RES.ResourceEvent\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 添加事件侦听器,参考 ResourceEvent 定义的常量。\n     * @param type 事件的类型。\n     * @param listener 处理事件的侦听器函数。此函数必须接受 Event 对象作为其唯一的参数，并且不能返回任何结果，\n     * 如下面的示例所示： function(evt:Event):void 函数可以有任何名称。\n     * @param thisObject 侦听函数绑定的 this 对象。\n     * @param useCapture 确定侦听器是运行于捕获阶段还是运行于目标和冒泡阶段。如果将 useCapture 设置为 true，\n     * 则侦听器只在捕获阶段处理事件，而不在目标或冒泡阶段处理事件。如果 useCapture 为 false，则侦听器只在目标或冒泡阶段处理事件。\n     * 要在所有三个阶段都侦听事件，请调用 addEventListener 两次：一次将 useCapture 设置为 true，一次将 useCapture 设置为 false。\n     * @param priority 事件侦听器的优先级。优先级由一个带符号的 32 位整数指定。数字越大，优先级越高。优先级为 n 的所有侦听器会在\n     * 优先级为 n -1 的侦听器之前得到处理。如果两个或更多个侦听器共享相同的优先级，则按照它们的添加顺序进行处理。默认优先级为 0。\n     * @see RES.ResourceEvent\n     * @see #setMaxRetryTimes\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function addEventListener(type: string, listener: (event: egret.Event) => void, thisObject: any, useCapture?: boolean, priority?: number): void;\n    /**\n     * Remove event listeners, reference ResourceEvent defined constants.\n     * @param type Event name。\n     * @param listener Listening function。\n     * @param thisObject The this object that is bound to a function.\n     * @param useCapture Is used to capture, and this property is only valid in the display list.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 移除事件侦听器,参考ResourceEvent定义的常量。\n     * @param type 事件名。\n     * @param listener 侦听函数。\n     * @param thisObject 侦听函数绑定的this对象。\n     * @param useCapture 是否使用捕获，这个属性只在显示列表中生效。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function removeEventListener(type: string, listener: (event: egret.Event) => void, thisObject: any, useCapture?: boolean): void;\n    /**\n     * Adding a custom resource configuration.\n     * @param data To add configuration.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 自定义添加一项资源配置。\n     * @param data 要添加的配置。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function $addResourceData(data: {\n        name: string;\n        type: string;\n        url: string;\n    }): void;\n    /**\n    * Returns the VersionController\n    * @version Egret 5.2\n    * @platform Web,Native\n    * @language en_US\n    */\n    /**\n     * 获得版本控制器.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getVersionController(): VersionController;\n    /**\n     * Register the VersionController\n     * @param vcs The VersionController to register.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 注册版本控制器,通过RES模块加载资源时会从版本控制器获取真实url\n     * @param vcs 注入的版本控制器。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function registerVersionController(vcs: VersionController): void;\n    /**\n     * Convert the address of the loaded resource (via version controller conversion)\n     * @param url path to the original resource\n     * @returns converted address\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 转换加载资源的地址（经过版本控制器的转换）\n     * @param url 原始资源的路径\n     * @returns 转换后的地址\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getVirtualUrl(url: any): any;\n    /**\n     * @private\n     */\n    class Resource extends egret.EventDispatcher {\n        vcs: VersionController;\n        isVcsInit: boolean;\n        constructor();\n        registerVersionController(vcs: VersionController): void;\n        /**\n         * 开始加载配置\n         * @method RES.loadConfig\n         */\n        loadConfig(): Promise<void>;\n        /**\n         * @private\n         * 版本控制器加载后的加载配置\n         */\n        private normalLoadConfig;\n        /**\n         * 检查某个资源组是否已经加载完成\n         * @method RES.isGroupLoaded\n         * @param name {string}\n         */\n        isGroupLoaded(name: string): boolean;\n        /**\n         * 根据组名获取组加载项列表\n         * @method RES.getGroupByName\n         * @param name {string}\n         */\n        getGroupByName(name: string): Array<ResourceInfo>;\n        /**\n         * 根据组名加载一组资源\n         * @method RES.loadGroup\n         * @param name {string}\n         * @param priority {number}\n         */\n        loadGroup(name: string, priority?: number, reporter?: PromiseTaskReporter): Promise<any>;\n        private _loadGroup(name, priority?, reporter?);\n        /**\n         * 创建自定义的加载资源组,注意：此方法仅在资源配置文件加载完成后执行才有效。\n         * 可以监听ResourceEvent.CONFIG_COMPLETE事件来确认配置加载完成。\n         * @method RES.ResourceConfig#createGroup\n         * @param name {string} 要创建的加载资源组的组名\n         * @param keys {egret.Array<string>} 要包含的键名列表，key对应配置文件里的name属性或一个资源组名。\n         * @param override {boolean} 是否覆盖已经存在的同名资源组,默认false。\n         * @returns {boolean}\n         */\n        createGroup(name: string, keys: Array<string>, override?: boolean): boolean;\n        /**\n         * 检查配置文件里是否含有指定的资源\n         * @method RES.hasRes\n         * @param key {string} 对应配置文件里的name属性或subKeys属性的一项。\n         * @returns {boolean}\n         */\n        hasRes(key: string): boolean;\n        /**\n         * 通过key同步获取资源\n         * @method RES.getRes\n         * @param key {string}\n         * @returns {any}\n         */\n        getRes(resKey: string): any;\n        /**\n         * 通过key异步获取资源\n         * @method RES.getResAsync\n         * @param key {string}\n         * @param compFunc {Function} 回调函数。示例：compFunc(data,url):void。\n         * @param thisObject {any}\n         */\n        getResAsync(key: string): Promise<any>;\n        getResAsync(key: string, compFunc: GetResAsyncCallback, thisObject: any): Promise<any>;\n        /**\n         * 通过url获取资源\n         * @method RES.getResByUrl\n         * @param url {string}\n         * @param compFunc {Function}\n         * @param thisObject {any}\n         * @param type {string}\n         */\n        getResByUrl(url: string, compFunc?: Function, thisObject?: any, type?: string): Promise<any>;\n        /**\n         * 销毁单个资源文件或一组资源的缓存数据,返回是否删除成功。\n         * @method RES.destroyRes\n         * @param name {string} 配置文件中加载项的name属性或资源组名\n         * @param force {boolean} 销毁一个资源组时其他资源组有同样资源情况资源是否会被删除，默认值true\n         * @returns {boolean}\n         */\n        destroyRes(name: string, force?: boolean): boolean;\n        /**\n         * 设置最大并发加载线程数量，默认值是4.\n         * @method RES.setMaxLoadingThread\n         * @param thread {number} 要设置的并发加载数。\n         */\n        setMaxLoadingThread(thread: number): void;\n        /**\n         * 设置资源加载失败时的重试次数。\n         * @param retry 要设置的重试次数。\n         */\n        setMaxRetryTimes(retry: number): void;\n        addResourceData(data: {\n            name: string;\n            type: string;\n            url: string;\n        }): void;\n    }\n}\ndeclare namespace RES {\n    /**\n     * Print the memory occupied by the picture.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 对文件路径的一些操作，针对的是 C:/A/B/C/D/example.ts这种格式\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    namespace path {\n        /**\n         * Format the file path,\"C:/A/B//C//D//example.ts\"=>\"C:/A/B/C/D/example.ts\"\n         * @param filename Incoming file path\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 格式化文件路径，\"C:/A/B//C//D//example.ts\"=>\"C:/A/B/C/D/example.ts\"\n         * @param filename 传入的文件路径\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function normalize(filename: string): string;\n        /**\n         * Get the file name according to the file path, \"C:/A/B/example.ts\"=>\"example.ts\"\n         * @param filename Incoming file path\n         * @return File name\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 根据文件路径得到文件名字，\"C:/A/B/example.ts\"=>\"example.ts\"\n         * @param filename 传入的文件路径\n         * @return 文件的名字\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function basename(filename: string): string;\n        /**\n         * The path to the folder where the file is located,\"C:/A/B/example.ts\"=>\"C:/A/B\"\n         * @param filename Incoming file path\n         * @return The address of the folder where the file is located\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文件所在文件夹路径，\"C:/A/B/example.ts\"=>\"C:/A/B\"\n         * @param filename 传入的文件路径\n         * @return 文件所在文件夹的地址\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        function dirname(path: string): string;\n    }\n}\ndeclare namespace RES {\n    /**\n     * @private\n     */\n    class NativeVersionController implements IVersionController {\n        private versionInfo;\n        init(): Promise<void>;\n        getVirtualUrl(url: string): string;\n        private getLocalData(filePath);\n    }\n}\ndeclare module RES.processor {\n    interface Processor {\n        /**\n         * Start loading a single resource\n         * @param host Load the processor, you can use the processor to load resources, directly use http to get the resources back\n         * @param resource Resource information\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 开始加载单项资源\n         * @param host 加载处理器，可以不使用这个处理器加载资源，直接用http获取资源返回即可\n         * @param resource 资源的信息\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        onLoadStart(host: ProcessHost, resource: ResourceInfo): Promise<any>;\n        /**\n         * Remove a single resource, usually call host.unload (resource);\n         * @param host Load the processor\n         * @param resource Resource information\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 移除单项资源，一般调用host.unload(resource);\n         * @param host 加载处理器\n         * @param resource 资源的信息\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        onRemoveStart(host: ProcessHost, resource: ResourceInfo): void;\n        /**\n        * Get the submap of the merged atlas\n        * @param host Load the processor\n        * @param resource Resource information\n        * @param key The key value of the resource\n        * @param subkey  Collection of subset names\n        * @version Egret 5.2\n        * @platform Web,Native\n        * @language en_US\n        */\n        /**\n         * 获取合并图集的子图\n         * @param host 加载处理器\n         * @param resource 资源的信息\n         * @param key 资源的key值\n         * @param subkey  子集名称的集合\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getData?(host: ProcessHost, resource: ResourceInfo, key: string, subkey: string): any;\n    }\n    /**\n     * Register the processor that loads the resource\n     * @param type Load resource type\n     * @param processor Loaded processor, an instance that implements the Processor interface\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 注册加载资源的处理器\n     * @param type 加载资源类型\n     * @param processor 加载的处理器，一个实现Processor接口的实例\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function map(type: string, processor: Processor): void;\n    /**\n     * @private\n     * @param url\n     * @param file\n     */\n    function getRelativePath(url: string, file: string): string;\n    var ImageProcessor: Processor;\n    const KTXTextureProcessor: RES.processor.Processor;\n    /**\n    *\n    */\n    function makeEtc1SeperatedAlphaResourceInfo(resource: ResourceInfo): ResourceInfo;\n    /**\n    *\n    */\n    const ETC1KTXProcessor: Processor;\n    var BinaryProcessor: Processor;\n    var TextProcessor: Processor;\n    var JsonProcessor: Processor;\n    var SoundProcessor: Processor;\n}\ndeclare module RES {\n    /**\n     * The events of resource loading.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 资源加载事件。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class ResourceEvent extends egret.Event {\n        /**\n         * Failure event for a load item.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个加载项加载失败事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ITEM_LOAD_ERROR: string;\n        /**\n         * Configure file to load and parse the completion event. Note: if a configuration file is loaded, it will not be thrown out, and if you want to handle the configuration loading failure, monitor the CONFIG_LOAD_ERROR event.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 配置文件加载并解析完成事件。注意：若有配置文件加载失败，将不会抛出此事件，若要处理配置加载失败，请同时监听 CONFIG_LOAD_ERROR 事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static CONFIG_COMPLETE: string;\n        /**\n         * Configuration file failed to load.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 配置文件加载失败事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static CONFIG_LOAD_ERROR: string;\n        /**\n         * Delay load group resource loading progress event.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 延迟加载组资源加载进度事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static GROUP_PROGRESS: string;\n        /**\n         * Delay load group resource to complete event. Note: if you have a resource item loading failure, the event will not be thrown, if you want to handle the group load failure, please listen to the GROUP_LOAD_ERROR event.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 延迟加载组资源加载完成事件。注意：若组内有资源项加载失败，将不会抛出此事件，若要处理组加载失败，请同时监听 GROUP_LOAD_ERROR 事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static GROUP_COMPLETE: string;\n        /**\n         * Delayed load group resource failed event.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 延迟加载组资源加载失败事件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static GROUP_LOAD_ERROR: string;\n        /**\n         * Creates an Event object to pass as a parameter to event listeners.\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @private\n         * @language en_US\n         */\n        /**\n         * 创建一个作为参数传递给事件侦听器的 Event 对象。\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @private\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean);\n        /**\n         * File number that has been loaded.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 已经加载的文件数。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        itemsLoaded: number;\n        /**\n         * Total file number to load.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 要加载的总文件数。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        itemsTotal: number;\n        /**\n         * Resource group name.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 资源组名。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        groupName: string;\n        /**\n         * An item of information that is finished by the end of a load.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一次加载项加载结束的项信息对象。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        resItem: ResourceItem;\n    }\n}\ndeclare module RES {\n    /**\n     * Resource term. One of the resources arrays in resource.json.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 资源项。对应 resource.json 中 resources 数组中的一项。\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    namespace ResourceItem {\n        /**\n         * XML file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * XML 文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const TYPE_XML: string;\n        /**\n         * Picture file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 图片文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const TYPE_IMAGE: string;\n        /**\n         * Binary file.\n         * @version Egret 5.2\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 二进制文件。\n         * @version Egret 5.2\n         * @platform Web\n         * @language zh_CN\n         */\n        const TYPE_BIN: string;\n        /**\n         * Text file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const TYPE_TEXT: string;\n        /**\n         * JSON file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * JSON 文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const TYPE_JSON: string;\n        /**\n         * SpriteSheet file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * SpriteSheet 文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const TYPE_SHEET: string;\n        /**\n         * BitmapTextSpriteSheet file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * BitmapTextSpriteSheet 文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const TYPE_FONT: string;\n        /**\n         * Sound file.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 声音文件。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const TYPE_SOUND: string;\n        function convertToResItem(r: ResourceInfo): ResourceItem;\n    }\n    interface ResourceItem extends ResourceInfo {\n        /**\n         * Name of resource term.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 加载项名称。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * URL of resource term.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 要加载的文件地址。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        url: string;\n        /**\n         * Type of resource term.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 加载项文件类型。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        type: string;\n        /**\n         * The raw data object to be referenced.\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 被引用的原始数据对象。\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        data: ResourceInfo;\n        crc32?: string;\n        size?: number;\n        soundType?: string;\n    }\n}\ndeclare module RES {\n    /**\n     * assetsManager underlying storage resource information\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * assetsManager底层存储资源信息\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface File {\n        url: string;\n        type: string;\n        name: string;\n        root: string;\n    }\n    /**\n    * @private\n    */\n    interface FileSystem {\n        addFile(data: {\n            name: string;\n            type: string;\n            url: string;\n            root?: string;\n            extra?: 1 | undefined;\n        }): any;\n        getFile(filename: string): File | null;\n        profile(): void;\n        removeFile(filename: string): any;\n    }\n}\ndeclare module RES {\n    /**\n     * Print the memory occupied by the picture.\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 打印图片所占内存\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function profile(): void;\n    /**\n    * @private\n    */\n    interface ProcessHost {\n        state: {\n            [index: string]: number;\n        };\n        resourceConfig: ResourceConfig;\n        load: (resource: ResourceInfo, processor?: string | processor.Processor) => Promise<any>;\n        unload: (resource: ResourceInfo) => void;\n        save: (rexource: ResourceInfo, data: any) => void;\n        get: (resource: ResourceInfo) => any;\n        remove: (resource: ResourceInfo) => void;\n    }\n    /**\n    * @private\n    */\n    class ResourceManagerError extends Error {\n        static errorMessage: {\n            1001: string;\n            1002: string;\n            2001: string;\n            2002: string;\n            2003: string;\n            2004: string;\n            2005: string;\n            2006: string;\n        };\n        /**\n         * why instanceof e  != ResourceManagerError ???\n         * see link : https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work\n         */\n        private __resource_manager_error__;\n        constructor(code: number, replacer?: Object, replacer2?: Object);\n    }\n}\ndeclare namespace RES {\n    /**\n     * Resource group loading progress prompt\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 资源组的加载进度提示\n     * @version Egret 5.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface PromiseTaskReporter {\n        /**\n         * Progress callback, asynchronous execution, load number and order have nothing to do\n         * @param current The number of currently loaded\n         * @param total Total resources required in the current resource bundle\n         * @param resItem currently loading resource information\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 进度回调，异步执行，加载数目和顺序无关\n         * @param current 当前已经加载数目\n         * @param total 当前资源包内需要资源总数\n         * @param resItem 当前加载资源信息\n         * @version Egret 5.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        onProgress?(current: number, total: number, resItem: ResourceInfo | undefined): void;\n    }\n}\n"
  },
  {
    "path": "source/lib/dragonBones.d.ts",
    "content": "declare namespace dragonBones {\n    /**\n     * @internal\n     * @private\n     */\n    const webAssemblyModule: {\n        HEAP16: Int16Array;\n        _malloc(byteSize: number): number;\n        _free(pointer: number): void;\n        setDataBinary(data: DragonBonesData, binaryPointer: number, intBytesLength: number, floatBytesLength: number, frameIntBytesLength: number, frameFloatBytesLength: number, frameBytesLength: number, timelineBytesLength: number): void;\n    };\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @internal\n     */\n    const enum BinaryOffset {\n        WeigthBoneCount = 0,\n        WeigthFloatOffset = 1,\n        WeigthBoneIndices = 2,\n        MeshVertexCount = 0,\n        MeshTriangleCount = 1,\n        MeshFloatOffset = 2,\n        MeshWeightOffset = 3,\n        MeshVertexIndices = 4,\n        TimelineScale = 0,\n        TimelineOffset = 1,\n        TimelineKeyFrameCount = 2,\n        TimelineFrameValueCount = 3,\n        TimelineFrameValueOffset = 4,\n        TimelineFrameOffset = 5,\n        FramePosition = 0,\n        FrameTweenType = 1,\n        FrameTweenEasingOrCurveSampleCount = 2,\n        FrameCurveSamples = 3,\n        DeformVertexOffset = 0,\n        DeformCount = 1,\n        DeformValueCount = 2,\n        DeformValueOffset = 3,\n        DeformFloatOffset = 4,\n        PathVertexCount = 0,\n        PathFloatOffset = 2,\n        PathWeightOffset = 3,\n    }\n    /**\n     * @internal\n     */\n    const enum ArmatureType {\n        Armature = 0,\n        MovieClip = 1,\n        Stage = 2,\n    }\n    /**\n     * @internal\n     */\n    const enum BoneType {\n        Bone = 0,\n        Surface = 1,\n    }\n    /**\n     * @private\n     */\n    const enum DisplayType {\n        Image = 0,\n        Armature = 1,\n        Mesh = 2,\n        BoundingBox = 3,\n        Path = 4,\n    }\n    /**\n     * - Bounding box type.\n     * @version DragonBones 5.0\n     * @language en_US\n     */\n    /**\n     * - 边界框类型。\n     * @version DragonBones 5.0\n     * @language zh_CN\n     */\n    const enum BoundingBoxType {\n        Rectangle = 0,\n        Ellipse = 1,\n        Polygon = 2,\n    }\n    /**\n     * @internal\n     */\n    const enum ActionType {\n        Play = 0,\n        Frame = 10,\n        Sound = 11,\n    }\n    /**\n     * @internal\n     */\n    const enum BlendMode {\n        Normal = 0,\n        Add = 1,\n        Alpha = 2,\n        Darken = 3,\n        Difference = 4,\n        Erase = 5,\n        HardLight = 6,\n        Invert = 7,\n        Layer = 8,\n        Lighten = 9,\n        Multiply = 10,\n        Overlay = 11,\n        Screen = 12,\n        Subtract = 13,\n    }\n    /**\n     * @internal\n     */\n    const enum TweenType {\n        None = 0,\n        Line = 1,\n        Curve = 2,\n        QuadIn = 3,\n        QuadOut = 4,\n        QuadInOut = 5,\n    }\n    /**\n     * @internal\n     */\n    const enum TimelineType {\n        Action = 0,\n        ZOrder = 1,\n        BoneAll = 10,\n        BoneTranslate = 11,\n        BoneRotate = 12,\n        BoneScale = 13,\n        Surface = 50,\n        SlotDisplay = 20,\n        SlotColor = 21,\n        SlotDeform = 22,\n        IKConstraint = 30,\n        AnimationTime = 40,\n        AnimationWeight = 41,\n    }\n    /**\n     * - Offset mode.\n     * @version DragonBones 5.5\n     * @language en_US\n     */\n    /**\n     * - 偏移模式。\n     * @version DragonBones 5.5\n     * @language zh_CN\n     */\n    const enum OffsetMode {\n        None = 0,\n        Additive = 1,\n        Override = 2,\n    }\n    /**\n     * - Animation fade out mode.\n     * @version DragonBones 4.5\n     * @language en_US\n     */\n    /**\n     * - 动画淡出模式。\n     * @version DragonBones 4.5\n     * @language zh_CN\n     */\n    const enum AnimationFadeOutMode {\n        /**\n         * - Do not fade out of any animation states.\n         * @language en_US\n         */\n        /**\n         * - 不淡出任何的动画状态。\n         * @language zh_CN\n         */\n        None = 0,\n        /**\n         * - Fade out the animation states of the same layer.\n         * @language en_US\n         */\n        /**\n         * - 淡出同层的动画状态。\n         * @language zh_CN\n         */\n        SameLayer = 1,\n        /**\n         * - Fade out the animation states of the same group.\n         * @language en_US\n         */\n        /**\n         * - 淡出同组的动画状态。\n         * @language zh_CN\n         */\n        SameGroup = 2,\n        /**\n         * - Fade out the animation states of the same layer and group.\n         * @language en_US\n         */\n        /**\n         * - 淡出同层并且同组的动画状态。\n         * @language zh_CN\n         */\n        SameLayerAndGroup = 3,\n        /**\n         * - Fade out of all animation states.\n         * @language en_US\n         */\n        /**\n         * - 淡出所有的动画状态。\n         * @language zh_CN\n         */\n        All = 4,\n        /**\n         * - Does not replace the animation state with the same name.\n         * @language en_US\n         */\n        /**\n         * - 不替换同名的动画状态。\n         * @language zh_CN\n         */\n        Single = 5,\n    }\n    const enum ConstraintType {\n        IK = 0,\n        Path = 1,\n    }\n    const enum PositionMode {\n        Fixed = 0,\n        Percent = 1,\n    }\n    const enum SpacingMode {\n        Length = 0,\n        Fixed = 1,\n        Percent = 2,\n    }\n    const enum RotateMode {\n        Tangent = 0,\n        Chain = 1,\n        ChainScale = 2,\n    }\n    /**\n     * @private\n     */\n    interface Map<T> {\n        [key: string]: T;\n    }\n    /**\n     * @private\n     */\n    class DragonBones {\n        static readonly VERSION: string;\n        static yDown: boolean;\n        static debug: boolean;\n        static debugDraw: boolean;\n        static webAssembly: boolean;\n        private readonly _clock;\n        private readonly _events;\n        private readonly _objects;\n        private _eventManager;\n        constructor(eventManager: IEventDispatcher);\n        advanceTime(passedTime: number): void;\n        bufferEvent(value: EventObject): void;\n        bufferObject(object: BaseObject): void;\n        readonly clock: WorldClock;\n        readonly eventManager: IEventDispatcher;\n    }\n}\n\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The BaseObject is the base class for all objects in the DragonBones framework.\n     * All BaseObject instances are cached to the object pool to reduce the performance consumption of frequent requests for memory or memory recovery.\n     * @version DragonBones 4.5\n     * @language en_US\n     */\n    /**\n     * - 基础对象，通常 DragonBones 的对象都继承自该类。\n     * 所有基础对象的实例都会缓存到对象池，以减少频繁申请内存或内存回收的性能消耗。\n     * @version DragonBones 4.5\n     * @language zh_CN\n     */\n    abstract class BaseObject {\n        private static _hashCode;\n        private static _defaultMaxCount;\n        private static readonly _maxCountMap;\n        private static readonly _poolsMap;\n        private static _returnObject(object);\n        static toString(): string;\n        /**\n         * - Set the maximum cache count of the specify object pool.\n         * @param objectConstructor - The specify class. (Set all object pools max cache count if not set)\n         * @param maxCount - Max count.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 设置特定对象池的最大缓存数量。\n         * @param objectConstructor - 特定的类。 (不设置则设置所有对象池的最大缓存数量)\n         * @param maxCount - 最大缓存数量。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        static setMaxCount(objectConstructor: (typeof BaseObject) | null, maxCount: number): void;\n        /**\n         * - Clear the cached instances of a specify object pool.\n         * @param objectConstructor - Specify class. (Clear all cached instances if not set)\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 清除特定对象池的缓存实例。\n         * @param objectConstructor - 特定的类。 (不设置则清除所有缓存的实例)\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        static clearPool(objectConstructor?: (typeof BaseObject) | null): void;\n        /**\n         * - Get an instance of the specify class from object pool.\n         * @param objectConstructor - The specify class.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 从对象池中获取特定类的实例。\n         * @param objectConstructor - 特定的类。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        static borrowObject<T extends BaseObject>(objectConstructor: {\n            new (): T;\n        }): T;\n        /**\n         * - A unique identification number assigned to the object.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 分配给此实例的唯一标识号。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        readonly hashCode: number;\n        private _isInPool;\n        protected abstract _onClear(): void;\n        /**\n         * - Clear the object and return it back to object pool。\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 清除该实例的所有数据并将其返还对象池。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        returnToPool(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - 2D Transform matrix.\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 2D 转换矩阵。\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class Matrix {\n        /**\n         * - The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @default 1.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 缩放或旋转图像时影响像素沿 x 轴定位的值。\n         * @default 1.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        a: number;\n        /**\n         * - The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 旋转或倾斜图像时影响像素沿 y 轴定位的值。\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        b: number;\n        /**\n         * - The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 旋转或倾斜图像时影响像素沿 x 轴定位的值。\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        c: number;\n        /**\n         * - The value that affects the positioning of pixels along the y axis when scaling or rotating an image.\n         * @default 1.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 缩放或旋转图像时影响像素沿 y 轴定位的值。\n         * @default 1.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        d: number;\n        /**\n         * - The distance by which to translate each point along the x axis.\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 沿 x 轴平移每个点的距离。\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        tx: number;\n        /**\n         * - The distance by which to translate each point along the y axis.\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 沿 y 轴平移每个点的距离。\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        ty: number;\n        /**\n         * @private\n         */\n        constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);\n        toString(): string;\n        /**\n         * @private\n         */\n        copyFrom(value: Matrix): Matrix;\n        /**\n         * @private\n         */\n        copyFromArray(value: Array<number>, offset?: number): Matrix;\n        /**\n         * - Convert to unit matrix.\n         * The resulting matrix has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 转换为单位矩阵。\n         * 该矩阵具有以下属性：a=1、b=0、c=0、d=1、tx=0、ty=0。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        identity(): Matrix;\n        /**\n         * - Multiplies the current matrix with another matrix.\n         * @param value - The matrix that needs to be multiplied.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 将当前矩阵与另一个矩阵相乘。\n         * @param value - 需要相乘的矩阵。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        concat(value: Matrix): Matrix;\n        /**\n         * - Convert to inverse matrix.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 转换为逆矩阵。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        invert(): Matrix;\n        /**\n         * - Apply a matrix transformation to a specific point.\n         * @param x - X coordinate.\n         * @param y - Y coordinate.\n         * @param result - The point after the transformation is applied.\n         * @param delta - Whether to ignore tx, ty's conversion to point.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 将矩阵转换应用于特定点。\n         * @param x - 横坐标。\n         * @param y - 纵坐标。\n         * @param result - 应用转换之后的点。\n         * @param delta - 是否忽略 tx，ty 对点的转换。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        transformPoint(x: number, y: number, result: {\n            x: number;\n            y: number;\n        }, delta?: boolean): void;\n        /**\n         * @private\n         */\n        transformRectangle(rectangle: {\n            x: number;\n            y: number;\n            width: number;\n            height: number;\n        }, delta?: boolean): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - 2D Transform.\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 2D 变换。\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class Transform {\n        /**\n         * @private\n         */\n        static readonly PI: number;\n        /**\n         * @private\n         */\n        static readonly PI_D: number;\n        /**\n         * @private\n         */\n        static readonly PI_H: number;\n        /**\n         * @private\n         */\n        static readonly PI_Q: number;\n        /**\n         * @private\n         */\n        static readonly RAD_DEG: number;\n        /**\n         * @private\n         */\n        static readonly DEG_RAD: number;\n        /**\n         * @private\n         */\n        static normalizeRadian(value: number): number;\n        /**\n         * - Horizontal translate.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 水平位移。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        x: number;\n        /**\n         * - Vertical translate.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 垂直位移。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        y: number;\n        /**\n         * - Skew. (In radians)\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 倾斜。 （以弧度为单位）\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        skew: number;\n        /**\n         * - rotation. (In radians)\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 旋转。 （以弧度为单位）\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        rotation: number;\n        /**\n         * - Horizontal Scaling.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 水平缩放。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        scaleX: number;\n        /**\n         * - Vertical scaling.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 垂直缩放。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        scaleY: number;\n        /**\n         * @private\n         */\n        constructor(x?: number, y?: number, skew?: number, rotation?: number, scaleX?: number, scaleY?: number);\n        toString(): string;\n        /**\n         * @private\n         */\n        copyFrom(value: Transform): Transform;\n        /**\n         * @private\n         */\n        identity(): Transform;\n        /**\n         * @private\n         */\n        add(value: Transform): Transform;\n        /**\n         * @private\n         */\n        minus(value: Transform): Transform;\n        /**\n         * @private\n         */\n        fromMatrix(matrix: Matrix): Transform;\n        /**\n         * @private\n         */\n        toMatrix(matrix: Matrix): Transform;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @internal\n     */\n    class ColorTransform {\n        alphaMultiplier: number;\n        redMultiplier: number;\n        greenMultiplier: number;\n        blueMultiplier: number;\n        alphaOffset: number;\n        redOffset: number;\n        greenOffset: number;\n        blueOffset: number;\n        constructor(alphaMultiplier?: number, redMultiplier?: number, greenMultiplier?: number, blueMultiplier?: number, alphaOffset?: number, redOffset?: number, greenOffset?: number, blueOffset?: number);\n        copyFrom(value: ColorTransform): void;\n        identity(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The Point object represents a location in a two-dimensional coordinate system.\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - Point 对象表示二维坐标系统中的某个位置。\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class Point {\n        /**\n         * - The horizontal coordinate.\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 该点的水平坐标。\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        x: number;\n        /**\n         * - The vertical coordinate.\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 该点的垂直坐标。\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        y: number;\n        /**\n         * - Creates a new point. If you pass no parameters to this method, a point is created at (0,0).\n         * @param x - The horizontal coordinate.\n         * @param y - The vertical coordinate.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 创建一个 egret.Point 对象.若不传入任何参数，将会创建一个位于（0，0）位置的点。\n         * @param x - 该对象的x属性值，默认为 0.0。\n         * @param y - 该对象的y属性值，默认为 0.0。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        constructor(x?: number, y?: number);\n        /**\n         * @private\n         */\n        copyFrom(value: Point): void;\n        /**\n         * @private\n         */\n        clear(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its\n     * width and its height.<br/>\n     * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of\n     * one property has no effect on the others. However, the right and bottom properties are integrally related to those\n     * four properties. For example, if you change the value of the right property, the value of the width property changes;\n     * if you change the bottom property, the value of the height property changes.\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - Rectangle 对象是按其位置（由它左上角的点 (x, y) 确定）以及宽度和高度定义的区域。<br/>\n     * Rectangle 类的 x、y、width 和 height 属性相互独立；更改一个属性的值不会影响其他属性。\n     * 但是，right 和 bottom 属性与这四个属性是整体相关的。例如，如果更改 right 属性的值，则 width\n     * 属性的值将发生变化；如果更改 bottom 属性，则 height 属性的值将发生变化。\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class Rectangle {\n        /**\n         * - The x coordinate of the top-left corner of the rectangle.\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 矩形左上角的 x 坐标。\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        x: number;\n        /**\n         * - The y coordinate of the top-left corner of the rectangle.\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 矩形左上角的 y 坐标。\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        y: number;\n        /**\n         * - The width of the rectangle, in pixels.\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 矩形的宽度（以像素为单位）。\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        width: number;\n        /**\n         * - 矩形的高度（以像素为单位）。\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - The height of the rectangle, in pixels.\n         * @default 0.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        height: number;\n        /**\n         * @private\n         */\n        constructor(x?: number, y?: number, width?: number, height?: number);\n        /**\n         * @private\n         */\n        copyFrom(value: Rectangle): void;\n        /**\n         * @private\n         */\n        clear(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The user custom data.\n     * @version DragonBones 5.0\n     * @language en_US\n     */\n    /**\n     * - 用户自定义数据。\n     * @version DragonBones 5.0\n     * @language zh_CN\n     */\n    class UserData extends BaseObject {\n        static toString(): string;\n        /**\n         * - The custom int numbers.\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 自定义整数。\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        readonly ints: Array<number>;\n        /**\n         * - The custom float numbers.\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 自定义浮点数。\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        readonly floats: Array<number>;\n        /**\n         * - The custom strings.\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 自定义字符串。\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        readonly strings: Array<string>;\n        protected _onClear(): void;\n        /**\n         * @internal\n         */\n        addInt(value: number): void;\n        /**\n         * @internal\n         */\n        addFloat(value: number): void;\n        /**\n         * @internal\n         */\n        addString(value: string): void;\n        /**\n         * - Get the custom int number.\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 获取自定义整数。\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        getInt(index?: number): number;\n        /**\n         * - Get the custom float number.\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 获取自定义浮点数。\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        getFloat(index?: number): number;\n        /**\n         * - Get the custom string.\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 获取自定义字符串。\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        getString(index?: number): string;\n    }\n    /**\n     * @internal\n     */\n    class ActionData extends BaseObject {\n        static toString(): string;\n        type: ActionType;\n        name: string;\n        bone: BoneData | null;\n        slot: SlotData | null;\n        data: UserData | null;\n        protected _onClear(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The DragonBones data.\n     * A DragonBones data contains multiple armature data.\n     * @see dragonBones.ArmatureData\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 龙骨数据。\n     * 一个龙骨数据包含多个骨架数据。\n     * @see dragonBones.ArmatureData\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class DragonBonesData extends BaseObject {\n        static toString(): string;\n        /**\n         * @private\n         */\n        autoSearch: boolean;\n        /**\n         * - The animation frame rate.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 动画帧频。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        frameRate: number;\n        /**\n         * - The data version.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 数据版本。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        version: string;\n        /**\n         * - The DragonBones data name.\n         * The name is consistent with the DragonBones project name.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 龙骨数据名称。\n         * 该名称与龙骨项目名保持一致。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * @private\n         */\n        stage: ArmatureData | null;\n        /**\n         * @internal\n         */\n        readonly frameIndices: Array<number>;\n        /**\n         * @internal\n         */\n        readonly cachedFrames: Array<number>;\n        /**\n         * - All armature data names.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 所有的骨架数据名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly armatureNames: Array<string>;\n        /**\n         * @private\n         */\n        readonly armatures: Map<ArmatureData>;\n        /**\n         * @internal\n         */\n        binary: ArrayBuffer;\n        /**\n         * @internal\n         */\n        intArray: Int16Array;\n        /**\n         * @internal\n         */\n        floatArray: Float32Array;\n        /**\n         * @internal\n         */\n        frameIntArray: Int16Array;\n        /**\n         * @internal\n         */\n        frameFloatArray: Float32Array;\n        /**\n         * @internal\n         */\n        frameArray: Int16Array;\n        /**\n         * @internal\n         */\n        timelineArray: Uint16Array;\n        /**\n         * @private\n         */\n        userData: UserData | null;\n        protected _onClear(): void;\n        /**\n         * @internal\n         */\n        addArmature(value: ArmatureData): void;\n        /**\n         * - Get a specific armature data.\n         * @param armatureName - The armature data name.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 获取特定的骨架数据。\n         * @param armatureName - 骨架数据名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getArmature(armatureName: string): ArmatureData | null;\n        /**\n         * - Deprecated, please refer to {@link #dragonBones.BaseFactory#removeDragonBonesData()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #dragonBones.BaseFactory#removeDragonBonesData()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        dispose(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The armature data.\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 骨架数据。\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class ArmatureData extends BaseObject {\n        static toString(): string;\n        /**\n         * @private\n         */\n        type: ArmatureType;\n        /**\n         * - The animation frame rate.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 动画帧率。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        frameRate: number;\n        /**\n         * @private\n         */\n        cacheFrameRate: number;\n        /**\n         * @private\n         */\n        scale: number;\n        /**\n         * - The armature name.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 骨架名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * @private\n         */\n        readonly aabb: Rectangle;\n        /**\n         * - The names of all the animation data.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 所有的动画数据名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly animationNames: Array<string>;\n        /**\n         * @private\n         */\n        readonly sortedBones: Array<BoneData>;\n        /**\n         * @private\n         */\n        readonly sortedSlots: Array<SlotData>;\n        /**\n         * @private\n         */\n        readonly defaultActions: Array<ActionData>;\n        /**\n         * @private\n         */\n        readonly actions: Array<ActionData>;\n        /**\n         * @private\n         */\n        readonly bones: Map<BoneData>;\n        /**\n         * @private\n         */\n        readonly slots: Map<SlotData>;\n        /**\n         * @private\n         */\n        readonly constraints: Map<ConstraintData>;\n        /**\n         * @private\n         */\n        readonly skins: Map<SkinData>;\n        /**\n         * @private\n         */\n        readonly animations: Map<AnimationData>;\n        /**\n         * - The default skin data.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 默认插槽数据。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        defaultSkin: SkinData | null;\n        /**\n         * - The default animation data.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 默认动画数据。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        defaultAnimation: AnimationData | null;\n        /**\n         * @private\n         */\n        canvas: CanvasData | null;\n        /**\n         * @private\n         */\n        userData: UserData | null;\n        /**\n         * @private\n         */\n        parent: DragonBonesData;\n        protected _onClear(): void;\n        /**\n         * @internal\n         */\n        sortBones(): void;\n        /**\n         * @internal\n         */\n        cacheFrames(frameRate: number): void;\n        /**\n         * @internal\n         */\n        setCacheFrame(globalTransformMatrix: Matrix, transform: Transform): number;\n        /**\n         * @internal\n         */\n        getCacheFrame(globalTransformMatrix: Matrix, transform: Transform, arrayOffset: number): void;\n        /**\n         * @internal\n         */\n        addBone(value: BoneData): void;\n        /**\n         * @internal\n         */\n        addSlot(value: SlotData): void;\n        /**\n         * @internal\n         */\n        addConstraint(value: ConstraintData): void;\n        /**\n         * @internal\n         */\n        addSkin(value: SkinData): void;\n        /**\n         * @internal\n         */\n        addAnimation(value: AnimationData): void;\n        /**\n         * @internal\n         */\n        addAction(value: ActionData, isDefault: boolean): void;\n        /**\n         * - Get a specific done data.\n         * @param boneName - The bone name.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 获取特定的骨骼数据。\n         * @param boneName - 骨骼名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getBone(boneName: string): BoneData | null;\n        /**\n         * - Get a specific slot data.\n         * @param slotName - The slot name.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 获取特定的插槽数据。\n         * @param slotName - 插槽名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getSlot(slotName: string): SlotData | null;\n        /**\n         * @private\n         */\n        getConstraint(constraintName: string): ConstraintData | null;\n        /**\n         * - Get a specific skin data.\n         * @param skinName - The skin name.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 获取特定皮肤数据。\n         * @param skinName - 皮肤名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getSkin(skinName: string): SkinData | null;\n        /**\n         * @private\n         */\n        getMesh(skinName: string, slotName: string, meshName: string): MeshDisplayData | null;\n        /**\n         * - Get a specific animation data.\n         * @param animationName - The animation animationName.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 获取特定的动画数据。\n         * @param animationName - 动画名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getAnimation(animationName: string): AnimationData | null;\n    }\n    /**\n     * - The bone data.\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 骨骼数据。\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class BoneData extends BaseObject {\n        static toString(): string;\n        /**\n         * @private\n         */\n        inheritTranslation: boolean;\n        /**\n         * @private\n         */\n        inheritRotation: boolean;\n        /**\n         * @private\n         */\n        inheritScale: boolean;\n        /**\n         * @private\n         */\n        inheritReflection: boolean;\n        /**\n         * @private\n         */\n        type: BoneType;\n        /**\n         * - The bone length.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 骨骼长度。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        length: number;\n        /**\n         * - The bone name.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 骨骼名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * @private\n         */\n        readonly transform: Transform;\n        /**\n         * @private\n         */\n        userData: UserData | null;\n        /**\n         * - The parent bone data.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 父骨骼数据。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        parent: BoneData | null;\n        protected _onClear(): void;\n    }\n    /**\n     * @internal\n     */\n    class SurfaceData extends BoneData {\n        static toString(): string;\n        segmentX: number;\n        segmentY: number;\n        readonly vertices: Array<number>;\n        protected _onClear(): void;\n    }\n    /**\n     * - The slot data.\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 插槽数据。\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class SlotData extends BaseObject {\n        /**\n         * @internal\n         */\n        static readonly DEFAULT_COLOR: ColorTransform;\n        /**\n         * @internal\n         */\n        static createColor(): ColorTransform;\n        static toString(): string;\n        /**\n         * @private\n         */\n        blendMode: BlendMode;\n        /**\n         * @private\n         */\n        displayIndex: number;\n        /**\n         * @private\n         */\n        zOrder: number;\n        /**\n         * - The slot name.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 插槽名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * @private\n         */\n        color: ColorTransform;\n        /**\n         * @private\n         */\n        userData: UserData | null;\n        /**\n         * - The parent bone data.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 父骨骼数据。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        parent: BoneData;\n        protected _onClear(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @internal\n     */\n    class CanvasData extends BaseObject {\n        static toString(): string;\n        hasBackground: boolean;\n        color: number;\n        x: number;\n        y: number;\n        width: number;\n        height: number;\n        protected _onClear(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The skin data, typically a armature data instance contains at least one skinData.\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 皮肤数据，通常一个骨架数据至少包含一个皮肤数据。\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class SkinData extends BaseObject {\n        static toString(): string;\n        /**\n         * - The skin name.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 皮肤名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * @private\n         */\n        readonly displays: Map<Array<DisplayData | null>>;\n        /**\n         * @private\n         */\n        parent: ArmatureData;\n        protected _onClear(): void;\n        /**\n         * @internal\n         */\n        addDisplay(slotName: string, value: DisplayData | null): void;\n        /**\n         * @private\n         */\n        getDisplay(slotName: string, displayName: string): DisplayData | null;\n        /**\n         * @private\n         */\n        getDisplays(slotName: string): Array<DisplayData | null> | null;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @internal\n     */\n    abstract class ConstraintData extends BaseObject {\n        order: number;\n        name: string;\n        type: ConstraintType;\n        target: BoneData;\n        root: BoneData;\n        bone: BoneData | null;\n        protected _onClear(): void;\n    }\n    /**\n     * @internal\n     */\n    class IKConstraintData extends ConstraintData {\n        static toString(): string;\n        scaleEnabled: boolean;\n        bendPositive: boolean;\n        weight: number;\n        protected _onClear(): void;\n    }\n    /**\n     * @internal\n     */\n    class PathConstraintData extends ConstraintData {\n        static toString(): string;\n        pathSlot: SlotData;\n        pathDisplayData: PathDisplayData;\n        bones: Array<BoneData>;\n        positionMode: PositionMode;\n        spacingMode: SpacingMode;\n        rotateMode: RotateMode;\n        position: number;\n        spacing: number;\n        rotateOffset: number;\n        rotateMix: number;\n        translateMix: number;\n        protected _onClear(): void;\n        AddBone(value: BoneData): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @internal\n     */\n    class VerticesData {\n        isShared: boolean;\n        inheritDeform: boolean;\n        offset: number;\n        data: DragonBonesData;\n        weight: WeightData | null;\n        clear(): void;\n        shareFrom(value: VerticesData): void;\n    }\n    /**\n     * @internal\n     */\n    abstract class DisplayData extends BaseObject {\n        type: DisplayType;\n        name: string;\n        path: string;\n        readonly transform: Transform;\n        parent: SkinData;\n        protected _onClear(): void;\n    }\n    /**\n     * @internal\n     */\n    class ImageDisplayData extends DisplayData {\n        static toString(): string;\n        readonly pivot: Point;\n        texture: TextureData | null;\n        protected _onClear(): void;\n    }\n    /**\n     * @internal\n     */\n    class ArmatureDisplayData extends DisplayData {\n        static toString(): string;\n        inheritAnimation: boolean;\n        readonly actions: Array<ActionData>;\n        armature: ArmatureData | null;\n        protected _onClear(): void;\n        /**\n         * @private\n         */\n        addAction(value: ActionData): void;\n    }\n    /**\n     * @internal\n     */\n    class MeshDisplayData extends DisplayData {\n        static toString(): string;\n        readonly vertices: VerticesData;\n        texture: TextureData | null;\n        protected _onClear(): void;\n    }\n    /**\n     * @internal\n     */\n    class BoundingBoxDisplayData extends DisplayData {\n        static toString(): string;\n        boundingBox: BoundingBoxData | null;\n        protected _onClear(): void;\n    }\n    /**\n     * @internal\n     */\n    class PathDisplayData extends DisplayData {\n        static toString(): string;\n        closed: boolean;\n        constantSpeed: boolean;\n        readonly vertices: VerticesData;\n        readonly curveLengths: Array<number>;\n        protected _onClear(): void;\n    }\n    /**\n     * @internal\n     */\n    class WeightData extends BaseObject {\n        static toString(): string;\n        count: number;\n        offset: number;\n        readonly bones: Array<BoneData>;\n        protected _onClear(): void;\n        addBone(value: BoneData): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The base class of bounding box data.\n     * @see dragonBones.RectangleData\n     * @see dragonBones.EllipseData\n     * @see dragonBones.PolygonData\n     * @version DragonBones 5.0\n     * @language en_US\n     */\n    /**\n     * - 边界框数据基类。\n     * @see dragonBones.RectangleData\n     * @see dragonBones.EllipseData\n     * @see dragonBones.PolygonData\n     * @version DragonBones 5.0\n     * @language zh_CN\n     */\n    abstract class BoundingBoxData extends BaseObject {\n        /**\n         * - The bounding box type.\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 边界框类型。\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        type: BoundingBoxType;\n        /**\n         * @private\n         */\n        color: number;\n        /**\n         * @private\n         */\n        width: number;\n        /**\n         * @private\n         */\n        height: number;\n        protected _onClear(): void;\n        /**\n         * - Check whether the bounding box contains a specific point. (Local coordinate system)\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 检查边界框是否包含特定点。（本地坐标系）\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        abstract containsPoint(pX: number, pY: number): boolean;\n        /**\n         * - Check whether the bounding box intersects a specific segment. (Local coordinate system)\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 检查边界框是否与特定线段相交。（本地坐标系）\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        abstract intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA: {\n            x: number;\n            y: number;\n        } | null, intersectionPointB: {\n            x: number;\n            y: number;\n        } | null, normalRadians: {\n            x: number;\n            y: number;\n        } | null): number;\n    }\n    /**\n     * - The rectangle bounding box data.\n     * @version DragonBones 5.1\n     * @language en_US\n     */\n    /**\n     * - 矩形边界框数据。\n     * @version DragonBones 5.1\n     * @language zh_CN\n     */\n    class RectangleBoundingBoxData extends BoundingBoxData {\n        static toString(): string;\n        /**\n         * - Compute the bit code for a point (x, y) using the clip rectangle\n         */\n        private static _computeOutCode(x, y, xMin, yMin, xMax, yMax);\n        /**\n         * @private\n         */\n        static rectangleIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xMin: number, yMin: number, xMax: number, yMax: number, intersectionPointA?: {\n            x: number;\n            y: number;\n        } | null, intersectionPointB?: {\n            x: number;\n            y: number;\n        } | null, normalRadians?: {\n            x: number;\n            y: number;\n        } | null): number;\n        protected _onClear(): void;\n        /**\n         * @inheritDoc\n         */\n        containsPoint(pX: number, pY: number): boolean;\n        /**\n         * @inheritDoc\n         */\n        intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: {\n            x: number;\n            y: number;\n        } | null, intersectionPointB?: {\n            x: number;\n            y: number;\n        } | null, normalRadians?: {\n            x: number;\n            y: number;\n        } | null): number;\n    }\n    /**\n     * - The ellipse bounding box data.\n     * @version DragonBones 5.1\n     * @language en_US\n     */\n    /**\n     * - 椭圆边界框数据。\n     * @version DragonBones 5.1\n     * @language zh_CN\n     */\n    class EllipseBoundingBoxData extends BoundingBoxData {\n        static toString(): string;\n        /**\n         * @private\n         */\n        static ellipseIntersectsSegment(xA: number, yA: number, xB: number, yB: number, xC: number, yC: number, widthH: number, heightH: number, intersectionPointA?: {\n            x: number;\n            y: number;\n        } | null, intersectionPointB?: {\n            x: number;\n            y: number;\n        } | null, normalRadians?: {\n            x: number;\n            y: number;\n        } | null): number;\n        protected _onClear(): void;\n        /**\n         * @inheritDoc\n         */\n        containsPoint(pX: number, pY: number): boolean;\n        /**\n         * @inheritDoc\n         */\n        intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: {\n            x: number;\n            y: number;\n        } | null, intersectionPointB?: {\n            x: number;\n            y: number;\n        } | null, normalRadians?: {\n            x: number;\n            y: number;\n        } | null): number;\n    }\n    /**\n     * - The polygon bounding box data.\n     * @version DragonBones 5.1\n     * @language en_US\n     */\n    /**\n     * - 多边形边界框数据。\n     * @version DragonBones 5.1\n     * @language zh_CN\n     */\n    class PolygonBoundingBoxData extends BoundingBoxData {\n        static toString(): string;\n        /**\n         * @private\n         */\n        static polygonIntersectsSegment(xA: number, yA: number, xB: number, yB: number, vertices: Array<number>, intersectionPointA?: {\n            x: number;\n            y: number;\n        } | null, intersectionPointB?: {\n            x: number;\n            y: number;\n        } | null, normalRadians?: {\n            x: number;\n            y: number;\n        } | null): number;\n        /**\n         * @private\n         */\n        x: number;\n        /**\n         * @private\n         */\n        y: number;\n        /**\n         * - The polygon vertices.\n         * @version DragonBones 5.1\n         * @language en_US\n         */\n        /**\n         * - 多边形顶点。\n         * @version DragonBones 5.1\n         * @language zh_CN\n         */\n        readonly vertices: Array<number>;\n        protected _onClear(): void;\n        /**\n         * @inheritDoc\n         */\n        containsPoint(pX: number, pY: number): boolean;\n        /**\n         * @inheritDoc\n         */\n        intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: {\n            x: number;\n            y: number;\n        } | null, intersectionPointB?: {\n            x: number;\n            y: number;\n        } | null, normalRadians?: {\n            x: number;\n            y: number;\n        } | null): number;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The animation data.\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 动画数据。\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class AnimationData extends BaseObject {\n        static toString(): string;\n        /**\n         * - FrameIntArray.\n         * @internal\n         */\n        frameIntOffset: number;\n        /**\n         * - FrameFloatArray.\n         * @internal\n         */\n        frameFloatOffset: number;\n        /**\n         * - FrameArray.\n         * @internal\n         */\n        frameOffset: number;\n        /**\n         * - The frame count of the animation.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 动画的帧数。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        frameCount: number;\n        /**\n         * - The play times of the animation. [0: Loop play, [1~N]: Play N times]\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 动画的播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次]\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        playTimes: number;\n        /**\n         * - The duration of the animation. (In seconds)\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 动画的持续时间。 （以秒为单位）\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        duration: number;\n        /**\n         * @private\n         */\n        scale: number;\n        /**\n         * - The fade in time of the animation. (In seconds)\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 动画的淡入时间。 （以秒为单位）\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        fadeInTime: number;\n        /**\n         * @private\n         */\n        cacheFrameRate: number;\n        /**\n         * - The animation name.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 动画名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * @private\n         */\n        readonly cachedFrames: Array<boolean>;\n        /**\n         * @private\n         */\n        readonly boneTimelines: Map<Array<TimelineData>>;\n        /**\n         * @private\n         */\n        readonly surfaceTimelines: Map<Array<TimelineData>>;\n        /**\n         * @private\n         */\n        readonly slotTimelines: Map<Array<TimelineData>>;\n        /**\n         * @private\n         */\n        readonly constraintTimelines: Map<Array<TimelineData>>;\n        /**\n         * @private\n         */\n        readonly animationTimelines: Map<Array<TimelineData>>;\n        /**\n         * @private\n         */\n        readonly boneCachedFrameIndices: Map<Array<number>>;\n        /**\n         * @private\n         */\n        readonly slotCachedFrameIndices: Map<Array<number>>;\n        /**\n         * @private\n         */\n        actionTimeline: TimelineData | null;\n        /**\n         * @private\n         */\n        zOrderTimeline: TimelineData | null;\n        /**\n         * @private\n         */\n        parent: ArmatureData;\n        protected _onClear(): void;\n        /**\n         * @internal\n         */\n        cacheFrames(frameRate: number): void;\n        /**\n         * @private\n         */\n        addBoneTimeline(bone: BoneData, timeline: TimelineData): void;\n        /**\n         * @private\n         */\n        addSurfaceTimeline(surface: SurfaceData, timeline: TimelineData): void;\n        /**\n         * @private\n         */\n        addSlotTimeline(slot: SlotData, timeline: TimelineData): void;\n        /**\n         * @private\n         */\n        addConstraintTimeline(constraint: ConstraintData, timeline: TimelineData): void;\n        /**\n         * @private\n         */\n        addAnimationTimeline(timelineName: string, timeline: TimelineData): void;\n        /**\n         * @private\n         */\n        getBoneTimelines(timelineName: string): Array<TimelineData> | null;\n        /**\n         * @private\n         */\n        getSurfaceTimelines(timelineName: string): Array<TimelineData> | null;\n        /**\n         * @private\n         */\n        getSlotTimelines(timelineName: string): Array<TimelineData> | null;\n        /**\n         * @private\n         */\n        getConstraintTimelines(timelineName: string): Array<TimelineData> | null;\n        /**\n         * @private\n         */\n        getAnimationTimelines(timelineName: string): Array<TimelineData> | null;\n        /**\n         * @private\n         */\n        getBoneCachedFrameIndices(boneName: string): Array<number> | null;\n        /**\n         * @private\n         */\n        getSlotCachedFrameIndices(slotName: string): Array<number> | null;\n    }\n    /**\n     * @internal\n     */\n    class TimelineData extends BaseObject {\n        static toString(): string;\n        type: TimelineType;\n        offset: number;\n        frameIndicesOffset: number;\n        protected _onClear(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The animation config is used to describe all the information needed to play an animation state.\n     * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used.\n     * @see dragonBones.AnimationState\n     * @beta\n     * @version DragonBones 5.0\n     * @language en_US\n     */\n    /**\n     * - 动画配置用来描述播放一个动画状态所需要的全部信息。\n     * 该 API 仍在实验阶段，使用时可能遭遇 bug 或稳定性或兼容性问题。\n     * @see dragonBones.AnimationState\n     * @beta\n     * @version DragonBones 5.0\n     * @language zh_CN\n     */\n    class AnimationConfig extends BaseObject {\n        static toString(): string;\n        /**\n         * @private\n         */\n        pauseFadeOut: boolean;\n        /**\n         * - Fade out the pattern of other animation states when the animation state is fade in.\n         * This property is typically used to specify the substitution of multiple animation states blend.\n         * @default dragonBones.AnimationFadeOutMode.All\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 淡入动画状态时淡出其他动画状态的模式。\n         * 该属性通常用来指定多个动画状态混合时的相互替换关系。\n         * @default dragonBones.AnimationFadeOutMode.All\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        fadeOutMode: AnimationFadeOutMode;\n        /**\n         * @private\n         */\n        fadeOutTweenType: TweenType;\n        /**\n         * @private\n         */\n        fadeOutTime: number;\n        /**\n         * @private\n         */\n        pauseFadeIn: boolean;\n        /**\n         * @private\n         */\n        actionEnabled: boolean;\n        /**\n         * @private\n         */\n        additiveBlending: boolean;\n        /**\n         * - Whether the animation state has control over the display property of the slots.\n         * Sometimes blend a animation state does not want it to control the display properties of the slots,\n         * especially if other animation state are controlling the display properties of the slots.\n         * @default true\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 动画状态是否对插槽的显示对象属性有控制权。\n         * 有时混合一个动画状态并不希望其控制插槽的显示对象属性，\n         * 尤其是其他动画状态正在控制这些插槽的显示对象属性时。\n         * @default true\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        displayControl: boolean;\n        /**\n         * - Whether to reset the objects without animation to the armature pose when the animation state is start to play.\n         * This property should usually be set to false when blend multiple animation states.\n         * @default true\n         * @version DragonBones 5.1\n         * @language en_US\n         */\n        /**\n         * - 开始播放动画状态时是否将没有动画的对象重置为骨架初始值。\n         * 通常在混合多个动画状态时应该将该属性设置为 false。\n         * @default true\n         * @version DragonBones 5.1\n         * @language zh_CN\n         */\n        resetToPose: boolean;\n        /**\n         * @private\n         */\n        fadeInTweenType: TweenType;\n        /**\n         * - The play times. [0: Loop play, [1~N]: Play N times]\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次]\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        playTimes: number;\n        /**\n         * - The blend layer.\n         * High layer animation state will get the blend weight first.\n         * When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned.\n         * @readonly\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 混合图层。\n         * 图层高的动画状态会优先获取混合权重。\n         * 当混合权重分配超过 1 时，剩余的动画状态将不再获得权重分配。\n         * @readonly\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        layer: number;\n        /**\n         * - The start time of play. (In seconds)\n         * @default 0.0\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 播放的开始时间。 （以秒为单位）\n         * @default 0.0\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        position: number;\n        /**\n         * - The duration of play.\n         * [-1: Use the default value of the animation data, 0: Stop play, (0~N]: The duration] (In seconds)\n         * @default -1.0\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 播放的持续时间。\n         * [-1: 使用动画数据默认值, 0: 动画停止, (0~N]: 持续时间] （以秒为单位）\n         * @default -1.0\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        duration: number;\n        /**\n         * - The play speed.\n         * The value is an overlay relationship with {@link dragonBones.Animation#timeScale}.\n         * [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play]\n         * @default 1.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 播放速度。\n         * 该值与 {@link dragonBones.Animation#timeScale} 是叠加关系。\n         * [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放]\n         * @default 1.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        timeScale: number;\n        /**\n         * - The blend weight.\n         * @default 1.0\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 混合权重。\n         * @default 1.0\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        weight: number;\n        /**\n         * - The fade in time.\n         * [-1: Use the default value of the animation data, [0~N]: The fade in time] (In seconds)\n         * @default -1.0\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 淡入时间。\n         * [-1: 使用动画数据默认值, [0~N]: 淡入时间] （以秒为单位）\n         * @default -1.0\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        fadeInTime: number;\n        /**\n         * - The auto fade out time when the animation state play completed.\n         * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds)\n         * @default -1.0\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 动画状态播放完成后的自动淡出时间。\n         * [-1: 不自动淡出, [0~N]: 淡出时间] （以秒为单位）\n         * @default -1.0\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        autoFadeOutTime: number;\n        /**\n         * - The name of the animation state. (Can be different from the name of the animation data)\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 动画状态名称。 （可以不同于动画数据）\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * - The animation data name.\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 动画数据名称。\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        animation: string;\n        /**\n         * - The blend group name of the animation state.\n         * This property is typically used to specify the substitution of multiple animation states blend.\n         * @readonly\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 混合组名称。\n         * 该属性通常用来指定多个动画状态混合时的相互替换关系。\n         * @readonly\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        group: string;\n        /**\n         * @private\n         */\n        readonly boneMask: Array<string>;\n        protected _onClear(): void;\n        /**\n         * @private\n         */\n        clear(): void;\n        /**\n         * @private\n         */\n        copyFrom(value: AnimationConfig): void;\n        /**\n         * @private\n         */\n        containsBoneMask(boneName: string): boolean;\n        /**\n         * @private\n         */\n        addBoneMask(armature: Armature, boneName: string, recursive?: boolean): void;\n        /**\n         * @private\n         */\n        removeBoneMask(armature: Armature, boneName: string, recursive?: boolean): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The texture atlas data.\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 贴图集数据。\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    abstract class TextureAtlasData extends BaseObject {\n        /**\n         * @private\n         */\n        autoSearch: boolean;\n        /**\n         * @private\n         */\n        width: number;\n        /**\n         * @private\n         */\n        height: number;\n        /**\n         * @private\n         */\n        scale: number;\n        /**\n         * - The texture atlas name.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 贴图集名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * - The image path of the texture atlas.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 贴图集图片路径。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        imagePath: string;\n        /**\n         * @private\n         */\n        readonly textures: Map<TextureData>;\n        protected _onClear(): void;\n        /**\n         * @private\n         */\n        copyFrom(value: TextureAtlasData): void;\n        /**\n         * @internal\n         */\n        abstract createTexture(): TextureData;\n        /**\n         * @internal\n         */\n        addTexture(value: TextureData): void;\n        /**\n         * @private\n         */\n        getTexture(textureName: string): TextureData | null;\n    }\n    /**\n     * @internal\n     */\n    abstract class TextureData extends BaseObject {\n        static createRectangle(): Rectangle;\n        rotated: boolean;\n        name: string;\n        readonly region: Rectangle;\n        parent: TextureAtlasData;\n        frame: Rectangle | null;\n        protected _onClear(): void;\n        copyFrom(value: TextureData): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @internal\n     */\n    class DeformVertices extends BaseObject {\n        static toString(): string;\n        verticesDirty: boolean;\n        readonly vertices: Array<number>;\n        readonly bones: Array<Bone | null>;\n        verticesData: VerticesData | null;\n        protected _onClear(): void;\n        init(verticesDataValue: VerticesData | null, armature: Armature): void;\n        isBonesUpdate(): boolean;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The armature proxy interface, the docking engine needs to implement it concretely.\n     * @see dragonBones.Armature\n     * @version DragonBones 5.0\n     * @language en_US\n     */\n    /**\n     * - 骨架代理接口，对接的引擎需要对其进行具体实现。\n     * @see dragonBones.Armature\n     * @version DragonBones 5.0\n     * @language zh_CN\n     */\n    interface IArmatureProxy extends IEventDispatcher {\n        /**\n         * @internal\n         */\n        dbInit(armature: Armature): void;\n        /**\n         * @internal\n         */\n        dbClear(): void;\n        /**\n         * @internal\n         */\n        dbUpdate(): void;\n        /**\n         * - Dispose the instance and the Armature instance. (The Armature instance will return to the object pool)\n         * @example\n         * <pre>\n         *     removeChild(armatureDisplay);\n         *     armatureDisplay.dispose();\n         * </pre>\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 释放该实例和骨架。 （骨架会回收到对象池）\n         * @example\n         * <pre>\n         *     removeChild(armatureDisplay);\n         *     armatureDisplay.dispose();\n         * </pre>\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        dispose(disposeProxy: boolean): void;\n        /**\n         * - The armature.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 骨架。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        readonly armature: Armature;\n        /**\n         * - The animation player.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 动画播放器。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly animation: Animation;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - Armature is the core of the skeleton animation system.\n     * @see dragonBones.ArmatureData\n     * @see dragonBones.Bone\n     * @see dragonBones.Slot\n     * @see dragonBones.Animation\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 骨架是骨骼动画系统的核心。\n     * @see dragonBones.ArmatureData\n     * @see dragonBones.Bone\n     * @see dragonBones.Slot\n     * @see dragonBones.Animation\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class Armature extends BaseObject implements IAnimatable {\n        static toString(): string;\n        private static _onSortSlots(a, b);\n        /**\n         * - Whether to inherit the animation control of the parent armature.\n         * True to try to have the child armature play an animation with the same name when the parent armature play the animation.\n         * @default true\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 是否继承父骨架的动画控制。\n         * 如果该值为 true，当父骨架播放动画时，会尝试让子骨架播放同名动画。\n         * @default true\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        inheritAnimation: boolean;\n        /**\n         * @private\n         */\n        userData: any;\n        private _lockUpdate;\n        private _slotsDirty;\n        private _zOrderDirty;\n        private _flipX;\n        private _flipY;\n        /**\n         * @internal\n         */\n        _cacheFrameIndex: number;\n        private readonly _bones;\n        private readonly _slots;\n        /**\n         * @internal\n         */\n        readonly _constraints: Array<Constraint>;\n        private readonly _actions;\n        /**\n         * @internal\n         */\n        _armatureData: ArmatureData;\n        private _animation;\n        private _proxy;\n        private _display;\n        /**\n         * @internal\n         */\n        _replaceTextureAtlasData: TextureAtlasData | null;\n        private _replacedTexture;\n        /**\n         * @internal\n         */\n        _dragonBones: DragonBones;\n        private _clock;\n        /**\n         * @internal\n         */\n        _parent: Slot | null;\n        protected _onClear(): void;\n        /**\n         * @internal\n         */\n        _sortZOrder(slotIndices: Array<number> | Int16Array | null, offset: number): void;\n        /**\n         * @internal\n         */\n        _addBone(value: Bone): void;\n        /**\n         * @internal\n         */\n        _addSlot(value: Slot): void;\n        /**\n         * @internal\n         */\n        _addConstraint(value: Constraint): void;\n        /**\n         * @internal\n         */\n        _bufferAction(action: EventObject, append: boolean): void;\n        /**\n         * - Dispose the armature. (Return to the object pool)\n         * @example\n         * <pre>\n         *     removeChild(armature.display);\n         *     armature.dispose();\n         * </pre>\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 释放骨架。 （回收到对象池）\n         * @example\n         * <pre>\n         *     removeChild(armature.display);\n         *     armature.dispose();\n         * </pre>\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        dispose(): void;\n        /**\n         * @internal\n         */\n        init(armatureData: ArmatureData, proxy: IArmatureProxy, display: any, dragonBones: DragonBones): void;\n        /**\n         * @inheritDoc\n         */\n        advanceTime(passedTime: number): void;\n        /**\n         * - Forces a specific bone or its owning slot to update the transform or display property in the next frame.\n         * @param boneName - The bone name. (If not set, all bones will be update)\n         * @param updateSlot - Whether to update the bone's slots. (Default: false)\n         * @see dragonBones.Bone#invalidUpdate()\n         * @see dragonBones.Slot#invalidUpdate()\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 强制特定骨骼或其拥有的插槽在下一帧更新变换或显示属性。\n         * @param boneName - 骨骼名称。 （如果未设置，将更新所有骨骼）\n         * @param updateSlot - 是否更新骨骼的插槽。 （默认: false）\n         * @see dragonBones.Bone#invalidUpdate()\n         * @see dragonBones.Slot#invalidUpdate()\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        invalidUpdate(boneName?: string | null, updateSlot?: boolean): void;\n        /**\n         * - Check whether a specific point is inside a custom bounding box in a slot.\n         * The coordinate system of the point is the inner coordinate system of the armature.\n         * Custom bounding boxes need to be customized in Dragonbones Pro.\n         * @param x - The horizontal coordinate of the point.\n         * @param y - The vertical coordinate of the point.\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 检查特定点是否在某个插槽的自定义边界框内。\n         * 点的坐标系为骨架内坐标系。\n         * 自定义边界框需要在 DragonBones Pro 中自定义。\n         * @param x - 点的水平坐标。\n         * @param y - 点的垂直坐标。\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        containsPoint(x: number, y: number): Slot | null;\n        /**\n         * - Check whether a specific segment intersects a custom bounding box for a slot in the armature.\n         * The coordinate system of the segment and intersection is the inner coordinate system of the armature.\n         * Custom bounding boxes need to be customized in Dragonbones Pro.\n         * @param xA - The horizontal coordinate of the beginning of the segment.\n         * @param yA - The vertical coordinate of the beginning of the segment.\n         * @param xB - The horizontal coordinate of the end point of the segment.\n         * @param yB - The vertical coordinate of the end point of the segment.\n         * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated)\n         * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated)\n         * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated)\n         * @returns The slot of the first custom bounding box where the segment intersects from the start point to the end point.\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 检查特定线段是否与骨架的某个插槽的自定义边界框相交。\n         * 线段和交点的坐标系均为骨架内坐标系。\n         * 自定义边界框需要在 DragonBones Pro 中自定义。\n         * @param xA - 线段起点的水平坐标。\n         * @param yA - 线段起点的垂直坐标。\n         * @param xB - 线段终点的水平坐标。\n         * @param yB - 线段终点的垂直坐标。\n         * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 （如果未设置，则不计算交点）\n         * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 （如果未设置，则不计算交点）\n         * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] （如果未设置，则不计算法线）\n         * @returns 线段从起点到终点相交的第一个自定义边界框的插槽。\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: {\n            x: number;\n            y: number;\n        } | null, intersectionPointB?: {\n            x: number;\n            y: number;\n        } | null, normalRadians?: {\n            x: number;\n            y: number;\n        } | null): Slot | null;\n        /**\n         * - Get a specific bone.\n         * @param name - The bone name.\n         * @see dragonBones.Bone\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 获取特定的骨骼。\n         * @param name - 骨骼名称。\n         * @see dragonBones.Bone\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getBone(name: string): Bone | null;\n        /**\n         * - Get a specific bone by the display.\n         * @param display - The display object.\n         * @see dragonBones.Bone\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 通过显示对象获取特定的骨骼。\n         * @param display - 显示对象。\n         * @see dragonBones.Bone\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getBoneByDisplay(display: any): Bone | null;\n        /**\n         * - Get a specific slot.\n         * @param name - The slot name.\n         * @see dragonBones.Slot\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 获取特定的插槽。\n         * @param name - 插槽名称。\n         * @see dragonBones.Slot\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getSlot(name: string): Slot | null;\n        /**\n         * - Get a specific slot by the display.\n         * @param display - The display object.\n         * @see dragonBones.Slot\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 通过显示对象获取特定的插槽。\n         * @param display - 显示对象。\n         * @see dragonBones.Slot\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getSlotByDisplay(display: any): Slot | null;\n        /**\n         * - Get all bones.\n         * @see dragonBones.Bone\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 获取所有的骨骼。\n         * @see dragonBones.Bone\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getBones(): Array<Bone>;\n        /**\n         * - Get all slots.\n         * @see dragonBones.Slot\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 获取所有的插槽。\n         * @see dragonBones.Slot\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getSlots(): Array<Slot>;\n        /**\n         * - Whether to flip the armature horizontally.\n         * @version DragonBones 5.5\n         * @language en_US\n         */\n        /**\n         * - 是否将骨架水平翻转。\n         * @version DragonBones 5.5\n         * @language zh_CN\n         */\n        flipX: boolean;\n        /**\n         * - Whether to flip the armature vertically.\n         * @version DragonBones 5.5\n         * @language en_US\n         */\n        /**\n         * - 是否将骨架垂直翻转。\n         * @version DragonBones 5.5\n         * @language zh_CN\n         */\n        flipY: boolean;\n        /**\n         * - The animation cache frame rate, which turns on the animation cache when the set value is greater than 0.\n         * There is a certain amount of memory overhead to improve performance by caching animation data in memory.\n         * The frame rate should not be set too high, usually with the frame rate of the animation is similar and lower than the program running frame rate.\n         * When the animation cache is turned on, some features will fail, such as the offset property of bone.\n         * @example\n         * <pre>\n         *     armature.cacheFrameRate = 24;\n         * </pre>\n         * @see dragonBones.DragonBonesData#frameRate\n         * @see dragonBones.ArmatureData#frameRate\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 动画缓存帧率，当设置的值大于 0 的时，将会开启动画缓存。\n         * 通过将动画数据缓存在内存中来提高运行性能，会有一定的内存开销。\n         * 帧率不宜设置的过高，通常跟动画的帧率相当且低于程序运行的帧率。\n         * 开启动画缓存后，某些功能将会失效，比如骨骼的 offset 属性等。\n         * @example\n         * <pre>\n         *     armature.cacheFrameRate = 24;\n         * </pre>\n         * @see dragonBones.DragonBonesData#frameRate\n         * @see dragonBones.ArmatureData#frameRate\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        cacheFrameRate: number;\n        /**\n         * - The armature name.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 骨架名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly name: string;\n        /**\n         * - The armature data.\n         * @see dragonBones.ArmatureData\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 骨架数据。\n         * @see dragonBones.ArmatureData\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        readonly armatureData: ArmatureData;\n        /**\n         * - The animation player.\n         * @see dragonBones.Animation\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 动画播放器。\n         * @see dragonBones.Animation\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly animation: Animation;\n        /**\n         * @pivate\n         */\n        readonly proxy: IArmatureProxy;\n        /**\n         * - The EventDispatcher instance of the armature.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 该骨架的 EventDispatcher 实例。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        readonly eventDispatcher: IEventDispatcher;\n        /**\n         * - The display container.\n         * The display of the slot is displayed as the parent.\n         * Depending on the rendering engine, the type will be different, usually the DisplayObjectContainer type.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 显示容器实例。\n         * 插槽的显示对象都会以此显示容器为父级。\n         * 根据渲染引擎的不同，类型会不同，通常是 DisplayObjectContainer 类型。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly display: any;\n        /**\n         * @private\n         */\n        replacedTexture: any;\n        /**\n         * @inheritDoc\n         */\n        clock: WorldClock | null;\n        /**\n         * - Get the parent slot which the armature belongs to.\n         * @see dragonBones.Slot\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 该骨架所属的父插槽。\n         * @see dragonBones.Slot\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        readonly parent: Slot | null;\n        /**\n         * @deprecated\n         * @private\n         */\n        replaceTexture(texture: any): void;\n        /**\n         * - Deprecated, please refer to {@link #eventDispatcher}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #eventDispatcher}。\n         * @deprecated\n         * @language zh_CN\n         */\n        hasEventListener(type: EventStringType): boolean;\n        /**\n         * - Deprecated, please refer to {@link #eventDispatcher}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #eventDispatcher}。\n         * @deprecated\n         * @language zh_CN\n         */\n        addEventListener(type: EventStringType, listener: Function, target: any): void;\n        /**\n         * - Deprecated, please refer to {@link #eventDispatcher}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #eventDispatcher}。\n         * @deprecated\n         * @language zh_CN\n         */\n        removeEventListener(type: EventStringType, listener: Function, target: any): void;\n        /**\n         * - Deprecated, please refer to {@link #cacheFrameRate}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #cacheFrameRate}。\n         * @deprecated\n         * @language zh_CN\n         */\n        enableAnimationCache(frameRate: number): void;\n        /**\n         * - Deprecated, please refer to {@link #display}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #display}。\n         * @deprecated\n         * @language zh_CN\n         */\n        getDisplay(): any;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The base class of the transform object.\n     * @see dragonBones.Transform\n     * @version DragonBones 4.5\n     * @language en_US\n     */\n    /**\n     * - 变换对象的基类。\n     * @see dragonBones.Transform\n     * @version DragonBones 4.5\n     * @language zh_CN\n     */\n    abstract class TransformObject extends BaseObject {\n        protected static readonly _helpMatrix: Matrix;\n        protected static readonly _helpTransform: Transform;\n        protected static readonly _helpPoint: Point;\n        /**\n         * - A matrix relative to the armature coordinate system.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 相对于骨架坐标系的矩阵。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly globalTransformMatrix: Matrix;\n        /**\n         * - A transform relative to the armature coordinate system.\n         * @see #updateGlobalTransform()\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 相对于骨架坐标系的变换。\n         * @see #updateGlobalTransform()\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly global: Transform;\n        /**\n         * - The offset transform relative to the armature or the parent bone coordinate system.\n         * @see #dragonBones.Bone#invalidUpdate()\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 相对于骨架或父骨骼坐标系的偏移变换。\n         * @see #dragonBones.Bone#invalidUpdate()\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly offset: Transform;\n        /**\n         * @private\n         */\n        origin: Transform | null;\n        /**\n         * @private\n         */\n        userData: any;\n        protected _globalDirty: boolean;\n        /**\n         * @internal\n         */\n        _armature: Armature;\n        /**\n         */\n        protected _onClear(): void;\n        /**\n         * - For performance considerations, rotation or scale in the {@link #global} attribute of the bone or slot is not always properly accessible,\n         * some engines do not rely on these attributes to update rendering, such as Egret.\n         * The use of this method ensures that the access to the {@link #global} property is correctly rotation or scale.\n         * @example\n         * <pre>\n         *     bone.updateGlobalTransform();\n         *     let rotation = bone.global.rotation;\n         * </pre>\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 出于性能的考虑，骨骼或插槽的 {@link #global} 属性中的旋转或缩放并不总是正确可访问的，有些引擎并不依赖这些属性更新渲染，比如 Egret。\n         * 使用此方法可以保证访问到 {@link #global} 属性中正确的旋转或缩放。\n         * @example\n         * <pre>\n         *     bone.updateGlobalTransform();\n         *     let rotation = bone.global.rotation;\n         * </pre>\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        updateGlobalTransform(): void;\n        /**\n         * - The armature to which it belongs.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 所属的骨架。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly armature: Armature;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - Bone is one of the most important logical units in the armature animation system,\n     * and is responsible for the realization of translate, rotation, scaling in the animations.\n     * A armature can contain multiple bones.\n     * @see dragonBones.BoneData\n     * @see dragonBones.Armature\n     * @see dragonBones.Slot\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 骨骼在骨骼动画体系中是最重要的逻辑单元之一，负责动画中的平移、旋转、缩放的实现。\n     * 一个骨架中可以包含多个骨骼。\n     * @see dragonBones.BoneData\n     * @see dragonBones.Armature\n     * @see dragonBones.Slot\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class Bone extends TransformObject {\n        static toString(): string;\n        /**\n         * - The offset mode.\n         * @see #offset\n         * @version DragonBones 5.5\n         * @language en_US\n         */\n        /**\n         * - 偏移模式。\n         * @see #offset\n         * @version DragonBones 5.5\n         * @language zh_CN\n         */\n        offsetMode: OffsetMode;\n        /**\n         * @internal\n         */\n        readonly animationPose: Transform;\n        /**\n         * @internal\n         */\n        _transformDirty: boolean;\n        /**\n         * @internal\n         */\n        _childrenTransformDirty: boolean;\n        protected _localDirty: boolean;\n        /**\n         * @internal\n         */\n        _hasConstraint: boolean;\n        protected _visible: boolean;\n        protected _cachedFrameIndex: number;\n        /**\n         * @internal\n         */\n        readonly _blendState: BlendState;\n        /**\n         * @internal\n         */\n        _boneData: BoneData;\n        /**\n         * @private\n         */\n        protected _parent: Bone | null;\n        /**\n         * @internal\n         */\n        _cachedFrameIndices: Array<number> | null;\n        protected _onClear(): void;\n        protected _updateGlobalTransformMatrix(isCache: boolean): void;\n        /**\n         * @internal\n         */\n        init(boneData: BoneData, armatureValue: Armature): void;\n        /**\n         * @internal\n         */\n        update(cacheFrameIndex: number): void;\n        /**\n         * @internal\n         */\n        updateByConstraint(): void;\n        /**\n         * - Forces the bone to update the transform in the next frame.\n         * When the bone is not animated or its animation state is finished, the bone will not continue to update,\n         * and when the skeleton must be updated for some reason, the method needs to be called explicitly.\n         * @example\n         * <pre>\n         *     let bone = armature.getBone(\"arm\");\n         *     bone.offset.scaleX = 2.0;\n         *     bone.invalidUpdate();\n         * </pre>\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 强制骨骼在下一帧更新变换。\n         * 当该骨骼没有动画状态或其动画状态播放完成时，骨骼将不在继续更新，而此时由于某些原因必须更新骨骼时，则需要显式调用该方法。\n         * @example\n         * <pre>\n         *     let bone = armature.getBone(\"arm\");\n         *     bone.offset.scaleX = 2.0;\n         *     bone.invalidUpdate();\n         * </pre>\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        invalidUpdate(): void;\n        /**\n         * - Check whether the bone contains a specific bone.\n         * @see dragonBones.Bone\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 检查该骨骼是否包含特定的骨骼。\n         * @see dragonBones.Bone\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        contains(value: Bone): boolean;\n        /**\n         * - The bone data.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 骨骼数据。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        readonly boneData: BoneData;\n        /**\n         * - The visible of all slots in the bone.\n         * @default true\n         * @see dragonBones.Slot#visible\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 此骨骼所有插槽的可见。\n         * @default true\n         * @see dragonBones.Slot#visible\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        visible: boolean;\n        /**\n         * - The bone name.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 骨骼名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly name: string;\n        /**\n         * - The parent bone to which it belongs.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 所属的父骨骼。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly parent: Bone | null;\n        /**\n         * - Deprecated, please refer to {@link dragonBones.Armature#getBones()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link dragonBones.Armature#getBones()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        getBones(): Array<Bone>;\n        /**\n         * - Deprecated, please refer to {@link dragonBones.Armature#getSlots()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link dragonBones.Armature#getSlots()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        getSlots(): Array<Slot>;\n        /**\n         * - Deprecated, please refer to {@link dragonBones.Armature#getSlot()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link dragonBones.Armature#getSlot()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        readonly slot: Slot | null;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @internal\n     */\n    class Surface extends Bone {\n        static toString(): string;\n        private _dX;\n        private _dY;\n        private _k;\n        private _kX;\n        private _kY;\n        readonly _vertices: Array<number>;\n        readonly _deformVertices: Array<number>;\n        /**\n         * - x1, y1, x2, y2, x3, y3, x4, y4, d1X, d1Y, d2X, d2Y\n         */\n        private readonly _hullCache;\n        /**\n         * - Inside [flag, a, b, c, d, tx, ty], Outside [flag, a, b, c, d, tx, ty]\n         */\n        private readonly _matrixCahce;\n        protected _onClear(): void;\n        private _getAffineTransform(x, y, lX, lY, aX, aY, bX, bY, cX, cY, transform, matrix, isDown);\n        private _updateVertices();\n        protected _updateGlobalTransformMatrix(isCache: boolean): void;\n        _getGlobalTransformMatrix(x: number, y: number): Matrix;\n        /**\n         * @internal\n         * @private\n         */\n        init(surfaceData: SurfaceData, armatureValue: Armature): void;\n        /**\n         * @internal\n         */\n        update(cacheFrameIndex: number): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The slot attached to the armature, controls the display status and properties of the display object.\n     * A bone can contain multiple slots.\n     * A slot can contain multiple display objects, displaying only one of the display objects at a time,\n     * but you can toggle the display object into frame animation while the animation is playing.\n     * The display object can be a normal texture, or it can be a display of a child armature, a grid display object,\n     * and a custom other display object.\n     * @see dragonBones.Armature\n     * @see dragonBones.Bone\n     * @see dragonBones.SlotData\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 插槽附着在骨骼上，控制显示对象的显示状态和属性。\n     * 一个骨骼上可以包含多个插槽。\n     * 一个插槽中可以包含多个显示对象，同一时间只能显示其中的一个显示对象，但可以在动画播放的过程中切换显示对象实现帧动画。\n     * 显示对象可以是普通的图片纹理，也可以是子骨架的显示容器，网格显示对象，还可以是自定义的其他显示对象。\n     * @see dragonBones.Armature\n     * @see dragonBones.Bone\n     * @see dragonBones.SlotData\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    abstract class Slot extends TransformObject {\n        /**\n         * - Displays the animated state or mixed group name controlled by the object, set to null to be controlled by all animation states.\n         * @default null\n         * @see dragonBones.AnimationState#displayControl\n         * @see dragonBones.AnimationState#name\n         * @see dragonBones.AnimationState#group\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 显示对象受到控制的动画状态或混合组名称，设置为 null 则表示受所有的动画状态控制。\n         * @default null\n         * @see dragonBones.AnimationState#displayControl\n         * @see dragonBones.AnimationState#name\n         * @see dragonBones.AnimationState#group\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        displayController: string | null;\n        protected _displayDirty: boolean;\n        protected _zOrderDirty: boolean;\n        protected _visibleDirty: boolean;\n        protected _blendModeDirty: boolean;\n        /**\n         * @internal\n         */\n        _colorDirty: boolean;\n        protected _transformDirty: boolean;\n        protected _visible: boolean;\n        protected _blendMode: BlendMode;\n        protected _displayIndex: number;\n        protected _animationDisplayIndex: number;\n        /**\n         * @internal\n         */\n        _zOrder: number;\n        protected _cachedFrameIndex: number;\n        /**\n         * @internal\n         */\n        _pivotX: number;\n        /**\n         * @internal\n         */\n        _pivotY: number;\n        protected readonly _localMatrix: Matrix;\n        /**\n         * @internal\n         */\n        readonly _colorTransform: ColorTransform;\n        protected readonly _displayDatas: Array<DisplayData | null>;\n        protected readonly _displayList: Array<any | Armature>;\n        /**\n         * @internal\n         */\n        _slotData: SlotData;\n        protected _rawDisplayDatas: Array<DisplayData | null> | null;\n        /**\n         * @internal\n         */\n        _displayData: DisplayData | null;\n        protected _boundingBoxData: BoundingBoxData | null;\n        protected _textureData: TextureData | null;\n        /**\n         * @internal\n         */\n        _deformVertices: DeformVertices | null;\n        protected _rawDisplay: any;\n        protected _meshDisplay: any;\n        protected _display: any;\n        protected _childArmature: Armature | null;\n        /**\n         * @private\n         */\n        protected _parent: Bone;\n        /**\n         * @internal\n         */\n        _cachedFrameIndices: Array<number> | null;\n        protected _onClear(): void;\n        protected abstract _initDisplay(value: any, isRetain: boolean): void;\n        protected abstract _disposeDisplay(value: any, isRelease: boolean): void;\n        protected abstract _onUpdateDisplay(): void;\n        protected abstract _addDisplay(): void;\n        protected abstract _replaceDisplay(value: any): void;\n        protected abstract _removeDisplay(): void;\n        protected abstract _updateZOrder(): void;\n        /**\n         * @internal\n         */\n        abstract _updateVisible(): void;\n        protected abstract _updateBlendMode(): void;\n        protected abstract _updateColor(): void;\n        protected abstract _updateFrame(): void;\n        protected abstract _updateMesh(): void;\n        /**\n         * @internal\n         */\n        abstract _updateGlueMesh(): void;\n        protected abstract _updateTransform(): void;\n        protected abstract _identityTransform(): void;\n        /**\n         * - Support default skin data.\n         */\n        protected _getDefaultRawDisplayData(displayIndex: number): DisplayData | null;\n        protected _updateDisplayData(): void;\n        protected _updateDisplay(): void;\n        protected _updateGlobalTransformMatrix(isCache: boolean): void;\n        /**\n         * @internal\n         */\n        _setDisplayIndex(value: number, isAnimation?: boolean): boolean;\n        /**\n         * @internal\n         */\n        _setZorder(value: number): boolean;\n        /**\n         * @internal\n         */\n        _setColor(value: ColorTransform): boolean;\n        /**\n         * @internal\n         */\n        _setDisplayList(value: Array<any> | null): boolean;\n        /**\n         * @internal\n         */\n        init(slotData: SlotData, armatureValue: Armature, rawDisplay: any, meshDisplay: any): void;\n        /**\n         * @internal\n         */\n        update(cacheFrameIndex: number): void;\n        /**\n         * @private\n         */\n        updateTransformAndMatrix(): void;\n        /**\n         * @private\n         */\n        replaceDisplayData(value: DisplayData | null, displayIndex?: number): void;\n        /**\n         * - Check whether a specific point is inside a custom bounding box in the slot.\n         * The coordinate system of the point is the inner coordinate system of the armature.\n         * Custom bounding boxes need to be customized in Dragonbones Pro.\n         * @param x - The horizontal coordinate of the point.\n         * @param y - The vertical coordinate of the point.\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 检查特定点是否在插槽的自定义边界框内。\n         * 点的坐标系为骨架内坐标系。\n         * 自定义边界框需要在 DragonBones Pro 中自定义。\n         * @param x - 点的水平坐标。\n         * @param y - 点的垂直坐标。\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        containsPoint(x: number, y: number): boolean;\n        /**\n         * - Check whether a specific segment intersects a custom bounding box for the slot.\n         * The coordinate system of the segment and intersection is the inner coordinate system of the armature.\n         * Custom bounding boxes need to be customized in Dragonbones Pro.\n         * @param xA - The horizontal coordinate of the beginning of the segment.\n         * @param yA - The vertical coordinate of the beginning of the segment.\n         * @param xB - The horizontal coordinate of the end point of the segment.\n         * @param yB - The vertical coordinate of the end point of the segment.\n         * @param intersectionPointA - The first intersection at which a line segment intersects the bounding box from the beginning to the end. (If not set, the intersection point will not calculated)\n         * @param intersectionPointB - The first intersection at which a line segment intersects the bounding box from the end to the beginning. (If not set, the intersection point will not calculated)\n         * @param normalRadians - The normal radians of the tangent of the intersection boundary box. [x: Normal radian of the first intersection tangent, y: Normal radian of the second intersection tangent] (If not set, the normal will not calculated)\n         * @returns Intersection situation. [1: Disjoint and segments within the bounding box, 0: Disjoint, 1: Intersecting and having a nodal point and ending in the bounding box, 2: Intersecting and having a nodal point and starting at the bounding box, 3: Intersecting and having two intersections, N: Intersecting and having N intersections]\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 检查特定线段是否与插槽的自定义边界框相交。\n         * 线段和交点的坐标系均为骨架内坐标系。\n         * 自定义边界框需要在 DragonBones Pro 中自定义。\n         * @param xA - 线段起点的水平坐标。\n         * @param yA - 线段起点的垂直坐标。\n         * @param xB - 线段终点的水平坐标。\n         * @param yB - 线段终点的垂直坐标。\n         * @param intersectionPointA - 线段从起点到终点与边界框相交的第一个交点。 （如果未设置，则不计算交点）\n         * @param intersectionPointB - 线段从终点到起点与边界框相交的第一个交点。 （如果未设置，则不计算交点）\n         * @param normalRadians - 交点边界框切线的法线弧度。 [x: 第一个交点切线的法线弧度, y: 第二个交点切线的法线弧度] （如果未设置，则不计算法线）\n         * @returns 相交的情况。 [-1: 不相交且线段在包围盒内, 0: 不相交, 1: 相交且有一个交点且终点在包围盒内, 2: 相交且有一个交点且起点在包围盒内, 3: 相交且有两个交点, N: 相交且有 N 个交点]\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        intersectsSegment(xA: number, yA: number, xB: number, yB: number, intersectionPointA?: {\n            x: number;\n            y: number;\n        } | null, intersectionPointB?: {\n            x: number;\n            y: number;\n        } | null, normalRadians?: {\n            x: number;\n            y: number;\n        } | null): number;\n        /**\n         * - Forces the slot to update the state of the display object in the next frame.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 强制插槽在下一帧更新显示对象的状态。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        invalidUpdate(): void;\n        /**\n         * - The visible of slot's display object.\n         * @default true\n         * @version DragonBones 5.6\n         * @language en_US\n         */\n        /**\n         * - 插槽的显示对象的可见。\n         * @default true\n         * @version DragonBones 5.6\n         * @language zh_CN\n         */\n        visible: boolean;\n        /**\n         * - The index of the display object displayed in the display list.\n         * @example\n         * <pre>\n         *     let slot = armature.getSlot(\"weapon\");\n         *     slot.displayIndex = 3;\n         *     slot.displayController = \"none\";\n         * </pre>\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 此时显示的显示对象在显示列表中的索引。\n         * @example\n         * <pre>\n         *     let slot = armature.getSlot(\"weapon\");\n         *     slot.displayIndex = 3;\n         *     slot.displayController = \"none\";\n         * </pre>\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        displayIndex: number;\n        /**\n         * - The slot name.\n         * @see dragonBones.SlotData#name\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 插槽名称。\n         * @see dragonBones.SlotData#name\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly name: string;\n        /**\n         * - Contains a display list of display objects or child armatures.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 包含显示对象或子骨架的显示列表。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        displayList: Array<any>;\n        /**\n         * - The slot data.\n         * @see dragonBones.SlotData\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 插槽数据。\n         * @see dragonBones.SlotData\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        readonly slotData: SlotData;\n        /**\n         * @private\n         */\n        rawDisplayDatas: Array<DisplayData | null> | null;\n        /**\n         * @private\n         */\n        readonly displayData: DisplayData | null;\n        /**\n         * - The custom bounding box data for the slot at current time.\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 插槽此时的自定义包围盒数据。\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        readonly boundingBoxData: BoundingBoxData | null;\n        /**\n         * @private\n         */\n        readonly rawDisplay: any;\n        /**\n         * @private\n         */\n        readonly meshDisplay: any;\n        /**\n         * - The display object that the slot displays at this time.\n         * @example\n         * <pre>\n         *     let slot = armature.getSlot(\"text\");\n         *     slot.display = new yourEngine.TextField();\n         * </pre>\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 插槽此时显示的显示对象。\n         * @example\n         * <pre>\n         *     let slot = armature.getSlot(\"text\");\n         *     slot.display = new yourEngine.TextField();\n         * </pre>\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        display: any;\n        /**\n         * - The child armature that the slot displayed at current time.\n         * @example\n         * <pre>\n         *     let slot = armature.getSlot(\"weapon\");\n         * let prevChildArmature = slot.childArmature;\n         * if (prevChildArmature) {\n         * prevChildArmature.dispose();\n         *     }\n         *     slot.childArmature = factory.buildArmature(\"weapon_blabla\", \"weapon_blabla_project\");\n         * </pre>\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 插槽此时显示的子骨架。\n         * 注意，被替换的对象或子骨架并不会被回收，根据语言和引擎的不同，需要额外处理。\n         * @example\n         * <pre>\n         *     let slot = armature.getSlot(\"weapon\");\n         * let prevChildArmature = slot.childArmature;\n         * if (prevChildArmature) {\n         * prevChildArmature.dispose();\n         *     }\n         *     slot.childArmature = factory.buildArmature(\"weapon_blabla\", \"weapon_blabla_project\");\n         * </pre>\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        childArmature: Armature | null;\n        /**\n         * - The parent bone to which it belongs.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 所属的父骨骼。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly parent: Bone;\n        /**\n         * - Deprecated, please refer to {@link #display}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #display}。\n         * @deprecated\n         * @language zh_CN\n         */\n        getDisplay(): any;\n        /**\n         * - Deprecated, please refer to {@link #display}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #display}。\n         * @deprecated\n         * @language zh_CN\n         */\n        setDisplay(value: any): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @internal\n     */\n    abstract class Constraint extends BaseObject {\n        protected static readonly _helpMatrix: Matrix;\n        protected static readonly _helpTransform: Transform;\n        protected static readonly _helpPoint: Point;\n        /**\n         * - For timeline state.\n         * @internal\n         */\n        _constraintData: ConstraintData;\n        protected _armature: Armature;\n        /**\n         * - For sort bones.\n         * @internal\n         */\n        _target: Bone;\n        /**\n         * - For sort bones.\n         * @internal\n         */\n        _root: Bone;\n        protected _bone: Bone | null;\n        protected _onClear(): void;\n        abstract init(constraintData: ConstraintData, armature: Armature): void;\n        abstract update(): void;\n        abstract invalidUpdate(): void;\n        readonly name: string;\n    }\n    /**\n     * @internal\n     */\n    class IKConstraint extends Constraint {\n        static toString(): string;\n        private _scaleEnabled;\n        /**\n         * - For timeline state.\n         * @internal\n         */\n        _bendPositive: boolean;\n        /**\n         * - For timeline state.\n         * @internal\n         */\n        _weight: number;\n        protected _onClear(): void;\n        private _computeA();\n        private _computeB();\n        init(constraintData: ConstraintData, armature: Armature): void;\n        update(): void;\n        invalidUpdate(): void;\n    }\n    /**\n     * @internal\n     */\n    class PathConstraint extends Constraint {\n        dirty: boolean;\n        pathOffset: number;\n        position: number;\n        spacing: number;\n        rotateOffset: number;\n        rotateMix: number;\n        translateMix: number;\n        private _pathSlot;\n        private _bones;\n        private _spaces;\n        private _positions;\n        private _curves;\n        private _boneLengths;\n        private _pathGlobalVertices;\n        private _segments;\n        static toString(): string;\n        protected _onClear(): void;\n        protected _updatePathVertices(verticesData: VerticesData): void;\n        protected _computeVertices(start: number, count: number, offset: number, out: Array<number>): void;\n        protected _computeBezierCurve(pathDisplayDta: PathDisplayData, spaceCount: number, tangents: boolean, percentPosition: boolean, percentSpacing: boolean): void;\n        private addCurvePosition(t, x1, y1, cx1, cy1, cx2, cy2, x2, y2, out, offset, tangents);\n        init(constraintData: ConstraintData, armature: Armature): void;\n        update(): void;\n        invalidUpdate(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - Play animation interface. (Both Armature and Wordclock implement the interface)\n     * Any instance that implements the interface can be added to the Worldclock instance and advance time by Worldclock instance uniformly.\n     * @see dragonBones.WorldClock\n     * @see dragonBones.Armature\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 播放动画接口。 (Armature 和 WordClock 都实现了该接口)\n     * 任何实现了此接口的实例都可以添加到 WorldClock 实例中，由 WorldClock 实例统一更新时间。\n     * @see dragonBones.WorldClock\n     * @see dragonBones.Armature\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    interface IAnimatable {\n        /**\n         * - Advance time.\n         * @param passedTime - Passed time. (In seconds)\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 更新时间。\n         * @param passedTime - 前进的时间。 （以秒为单位）\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        advanceTime(passedTime: number): void;\n        /**\n         * - The Wordclock instance to which the current belongs.\n         * @example\n         * <pre>\n         *     armature.clock = factory.clock; // Add armature to clock.\n         *     armature.clock = null; // Remove armature from clock.\n         * </pre>\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 当前所属的 WordClock 实例。\n         * @example\n         * <pre>\n         *     armature.clock = factory.clock; // 将骨架添加到时钟。\n         *     armature.clock = null; // 将骨架从时钟移除。\n         * </pre>\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        clock: WorldClock | null;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - Worldclock provides clock support for animations, advance time for each IAnimatable object added to the instance.\n     * @see dragonBones.IAnimateble\n     * @see dragonBones.Armature\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - WorldClock 对动画提供时钟支持，为每个加入到该实例的 IAnimatable 对象更新时间。\n     * @see dragonBones.IAnimateble\n     * @see dragonBones.Armature\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class WorldClock implements IAnimatable {\n        /**\n         * - Current time. (In seconds)\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 当前的时间。 (以秒为单位)\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        time: number;\n        /**\n         * - The play speed, used to control animation speed-shift play.\n         * [0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play]\n         * @default 1.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 播放速度，用于控制动画变速播放。\n         * [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放]\n         * @default 1.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        timeScale: number;\n        private _systemTime;\n        private readonly _animatebles;\n        private _clock;\n        /**\n         * - Creating a Worldclock instance. Typically, you do not need to create Worldclock instance.\n         * When multiple Worldclock instances are running at different speeds, can achieving some specific animation effects, such as bullet time.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 创建一个 WorldClock 实例。通常并不需要创建 WorldClock 实例。\n         * 当多个 WorldClock 实例使用不同的速度运行时，可以实现一些特殊的动画效果，比如子弹时间等。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        constructor(time?: number);\n        /**\n         * - Advance time for all IAnimatable instances.\n         * @param passedTime - Passed time. [-1: Automatically calculates the time difference between the current frame and the previous frame, [0~N): Passed time] (In seconds)\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 为所有的 IAnimatable 实例更新时间。\n         * @param passedTime - 前进的时间。 [-1: 自动计算当前帧与上一帧的时间差, [0~N): 前进的时间] (以秒为单位)\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        advanceTime(passedTime: number): void;\n        /**\n         * - Check whether contains a specific instance of IAnimatable.\n         * @param value - The IAnimatable instance.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 检查是否包含特定的 IAnimatable 实例。\n         * @param value - IAnimatable 实例。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        contains(value: IAnimatable): boolean;\n        /**\n         * - Add IAnimatable instance.\n         * @param value - The IAnimatable instance.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 添加 IAnimatable 实例。\n         * @param value - IAnimatable 实例。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        add(value: IAnimatable): void;\n        /**\n         * - Removes a specified IAnimatable instance.\n         * @param value - The IAnimatable instance.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 移除特定的 IAnimatable 实例。\n         * @param value - IAnimatable 实例。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        remove(value: IAnimatable): void;\n        /**\n         * - Clear all IAnimatable instances.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 清除所有的 IAnimatable 实例。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        clear(): void;\n        /**\n         * @inheritDoc\n         */\n        clock: WorldClock | null;\n        /**\n         * - Deprecated, please refer to {@link dragonBones.BaseFactory#clock}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link dragonBones.BaseFactory#clock}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static readonly clock: WorldClock;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The animation player is used to play the animation data and manage the animation states.\n     * @see dragonBones.AnimationData\n     * @see dragonBones.AnimationState\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 动画播放器用来播放动画数据和管理动画状态。\n     * @see dragonBones.AnimationData\n     * @see dragonBones.AnimationState\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class Animation extends BaseObject {\n        static toString(): string;\n        /**\n         * - The play speed of all animations. [0: Stop, (0~1): Slow, 1: Normal, (1~N): Fast]\n         * @default 1.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 所有动画的播放速度。 [0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放]\n         * @default 1.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        timeScale: number;\n        private _lockUpdate;\n        private _animationDirty;\n        private _inheritTimeScale;\n        private readonly _animationNames;\n        private readonly _animationStates;\n        private readonly _animations;\n        private _armature;\n        private _animationConfig;\n        private _lastAnimationState;\n        protected _onClear(): void;\n        private _fadeOut(animationConfig);\n        /**\n         * @internal\n         */\n        init(armature: Armature): void;\n        /**\n         * @internal\n         */\n        advanceTime(passedTime: number): void;\n        /**\n         * - Clear all animations states.\n         * @see dragonBones.AnimationState\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 清除所有的动画状态。\n         * @see dragonBones.AnimationState\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        reset(): void;\n        /**\n         * - Pause a specific animation state.\n         * @param animationName - The name of animation state. (If not set, it will pause all animations)\n         * @see dragonBones.AnimationState\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 暂停指定动画状态的播放。\n         * @param animationName - 动画状态名称。 （如果未设置，则暂停所有动画）\n         * @see dragonBones.AnimationState\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        stop(animationName?: string | null): void;\n        /**\n         * - Play animation with a specific animation config.\n         * The API is still in the experimental phase and may encounter bugs or stability or compatibility issues when used.\n         * @param animationConfig - The animation config.\n         * @returns The playing animation state.\n         * @see dragonBones.AnimationConfig\n         * @beta\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 通过指定的动画配置来播放动画。\n         * 该 API 仍在实验阶段，使用时可能遭遇 bug 或稳定性或兼容性问题。\n         * @param animationConfig - 动画配置。\n         * @returns 播放的动画状态。\n         * @see dragonBones.AnimationConfig\n         * @beta\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        playConfig(animationConfig: AnimationConfig): AnimationState | null;\n        /**\n         * - Play a specific animation.\n         * @param animationName - The name of animation data. (If not set, The default animation will be played, or resume the animation playing from pause status, or replay the last playing animation)\n         * @param playTimes - Playing repeat times. [-1: Use default value of the animation data, 0: No end loop playing, [1~N]: Repeat N times] (default: -1)\n         * @returns The playing animation state.\n         * @example\n         * <pre>\n         *     armature.animation.play(\"walk\");\n         * </pre>\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 播放指定动画。\n         * @param animationName - 动画数据名称。 （如果未设置，则播放默认动画，或将暂停状态切换为播放状态，或重新播放之前播放的动画）\n         * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] （默认: -1）\n         * @returns 播放的动画状态。\n         * @example\n         * <pre>\n         *     armature.animation.play(\"walk\");\n         * </pre>\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        play(animationName?: string | null, playTimes?: number): AnimationState | null;\n        /**\n         * - Fade in a specific animation.\n         * @param animationName - The name of animation data.\n         * @param fadeInTime - The fade in time. [-1: Use the default value of animation data, [0~N]: The fade in time (In seconds)] (Default: -1)\n         * @param playTimes - playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1)\n         * @param layer - The blending layer, the animation states in high level layer will get the blending weights with high priority, when the total blending weights are more than 1.0, there will be no more weights can be allocated to the other animation states. (Default: 0)\n         * @param group - The blending group name, it is typically used to specify the substitution of multiple animation states blending. (Default: null)\n         * @param fadeOutMode - The fade out mode, which is typically used to specify alternate mode of multiple animation states blending. (Default: AnimationFadeOutMode.SameLayerAndGroup)\n         * @returns The playing animation state.\n         * @example\n         * <pre>\n         *     armature.animation.fadeIn(\"walk\", 0.3, 0, 0, \"normalGroup\").resetToPose = false;\n         *     armature.animation.fadeIn(\"attack\", 0.3, 1, 0, \"attackGroup\").resetToPose = false;\n         * </pre>\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 淡入播放指定的动画。\n         * @param animationName - 动画数据名称。\n         * @param fadeInTime - 淡入时间。 [-1: 使用动画数据默认值, [0~N]: 淡入时间 (以秒为单位)] （默认: -1）\n         * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] （默认: -1）\n         * @param layer - 混合图层，图层高的动画状态会优先获取混合权重，当混合权重分配总和超过 1.0 时，剩余的动画状态将不能再获得权重分配。 （默认: 0）\n         * @param group - 混合组名称，该属性通常用来指定多个动画状态混合时的相互替换关系。 （默认: null）\n         * @param fadeOutMode - 淡出模式，该属性通常用来指定多个动画状态混合时的相互替换模式。 （默认: AnimationFadeOutMode.SameLayerAndGroup）\n         * @returns 播放的动画状态。\n         * @example\n         * <pre>\n         *     armature.animation.fadeIn(\"walk\", 0.3, 0, 0, \"normalGroup\").resetToPose = false;\n         *     armature.animation.fadeIn(\"attack\", 0.3, 1, 0, \"attackGroup\").resetToPose = false;\n         * </pre>\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        fadeIn(animationName: string, fadeInTime?: number, playTimes?: number, layer?: number, group?: string | null, fadeOutMode?: AnimationFadeOutMode): AnimationState | null;\n        /**\n         * - Play a specific animation from the specific time.\n         * @param animationName - The name of animation data.\n         * @param time - The start time point of playing. (In seconds)\n         * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1)\n         * @returns The played animation state.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 从指定时间开始播放指定的动画。\n         * @param animationName - 动画数据名称。\n         * @param time - 播放开始的时间。 (以秒为单位)\n         * @param playTimes - 循环播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] （默认: -1）\n         * @returns 播放的动画状态。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        gotoAndPlayByTime(animationName: string, time?: number, playTimes?: number): AnimationState | null;\n        /**\n         * - Play a specific animation from the specific frame.\n         * @param animationName - The name of animation data.\n         * @param frame - The start frame of playing.\n         * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1)\n         * @returns The played animation state.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 从指定帧开始播放指定的动画。\n         * @param animationName - 动画数据名称。\n         * @param frame - 播放开始的帧数。\n         * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] （默认: -1）\n         * @returns 播放的动画状态。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        gotoAndPlayByFrame(animationName: string, frame?: number, playTimes?: number): AnimationState | null;\n        /**\n         * - Play a specific animation from the specific progress.\n         * @param animationName - The name of animation data.\n         * @param progress - The start progress value of playing.\n         * @param playTimes - Playing repeat times. [-1: Use the default value of animation data, 0: No end loop playing, [1~N]: Repeat N times] (Default: -1)\n         * @returns The played animation state.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 从指定进度开始播放指定的动画。\n         * @param animationName - 动画数据名称。\n         * @param progress - 开始播放的进度。\n         * @param playTimes - 播放次数。 [-1: 使用动画数据默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次] （默认: -1）\n         * @returns 播放的动画状态。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        gotoAndPlayByProgress(animationName: string, progress?: number, playTimes?: number): AnimationState | null;\n        /**\n         * - Stop a specific animation at the specific time.\n         * @param animationName - The name of animation data.\n         * @param time - The stop time. (In seconds)\n         * @returns The played animation state.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 在指定时间停止指定动画播放\n         * @param animationName - 动画数据名称。\n         * @param time - 停止的时间。 (以秒为单位)\n         * @returns 播放的动画状态。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        gotoAndStopByTime(animationName: string, time?: number): AnimationState | null;\n        /**\n         * - Stop a specific animation at the specific frame.\n         * @param animationName - The name of animation data.\n         * @param frame - The stop frame.\n         * @returns The played animation state.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 在指定帧停止指定动画的播放\n         * @param animationName - 动画数据名称。\n         * @param frame - 停止的帧数。\n         * @returns 播放的动画状态。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        gotoAndStopByFrame(animationName: string, frame?: number): AnimationState | null;\n        /**\n         * - Stop a specific animation at the specific progress.\n         * @param animationName - The name of animation data.\n         * @param progress - The stop progress value.\n         * @returns The played animation state.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 在指定的进度停止指定的动画播放。\n         * @param animationName - 动画数据名称。\n         * @param progress - 停止进度。\n         * @returns 播放的动画状态。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        gotoAndStopByProgress(animationName: string, progress?: number): AnimationState | null;\n        /**\n         * - Get a specific animation state.\n         * @param animationName - The name of animation state.\n         * @example\n         * <pre>\n         *     armature.animation.play(\"walk\");\n         *     let walkState = armature.animation.getState(\"walk\");\n         *     walkState.timeScale = 0.5;\n         * </pre>\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 获取指定的动画状态\n         * @param animationName - 动画状态名称。\n         * @example\n         * <pre>\n         *     armature.animation.play(\"walk\");\n         *     let walkState = armature.animation.getState(\"walk\");\n         *     walkState.timeScale = 0.5;\n         * </pre>\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getState(animationName: string): AnimationState | null;\n        /**\n         * - Check whether a specific animation data is included.\n         * @param animationName - The name of animation data.\n         * @see dragonBones.AnimationData\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 检查是否包含指定的动画数据\n         * @param animationName - 动画数据名称。\n         * @see dragonBones.AnimationData\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        hasAnimation(animationName: string): boolean;\n        /**\n         * - Get all the animation states.\n         * @version DragonBones 5.1\n         * @language en_US\n         */\n        /**\n         * - 获取所有的动画状态\n         * @version DragonBones 5.1\n         * @language zh_CN\n         */\n        getStates(): Array<AnimationState>;\n        /**\n         * - Check whether there is an animation state is playing\n         * @see dragonBones.AnimationState\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 检查是否有动画状态正在播放\n         * @see dragonBones.AnimationState\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly isPlaying: boolean;\n        /**\n         * - Check whether all the animation states' playing were finished.\n         * @see dragonBones.AnimationState\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 检查是否所有的动画状态均已播放完毕。\n         * @see dragonBones.AnimationState\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly isCompleted: boolean;\n        /**\n         * - The name of the last playing animation state.\n         * @see #lastAnimationState\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 上一个播放的动画状态名称\n         * @see #lastAnimationState\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly lastAnimationName: string;\n        /**\n         * - The name of all animation data\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 所有动画数据的名称\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        readonly animationNames: Array<string>;\n        /**\n         * - All animation data.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 所有的动画数据。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        animations: Map<AnimationData>;\n        /**\n         * - An AnimationConfig instance that can be used quickly.\n         * @see dragonBones.AnimationConfig\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 一个可以快速使用的动画配置实例。\n         * @see dragonBones.AnimationConfig\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        readonly animationConfig: AnimationConfig;\n        /**\n         * - The last playing animation state\n         * @see dragonBones.AnimationState\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 上一个播放的动画状态\n         * @see dragonBones.AnimationState\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly lastAnimationState: AnimationState | null;\n        /**\n         * - Deprecated, please refer to {@link #play()} {@link #fadeIn()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #play()} {@link #fadeIn()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        gotoAndPlay(animationName: string, fadeInTime?: number, duration?: number, playTimes?: number, layer?: number, group?: string | null, fadeOutMode?: AnimationFadeOutMode, pauseFadeOut?: boolean, pauseFadeIn?: boolean): AnimationState | null;\n        /**\n         * - Deprecated, please refer to {@link #gotoAndStopByTime()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #gotoAndStopByTime()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        gotoAndStop(animationName: string, time?: number): AnimationState | null;\n        /**\n         * - Deprecated, please refer to {@link #animationNames}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #animationNames}。\n         * @deprecated\n         * @language zh_CN\n         */\n        readonly animationList: Array<string>;\n        /**\n         * - Deprecated, please refer to {@link #animationNames}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #animationNames}。\n         * @deprecated\n         * @language zh_CN\n         */\n        readonly animationDataList: Array<AnimationData>;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The animation state is generated when the animation data is played.\n     * @see dragonBones.Animation\n     * @see dragonBones.AnimationData\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 动画状态由播放动画数据时产生。\n     * @see dragonBones.Animation\n     * @see dragonBones.AnimationData\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class AnimationState extends BaseObject {\n        static toString(): string;\n        /**\n         * @private\n         */\n        actionEnabled: boolean;\n        /**\n         * @private\n         */\n        additiveBlending: boolean;\n        /**\n         * - Whether the animation state has control over the display object properties of the slots.\n         * Sometimes blend a animation state does not want it to control the display object properties of the slots,\n         * especially if other animation state are controlling the display object properties of the slots.\n         * @default true\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 动画状态是否对插槽的显示对象属性有控制权。\n         * 有时混合一个动画状态并不希望其控制插槽的显示对象属性，\n         * 尤其是其他动画状态正在控制这些插槽的显示对象属性时。\n         * @default true\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        displayControl: boolean;\n        /**\n         * - Whether to reset the objects without animation to the armature pose when the animation state is start to play.\n         * This property should usually be set to false when blend multiple animation states.\n         * @default true\n         * @version DragonBones 5.1\n         * @language en_US\n         */\n        /**\n         * - 开始播放动画状态时是否将没有动画的对象重置为骨架初始值。\n         * 通常在混合多个动画状态时应该将该属性设置为 false。\n         * @default true\n         * @version DragonBones 5.1\n         * @language zh_CN\n         */\n        resetToPose: boolean;\n        /**\n         * - The play times. [0: Loop play, [1~N]: Play N times]\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 播放次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次]\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        playTimes: number;\n        /**\n         * - The blend layer.\n         * High layer animation state will get the blend weight first.\n         * When the blend weight is assigned more than 1, the remaining animation states will no longer get the weight assigned.\n         * @readonly\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 混合图层。\n         * 图层高的动画状态会优先获取混合权重。\n         * 当混合权重分配超过 1 时，剩余的动画状态将不再获得权重分配。\n         * @readonly\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        layer: number;\n        /**\n         * - The play speed.\n         * The value is an overlay relationship with {@link dragonBones.Animation#timeScale}.\n         * [(-N~0): Reverse play, 0: Stop play, (0~1): Slow play, 1: Normal play, (1~N): Fast play]\n         * @default 1.0\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 播放速度。\n         * 该值与 {@link dragonBones.Animation#timeScale} 是叠加关系。\n         * [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放]\n         * @default 1.0\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        timeScale: number;\n        /**\n         * - The blend weight.\n         * @default 1.0\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 混合权重。\n         * @default 1.0\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        weight: number;\n        /**\n         * - The auto fade out time when the animation state play completed.\n         * [-1: Do not fade out automatically, [0~N]: The fade out time] (In seconds)\n         * @default -1.0\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 动画状态播放完成后的自动淡出时间。\n         * [-1: 不自动淡出, [0~N]: 淡出时间] （以秒为单位）\n         * @default -1.0\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        autoFadeOutTime: number;\n        /**\n         * @private\n         */\n        fadeTotalTime: number;\n        /**\n         * - The name of the animation state. (Can be different from the name of the animation data)\n         * @readonly\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 动画状态名称。 （可以不同于动画数据）\n         * @readonly\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * - The blend group name of the animation state.\n         * This property is typically used to specify the substitution of multiple animation states blend.\n         * @readonly\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 混合组名称。\n         * 该属性通常用来指定多个动画状态混合时的相互替换关系。\n         * @readonly\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        group: string;\n        private _timelineDirty;\n        /**\n         * - xx: Play Enabled, Fade Play Enabled\n         * @internal\n         */\n        _playheadState: number;\n        /**\n         * -1: Fade in, 0: Fade complete, 1: Fade out;\n         * @internal\n         */\n        _fadeState: number;\n        /**\n         * -1: Fade start, 0: Fading, 1: Fade complete;\n         * @internal\n         */\n        _subFadeState: number;\n        /**\n         * @internal\n         */\n        _position: number;\n        /**\n         * @internal\n         */\n        _duration: number;\n        private _fadeTime;\n        private _time;\n        /**\n         * @internal\n         */\n        _fadeProgress: number;\n        /**\n         * @internal\n         */\n        _weightResult: number;\n        /**\n         * @internal\n         */\n        readonly _blendState: BlendState;\n        private readonly _boneMask;\n        private readonly _boneTimelines;\n        private readonly _surfaceTimelines;\n        private readonly _slotTimelines;\n        private readonly _constraintTimelines;\n        private readonly _animationTimelines;\n        private readonly _poseTimelines;\n        private readonly _bonePoses;\n        /**\n         * @internal\n         */\n        _animationData: AnimationData;\n        private _armature;\n        /**\n         * @internal\n         */\n        _actionTimeline: ActionTimelineState;\n        private _zOrderTimeline;\n        /**\n         * @internal\n         */\n        _parent: AnimationState;\n        protected _onClear(): void;\n        private _updateTimelines();\n        private _updateBoneAndSlotTimelines();\n        private _advanceFadeTime(passedTime);\n        /**\n         * @internal\n         */\n        init(armature: Armature, animationData: AnimationData, animationConfig: AnimationConfig): void;\n        /**\n         * @internal\n         */\n        advanceTime(passedTime: number, cacheFrameRate: number): void;\n        /**\n         * - Continue play.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 继续播放。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        play(): void;\n        /**\n         * - Stop play.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 暂停播放。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        stop(): void;\n        /**\n         * - Fade out the animation state.\n         * @param fadeOutTime - The fade out time. (In seconds)\n         * @param pausePlayhead - Whether to pause the animation playing when fade out.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 淡出动画状态。\n         * @param fadeOutTime - 淡出时间。 （以秒为单位）\n         * @param pausePlayhead - 淡出时是否暂停播放。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        fadeOut(fadeOutTime: number, pausePlayhead?: boolean): void;\n        /**\n         * - Check if a specific bone mask is included.\n         * @param boneName - The bone name.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 检查是否包含特定骨骼遮罩。\n         * @param boneName - 骨骼名称。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        containsBoneMask(boneName: string): boolean;\n        /**\n         * - Add a specific bone mask.\n         * @param boneName - The bone name.\n         * @param recursive - Whether or not to add a mask to the bone's sub-bone.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 添加特定的骨骼遮罩。\n         * @param boneName - 骨骼名称。\n         * @param recursive - 是否为该骨骼的子骨骼添加遮罩。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        addBoneMask(boneName: string, recursive?: boolean): void;\n        /**\n         * - Remove the mask of a specific bone.\n         * @param boneName - The bone name.\n         * @param recursive - Whether to remove the bone's sub-bone mask.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 删除特定骨骼的遮罩。\n         * @param boneName - 骨骼名称。\n         * @param recursive - 是否删除该骨骼的子骨骼遮罩。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        removeBoneMask(boneName: string, recursive?: boolean): void;\n        /**\n         * - Remove all bone masks.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 删除所有骨骼遮罩。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        removeAllBoneMask(): void;\n        /**\n         * - Whether the animation state is fading in.\n         * @version DragonBones 5.1\n         * @language en_US\n         */\n        /**\n         * - 是否正在淡入。\n         * @version DragonBones 5.1\n         * @language zh_CN\n         */\n        readonly isFadeIn: boolean;\n        /**\n         * - Whether the animation state is fading out.\n         * @version DragonBones 5.1\n         * @language en_US\n         */\n        /**\n         * - 是否正在淡出。\n         * @version DragonBones 5.1\n         * @language zh_CN\n         */\n        readonly isFadeOut: boolean;\n        /**\n         * - Whether the animation state is fade completed.\n         * @version DragonBones 5.1\n         * @language en_US\n         */\n        /**\n         * - 是否淡入或淡出完毕。\n         * @version DragonBones 5.1\n         * @language zh_CN\n         */\n        readonly isFadeComplete: boolean;\n        /**\n         * - Whether the animation state is playing.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 是否正在播放。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly isPlaying: boolean;\n        /**\n         * - Whether the animation state is play completed.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 是否播放完毕。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly isCompleted: boolean;\n        /**\n         * - The times has been played.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 已经循环播放的次数。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly currentPlayTimes: number;\n        /**\n         * - The total time. (In seconds)\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 总播放时间。 （以秒为单位）\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly totalTime: number;\n        /**\n         * - The time is currently playing. (In seconds)\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 当前播放的时间。 （以秒为单位）\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        currentTime: number;\n        /**\n         * - The animation data.\n         * @see dragonBones.AnimationData\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 动画数据。\n         * @see dragonBones.AnimationData\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        readonly animationData: AnimationData;\n    }\n    /**\n     * @internal\n     */\n    class BonePose extends BaseObject {\n        static toString(): string;\n        readonly current: Transform;\n        readonly delta: Transform;\n        readonly result: Transform;\n        protected _onClear(): void;\n    }\n    /**\n     * @internal\n     */\n    class BlendState {\n        dirty: boolean;\n        layer: number;\n        leftWeight: number;\n        layerWeight: number;\n        blendWeight: number;\n        /**\n         * -1: First blending, 0: No blending, 1: Blending.\n         */\n        update(weight: number, p_layer: number): number;\n        clear(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @internal\n     */\n    const enum TweenState {\n        None = 0,\n        Once = 1,\n        Always = 2,\n    }\n    /**\n     * @internal\n     */\n    abstract class TimelineState extends BaseObject {\n        /**\n         * -1: start, 0: play, 1: complete;\n         */\n        playState: number;\n        currentPlayTimes: number;\n        currentTime: number;\n        protected _tweenState: TweenState;\n        protected _frameRate: number;\n        protected _frameValueOffset: number;\n        protected _frameCount: number;\n        protected _frameOffset: number;\n        protected _frameIndex: number;\n        protected _frameRateR: number;\n        protected _position: number;\n        protected _duration: number;\n        protected _timeScale: number;\n        protected _timeOffset: number;\n        protected _dragonBonesData: DragonBonesData;\n        protected _animationData: AnimationData;\n        protected _timelineData: TimelineData | null;\n        protected _armature: Armature;\n        protected _animationState: AnimationState;\n        protected _actionTimeline: TimelineState;\n        protected _frameArray: Array<number> | Int16Array;\n        protected _frameIntArray: Array<number> | Int16Array;\n        protected _frameFloatArray: Array<number> | Int16Array;\n        protected _timelineArray: Array<number> | Uint16Array;\n        protected _frameIndices: Array<number>;\n        protected _onClear(): void;\n        protected abstract _onArriveAtFrame(): void;\n        protected abstract _onUpdateFrame(): void;\n        protected _setCurrentTime(passedTime: number): boolean;\n        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;\n        fadeOut(): void;\n        update(passedTime: number): void;\n    }\n    /**\n     * @internal\n     */\n    abstract class TweenTimelineState extends TimelineState {\n        private static _getEasingValue(tweenType, progress, easing);\n        private static _getEasingCurveValue(progress, samples, count, offset);\n        protected _tweenType: TweenType;\n        protected _curveCount: number;\n        protected _framePosition: number;\n        protected _frameDurationR: number;\n        protected _tweenProgress: number;\n        protected _tweenEasing: number;\n        protected _onClear(): void;\n        protected _onArriveAtFrame(): void;\n        protected _onUpdateFrame(): void;\n    }\n    /**\n     * @internal\n     */\n    abstract class BoneTimelineState extends TweenTimelineState {\n        bone: Bone;\n        bonePose: BonePose;\n        protected _onClear(): void;\n        blend(state: number): void;\n    }\n    /**\n     * @internal\n     */\n    abstract class SlotTimelineState extends TweenTimelineState {\n        slot: Slot;\n        protected _onClear(): void;\n    }\n    /**\n     * @internal\n     */\n    abstract class ConstraintTimelineState extends TweenTimelineState {\n        constraint: Constraint;\n        protected _onClear(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @internal\n     */\n    class ActionTimelineState extends TimelineState {\n        static toString(): string;\n        private _onCrossFrame(frameIndex);\n        protected _onArriveAtFrame(): void;\n        protected _onUpdateFrame(): void;\n        update(passedTime: number): void;\n        setCurrentTime(value: number): void;\n    }\n    /**\n     * @internal\n     */\n    class ZOrderTimelineState extends TimelineState {\n        static toString(): string;\n        protected _onArriveAtFrame(): void;\n        protected _onUpdateFrame(): void;\n    }\n    /**\n     * @internal\n     */\n    class BoneAllTimelineState extends BoneTimelineState {\n        static toString(): string;\n        protected _onArriveAtFrame(): void;\n        protected _onUpdateFrame(): void;\n        fadeOut(): void;\n    }\n    /**\n     * @internal\n     */\n    class BoneTranslateTimelineState extends BoneTimelineState {\n        static toString(): string;\n        protected _onArriveAtFrame(): void;\n        protected _onUpdateFrame(): void;\n    }\n    /**\n     * @internal\n     */\n    class BoneRotateTimelineState extends BoneTimelineState {\n        static toString(): string;\n        protected _onArriveAtFrame(): void;\n        protected _onUpdateFrame(): void;\n        fadeOut(): void;\n    }\n    /**\n     * @internal\n     */\n    class BoneScaleTimelineState extends BoneTimelineState {\n        static toString(): string;\n        protected _onArriveAtFrame(): void;\n        protected _onUpdateFrame(): void;\n    }\n    /**\n     * @internal\n     */\n    class SurfaceTimelineState extends TweenTimelineState {\n        static toString(): string;\n        surface: Surface;\n        private _frameFloatOffset;\n        private _valueCount;\n        private _deformCount;\n        private _valueOffset;\n        private readonly _current;\n        private readonly _delta;\n        private readonly _result;\n        protected _onClear(): void;\n        protected _onArriveAtFrame(): void;\n        protected _onUpdateFrame(): void;\n        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;\n        blend(state: number): void;\n    }\n    /**\n     * @internal\n     */\n    class SlotDislayTimelineState extends SlotTimelineState {\n        static toString(): string;\n        protected _onArriveAtFrame(): void;\n    }\n    /**\n     * @internal\n     */\n    class SlotColorTimelineState extends SlotTimelineState {\n        static toString(): string;\n        private _dirty;\n        private readonly _current;\n        private readonly _delta;\n        private readonly _result;\n        protected _onClear(): void;\n        protected _onArriveAtFrame(): void;\n        protected _onUpdateFrame(): void;\n        fadeOut(): void;\n        update(passedTime: number): void;\n    }\n    /**\n     * @internal\n     */\n    class DeformTimelineState extends SlotTimelineState {\n        static toString(): string;\n        vertexOffset: number;\n        private _dirty;\n        private _frameFloatOffset;\n        private _valueCount;\n        private _deformCount;\n        private _valueOffset;\n        private readonly _current;\n        private readonly _delta;\n        private readonly _result;\n        protected _onClear(): void;\n        protected _onArriveAtFrame(): void;\n        protected _onUpdateFrame(): void;\n        init(armature: Armature, animationState: AnimationState, timelineData: TimelineData | null): void;\n        fadeOut(): void;\n        update(passedTime: number): void;\n    }\n    /**\n     * @internal\n     */\n    class IKConstraintTimelineState extends ConstraintTimelineState {\n        static toString(): string;\n        private _current;\n        private _delta;\n        protected _onClear(): void;\n        protected _onArriveAtFrame(): void;\n        protected _onUpdateFrame(): void;\n    }\n    /**\n     * @internal\n     */\n    class AnimationTimelineState extends TweenTimelineState {\n        static toString(): string;\n        animationState: AnimationState;\n        private readonly _floats;\n        protected _onClear(): void;\n        protected _onArriveAtFrame(): void;\n        protected _onUpdateFrame(): void;\n        blend(state: number): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The properties of the object carry basic information about an event,\n     * which are passed as parameter or parameter's parameter to event listeners when an event occurs.\n     * @version DragonBones 4.5\n     * @language en_US\n     */\n    /**\n     * - 事件对象，包含有关事件的基本信息，当发生事件时，该实例将作为参数或参数的参数传递给事件侦听器。\n     * @version DragonBones 4.5\n     * @language zh_CN\n     */\n    class EventObject extends BaseObject {\n        /**\n         * - Animation start play.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 动画开始播放。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        static readonly START: string;\n        /**\n         * - Animation loop play complete once.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 动画循环播放完成一次。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        static readonly LOOP_COMPLETE: string;\n        /**\n         * - Animation play complete.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 动画播放完成。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        static readonly COMPLETE: string;\n        /**\n         * - Animation fade in start.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 动画淡入开始。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        static readonly FADE_IN: string;\n        /**\n         * - Animation fade in complete.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 动画淡入完成。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        static readonly FADE_IN_COMPLETE: string;\n        /**\n         * - Animation fade out start.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 动画淡出开始。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        static readonly FADE_OUT: string;\n        /**\n         * - Animation fade out complete.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 动画淡出完成。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        static readonly FADE_OUT_COMPLETE: string;\n        /**\n         * - Animation frame event.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 动画帧事件。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        static readonly FRAME_EVENT: string;\n        /**\n         * - Animation frame sound event.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 动画帧声音事件。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        static readonly SOUND_EVENT: string;\n        /**\n         * @internal\n         * @private\n         */\n        static actionDataToInstance(data: ActionData, instance: EventObject, armature: Armature): void;\n        static toString(): string;\n        /**\n         * - If is a frame event, the value is used to describe the time that the event was in the animation timeline. (In seconds)\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 如果是帧事件，此值用来描述该事件在动画时间轴中所处的时间。（以秒为单位）\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        time: number;\n        /**\n         * - The event type。\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 事件类型。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        type: EventStringType;\n        /**\n         * - The event name. (The frame event name or the frame sound name)\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 事件名称。 (帧事件的名称或帧声音的名称)\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * - The armature that dispatch the event.\n         * @see dragonBones.Armature\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 发出该事件的骨架。\n         * @see dragonBones.Armature\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        armature: Armature;\n        /**\n         * - The bone that dispatch the event.\n         * @see dragonBones.Bone\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 发出该事件的骨骼。\n         * @see dragonBones.Bone\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        bone: Bone | null;\n        /**\n         * - The slot that dispatch the event.\n         * @see dragonBones.Slot\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 发出该事件的插槽。\n         * @see dragonBones.Slot\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        slot: Slot | null;\n        /**\n         * - The animation state that dispatch the event.\n         * @see dragonBones.AnimationState\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 发出该事件的动画状态。\n         * @see dragonBones.AnimationState\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        animationState: AnimationState;\n        /**\n         * @private\n         */\n        actionData: ActionData | null;\n        /**\n         * @private\n         */\n        /**\n         * - The custom data.\n         * @see dragonBones.CustomData\n         * @version DragonBones 5.0\n         * @language en_US\n         */\n        /**\n         * - 自定义数据。\n         * @see dragonBones.CustomData\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        data: UserData | null;\n        protected _onClear(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @private\n     */\n    type EventStringType = string | \"start\" | \"loopComplete\" | \"complete\" | \"fadeIn\" | \"fadeInComplete\" | \"fadeOut\" | \"fadeOutComplete\" | \"frameEvent\" | \"soundEvent\";\n    /**\n     * - The event dispatcher interface.\n     * Dragonbones event dispatch usually relies on docking engine to implement, which defines the event method to be implemented when docking the engine.\n     * @version DragonBones 4.5\n     * @language en_US\n     */\n    /**\n     * - 事件派发接口。\n     * DragonBones 的事件派发通常依赖于对接的引擎来实现，该接口定义了对接引擎时需要实现的事件方法。\n     * @version DragonBones 4.5\n     * @language zh_CN\n     */\n    interface IEventDispatcher {\n        /**\n         * - Checks whether the object has any listeners registered for a specific type of event。\n         * @param type - Event type.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 检查是否为特定的事件类型注册了任何侦听器。\n         * @param type - 事件类型。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        hasDBEventListener(type: EventStringType): boolean;\n        /**\n         * - Dispatches an event into the event flow.\n         * @param type - Event type.\n         * @param eventObject - Event object.\n         * @see dragonBones.EventObject\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 分派特定的事件到事件流中。\n         * @param type - 事件类型。\n         * @param eventObject - 事件数据。\n         * @see dragonBones.EventObject\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        dispatchDBEvent(type: EventStringType, eventObject: EventObject): void;\n        /**\n         * - Add an event listener object so that the listener receives notification of an event.\n         * @param type - Event type.\n         * @param listener - Event listener.\n         * @param thisObject - The listener function's \"this\".\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 添加特定事件类型的事件侦听器，以使侦听器能够接收事件通知。\n         * @param type - 事件类型。\n         * @param listener - 事件侦听器。\n         * @param thisObject - 侦听函数绑定的 this 对象。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        addDBEventListener(type: EventStringType, listener: Function, thisObject: any): void;\n        /**\n         * - Removes a listener from the object.\n         * @param type - Event type.\n         * @param listener - Event listener.\n         * @param thisObject - The listener function's \"this\".\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 删除特定事件类型的侦听器。\n         * @param type - 事件类型。\n         * @param listener - 事件侦听器。\n         * @param thisObject - 侦听函数绑定的 this 对象。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        removeDBEventListener(type: EventStringType, listener: Function, thisObject: any): void;\n        /**\n         * - Deprecated, please refer to {@link #hasDBEventListener()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #hasDBEventListener()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        hasEvent(type: EventStringType): boolean;\n        /**\n         * - Deprecated, please refer to {@link #addDBEventListener()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #addDBEventListener()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        addEvent(type: EventStringType, listener: Function, thisObject: any): void;\n        /**\n         * - Deprecated, please refer to {@link #removeDBEventListener()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #removeDBEventListener()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        removeEvent(type: EventStringType, listener: Function, thisObject: any): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @internal\n     */\n    abstract class DataParser {\n        protected static readonly DATA_VERSION_2_3: string;\n        protected static readonly DATA_VERSION_3_0: string;\n        protected static readonly DATA_VERSION_4_0: string;\n        protected static readonly DATA_VERSION_4_5: string;\n        protected static readonly DATA_VERSION_5_0: string;\n        protected static readonly DATA_VERSION_5_5: string;\n        protected static readonly DATA_VERSION: string;\n        protected static readonly DATA_VERSIONS: Array<string>;\n        protected static readonly TEXTURE_ATLAS: string;\n        protected static readonly SUB_TEXTURE: string;\n        protected static readonly FORMAT: string;\n        protected static readonly IMAGE_PATH: string;\n        protected static readonly WIDTH: string;\n        protected static readonly HEIGHT: string;\n        protected static readonly ROTATED: string;\n        protected static readonly FRAME_X: string;\n        protected static readonly FRAME_Y: string;\n        protected static readonly FRAME_WIDTH: string;\n        protected static readonly FRAME_HEIGHT: string;\n        protected static readonly DRADON_BONES: string;\n        protected static readonly USER_DATA: string;\n        protected static readonly ARMATURE: string;\n        protected static readonly BONE: string;\n        protected static readonly SURFACE: string;\n        protected static readonly SLOT: string;\n        protected static readonly CONSTRAINT: string;\n        protected static readonly IK: string;\n        protected static readonly PATH_CONSTRAINT: string;\n        protected static readonly SKIN: string;\n        protected static readonly DISPLAY: string;\n        protected static readonly ANIMATION: string;\n        protected static readonly Z_ORDER: string;\n        protected static readonly FFD: string;\n        protected static readonly FRAME: string;\n        protected static readonly TRANSLATE_FRAME: string;\n        protected static readonly ROTATE_FRAME: string;\n        protected static readonly SCALE_FRAME: string;\n        protected static readonly DISPLAY_FRAME: string;\n        protected static readonly COLOR_FRAME: string;\n        protected static readonly DEFAULT_ACTIONS: string;\n        protected static readonly ACTIONS: string;\n        protected static readonly EVENTS: string;\n        protected static readonly INTS: string;\n        protected static readonly FLOATS: string;\n        protected static readonly STRINGS: string;\n        protected static readonly CANVAS: string;\n        protected static readonly TRANSFORM: string;\n        protected static readonly PIVOT: string;\n        protected static readonly AABB: string;\n        protected static readonly COLOR: string;\n        protected static readonly VERSION: string;\n        protected static readonly COMPATIBLE_VERSION: string;\n        protected static readonly FRAME_RATE: string;\n        protected static readonly TYPE: string;\n        protected static readonly SUB_TYPE: string;\n        protected static readonly NAME: string;\n        protected static readonly PARENT: string;\n        protected static readonly TARGET: string;\n        protected static readonly STAGE: string;\n        protected static readonly SHARE: string;\n        protected static readonly PATH: string;\n        protected static readonly LENGTH: string;\n        protected static readonly DISPLAY_INDEX: string;\n        protected static readonly BLEND_MODE: string;\n        protected static readonly INHERIT_TRANSLATION: string;\n        protected static readonly INHERIT_ROTATION: string;\n        protected static readonly INHERIT_SCALE: string;\n        protected static readonly INHERIT_REFLECTION: string;\n        protected static readonly INHERIT_ANIMATION: string;\n        protected static readonly INHERIT_DEFORM: string;\n        protected static readonly SEGMENT_X: string;\n        protected static readonly SEGMENT_Y: string;\n        protected static readonly BEND_POSITIVE: string;\n        protected static readonly CHAIN: string;\n        protected static readonly WEIGHT: string;\n        protected static readonly FADE_IN_TIME: string;\n        protected static readonly PLAY_TIMES: string;\n        protected static readonly SCALE: string;\n        protected static readonly OFFSET: string;\n        protected static readonly POSITION: string;\n        protected static readonly DURATION: string;\n        protected static readonly TWEEN_EASING: string;\n        protected static readonly TWEEN_ROTATE: string;\n        protected static readonly TWEEN_SCALE: string;\n        protected static readonly CLOCK_WISE: string;\n        protected static readonly CURVE: string;\n        protected static readonly SOUND: string;\n        protected static readonly EVENT: string;\n        protected static readonly ACTION: string;\n        protected static readonly X: string;\n        protected static readonly Y: string;\n        protected static readonly SKEW_X: string;\n        protected static readonly SKEW_Y: string;\n        protected static readonly SCALE_X: string;\n        protected static readonly SCALE_Y: string;\n        protected static readonly VALUE: string;\n        protected static readonly ROTATE: string;\n        protected static readonly SKEW: string;\n        protected static readonly ALPHA_OFFSET: string;\n        protected static readonly RED_OFFSET: string;\n        protected static readonly GREEN_OFFSET: string;\n        protected static readonly BLUE_OFFSET: string;\n        protected static readonly ALPHA_MULTIPLIER: string;\n        protected static readonly RED_MULTIPLIER: string;\n        protected static readonly GREEN_MULTIPLIER: string;\n        protected static readonly BLUE_MULTIPLIER: string;\n        protected static readonly UVS: string;\n        protected static readonly VERTICES: string;\n        protected static readonly TRIANGLES: string;\n        protected static readonly WEIGHTS: string;\n        protected static readonly SLOT_POSE: string;\n        protected static readonly BONE_POSE: string;\n        protected static readonly GLUE_WEIGHTS: string;\n        protected static readonly GLUE_MESHES: string;\n        protected static readonly BONES: string;\n        protected static readonly POSITION_MODE: string;\n        protected static readonly SPACING_MODE: string;\n        protected static readonly ROTATE_MODE: string;\n        protected static readonly SPACING: string;\n        protected static readonly ROTATE_OFFSET: string;\n        protected static readonly ROTATE_MIX: string;\n        protected static readonly TRANSLATE_MIX: string;\n        protected static readonly TARGET_DISPLAY: string;\n        protected static readonly CLOSED: string;\n        protected static readonly CONSTANT_SPEED: string;\n        protected static readonly VERTEX_COUNT: string;\n        protected static readonly LENGTHS: string;\n        protected static readonly GOTO_AND_PLAY: string;\n        protected static readonly DEFAULT_NAME: string;\n        protected static _getArmatureType(value: string): ArmatureType;\n        protected static _getBoneType(value: string): BoneType;\n        protected static _getDisplayType(value: string): DisplayType;\n        protected static _getBoundingBoxType(value: string): BoundingBoxType;\n        protected static _getActionType(value: string): ActionType;\n        protected static _getBlendMode(value: string): BlendMode;\n        protected static _getPositionMode(value: string): PositionMode;\n        protected static _getSpacingMode(value: string): SpacingMode;\n        protected static _getRotateMode(value: string): RotateMode;\n        abstract parseDragonBonesData(rawData: any, scale: number): DragonBonesData | null;\n        abstract parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale: number): boolean;\n        /**\n         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static parseDragonBonesData(rawData: any): DragonBonesData | null;\n        /**\n         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parsetTextureAtlasData()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link dragonBones.BaseFactory#parsetTextureAtlasData()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static parseTextureAtlasData(rawData: any, scale?: number): any;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @internal\n     */\n    class ObjectDataParser extends DataParser {\n        protected static _getBoolean(rawData: any, key: string, defaultValue: boolean): boolean;\n        protected static _getNumber(rawData: any, key: string, defaultValue: number): number;\n        protected static _getString(rawData: any, key: string, defaultValue: string): string;\n        protected _rawTextureAtlasIndex: number;\n        protected readonly _rawBones: Array<BoneData>;\n        protected _data: DragonBonesData;\n        protected _armature: ArmatureData;\n        protected _bone: BoneData;\n        protected _surface: SurfaceData;\n        protected _slot: SlotData;\n        protected _skin: SkinData;\n        protected _mesh: MeshDisplayData;\n        protected _animation: AnimationData;\n        protected _timeline: TimelineData;\n        protected _rawTextureAtlases: Array<any> | null;\n        private _defaultColorOffset;\n        private _prevClockwise;\n        private _prevRotation;\n        private readonly _helpMatrixA;\n        private readonly _helpMatrixB;\n        private readonly _helpTransform;\n        private readonly _helpColorTransform;\n        private readonly _helpPoint;\n        private readonly _helpArray;\n        private readonly _intArray;\n        private readonly _floatArray;\n        private readonly _frameIntArray;\n        private readonly _frameFloatArray;\n        private readonly _frameArray;\n        private readonly _timelineArray;\n        private readonly _cacheRawMeshes;\n        private readonly _cacheMeshes;\n        private readonly _actionFrames;\n        private readonly _weightSlotPose;\n        private readonly _weightBonePoses;\n        private readonly _cacheBones;\n        private readonly _slotChildActions;\n        private _getCurvePoint(x1, y1, x2, y2, x3, y3, x4, y4, t, result);\n        private _samplingEasingCurve(curve, samples);\n        private _parseActionDataInFrame(rawData, frameStart, bone, slot);\n        private _mergeActionFrame(rawData, frameStart, type, bone, slot);\n        protected _parseArmature(rawData: any, scale: number): ArmatureData;\n        protected _parseBone(rawData: any): BoneData;\n        protected _parseIKConstraint(rawData: any): ConstraintData | null;\n        protected _parsePathConstraint(rawData: any): ConstraintData | null;\n        protected _parseSlot(rawData: any, zOrder: number): SlotData;\n        protected _parseSkin(rawData: any): SkinData;\n        protected _parseDisplay(rawData: any): DisplayData | null;\n        protected _parsePath(rawData: any, display: PathDisplayData): void;\n        protected _parsePivot(rawData: any, display: ImageDisplayData): void;\n        protected _parseMesh(rawData: any, mesh: MeshDisplayData): void;\n        protected _parseMeshGlue(rawData: any, mesh: MeshDisplayData): void;\n        protected _parseBoundingBox(rawData: any): BoundingBoxData | null;\n        protected _parsePolygonBoundingBox(rawData: any): PolygonBoundingBoxData;\n        protected _parseAnimation(rawData: any): AnimationData;\n        protected _parseTimeline(rawData: any, rawFrames: Array<any> | null, framesKey: string, type: TimelineType, addIntOffset: boolean, addFloatOffset: boolean, frameValueCount: number, frameParser: (rawData: any, frameStart: number, frameCount: number) => number): TimelineData | null;\n        protected _parseBoneTimeline(rawData: any): void;\n        protected _parseSlotTimeline(rawData: any): void;\n        protected _parseFrame(rawData: any, frameStart: number, frameCount: number): number;\n        protected _parseTweenFrame(rawData: any, frameStart: number, frameCount: number): number;\n        protected _parseActionFrame(frame: ActionFrame, frameStart: number, frameCount: number): number;\n        protected _parseZOrderFrame(rawData: any, frameStart: number, frameCount: number): number;\n        protected _parseBoneAllFrame(rawData: any, frameStart: number, frameCount: number): number;\n        protected _parseBoneTranslateFrame(rawData: any, frameStart: number, frameCount: number): number;\n        protected _parseBoneRotateFrame(rawData: any, frameStart: number, frameCount: number): number;\n        protected _parseBoneScaleFrame(rawData: any, frameStart: number, frameCount: number): number;\n        protected _parseSurfaceFrame(rawData: any, frameStart: number, frameCount: number): number;\n        protected _parseSlotDisplayFrame(rawData: any, frameStart: number, frameCount: number): number;\n        protected _parseSlotColorFrame(rawData: any, frameStart: number, frameCount: number): number;\n        protected _parseSlotFFDFrame(rawData: any, frameStart: number, frameCount: number): number;\n        protected _parseIKConstraintFrame(rawData: any, frameStart: number, frameCount: number): number;\n        protected _parseAnimationFrame(rawData: any, frameStart: number, frameCount: number): number;\n        protected _parseActionData(rawData: any, type: ActionType, bone: BoneData | null, slot: SlotData | null): Array<ActionData>;\n        protected _parseTransform(rawData: any, transform: Transform, scale: number): void;\n        protected _parseColorTransform(rawData: any, color: ColorTransform): void;\n        protected _parseArray(rawData: any): void;\n        protected _modifyArray(): void;\n        parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null;\n        parseTextureAtlasData(rawData: any, textureAtlasData: TextureAtlasData, scale?: number): boolean;\n        private static _objectDataParserInstance;\n        /**\n         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static getInstance(): ObjectDataParser;\n    }\n    /**\n     * @internal\n     */\n    class ActionFrame {\n        frameStart: number;\n        readonly actions: Array<number>;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @internal\n     */\n    class BinaryDataParser extends ObjectDataParser {\n        private _binaryOffset;\n        private _binary;\n        private _intArrayBuffer;\n        private _floatArrayBuffer;\n        private _frameIntArrayBuffer;\n        private _frameFloatArrayBuffer;\n        private _frameArrayBuffer;\n        private _timelineArrayBuffer;\n        private _inRange(a, min, max);\n        private _decodeUTF8(data);\n        private _getUTF16Key(value);\n        private _parseBinaryTimeline(type, offset, timelineData?);\n        private _parseVertices(rawData, vertices);\n        protected _parseMesh(rawData: any, mesh: MeshDisplayData): void;\n        protected _parsePath(rawData: any, path: PathDisplayData): void;\n        protected _parseAnimation(rawData: any): AnimationData;\n        protected _parseArray(rawData: any): void;\n        parseDragonBonesData(rawData: any, scale?: number): DragonBonesData | null;\n        private static _binaryDataParserInstance;\n        /**\n         * - Deprecated, please refer to {@link dragonBones.BaseFactory#parseDragonBonesData()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link dragonBones.BaseFactory#parseDragonBonesData()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static getInstance(): BinaryDataParser;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - Base class for the factory that create the armatures. (Typically only one global factory instance is required)\n     * The factory instance create armatures by parsed and added DragonBonesData instances and TextureAtlasData instances.\n     * Once the data has been parsed, it has been cached in the factory instance and does not need to be parsed again until it is cleared by the factory instance.\n     * @see dragonBones.DragonBonesData\n     * @see dragonBones.TextureAtlasData\n     * @see dragonBones.ArmatureData\n     * @see dragonBones.Armature\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - 创建骨架的工厂基类。 （通常只需要一个全局工厂实例）\n     * 工厂通过解析并添加的 DragonBonesData 实例和 TextureAtlasData 实例来创建骨架。\n     * 当数据被解析过之后，已经添加到工厂中，在没有被工厂清理之前，不需要再次解析。\n     * @see dragonBones.DragonBonesData\n     * @see dragonBones.TextureAtlasData\n     * @see dragonBones.ArmatureData\n     * @see dragonBones.Armature\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    abstract class BaseFactory {\n        protected static _objectParser: ObjectDataParser;\n        protected static _binaryParser: BinaryDataParser;\n        /**\n         * @private\n         */\n        autoSearch: boolean;\n        protected readonly _dragonBonesDataMap: Map<DragonBonesData>;\n        protected readonly _textureAtlasDataMap: Map<Array<TextureAtlasData>>;\n        protected _dragonBones: DragonBones;\n        protected _dataParser: DataParser;\n        /**\n         * - Create a factory instance. (typically only one global factory instance is required)\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 创建一个工厂实例。 （通常只需要一个全局工厂实例）\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        constructor(dataParser?: DataParser | null);\n        protected _isSupportMesh(): boolean;\n        protected _getTextureData(textureAtlasName: string, textureName: string): TextureData | null;\n        protected _fillBuildArmaturePackage(dataPackage: BuildArmaturePackage, dragonBonesName: string, armatureName: string, skinName: string, textureAtlasName: string): boolean;\n        protected _buildBones(dataPackage: BuildArmaturePackage, armature: Armature): void;\n        /**\n         * @private\n         */\n        protected _buildSlots(dataPackage: BuildArmaturePackage, armature: Armature): void;\n        protected _buildConstraints(dataPackage: BuildArmaturePackage, armature: Armature): void;\n        protected _buildChildArmature(dataPackage: BuildArmaturePackage | null, slot: Slot, displayData: DisplayData): Armature | null;\n        protected _getSlotDisplay(dataPackage: BuildArmaturePackage | null, displayData: DisplayData, rawDisplayData: DisplayData | null, slot: Slot): any;\n        protected abstract _buildTextureAtlasData(textureAtlasData: TextureAtlasData | null, textureAtlas: any): TextureAtlasData;\n        protected abstract _buildArmature(dataPackage: BuildArmaturePackage): Armature;\n        protected abstract _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot;\n        /**\n         * - Parse the raw data to a DragonBonesData instance and cache it to the factory.\n         * @param rawData - The raw data.\n         * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead)\n         * @param scale - Specify a scaling value for all armatures. (Default: 1.0)\n         * @returns DragonBonesData instance\n         * @see #getDragonBonesData()\n         * @see #addDragonBonesData()\n         * @see #removeDragonBonesData()\n         * @see dragonBones.DragonBonesData\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 将原始数据解析为 DragonBonesData 实例，并缓存到工厂中。\n         * @param rawData - 原始数据。\n         * @param name - 为该实例指定一个缓存名称，以便可以通过此名称获取该实例。 （如果未设置，则使用该实例中的名称）\n         * @param scale - 为所有的骨架指定一个缩放值。 （默认: 1.0）\n         * @returns DragonBonesData 实例\n         * @see #getDragonBonesData()\n         * @see #addDragonBonesData()\n         * @see #removeDragonBonesData()\n         * @see dragonBones.DragonBonesData\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        parseDragonBonesData(rawData: any, name?: string | null, scale?: number): DragonBonesData | null;\n        /**\n         * - Parse the raw texture atlas data and the texture atlas object to a TextureAtlasData instance and cache it to the factory.\n         * @param rawData - The raw texture atlas data.\n         * @param textureAtlas - The texture atlas object.\n         * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (If not set, use the instance name instead)\n         * @param scale - Specify a scaling value for the map set. (Default: 1.0)\n         * @returns TextureAtlasData instance\n         * @see #getTextureAtlasData()\n         * @see #addTextureAtlasData()\n         * @see #removeTextureAtlasData()\n         * @see dragonBones.TextureAtlasData\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 将原始贴图集数据和贴图集对象解析为 TextureAtlasData 实例，并缓存到工厂中。\n         * @param rawData - 原始贴图集数据。\n         * @param textureAtlas - 贴图集对象。\n         * @param name - 为该实例指定一个缓存名称，以便可以通过此名称获取该实例。 （如果未设置，则使用该实例中的名称）\n         * @param scale - 为贴图集指定一个缩放值。 （默认: 1.0）\n         * @returns TextureAtlasData 实例\n         * @see #getTextureAtlasData()\n         * @see #addTextureAtlasData()\n         * @see #removeTextureAtlasData()\n         * @see dragonBones.TextureAtlasData\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        parseTextureAtlasData(rawData: any, textureAtlas: any, name?: string | null, scale?: number): TextureAtlasData;\n        /**\n         * @private\n         */\n        updateTextureAtlasData(name: string, textureAtlases: Array<any>): void;\n        /**\n         * - Get a specific DragonBonesData instance.\n         * @param name - The DragonBonesData instance cache name.\n         * @returns DragonBonesData instance\n         * @see #parseDragonBonesData()\n         * @see #addDragonBonesData()\n         * @see #removeDragonBonesData()\n         * @see dragonBones.DragonBonesData\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 获取特定的 DragonBonesData 实例。\n         * @param name - DragonBonesData 实例的缓存名称。\n         * @returns DragonBonesData 实例\n         * @see #parseDragonBonesData()\n         * @see #addDragonBonesData()\n         * @see #removeDragonBonesData()\n         * @see dragonBones.DragonBonesData\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getDragonBonesData(name: string): DragonBonesData | null;\n        /**\n         * - Cache a DragonBonesData instance to the factory.\n         * @param data - The DragonBonesData instance.\n         * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead)\n         * @see #parseDragonBonesData()\n         * @see #getDragonBonesData()\n         * @see #removeDragonBonesData()\n         * @see dragonBones.DragonBonesData\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 将 DragonBonesData 实例缓存到工厂中。\n         * @param data - DragonBonesData 实例。\n         * @param name - 为该实例指定一个缓存名称，以便可以通过此名称获取该实例。 （如果未设置，则使用该实例中的名称）\n         * @see #parseDragonBonesData()\n         * @see #getDragonBonesData()\n         * @see #removeDragonBonesData()\n         * @see dragonBones.DragonBonesData\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        addDragonBonesData(data: DragonBonesData, name?: string | null): void;\n        /**\n         * - Remove a DragonBonesData instance.\n         * @param name - The DragonBonesData instance cache name.\n         * @param disposeData - Whether to dispose data. (Default: true)\n         * @see #parseDragonBonesData()\n         * @see #getDragonBonesData()\n         * @see #addDragonBonesData()\n         * @see dragonBones.DragonBonesData\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 移除 DragonBonesData 实例。\n         * @param name - DragonBonesData 实例缓存名称。\n         * @param disposeData - 是否释放数据。 （默认: true）\n         * @see #parseDragonBonesData()\n         * @see #getDragonBonesData()\n         * @see #addDragonBonesData()\n         * @see dragonBones.DragonBonesData\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        removeDragonBonesData(name: string, disposeData?: boolean): void;\n        /**\n         * - Get a list of specific TextureAtlasData instances.\n         * @param name - The TextureAtlasData cahce name.\n         * @see #parseTextureAtlasData()\n         * @see #addTextureAtlasData()\n         * @see #removeTextureAtlasData()\n         * @see dragonBones.TextureAtlasData\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 获取特定的 TextureAtlasData 实例列表。\n         * @param name - TextureAtlasData 实例缓存名称。\n         * @see #parseTextureAtlasData()\n         * @see #addTextureAtlasData()\n         * @see #removeTextureAtlasData()\n         * @see dragonBones.TextureAtlasData\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getTextureAtlasData(name: string): Array<TextureAtlasData> | null;\n        /**\n         * - Cache a TextureAtlasData instance to the factory.\n         * @param data - The TextureAtlasData instance.\n         * @param name - Specify a cache name for the instance so that the instance can be obtained through this name. (if not set, use the instance name instead)\n         * @see #parseTextureAtlasData()\n         * @see #getTextureAtlasData()\n         * @see #removeTextureAtlasData()\n         * @see dragonBones.TextureAtlasData\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 将 TextureAtlasData 实例缓存到工厂中。\n         * @param data - TextureAtlasData 实例。\n         * @param name - 为该实例指定一个缓存名称，以便可以通过此名称获取该实例。 （如果未设置，则使用该实例中的名称）\n         * @see #parseTextureAtlasData()\n         * @see #getTextureAtlasData()\n         * @see #removeTextureAtlasData()\n         * @see dragonBones.TextureAtlasData\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        addTextureAtlasData(data: TextureAtlasData, name?: string | null): void;\n        /**\n         * - Remove a TextureAtlasData instance.\n         * @param name - The TextureAtlasData instance cache name.\n         * @param disposeData - Whether to dispose data.\n         * @see #parseTextureAtlasData()\n         * @see #getTextureAtlasData()\n         * @see #addTextureAtlasData()\n         * @see dragonBones.TextureAtlasData\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 移除 TextureAtlasData 实例。\n         * @param name - TextureAtlasData 实例的缓存名称。\n         * @param disposeData - 是否释放数据。\n         * @see #parseTextureAtlasData()\n         * @see #getTextureAtlasData()\n         * @see #addTextureAtlasData()\n         * @see dragonBones.TextureAtlasData\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        removeTextureAtlasData(name: string, disposeData?: boolean): void;\n        /**\n         * - Get a specific armature data.\n         * @param name - The armature data name.\n         * @param dragonBonesName - The cached name for DragonbonesData instance.\n         * @see dragonBones.ArmatureData\n         * @version DragonBones 5.1\n         * @language en_US\n         */\n        /**\n         * - 获取特定的骨架数据。\n         * @param name - 骨架数据名称。\n         * @param dragonBonesName - DragonBonesData 实例的缓存名称。\n         * @see dragonBones.ArmatureData\n         * @version DragonBones 5.1\n         * @language zh_CN\n         */\n        getArmatureData(name: string, dragonBonesName?: string): ArmatureData | null;\n        /**\n         * - Clear all cached DragonBonesData instances and TextureAtlasData instances.\n         * @param disposeData - Whether to dispose data.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 清除缓存的所有 DragonBonesData 实例和 TextureAtlasData 实例。\n         * @param disposeData - 是否释放数据。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        clear(disposeData?: boolean): void;\n        /**\n         * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances.\n         * Note that when the created armature that is no longer in use, you need to explicitly dispose {@link #dragonBones.Armature#dispose()}.\n         * @param armatureName - The armature data name.\n         * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature)\n         * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data)\n         * @returns The armature.\n         * @example\n         * <pre>\n         *     let armature = factory.buildArmature(\"armatureName\", \"dragonBonesName\");\n         *     armature.clock = factory.clock;\n         * </pre>\n         * @see dragonBones.DragonBonesData\n         * @see dragonBones.ArmatureData\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架。\n         * 注意，创建的骨架不再使用时，需要显式释放 {@link #dragonBones.Armature#dispose()}。\n         * @param armatureName - 骨架数据名称。\n         * @param dragonBonesName - DragonBonesData 实例的缓存名称。 （如果未设置，将检索所有的 DragonBonesData 实例，当多个 DragonBonesData 实例中包含同名的骨架数据时，可能无法准确的创建出特定的骨架）\n         * @param skinName - 皮肤名称，可以设置一个其他骨架数据名称来共享其皮肤数据。（如果未设置，则使用默认的皮肤数据）\n         * @returns 骨架。\n         * @example\n         * <pre>\n         *     let armature = factory.buildArmature(\"armatureName\", \"dragonBonesName\");\n         *     armature.clock = factory.clock;\n         * </pre>\n         * @see dragonBones.DragonBonesData\n         * @see dragonBones.ArmatureData\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        buildArmature(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string): Armature | null;\n        /**\n         * @private\n         */\n        replaceDisplay(slot: Slot, displayData: DisplayData, displayIndex?: number): void;\n        /**\n         * - Replaces the current display data for a particular slot with a specific display data.\n         * Specify display data with \"dragonBonesName/armatureName/slotName/displayName\".\n         * @param dragonBonesName - The DragonBonesData instance cache name.\n         * @param armatureName - The armature data name.\n         * @param slotName - The slot data name.\n         * @param displayName - The display data name.\n         * @param slot - The slot.\n         * @param displayIndex - The index of the display data that is replaced. (If it is not set, replaces the current display data)\n         * @example\n         * <pre>\n         *     let slot = armature.getSlot(\"weapon\");\n         *     factory.replaceSlotDisplay(\"dragonBonesName\", \"armatureName\", \"slotName\", \"displayName\", slot);\n         * </pre>\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 用特定的显示对象数据替换特定插槽当前的显示对象数据。\n         * 用 \"dragonBonesName/armatureName/slotName/displayName\" 指定显示对象数据。\n         * @param dragonBonesName - DragonBonesData 实例的缓存名称。\n         * @param armatureName - 骨架数据名称。\n         * @param slotName - 插槽数据名称。\n         * @param displayName - 显示对象数据名称。\n         * @param slot - 插槽。\n         * @param displayIndex - 被替换的显示对象数据的索引。 （如果未设置，则替换当前的显示对象数据）\n         * @example\n         * <pre>\n         *     let slot = armature.getSlot(\"weapon\");\n         *     factory.replaceSlotDisplay(\"dragonBonesName\", \"armatureName\", \"slotName\", \"displayName\", slot);\n         * </pre>\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        replaceSlotDisplay(dragonBonesName: string, armatureName: string, slotName: string, displayName: string, slot: Slot, displayIndex?: number): boolean;\n        /**\n         * @private\n         */\n        replaceSlotDisplayList(dragonBonesName: string | null, armatureName: string, slotName: string, slot: Slot): boolean;\n        /**\n         * - Share specific skin data with specific armature.\n         * @param armature - The armature.\n         * @param skin - The skin data.\n         * @param isOverride - Whether it completely override the original skin. (Default: false)\n         * @param exclude - A list of slot names that do not need to be replace.\n         * @example\n         * <pre>\n         *     let armatureA = factory.buildArmature(\"armatureA\", \"dragonBonesA\");\n         *     let armatureDataB = factory.getArmatureData(\"armatureB\", \"dragonBonesB\");\n         *     if (armatureDataB && armatureDataB.defaultSkin) {\n         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, [\"arm_l\", \"weapon_l\"]);\n         *     }\n         * </pre>\n         * @see dragonBones.Armature\n         * @see dragonBones.SkinData\n         * @version DragonBones 5.6\n         * @language en_US\n         */\n        /**\n         * - 将特定的皮肤数据共享给特定的骨架使用。\n         * @param armature - 骨架。\n         * @param skin - 皮肤数据。\n         * @param isOverride - 是否完全覆盖原来的皮肤。 （默认: false）\n         * @param exclude - 不需要被替换的插槽名称列表。\n         * @example\n         * <pre>\n         *     let armatureA = factory.buildArmature(\"armatureA\", \"dragonBonesA\");\n         *     let armatureDataB = factory.getArmatureData(\"armatureB\", \"dragonBonesB\");\n         *     if (armatureDataB && armatureDataB.defaultSkin) {\n         *     factory.replaceSkin(armatureA, armatureDataB.defaultSkin, false, [\"arm_l\", \"weapon_l\"]);\n         *     }\n         * </pre>\n         * @see dragonBones.Armature\n         * @see dragonBones.SkinData\n         * @version DragonBones 5.6\n         * @language zh_CN\n         */\n        replaceSkin(armature: Armature, skin: SkinData, isOverride?: boolean, exclude?: Array<string> | null): boolean;\n        /**\n         * - Replaces the existing animation data for a specific armature with the animation data for the specific armature data.\n         * This enables you to make a armature template so that other armature without animations can share it's animations.\n         * @param armature - The armtaure.\n         * @param armatureData - The armature data.\n         * @param isOverride - Whether to completely overwrite the original animation. (Default: false)\n         * @example\n         * <pre>\n         *     let armatureA = factory.buildArmature(\"armatureA\", \"dragonBonesA\");\n         *     let armatureDataB = factory.getArmatureData(\"armatureB\", \"dragonBonesB\");\n         *     if (armatureDataB) {\n         *     factory.replaceAnimation(armatureA, armatureDataB);\n         *     }\n         * </pre>\n         * @see dragonBones.Armature\n         * @see dragonBones.ArmatureData\n         * @version DragonBones 5.6\n         * @language en_US\n         */\n        /**\n         * - 用特定骨架数据的动画数据替换特定骨架现有的动画数据。\n         * 这样就能实现制作一个骨架动画模板，让其他没有制作动画的骨架共享该动画。\n         * @param armature - 骨架。\n         * @param armatureData - 骨架数据。\n         * @param isOverride - 是否完全覆盖原来的动画。（默认: false）\n         * @example\n         * <pre>\n         *     let armatureA = factory.buildArmature(\"armatureA\", \"dragonBonesA\");\n         *     let armatureDataB = factory.getArmatureData(\"armatureB\", \"dragonBonesB\");\n         *     if (armatureDataB) {\n         *     factory.replaceAnimation(armatureA, armatureDataB);\n         *     }\n         * </pre>\n         * @see dragonBones.Armature\n         * @see dragonBones.ArmatureData\n         * @version DragonBones 5.6\n         * @language zh_CN\n         */\n        replaceAnimation(armature: Armature, armatureData: ArmatureData, isOverride?: boolean): boolean;\n        /**\n         * @private\n         */\n        getAllDragonBonesData(): Map<DragonBonesData>;\n        /**\n         * @private\n         */\n        getAllTextureAtlasData(): Map<Array<TextureAtlasData>>;\n        /**\n         * - An Worldclock instance updated by engine.\n         * @version DragonBones 5.7\n         * @language en_US\n         */\n        /**\n         * - 由引擎驱动的 WorldClock 实例。\n         * @version DragonBones 5.7\n         * @language zh_CN\n         */\n        readonly clock: WorldClock;\n        /**\n         * @private\n         */\n        readonly dragonBones: DragonBones;\n        /**\n         * - Deprecated, please refer to {@link #replaceSkin}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #replaceSkin}。\n         * @deprecated\n         * @language zh_CN\n         */\n        changeSkin(armature: Armature, skin: SkinData, exclude?: Array<string> | null): boolean;\n        /**\n         * - Deprecated, please refer to {@link #replaceAnimation}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #replaceAnimation}。\n         * @deprecated\n         * @language zh_CN\n         */\n        copyAnimationsToArmature(toArmature: Armature, fromArmatreName: string, fromSkinName?: string, fromDragonBonesDataName?: string, replaceOriginalAnimation?: boolean): boolean;\n    }\n    /**\n     * @internal\n     */\n    class BuildArmaturePackage {\n        dataName: string;\n        textureAtlasName: string;\n        data: DragonBonesData;\n        armature: ArmatureData;\n        skin: SkinData | null;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The egret texture atlas data.\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - Egret 贴图集数据。\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class EgretTextureAtlasData extends TextureAtlasData {\n        static toString(): string;\n        /**\n         * @internal\n         */\n        disposeEnabled: boolean;\n        private _renderTexture;\n        protected _onClear(): void;\n        /**\n         * @inheritDoc\n         */\n        createTexture(): TextureData;\n        /**\n         * - The Egret texture.\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - Egret 贴图。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        renderTexture: egret.Texture | null;\n        /**\n         * - Deprecated, please refer to {@link dragonBones.BaseFactory#removeTextureAtlasData()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link dragonBones.BaseFactory#removeTextureAtlasData()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        dispose(): void;\n        /**\n         * - Deprecated, please refer to {@link #renderTexture}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #renderTexture}。\n         * @deprecated\n         * @language zh_CN\n         */\n        readonly texture: egret.Texture | null;\n    }\n    /**\n     * @internal\n     */\n    class EgretTextureData extends TextureData {\n        static toString(): string;\n        renderTexture: egret.Texture | null;\n        protected _onClear(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The egret event.\n     * @version DragonBones 4.5\n     * @language en_US\n     */\n    /**\n     * - Egret 事件。\n     * @version DragonBones 4.5\n     * @language zh_CN\n     */\n    class EgretEvent extends egret.Event {\n        /**\n         * - The event object.\n         * @see dragonBones.EventObject\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 事件对象。\n         * @see dragonBones.EventObject\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        readonly eventObject: EventObject;\n        /**\n         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#animationState}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #eventObject} {@link #dragonBones.EventObject#animationState}。\n         * @deprecated\n         * @language zh_CN\n         */\n        readonly animationName: string;\n        /**\n         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#armature}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #eventObject} {@link #dragonBones.EventObject#armature}。\n         * @deprecated\n         * @language zh_CN\n         */\n        readonly armature: Armature;\n        /**\n         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#bone}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #eventObject} {@link #dragonBones.EventObject#bone}。\n         * @deprecated\n         * @language zh_CN\n         */\n        readonly bone: Bone | null;\n        /**\n         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#slot}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #eventObject} {@link #dragonBones.EventObject#slot}。\n         * @deprecated\n         * @language zh_CN\n         */\n        readonly slot: Slot | null;\n        /**\n         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#animationState}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #eventObject} {@link #dragonBones.EventObject#animationState}。\n         * @deprecated\n         * @language zh_CN\n         */\n        readonly animationState: AnimationState | null;\n        /**\n         * Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#name}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #eventObject} {@link #dragonBones.EventObject#name}。\n         * @deprecated\n         * @language zh_CN\n         */\n        readonly frameLabel: string;\n        /**\n         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#name}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #eventObject} {@link #dragonBones.EventObject#name}。\n         * @deprecated\n         * @language zh_CN\n         */\n        readonly sound: string;\n        /**\n         * - Deprecated, please refer to {@link #eventObject} {@link #dragonBones.EventObject#animationState}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #eventObject} {@link #dragonBones.EventObject#animationState}。\n         * @deprecated\n         * @language zh_CN\n         */\n        readonly movementID: string;\n        /**\n         * - Deprecated, please refer to {@link #dragonBones.EventObject.START}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #dragonBones.EventObject.START}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static START: string;\n        /**\n         * - Deprecated, please refer to {@link #dragonBones.EventObject.LOOP_COMPLETE}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #dragonBones.EventObject.LOOP_COMPLETE}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static LOOP_COMPLETE: string;\n        /**\n         * - Deprecated, please refer to {@link #dragonBones.EventObject.COMPLETE}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #dragonBones.EventObject.COMPLETE}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static COMPLETE: string;\n        /**\n         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_IN}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #dragonBones.EventObject.FADE_IN}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static FADE_IN: string;\n        /**\n         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_IN_COMPLETE}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #dragonBones.EventObject.FADE_IN_COMPLETE}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static FADE_IN_COMPLETE: string;\n        /**\n         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_OUT}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #dragonBones.EventObject.FADE_OUT}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static FADE_OUT: string;\n        /**\n         * - Deprecated, please refer to {@link #dragonBones.EventObject.FADE_OUT_COMPLETE}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #dragonBones.EventObject.FADE_OUT_COMPLETE}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static FADE_OUT_COMPLETE: string;\n        /**\n         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static FRAME_EVENT: string;\n        /**\n         * - Deprecated, please refer to {@link #dragonBones.EventObject.SOUND_EVENT}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #dragonBones.EventObject.SOUND_EVENT}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static SOUND_EVENT: string;\n        /**\n         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static ANIMATION_FRAME_EVENT: string;\n        /**\n         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static BONE_FRAME_EVENT: string;\n        /**\n         * - Deprecated, please refer to {@link #dragonBones.EventObject.FRAME_EVENT}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #dragonBones.EventObject.FRAME_EVENT}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static MOVEMENT_FRAME_EVENT: string;\n        /**\n         * - Deprecated, please refer to {@link #dragonBones.EventObject.SOUND_EVENT}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #dragonBones.EventObject.SOUND_EVENT}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static SOUND: string;\n    }\n    /**\n     * @inheritDoc\n     */\n    class EgretArmatureDisplay extends egret.DisplayObjectContainer implements IArmatureProxy {\n        private static _cleanBeforeRender();\n        /**\n         * @private\n         */\n        debugDraw: boolean;\n        /**\n         * @internal\n         */\n        _batchEnabled: boolean;\n        /**\n         * @internal\n         */\n        _childDirty: boolean;\n        private _debugDraw;\n        private _armature;\n        private _bounds;\n        private _debugDrawer;\n        /**\n         * @inheritDoc\n         */\n        dbInit(armature: Armature): void;\n        /**\n         * @inheritDoc\n         */\n        dbClear(): void;\n        /**\n         * @inheritDoc\n         */\n        dbUpdate(): void;\n        /**\n         * @inheritDoc\n         */\n        dispose(disposeProxy?: boolean): void;\n        /**\n         * @inheritDoc\n         */\n        dispatchDBEvent(type: EventStringType, eventObject: EventObject): void;\n        /**\n         * @inheritDoc\n         */\n        hasDBEventListener(type: EventStringType): boolean;\n        /**\n         * @inheritDoc\n         */\n        addDBEventListener(type: EventStringType, listener: (event: EgretEvent) => void, target: any): void;\n        /**\n         * @inheritDoc\n         */\n        removeDBEventListener(type: EventStringType, listener: (event: EgretEvent) => void, target: any): void;\n        /**\n         * - Disable the batch.\n         * Batch rendering for performance reasons, the boundary properties of the render object are not updated.\n         * This will not correctly obtain the wide-height properties of the rendered object and the transformation properties of its internal display objects,\n         * which can turn off batch rendering if you need to use these properties.\n         * @version DragonBones 5.1\n         * @language en_US\n         */\n        /**\n         * - 关闭批次渲染。\n         * 批次渲染出于性能考虑，不会更新渲染对象的边界属性。\n         * 这样将无法正确获得渲染对象的宽高属性以及其内部显示对象的变换属性，如果需要使用这些属性，可以关闭批次渲染。\n         * @version DragonBones 5.1\n         * @language zh_CN\n         */\n        disableBatch(): void;\n        /**\n         * @inheritDoc\n         */\n        readonly armature: Armature;\n        /**\n         * @inheritDoc\n         */\n        readonly animation: Animation;\n        /**\n         * @inheritDoc\n         */\n        $measureContentBounds(bounds: egret.Rectangle): void;\n        /**\n         * @inheritDoc\n         */\n        hasEvent(type: EventStringType): boolean;\n        /**\n         * @inheritDoc\n         */\n        addEvent(type: EventStringType, listener: (event: EgretEvent) => void, target: any): void;\n        /**\n         * @inheritDoc\n         */\n        removeEvent(type: EventStringType, listener: (event: EgretEvent) => void, target: any): void;\n        /**\n         * - Deprecated, please refer to {@link dragonBones.Armature#clock} {@link dragonBones.BaseFactory#clock}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link dragonBones.Armature#clock} {@link dragonBones.BaseFactory#clock}。\n         * @deprecated\n         * @language zh_CN\n         */\n        advanceTimeBySelf(on: boolean): void;\n    }\n    /**\n     * 已废弃，请参考 {@link dragonBones.Armature}。\n     * @deprecated\n     * @language zh_CN\n     */\n    type FastArmature = Armature;\n    /**\n     * 已废弃，请参考 {@link dragonBones.Bone}。\n     * @deprecated\n     * @language zh_CN\n     */\n    type FastBone = Bone;\n    /**\n     * 已废弃，请参考 {@link dragonBones.Slot}。\n     * @deprecated\n     * @language zh_CN\n     */\n    type FastSlot = Slot;\n    /**\n     * 已废弃，请参考 {@link dragonBones.Animation}。\n     * @deprecated\n     * @language zh_CN\n     */\n    type FastAnimation = Animation;\n    /**\n     * 已废弃，请参考 {@link dragonBones.AnimationState}。\n     * @deprecated\n     * @language zh_CN\n     */\n    type FastAnimationState = AnimationState;\n    /**\n     * 已废弃，请参考 {@link dragonBones.EgretEvent}。\n     * @deprecated\n     * @language zh_CN\n     */\n    class Event extends EgretEvent {\n    }\n    /**\n     * 已废弃，请参考 {@link dragonBones.EgretEvent}。\n     * @deprecated\n     * @language zh_CN\n     */\n    class ArmatureEvent extends EgretEvent {\n    }\n    /**\n     * 已废弃，请参考 {@link dragonBones.EgretEvent}。\n     * @deprecated\n     * @language zh_CN\n     */\n    class AnimationEvent extends EgretEvent {\n    }\n    /**\n     * 已废弃，请参考 {@link dragonBones.EgretEvent}。\n     * @deprecated\n     * @language zh_CN\n     */\n    class FrameEvent extends EgretEvent {\n    }\n    /**\n     * 已废弃，请参考 {@link dragonBones.EgretEvent}。\n     * @deprecated\n     * @language zh_CN\n     */\n    class SoundEvent extends EgretEvent {\n    }\n    /**\n     * 已废弃，请参考 {@link dragonBones.BaseFacory#parseTextureAtlasData()}。\n     * @deprecated\n     * @language zh_CN\n     */\n    class EgretTextureAtlas extends EgretTextureAtlasData {\n        static toString(): string;\n        /**\n         * 已废弃，请参考 {@link dragonBones.BaseFacory#parseTextureAtlasData()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        constructor(texture: egret.Texture, rawData: any, scale?: number);\n    }\n    /**\n     * 已废弃，请参考 {@link dragonBones.BaseFacory#parseTextureAtlasData()}。\n     * @deprecated\n     * @language zh_CN\n     */\n    class EgretSheetAtlas extends EgretTextureAtlas {\n    }\n    /**\n     * 已废弃，请参考 {@link dragonBones.EgretFactory#soundEventManager}。\n     * @deprecated\n     * @language zh_CN\n     */\n    class SoundEventManager {\n        /**\n         * 已废弃，请参考 {@link dragonBones.EgretFactory#soundEventManager}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static getInstance(): EgretArmatureDisplay;\n    }\n    /**\n     * 已废弃，请参考 {@link dragonBones.Armature#cacheFrameRate}。\n     * @deprecated\n     * @language zh_CN\n     */\n    class AnimationCacheManager {\n        /**\n         * 已废弃，请参考 {@link dragonBones.Armature#cacheFrameRate}。\n         * @deprecated\n         * @language zh_CN\n         */\n        constructor();\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * - The egret slot.\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - Egret 插槽。\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class EgretSlot extends Slot {\n        static toString(): string;\n        /**\n         * - Whether to update the transform properties of the display object.\n         * For better performance, the transform properties of display object (x, y, rotation, ScaleX, ScaleX) are not updated and need to be set to true if these properties need to be accessed correctly.\n         * @default false\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        /**\n         * - 是否更新显示对象的变换属性。\n         * 为了更好的性能, 默认并不会更新显示对象的变换属性 (x, y, rotation, scaleX, scaleX), 如果需要正确访问这些属性, 则需要设置为 true 。\n         * @default false\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        transformUpdateEnabled: boolean;\n        private _armatureDisplay;\n        private _renderDisplay;\n        private _colorFilter;\n        /**\n         * @inheritDoc\n         */\n        init(slotData: SlotData, armatureValue: Armature, rawDisplay: any, meshDisplay: any): void;\n        protected _onClear(): void;\n        protected _initDisplay(value: any, isRetain: boolean): void;\n        protected _disposeDisplay(value: any, isRelease: boolean): void;\n        protected _onUpdateDisplay(): void;\n        protected _addDisplay(): void;\n        protected _replaceDisplay(value: any): void;\n        protected _removeDisplay(): void;\n        protected _updateZOrder(): void;\n        /**\n         * @internal\n         */\n        _updateVisible(): void;\n        protected _updateBlendMode(): void;\n        protected _updateColor(): void;\n        protected _updateFrame(): void;\n        protected _updateMesh(): void;\n        /**\n         * @internal\n         */\n        _updateGlueMesh(): void;\n        protected _updateTransform(): void;\n        protected _identityTransform(): void;\n        private _updateTransformV4();\n        private _updateTransformV5();\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare namespace dragonBones {\n    /**\n     * @internal\n     */\n    const isV5: boolean;\n    /**\n     * - The Egret factory.\n     * @version DragonBones 3.0\n     * @language en_US\n     */\n    /**\n     * - Egret 工厂。\n     * @version DragonBones 3.0\n     * @language zh_CN\n     */\n    class EgretFactory extends BaseFactory {\n        private static _time;\n        private static _dragonBonesInstance;\n        private static _factory;\n        private static _clockHandler(time);\n        /**\n         * - A global factory instance that can be used directly.\n         * @version DragonBones 4.7\n         * @language en_US\n         */\n        /**\n         * - 一个可以直接使用的全局工厂实例。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        static readonly factory: EgretFactory;\n        /**\n         * @inheritDoc\n         */\n        constructor(dataParser?: DataParser | null);\n        protected _isSupportMesh(): boolean;\n        protected _buildTextureAtlasData(textureAtlasData: EgretTextureAtlasData | null, textureAtlas: egret.Texture | HTMLImageElement | null): EgretTextureAtlasData;\n        protected _buildArmature(dataPackage: BuildArmaturePackage): Armature;\n        protected _buildSlot(dataPackage: BuildArmaturePackage, slotData: SlotData, armature: Armature): Slot;\n        /**\n         * - Create a armature from cached DragonBonesData instances and TextureAtlasData instances, then use the {@link #clock} to update it.\n         * Note that when the created armature proxy that is no longer in use, you need to explicitly dispose {@link #dragonBones.IArmatureProxy#dispose()}.\n         * The difference is that the armature created by {@link #buildArmature} is not WorldClock instance update.\n         * @param armatureName - The armature data name.\n         * @param dragonBonesName - The cached name of the DragonBonesData instance. (If not set, all DragonBonesData instances are retrieved, and when multiple DragonBonesData instances contain a the same name armature data, it may not be possible to accurately create a specific armature)\n         * @param skinName - The skin name, you can set a different ArmatureData name to share it's skin data. (If not set, use the default skin data)\n         * @returns The armature display container.\n         * @see dragonBones.IArmatureProxy\n         * @see dragonBones.BaseFactory#buildArmature\n         * @version DragonBones 4.5\n         * @example\n         * <pre>\n         *     let armatureDisplay = factory.buildArmatureDisplay(\"armatureName\", \"dragonBonesName\");\n         * </pre>\n         * @language en_US\n         */\n        /**\n         * - 通过缓存的 DragonBonesData 实例和 TextureAtlasData 实例创建一个骨架，并用 {@link #clock} 更新该骨架。\n         * 区别在于由 {@link #buildArmature} 创建的骨架没有 WorldClock 实例驱动。\n         * 注意，创建的骨架代理不再使用时，需要显式释放 {@link #dragonBones.IArmatureProxy#dispose()}。\n         * @param armatureName - 骨架数据名称。\n         * @param dragonBonesName - DragonBonesData 实例的缓存名称。 （如果未设置，将检索所有的 DragonBonesData 实例，当多个 DragonBonesData 实例中包含同名的骨架数据时，可能无法准确的创建出特定的骨架）\n         * @param skinName - 皮肤名称，可以设置一个其他骨架数据名称来共享其皮肤数据。（如果未设置，则使用默认的皮肤数据）\n         * @returns 骨架的显示容器。\n         * @see dragonBones.IArmatureProxy\n         * @see dragonBones.BaseFactory#buildArmature\n         * @version DragonBones 4.5\n         * @example\n         * <pre>\n         *     let armatureDisplay = factory.buildArmatureDisplay(\"armatureName\", \"dragonBonesName\");\n         * </pre>\n         * @language zh_CN\n         */\n        buildArmatureDisplay(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string): EgretArmatureDisplay | null;\n        /**\n         * - Create the display object with the specified texture.\n         * @param textureName - The texture data name.\n         * @param textureAtlasName - The texture atlas data name. (Of not set, all texture atlas data will be searched)\n         * @version DragonBones 3.0\n         * @language en_US\n         */\n        /**\n         * - 创建带有指定贴图的显示对象。\n         * @param textureName - 贴图数据名称。\n         * @param textureAtlasName - 贴图集数据名称。 （如果未设置，将检索所有的贴图集数据）\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        getTextureDisplay(textureName: string, textureAtlasName?: string | null): egret.Bitmap | null;\n        /**\n         * - A global sound event manager.\n         * Sound events can be listened to uniformly from the manager.\n         * @version DragonBones 4.5\n         * @language en_US\n         */\n        /**\n         * - 全局声音事件管理器。\n         * 声音事件可以从该管理器统一侦听。\n         * @version DragonBones 4.5\n         * @language zh_CN\n         */\n        readonly soundEventManager: EgretArmatureDisplay;\n        /**\n         * - Deprecated, please refer to {@link #clock}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #clock}。\n         * @deprecated\n         * @language zh_CN\n         */\n        static readonly clock: WorldClock;\n        /**\n         * - Deprecated, please refer to {@link #addDragonBonesData()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #addDragonBonesData()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        addSkeletonData(dragonBonesData: DragonBonesData, dragonBonesName?: string | null): void;\n        /**\n         * - Deprecated, please refer to {@link #getDragonBonesData()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #getDragonBonesData()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        getSkeletonData(dragonBonesName: string): DragonBonesData | null;\n        /**\n         * - Deprecated, please refer to {@link #removeDragonBonesData()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #removeDragonBonesData()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        removeSkeletonData(dragonBonesName: string): void;\n        /**\n         * - Deprecated, please refer to {@link #addTextureAtlasData()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #addTextureAtlasData()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        addTextureAtlas(textureAtlasData: TextureAtlasData, dragonBonesName?: string | null): void;\n        /**\n         * - Deprecated, please refer to {@link #getTextureAtlas()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #getTextureAtlas()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        getTextureAtlas(dragonBonesName: string): TextureAtlasData[] | null;\n        /**\n         * - Deprecated, please refer to {@link #removeTextureAtlasData()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #removeTextureAtlasData()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        removeTextureAtlas(dragonBonesName: string): void;\n        /**\n         * - Deprecated, please refer to {@link #buildArmature()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #buildArmature()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        buildFastArmature(armatureName: string, dragonBonesName?: string, skinName?: string): FastArmature | null;\n        /**\n         * - Deprecated, please refer to {@link #clear()}.\n         * @deprecated\n         * @language en_US\n         */\n        /**\n         * - 已废弃，请参考 {@link #clear()}。\n         * @deprecated\n         * @language zh_CN\n         */\n        dispose(): void;\n    }\n}\n/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2012-2018 DragonBones team and other contributors\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\ndeclare const _super: any;\ndeclare namespace dragonBones {\n    /**\n     * 是否包含指定名称的动画组。\n     * @param groupName 动画组的名称。\n     * @version DragonBones 4.7\n     * @language zh_CN\n     */\n    function hasMovieGroup(groupName: string): boolean;\n    /**\n     * 添加动画组。\n     * @param groupData 动画二进制数据。\n     * @param textureAtlas 贴图集或贴图集列表。\n     * @param groupName 为动画组指定一个名称，如果未设置，则使用数据中的名称。\n     * @version DragonBones 4.7\n     * @language zh_CN\n     */\n    function addMovieGroup(groupData: ArrayBuffer, textureAtlas: egret.Texture | egret.Texture[], groupName?: string | null): void;\n    /**\n     * 移除动画组。\n     * @param groupName 动画组的名称。\n     * @version DragonBones 4.7\n     * @language zh_CN\n     */\n    function removeMovieGroup(groupName: string): void;\n    /**\n     * 移除所有的动画组。\n     * @param groupName 动画组的名称。\n     * @version DragonBones 4.7\n     * @language zh_CN\n     */\n    function removeAllMovieGroup(): void;\n    /**\n     * 创建一个动画。\n     * @param movieName 动画的名称。\n     * @param groupName 动画组的名称，如果未设置，将检索所有的动画组，当多个动画组中包含同名的动画时，可能无法创建出准确的动画。\n     * @version DragonBones 4.7\n     * @language zh_CN\n     */\n    function buildMovie(movieName: string, groupName?: string | null): Movie | null;\n    /**\n     * 获取指定动画组内包含的所有动画名称。\n     * @param groupName 动画组的名称。\n     * @version DragonBones 4.7\n     * @language zh_CN\n     */\n    function getMovieNames(groupName: string): string[] | null;\n    /**\n     * 动画事件。\n     * @version DragonBones 4.7\n     * @language zh_CN\n     */\n    class MovieEvent extends egret.Event {\n        /**\n         * 动画剪辑开始播放。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        static START: string;\n        /**\n         * 动画剪辑循环播放一次完成。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        static LOOP_COMPLETE: string;\n        /**\n         * 动画剪辑播放完成。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        static COMPLETE: string;\n        /**\n         * 动画剪辑帧事件。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        static FRAME_EVENT: string;\n        /**\n         * 动画剪辑声音事件。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        static SOUND_EVENT: string;\n        /**\n         * 事件名称。 (帧标签的名称或声音的名称)\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * 发出事件的插槽名称。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        slotName: string;\n        /**\n         * 发出事件的动画剪辑名称。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        clipName: string;\n        /**\n         * 发出事件的动画。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        movie: Movie;\n        /**\n         * @private\n         */\n        constructor(type: string);\n        /**\n         * @private\n         */\n        readonly armature: any;\n        /**\n         * @private\n         */\n        readonly bone: any;\n        /**\n         * @private\n         */\n        readonly animationState: any;\n        /**\n         * @private\n         */\n        readonly frameLabel: any;\n        /**\n         * @private\n         */\n        readonly movementID: any;\n    }\n    /**\n     * 通过读取缓存的二进制动画数据来更新动画，具有良好的运行性能，同时对内存的占用也非常低。\n     * @see dragonBones.buildMovie\n     * @version DragonBones 4.7\n     * @language zh_CN\n     */\n    class Movie extends egret.DisplayObjectContainer implements IAnimatable {\n        private static _cleanBeforeRender();\n        /**\n         * 动画的播放速度。 [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放]\n         * @default 1\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        timeScale: number;\n        /**\n         * 动画剪辑的播放速度。 [(-N~0): 倒转播放, 0: 停止播放, (0~1): 慢速播放, 1: 正常播放, (1~N): 快速播放]\n         * （当再次播放其他动画剪辑时，此值将被重置为 1）\n         * @default 1\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        clipTimeScale: number;\n        private _batchEnabled;\n        private _isLockDispose;\n        private _isDelayDispose;\n        private _isStarted;\n        private _isPlaying;\n        private _isReversing;\n        private _isCompleted;\n        private _playTimes;\n        private _time;\n        private _currentTime;\n        private _currentPlayTimes;\n        private _cacheFrameIndex;\n        private _frameSize;\n        private _cacheRectangle;\n        private _clock;\n        private _groupConfig;\n        private _config;\n        private _clipConfig;\n        private _currentFrameConfig;\n        private _clipArray;\n        private _clipNames;\n        private _slots;\n        private _childMovies;\n        constructor(createMovieHelper: any);\n        private _configToEvent(config, event);\n        private _onCrossFrame(frameConfig);\n        private _updateSlotBlendMode(slot);\n        private _updateSlotColor(slot, aM, rM, gM, bM, aO, rO, gO, bO);\n        private _updateSlotDisplay(slot);\n        private _getSlot(name);\n        /**\n         * @inheritDoc\n         */\n        $render(): void;\n        /**\n         * @inheritDoc\n         */\n        $updateRenderNode(): void;\n        /**\n         * @inheritDoc\n         */\n        $measureContentBounds(bounds: egret.Rectangle): void;\n        /**\n         * @inheritDoc\n         */\n        $doAddChild(child: egret.DisplayObject, index: number, notifyListeners?: boolean): egret.DisplayObject;\n        /**\n         * @inheritDoc\n         */\n        $doRemoveChild(index: number, notifyListeners?: boolean): egret.DisplayObject;\n        /**\n         * 释放动画。\n         * @version DragonBones 3.0\n         * @language zh_CN\n         */\n        dispose(): void;\n        /**\n         * @inheritDoc\n         */\n        advanceTime(passedTime: number): void;\n        /**\n         * 播放动画剪辑。\n         * @param clipName 动画剪辑的名称，如果未设置，则播放默认动画剪辑，或将暂停状态切换为播放状态，或重新播放上一个正在播放的动画剪辑。\n         * @param playTimes 动画剪辑需要播放的次数。 [-1: 使用动画剪辑默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次]\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        play(clipName?: string | null, playTimes?: number): void;\n        /**\n         * 暂停播放动画。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        stop(): void;\n        /**\n         * 从指定时间播放动画。\n         * @param clipName 动画剪辑的名称。\n         * @param time 指定时间。（以秒为单位）\n         * @param playTimes 动画剪辑需要播放的次数。 [-1: 使用动画剪辑默认值, 0: 无限循环播放, [1~N]: 循环播放 N 次]\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        gotoAndPlay(clipName: string | null | undefined, time: number, playTimes?: number): void;\n        /**\n         * 将动画停止到指定时间。\n         * @param clipName 动画剪辑的名称。\n         * @param time 指定时间。（以秒为单位）\n         * @version DragonBones 5.0\n         * @language zh_CN\n         */\n        gotoAndStop(clipName: string | null | undefined, time: number): void;\n        /**\n         * 是否包含指定动画剪辑。\n         * @param clipName 动画剪辑的名称。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        hasClip(clipName: string): boolean;\n        /**\n         * 动画剪辑是否处正在播放。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        readonly isPlaying: boolean;\n        /**\n         * 动画剪辑是否均播放完毕。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        readonly isComplete: boolean;\n        /**\n         * 当前动画剪辑的播放时间。 (以秒为单位)\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        readonly currentTime: number;\n        /**\n         * 当前动画剪辑的总时间。 (以秒为单位)\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        readonly totalTime: number;\n        /**\n         * 当前动画剪辑的播放次数。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        readonly currentPlayTimes: number;\n        /**\n         * 当前动画剪辑需要播放的次数。 [0: 无限循环播放, [1~N]: 循环播放 N 次]\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        readonly playTimes: number;\n        readonly groupName: string;\n        /**\n         * 正在播放的动画剪辑名称。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        readonly clipName: string;\n        /**\n         * 所有动画剪辑的名称。\n         * @version DragonBones 4.7\n         * @language zh_CN\n         */\n        readonly clipNames: string[];\n        /**\n         * @inheritDoc\n         */\n        clock: WorldClock | null;\n        /**\n         * 已废弃，请参考 {@link dragonBones.Movie#clock} {@link dragonBones.Movie#clock} {@link dragonBones.EgretFactory#clock}。\n         * @deprecated\n         * @language zh_CN\n         */\n        advanceTimeBySelf(on: boolean): void;\n        /**\n         * @private\n         */\n        readonly display: any;\n        /**\n         * @private\n         */\n        readonly animation: any;\n        /**\n         * @private\n         */\n        readonly armature: any;\n        /**\n         * @private\n         */\n        getAnimation(): any;\n        /**\n         * @private\n         */\n        getArmature(): any;\n        /**\n         * @private\n         */\n        getDisplay(): any;\n        /**\n         * @private\n         */\n        hasAnimation(name: string): boolean;\n        /**\n         * @private\n         */\n        invalidUpdate(...args: any[]): void;\n        /**\n         * @private\n         */\n        readonly lastAnimationName: string;\n        /**\n         * @private\n         */\n        readonly animationNames: string[];\n        /**\n         * @private\n         */\n        readonly animationList: string[];\n    }\n}\n"
  },
  {
    "path": "source/lib/egret.d.ts",
    "content": "declare var global: any;\ndeclare var __global: any;\ndeclare let __define: any;\ndeclare namespace egret {\n    type Nullable<T> = T | null;\n    /**\n     * The HashObject class is the base class for all objects in the Egret framework.The HashObject\n     * class includes a hashCode property, which is a unique identification number of the instance.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * Egret顶级对象。框架内所有对象的基类，为对象实例提供唯一的hashCode值。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface IHashObject {\n        /**\n         * a unique identification number assigned to this instance.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language en_US\n         */\n        /**\n         * 返回此对象唯一的哈希值,用于唯一确定一个对象。hashCode为大于等于1的整数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language zh_CN\n         */\n        hashCode: number;\n    }\n    /**\n     * @private\n     * 哈希计数\n     */\n    let $hashCount: number;\n    /**\n     * The HashObject class is the base class for all objects in the Egret framework.The HashObject\n     * class includes a hashCode property, which is a unique identification number of the instance.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * Egret顶级对象。框架内所有对象的基类，为对象实例提供唯一的hashCode值。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class HashObject implements IHashObject {\n        /**\n         * Initializes a HashObject\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 HashObject 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        /**\n         * @private\n         */\n        $hashCode: number;\n        /**\n         * a unique identification number assigned to this instance.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回此对象唯一的哈希值,用于唯一确定一个对象。hashCode为大于等于1的整数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly hashCode: number;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The EventDispatcher class is the base class for all classes that dispatchEvent events. The EventDispatcher class implements\n     * the IEventDispatcher interface and is the base class for the DisplayObject class. The EventDispatcher class allows\n     * any object on the display list to be an event target and as such, to use the methods of the IEventDispatcher interface.\n     * Event targets are an important part of the Egret event model. The event target serves as the focal point for how events\n     * flow through the display list hierarchy. When an event such as a touch tap, Egret dispatches an event object into the\n     * event flow from the root of the display list. The event object then makes its way through the display list until it\n     * reaches the event target, at which point it begins its return trip through the display list. This round-trip journey\n     * to the event target is conceptually divided into three phases: <br/>\n     * the capture phase comprises the journey from the root to the last node before the event target's node, the target\n     * phase comprises only the event target node, and the bubbling phase comprises any subsequent nodes encountered on\n     * the return trip to the root of the display list. In general, the easiest way for a user-defined class to gain event\n     * dispatching capabilities is to extend EventDispatcher. If this is impossible (that is, if the class is already extending\n     * another class), you can instead implement the IEventDispatcher interface, create an EventDispatcher member, and write simple\n     * hooks to route calls into the aggregated EventDispatcher.\n     * @see egret.IEventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/EventDispatcher.ts\n     * @language en_US\n     */\n    /**\n     * EventDispatcher 是 Egret 的事件派发器类，负责进行事件的发送和侦听。\n     * 事件目标是事件如何通过显示列表层次结构这一问题的焦点。当发生鼠标单击、触摸或按键等事件时，\n     * 框架会将事件对象调度到从显示列表根开始的事件流中。然后该事件对象在显示列表中前进，直到到达事件目标，\n     * 然后从这一点开始其在显示列表中的回程。在概念上，到事件目标的此往返行程被划分为三个阶段：\n     * 捕获阶段包括从根到事件目标节点之前的最后一个节点的行程，目标阶段仅包括事件目标节点，冒泡阶段包括回程上遇到的任何后续节点到显示列表的根。\n     * 通常，使用户定义的类能够调度事件的最简单方法是扩展 EventDispatcher。如果无法扩展（即，如果该类已经扩展了另一个类），则可以实现\n     * IEventDispatcher 接口，创建 EventDispatcher 成员，并编写一些简单的映射，将调用连接到聚合的 EventDispatcher 中。\n     * @see egret.IEventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/EventDispatcher.ts\n     * @language zh_CN\n     */\n    class EventDispatcher extends HashObject implements IEventDispatcher {\n        /**\n         * create an instance of the EventDispatcher class.\n         * @param target The target object for events dispatched to the EventDispatcher object. This parameter is used when\n         * the EventDispatcher instance is aggregated by a class that implements IEventDispatcher; it is necessary so that the\n         * containing object can be the target for events. Do not use this parameter in simple cases in which a class extends EventDispatcher.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 EventDispatcher 类的实例\n         * @param target 此 EventDispatcher 所抛出事件对象的 target 指向。此参数主要用于一个实现了 IEventDispatcher 接口的自定义类，\n         * 以便抛出的事件对象的 target 属性可以指向自定义类自身。请勿在直接继承 EventDispatcher 的情况下使用此参数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(target?: IEventDispatcher);\n        /**\n         * @private\n         */\n        $EventDispatcher: Object;\n        /**\n         * @private\n         *\n         * @param useCapture\n         */\n        $getEventMap(useCapture?: boolean): any;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): void;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        once(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): void;\n        /**\n         * @private\n         */\n        $addListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number, dispatchOnce?: boolean): void;\n        $insertEventBin(list: any[], type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number, dispatchOnce?: boolean): boolean;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        removeEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean): void;\n        $removeEventBin(list: any[], listener: Function, thisObject: any): boolean;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        hasEventListener(type: string): boolean;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        willTrigger(type: string): boolean;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        dispatchEvent(event: Event): boolean;\n        /**\n         * @private\n         */\n        $notifyListener(event: Event, capturePhase: boolean): boolean;\n        /**\n         * Distribute a specified event parameters.\n         * @param type The type of the event. Event listeners can access this information through the inherited type property.\n         * @param bubbles Determines whether the Event object bubbles. Event listeners can access this information through\n         * the inherited bubbles property.\n         * @param data {any} data\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 派发一个指定参数的事件。\n         * @param type {string} 事件类型\n         * @param bubbles {boolean} 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param data {any} 事件data\n         * @param cancelable {boolean} 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        dispatchEventWith(type: string, bubbles?: boolean, data?: any, cancelable?: boolean): boolean;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 事件信息对象\n     */\n    interface EventBin {\n        type: string;\n        /**\n         * @private\n         */\n        listener: Function;\n        /**\n         * @private\n         */\n        thisObject: any;\n        /**\n         * @private\n         */\n        priority: number;\n        /**\n         * @private\n         */\n        target: IEventDispatcher;\n        /**\n         * @private\n         */\n        useCapture: boolean;\n        /**\n         * @private\n         */\n        dispatchOnce: boolean;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    class Filter extends HashObject {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        type: string;\n        /**\n         * @private\n         */\n        $id: number;\n        /**\n         * @private\n         */\n        $uniforms: any;\n        /**\n         * @private\n         */\n        protected paddingTop: number;\n        /**\n         * @private\n         */\n        protected paddingBottom: number;\n        /**\n         * @private\n         */\n        protected paddingLeft: number;\n        /**\n         * @private\n         */\n        protected paddingRight: number;\n        /**\n         * @private\n         * @native Render\n         */\n        $obj: any;\n        constructor();\n        /**\n         * @private\n         */\n        $toJson(): string;\n        protected updatePadding(): void;\n        onPropertyChange(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    const enum RenderMode {\n        NONE = 1,\n        FILTER = 2,\n        CLIP = 3,\n        SCROLLRECT = 4,\n    }\n    /**\n     * The DisplayObject class is the base class for all objects that can be placed on the display list. The display list\n     * manages all objects displayed in the runtime. Use the DisplayObjectContainer class to arrange the display\n     * objects in the display list. DisplayObjectContainer objects can have child display objects, while other display objects,\n     * such as Shape and TextField objects, are \"leaf\" nodes that have only parents and siblings, no children.\n     * The DisplayObject class supports basic functionality like the x and y position of an object, as well as more advanced\n     * properties of the object such as its transformation matrix.<br/>\n     * The DisplayObject class contains several broadcast events.Normally, the target of any particular event is a specific\n     * DisplayObject instance. For example, the target of an added event is the specific DisplayObject instance that was added\n     * to the display list. Having a single target restricts the placement of event listeners to that target and in some cases\n     * the target's ancestors on the display list. With broadcast events, however, the target is not a specific DisplayObject\n     * instance, but rather all DisplayObject instances, including those that are not on the display list. This means that you\n     * can add a listener to any DisplayObject instance to listen for broadcast events.\n     *\n     * @event egret.Event.ADDED Dispatched when a display object is added to the display list.\n     * @event egret.Event.ADDED_TO_STAGE Dispatched when a display object is added to the on stage display list, either directly or through the addition of a sub tree in which the display object is contained.\n     * @event egret.Event.REMOVED Dispatched when a display object is about to be removed from the display list.\n     * @event egret.Event.REMOVED_FROM_STAGE Dispatched when a display object is about to be removed from the display list, either directly or through the removal of a sub tree in which the display object is contained.\n     * @event egret.Event.ENTER_FRAME [broadcast event] Dispatched when the playhead is entering a new frame.\n     * @event egret.Event.RENDER [broadcast event] Dispatched when the display list is about to be updated and rendered.\n     * @event egret.TouchEvent.TOUCH_MOVE Dispatched when the user touches the device, and is continuously dispatched until the point of contact is removed.\n     * @event egret.TouchEvent.TOUCH_BEGIN Dispatched when the user first contacts a touch-enabled device (such as touches a finger to a mobile phone or tablet with a touch screen).\n     * @event egret.TouchEvent.TOUCH_END Dispatched when the user removes contact with a touch-enabled device (such as lifts a finger off a mobile phone or tablet with a touch screen).\n     * @event egret.TouchEvent.TOUCH_TAP Dispatched when the user lifts the point of contact over the same DisplayObject instance on which the contact was initiated on a touch-enabled device (such as presses and releases a finger from a single point over a display object on a mobile phone or tablet with a touch screen).\n     * @event egret.TouchEvent.TOUCH_RELEASE_OUTSIDE Dispatched when the user lifts the point of contact over the different DisplayObject instance on which the contact was initiated on a touch-enabled device (such as presses and releases a finger from a single point over a display object on a mobile phone or tablet with a touch screen).\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/DisplayObject.ts\n     * @language en_US\n     */\n    /**\n     * DisplayObject 类是可放在显示列表中的所有对象的基类。该显示列表管理运行时中显示的所有对象。使用 DisplayObjectContainer 类排列\n     * 显示列表中的显示对象。DisplayObjectContainer 对象可以有子显示对象，而其他显示对象（如 Shape 和 TextField 对象）是“叶”节点，没有子项，只有父级和\n     * 同级。DisplayObject 类有一些基本的属性（如确定坐标位置的 x 和 y 属性），也有一些高级的对象属性（如 Matrix 矩阵变换）。<br/>\n     * DisplayObject 类包含若干广播事件。通常，任何特定事件的目标均为一个特定的 DisplayObject 实例。例如，added 事件的目标是已添加到显示列表\n     * 的目标 DisplayObject 实例。若只有一个目标，则会将事件侦听器限制为只能监听在该目标上（在某些情况下，可监听在显示列表中该目标的祖代上）。\n     * 但是对于广播事件，目标不是特定的 DisplayObject 实例，而是所有 DisplayObject 实例（包括那些不在显示列表中的实例）。这意味着您可以向任何\n     * DisplayObject 实例添加侦听器来侦听广播事件。\n     *\n     * @event egret.Event.ADDED 将显示对象添加到显示列表中时调度。\n     * @event egret.Event.ADDED_TO_STAGE 在将显示对象直接添加到舞台显示列表或将包含显示对象的子树添加至舞台显示列表中时调度。\n     * @event egret.Event.REMOVED 将要从显示列表中删除显示对象时调度。\n     * @event egret.Event.REMOVED_FROM_STAGE 在从显示列表中直接删除显示对象或删除包含显示对象的子树时调度。\n     * @event egret.Event.ENTER_FRAME [广播事件] 播放头进入新帧时调度。\n     * @event egret.Event.RENDER [广播事件] 将要更新和呈现显示列表时调度。\n     * @event egret.TouchEvent.TOUCH_MOVE 当用户触碰设备时进行调度，而且会连续调度，直到接触点被删除。\n     * @event egret.TouchEvent.TOUCH_BEGIN 当用户第一次触摸启用触摸的设备时（例如，用手指触摸手机屏幕）调度。\n     * @event egret.TouchEvent.TOUCH_END 当用户移除与启用触摸的设备的接触时（例如，将手指从屏幕上抬起）调度。\n     * @event egret.TouchEvent.TOUCH_TAP 当用户在启用触摸设备上的已启动接触的同一 DisplayObject 实例上抬起接触点时（例如，手机点击屏幕后抬起）调度。\n     * @event egret.TouchEvent.TOUCH_RELEASE_OUTSIDE 当用户在启用触摸设备上的已启动接触的不同 DisplayObject 实例上抬起接触点时（例如，按住屏幕上的某个对象,然后从它上面挪开后再松开手指）调度。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/DisplayObject.ts\n     * @language zh_CN\n     */\n    class DisplayObject extends EventDispatcher {\n        /**\n         * Initializes a DisplayObject object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个显示对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        $nativeDisplayObject: egret_native.NativeDisplayObject;\n        protected createNativeDisplayObject(): void;\n        /**\n         * @private\n         * 是否添加到舞台上，防止重复发送 removed_from_stage 消息\n         */\n        $hasAddToStage: boolean;\n        /**\n         * @private\n         * 能够含有子项的类将子项列表存储在这个属性里。\n         */\n        $children: DisplayObject[];\n        private $name;\n        /**\n         * Indicates the instance name of the DisplayObject. The object can be identified in the child list of its parent\n         * display object container by calling the getChildByName() method of the display object container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 DisplayObject 的实例名称。\n         * 通过调用父显示对象容器的 getChildByName() 方法，可以在父显示对象容器的子列表中标识该对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * @private\n         */\n        $parent: DisplayObjectContainer;\n        /**\n         * Indicates the DisplayObjectContainer object that contains this display object. Use the parent property to specify\n         * a relative path to display objects that are above the current display object in the display list hierarchy.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示包含此显示对象的 DisplayObjectContainer 对象。\n         * 使用 parent 属性可以指定高于显示列表层次结构中当前显示对象的显示对象的相对路径。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly parent: DisplayObjectContainer;\n        /**\n         * @private\n         * 设置父级显示对象\n         */\n        $setParent(parent: DisplayObjectContainer): void;\n        /**\n         * @private\n         * 显示对象添加到舞台\n         */\n        $onAddToStage(stage: Stage, nestLevel: number): void;\n        /**\n         * @private\n         * 显示对象从舞台移除\n         */\n        $onRemoveFromStage(): void;\n        /**\n         * @private\n         */\n        $stage: Stage;\n        /**\n         * @private\n         * 这个对象在显示列表中的嵌套深度，舞台为1，它的子项为2，子项的子项为3，以此类推。当对象不在显示列表中时此属性值为0.\n         */\n        $nestLevel: number;\n        $useTranslate: boolean;\n        protected $updateUseTransform(): void;\n        /**\n         * The Stage of the display object. you can create and load multiple display objects into the display list, and\n         * the stage property of each display object refers to the same Stage object.<br/>\n         * If a display object is not added to the display list, its stage property is set to null.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 显示对象的舞台。\n         * 例如，您可以创建多个显示对象并加载到显示列表中，每个显示对象的 stage 属性是指向相同的 Stage 对象。<br/>\n         * 如果显示对象未添加到显示列表，则其 stage 属性会设置为 null。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly stage: Stage;\n        /**\n         * A Matrix object containing values that alter the scaling, rotation, and translation of the display object.<br/>\n         * Note: to change the value of a display object's matrix, you must make a copy of the entire matrix object, then copy\n         * the new object into the matrix property of the display object.\n         * @example the following code increases the tx value of a display object's matrix\n         * <pre>\n         *     let myMatrix:Matrix = myDisplayObject.matrix;\n         *     myMatrix.tx += 10;\n         *     myDisplayObject.matrix = myMatrix;\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个 Matrix 对象，其中包含更改显示对象的缩放、旋转和平移的值。<br/>\n         * 注意：要改变一个显示对象矩阵的值，您必引用整个矩阵对象，然后将它重新赋值给显示对象的 matrix 属性。\n         * @example 以下代码改变了显示对象矩阵的tx属性值：\n         * <pre>\n         *     let myMatrix:Matrix = myDisplayObject.matrix;\n         *     myMatrix.tx += 10;\n         *     myDisplayObject.matrix = myMatrix;\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        matrix: Matrix;\n        private $matrix;\n        private $matrixDirty;\n        /**\n         * @private\n         * 获取矩阵\n         */\n        $getMatrix(): Matrix;\n        /**\n         * @private\n         * 设置矩阵\n         */\n        $setMatrix(matrix: Matrix, needUpdateProperties?: boolean): void;\n        private $concatenatedMatrix;\n        /**\n         * @private\n         * 获得这个显示对象以及它所有父级对象的连接矩阵。\n         */\n        $getConcatenatedMatrix(): Matrix;\n        private $invertedConcatenatedMatrix;\n        /**\n         * @private\n         * 获取链接矩阵\n         */\n        $getInvertedConcatenatedMatrix(): Matrix;\n        $x: number;\n        /**\n         * Indicates the x coordinate of the DisplayObject instance relative to the local coordinates of the parent\n         * DisplayObjectContainer.<br/>\n         * If the object is inside a DisplayObjectContainer that has transformations, it is in\n         * the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer\n         * rotated 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is\n         * rotated 90° counterclockwise. The object's coordinates refer to the registration point position.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 DisplayObject 实例相对于父级 DisplayObjectContainer 本地坐标的 x 坐标。<br/>\n         * 如果该对象位于具有变形的 DisplayObjectContainer 内，则它也位于包含 DisplayObjectContainer 的本地坐标系中。\n         * 因此，对于逆时针旋转 90 度的 DisplayObjectContainer，该 DisplayObjectContainer 的子级将继承逆时针旋转 90 度的坐标系。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        x: number;\n        /**\n         * @private\n         * 获取x坐标\n         */\n        $getX(): number;\n        /**\n         * @private\n         * 设置x坐标\n         */\n        $setX(value: number): boolean;\n        $y: number;\n        /**\n         * Indicates the y coordinate of the DisplayObject instance relative to the local coordinates of the parent\n         * DisplayObjectContainer. <br/>\n         * If the object is inside a DisplayObjectContainer that has transformations, it is in\n         * the local coordinate system of the enclosing DisplayObjectContainer. Thus, for a DisplayObjectContainer rotated\n         * 90° counterclockwise, the DisplayObjectContainer's children inherit a coordinate system that is rotated 90°\n         * counterclockwise. The object's coordinates refer to the registration point position.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 DisplayObject 实例相对于父级 DisplayObjectContainer 本地坐标的 y 坐标。<br/>\n         * 如果该对象位于具有变形的 DisplayObjectContainer 内，则它也位于包含 DisplayObjectContainer 的本地坐标系中。\n         * 因此，对于逆时针旋转 90 度的 DisplayObjectContainer，该 DisplayObjectContainer 的子级将继承逆时针旋转 90 度的坐标系。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        y: number;\n        /**\n         * @private\n         * 获取y坐标\n         */\n        $getY(): number;\n        /**\n         * @private\n         * 设置y坐标\n         */\n        $setY(value: number): boolean;\n        private $scaleX;\n        /**\n         * Indicates the horizontal scale (percentage) of the object as applied from the registration point. <br/>\n         * The default 1.0 equals 100% scale.\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示从注册点开始应用的对象的水平缩放比例（百分比）。<br/>\n         * 1.0 等于 100% 缩放。\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        scaleX: number;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getScaleX(): number;\n        /**\n         * @private\n         * 设置水平缩放值\n         */\n        $setScaleX(value: number): void;\n        private $scaleY;\n        /**\n         * Indicates the vertical scale (percentage) of an object as applied from the registration point of the object.\n         * 1.0 is 100% scale.\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示从对象注册点开始应用的对象的垂直缩放比例（百分比）。1.0 是 100% 缩放。\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        scaleY: number;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getScaleY(): number;\n        /**\n         * @private\n         * 设置垂直缩放值\n         */\n        $setScaleY(value: number): void;\n        private $rotation;\n        /**\n         * Indicates the rotation of the DisplayObject instance, in degrees, from its original orientation. Values from\n         * 0 to 180 represent clockwise rotation; values from 0 to -180 represent counterclockwise rotation. Values outside\n         * this range are added to or subtracted from 360 to obtain a value within the range. For example, the statement\n         * myDisplayObject.rotation = 450 is the same as myDisplayObject.rotation = 90.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 DisplayObject 实例距其原始方向的旋转程度，以度为单位。\n         * 从 0 到 180 的值表示顺时针方向旋转；从 0 到 -180 的值表示逆时针方向旋转。对于此范围之外的值，可以通过加上或\n         * 减去 360 获得该范围内的值。例如，myDisplayObject.rotation = 450语句与 myDisplayObject.rotation = 90 是相同的。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        rotation: number;\n        /**\n         * @private\n         */\n        $getRotation(): number;\n        $setRotation(value: number): void;\n        private $skewX;\n        private $skewXdeg;\n        /**\n         * 表示DisplayObject的x方向斜切\n         * @member {number} egret.DisplayObject#skewX\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        skewX: number;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setSkewX(value: number): void;\n        private $skewY;\n        private $skewYdeg;\n        /**\n         * 表示DisplayObject的y方向斜切\n         * @member {number} egret.DisplayObject#skewY\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        skewY: number;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setSkewY(value: number): void;\n        /**\n         * Indicates the width of the display object, in pixels. The width is calculated based on the bounds of the content\n         * of the display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示显示对象的宽度，以像素为单位。宽度是根据显示对象内容的范围来计算的。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        width: number;\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        $getWidth(): number;\n        $explicitWidth: number;\n        /**\n         * @private\n         * 设置显示宽度\n         */\n        $setWidth(value: number): void;\n        /**\n         * Indicates the height of the display object, in pixels. The height is calculated based on the bounds of the\n         * content of the display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示显示对象的高度，以像素为单位。高度是根据显示对象内容的范围来计算的。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        height: number;\n        $explicitHeight: number;\n        /**\n         * @private\n         * 获取显示高度\n         */\n        $getHeight(): number;\n        /**\n         * @private\n         * 设置显示高度\n         */\n        $setHeight(value: number): void;\n        /**\n         * 测量宽度\n         * @returns {number}\n         * @member {egret.Rectangle} egret.DisplayObject#measuredWidth\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly measuredWidth: number;\n        /**\n         * 测量高度\n         * @returns {number}\n         * @member {egret.Rectangle} egret.DisplayObject#measuredWidth\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly measuredHeight: number;\n        $anchorOffsetX: number;\n        /**\n         * X represents the object of which is the anchor.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示从对象绝对锚点X。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        anchorOffsetX: number;\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        $setAnchorOffsetX(value: number): void;\n        $anchorOffsetY: number;\n        /**\n         * Y represents the object of which is the anchor.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示从对象绝对锚点Y。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        anchorOffsetY: number;\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        $setAnchorOffsetY(value: number): void;\n        /**\n         * @private\n         */\n        $visible: boolean;\n        /**\n         * Whether or not the display object is visible. Display objects that are not visible are disabled. For example,\n         * if visible=false for an DisplayObject instance, it cannot receive touch or other user input.\n         * @default true\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 显示对象是否可见。不可见的显示对象将被禁用。例如，如果实例的 visible 为 false，则无法接受触摸或用户交互操作。\n         * @default true\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        visible: boolean;\n        $setVisible(value: boolean): void;\n        /**\n         * @private\n         * cacheAsBitmap创建的缓存位图节点。\n         */\n        $displayList: egret.sys.DisplayList;\n        private $cacheAsBitmap;\n        /**\n         * If set to true, Egret runtime caches an internal bitmap representation of the display object. This caching can\n         * increase performance for display objects that contain complex vector content. After you set the cacheAsBitmap\n         * property to true, the rendering does not change, however the display object performs pixel snapping automatically.\n         * The execution speed can be significantly faster depending on the complexity of the content.The cacheAsBitmap\n         * property is best used with display objects that have mostly static content and that do not scale and rotate frequently.<br/>\n         * Note: The display object will not create the bitmap caching when the memory exceeds the upper limit,even if you set it to true.\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果设置为 true，则 Egret 运行时将缓存显示对象的内部位图表示形式。此缓存可以提高包含复杂矢量内容的显示对象的性能。\n         * 将 cacheAsBitmap 属性设置为 true 后，呈现并不更改，但是，显示对象将自动执行像素贴紧。执行速度可能会大大加快，\n         * 具体取决于显示对象内容的复杂性。最好将 cacheAsBitmap 属性与主要具有静态内容且不频繁缩放或旋转的显示对象一起使用。<br/>\n         * 注意：在内存超过上限的情况下，即使将 cacheAsBitmap 属性设置为 true，显示对象也不使用位图缓存。\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        cacheAsBitmap: boolean;\n        $setHasDisplayList(value: boolean): void;\n        $cacheDirty: boolean;\n        $cacheDirtyUp(): void;\n        /**\n         * @private\n         */\n        $alpha: number;\n        /**\n         * Indicates the alpha transparency value of the object specified. Valid values are 0 (fully transparent) to 1 (fully opaque).\n         * The default value is 1. Display objects with alpha set to 0 are active, even though they are invisible.\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示指定对象的 Alpha 透明度值。\n         * 有效值为 0（完全透明）到 1（完全不透明）。alpha 设置为 0 的显示对象是可触摸的，即使它们不可见。\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        alpha: number;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setAlpha(value: number): void;\n        /**\n         * @private\n         * The default touchEnabled property of DisplayObject\n         * @default false\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * @private\n         * 显示对象默认的 touchEnabled 属性\n         * @default false\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static defaultTouchEnabled: boolean;\n        $touchEnabled: boolean;\n        /**\n         * Specifies whether this object receives touch or other user input. The default value is false, which means that\n         * by default any DisplayObject instance that is on the display list cannot receive touch events. If touchEnabled is\n         * set to false, the instance does not receive any touch events (or other user input events). Any children of\n         * this instance on the display list are not affected. To change the touchEnabled behavior for all children of\n         * an object on the display list, use DisplayObjectContainer.touchChildren.\n         * @see egret.DisplayObjectContainer#touchChildren\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定此对象是否接收触摸或其他用户输入。默认值为 false，这表示默认情况下，显示列表上的任何 DisplayObject 实例都不会接收触摸事件或\n         * 其他用户输入事件。如果将 touchEnabled 设置为 false，则实例将不接收任何触摸事件（或其他用户输入事件）。显示列表上的该实例的任\n         * 何子级都不会受到影响。要更改显示列表上对象的所有子级的 touchEnabled 行为，请使用 DisplayObjectContainer.touchChildren。\n         * @see egret.DisplayObjectContainer#touchChildren\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        touchEnabled: boolean;\n        /**\n         * @private\n         */\n        $getTouchEnabled(): boolean;\n        /**\n         * @private\n         */\n        $setTouchEnabled(value: boolean): void;\n        /**\n         * @private\n         */\n        $scrollRect: Rectangle;\n        /**\n         * The scroll rectangle bounds of the display object. The display object is cropped to the size defined by the rectangle,\n         * and it scrolls within the rectangle when you change the x and y properties of the scrollRect object. A scrolled display\n         * object always scrolls in whole pixel increments.You can scroll an object left and right by setting the x property of\n         * the scrollRect Rectangle object. You can scroll an object up and down by setting the y property of the scrollRect\n         * Rectangle object. If the display object is rotated 90° and you scroll it left and right, the display object actually\n         * scrolls up and down.<br/>\n         *\n         * Note: to change the value of a display object's scrollRect, you must make a copy of the entire scrollRect object, then copy\n         * the new object into the scrollRect property of the display object.\n         * @example the following code increases the x value of a display object's scrollRect\n         * <pre>\n         *     let myRectangle:Rectangle = myDisplayObject.scrollRect;\n         *     myRectangle.x += 10;\n         *     myDisplayObject.scrollRect = myRectangle;\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 显示对象的滚动矩形范围。显示对象被裁切为矩形定义的大小，当您更改 scrollRect 对象的 x 和 y 属性时，它会在矩形内滚动。\n         * 滚动的显示对象始终以整像素为增量进行滚动。您可以通过设置 scrollRect Rectangle 对象的 x 属性来左右滚动对象， 还可以通过设置\n         * scrollRect 对象的 y 属性来上下滚动对象。如果显示对象旋转了 90 度，并且您左右滚动它，则实际上显示对象会上下滚动。<br/>\n         *\n         * 注意：要改变一个显示对象 scrollRect 属性的值，您必引用整个 scrollRect 对象，然后将它重新赋值给显示对象的 scrollRect 属性。\n         * @example 以下代码改变了显示对象 scrollRect 的 x 属性值：\n         * <pre>\n         *     let myRectangle:Rectangle = myDisplayObject.scrollRect;\n         *     myRectangle.x += 10;\n         *     myDisplayObject.scrollRect = myRectangle;//设置完scrollRect的x、y、width、height值之后，一定要对myDisplayObject重新赋值scrollRect，不然会出问题。\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        scrollRect: Rectangle;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        private $setScrollRect(value);\n        /**\n         * @private\n         */\n        $blendMode: number;\n        /**\n         * A value from the BlendMode class that specifies which blend mode to use. Determine how a source image (new one)\n         * is drawn on the target image (old one).<br/>\n         * If you attempt to set this property to an invalid value, Egret runtime set the value to BlendMode.NORMAL.\n         * @default egret.BlendMode.NORMAL\n         * @see egret.BlendMode\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * BlendMode 枚举中的一个值，用于指定要使用的混合模式，确定如何将一个源（新的）图像绘制到目标（已有）的图像上<br/>\n         * 如果尝试将此属性设置为无效值，则运行时会将此值设置为 BlendMode.NORMAL。\n         * @default egret.BlendMode.NORMAL\n         * @see egret.BlendMode\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        blendMode: string;\n        /**\n         * @private\n         * 被遮罩的对象\n         */\n        $maskedObject: DisplayObject;\n        /**\n         * @private\n         */\n        $mask: DisplayObject;\n        /**\n         * @private\n         */\n        $maskRect: Rectangle;\n        /**\n         * The calling display object is masked by the specified mask object. To ensure that masking works when the Stage\n         * is scaled, the mask display object must be in an active part of the display list. The mask object itself is not drawn.\n         * Set mask to null to remove the mask. To be able to scale a mask object, it must be on the display list. To be\n         * able to drag a mask object , it must be on the display list.<br/>\n         * Note: A single mask object cannot be used to mask more than one calling display object. When the mask is assigned\n         * to a second display object, it is removed as the mask of the first object, and that object's mask property becomes null.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 调用显示对象被指定的 mask 对象遮罩。要确保当舞台缩放时蒙版仍然有效，mask 显示对象必须处于显示列表的活动部分。\n         * 但不绘制 mask 对象本身。将 mask 设置为 null 可删除蒙版。要能够缩放遮罩对象，它必须在显示列表中。要能够拖动蒙版\n         * 对象，它必须在显示列表中。<br/>\n         * 注意：单个 mask 对象不能用于遮罩多个执行调用的显示对象。在将 mask 分配给第二个显示对象时，会撤消其作为第一个对象的遮罩，\n         * 该对象的 mask 属性将变为 null。\n         *\n         * 下面例子为 mask 为 Rectangle 类型对象，这种情况下，修改 mask 的值后，一定要对 myDisplayObject 重新赋值 mask，不然会出问题。\n         * @example 以下代码改变了显示对象 mask 的 x 属性值：\n         * <pre>\n         *     let myMask:Rectangle = myDisplayObject.mask;\n         *     myMask.x += 10;\n         *     myDisplayObject.mask = myMask;//设置完 mask 的x、y、width、height值之后，一定要对myDisplayObject重新赋值 mask，不然会出问题。\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        mask: DisplayObject | Rectangle;\n        private $setMaskRect(value);\n        $filters: Array<Filter | CustomFilter>;\n        /**\n         * An indexed array that contains each filter object currently associated with the display object.\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 包含当前与显示对象关联的每个滤镜对象的索引数组。\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        filters: Array<Filter | CustomFilter>;\n        /**\n         * Returns a rectangle that defines the area of the display object relative to the coordinate system of the targetCoordinateSpace object.\n         * @param targetCoordinateSpace The display object that defines the coordinate system to use.\n         * @param resultRect A reusable instance of Rectangle for saving the results. Passing this parameter can reduce the number of reallocate objects\n         *, which allows you to get better code execution performance..\n         * @returns The rectangle that defines the area of the display object relative to the targetCoordinateSpace object's coordinate system.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回一个矩形，该矩形定义相对于 targetCoordinateSpace 对象坐标系的显示对象区域。\n         * @param targetCoordinateSpace 定义要使用的坐标系的显示对象。\n         * @param resultRect 一个用于存储结果的可复用Rectangle实例，传入此参数能够减少内部创建对象的次数，从而获得更高的运行性能。\n         * @returns 定义与 targetCoordinateSpace 对象坐标系统相关的显示对象面积的矩形。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getTransformedBounds(targetCoordinateSpace: DisplayObject, resultRect?: Rectangle): Rectangle;\n        /**\n         * Obtain measurement boundary of display object\n         * @param resultRect {Rectangle} Optional. It is used to import Rectangle object for saving results, preventing duplicate object creation.\n         * @param calculateAnchor {boolean} Optional. It is used to determine whether to calculate anchor point.\n         * @returns {Rectangle}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取显示对象的测量边界\n         * @param resultRect {Rectangle} 可选参数，传入用于保存结果的Rectangle对象，避免重复创建对象。\n         * @param calculateAnchor {boolean} 可选参数，是否会计算锚点。\n         * @returns {Rectangle}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getBounds(resultRect?: Rectangle, calculateAnchor?: boolean): egret.Rectangle;\n        /**\n         * @private\n         */\n        $getTransformedBounds(targetCoordinateSpace: DisplayObject, resultRect?: Rectangle): Rectangle;\n        /**\n         * Converts the point object from the Stage (global) coordinates to the display object's (local) coordinates.\n         * @param stageX the x value in the global coordinates\n         * @param stageY the y value in the global coordinates\n         * @param resultPoint A reusable instance of Point for saving the results. Passing this parameter can reduce the\n         * number of reallocate objects, which allows you to get better code execution performance.\n         * @returns A Point object with coordinates relative to the display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将从舞台（全局）坐标转换为显示对象的（本地）坐标。\n         * @param stageX 舞台坐标x\n         * @param stageY 舞台坐标y\n         * @param resultPoint 一个用于存储结果的可复用 Point 实例，传入此参数能够减少内部创建对象的次数，从而获得更高的运行性能。\n         * @returns 具有相对于显示对象的坐标的 Point 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        globalToLocal(stageX?: number, stageY?: number, resultPoint?: Point): Point;\n        /**\n         * Converts the point object from the display object's (local) coordinates to the Stage (global) coordinates.\n         * @param localX the x value in the local coordinates\n         * @param localY the x value in the local coordinates\n         * @param resultPoint A reusable instance of Point for saving the results. Passing this parameter can reduce the\n         * number of reallocate objects, which allows you to get better code execution performance.\n         * @returns  A Point object with coordinates relative to the Stage.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将显示对象的（本地）坐标转换为舞台（全局）坐标。\n         * @param localX 本地坐标 x\n         * @param localY 本地坐标 y\n         * @param resultPoint 一个用于存储结果的可复用 Point 实例，传入此参数能够减少内部创建对象的次数，从而获得更高的运行性能。\n         * @returns 一个具有相对于舞台坐标的 Point 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        localToGlobal(localX?: number, localY?: number, resultPoint?: Point): Point;\n        /**\n         * @private\n         * 获取显示对象占用的矩形区域集合，通常包括自身绘制的测量区域，如果是容器，还包括所有子项占据的区域。\n         */\n        $getOriginalBounds(): Rectangle;\n        /**\n         * @private\n         * 测量子项占用的矩形区域\n         * @param bounds 测量结果存储在这个矩形对象内\n         */\n        $measureChildBounds(bounds: Rectangle): void;\n        /**\n         * @private\n         */\n        $getContentBounds(): Rectangle;\n        /**\n         * @private\n         * 测量自身占用的矩形区域，注意：此测量结果并不包括子项占据的区域。\n         * @param bounds 测量结果存储在这个矩形对象内\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        /**\n         * @private\n         */\n        $parentDisplayList: egret.sys.DisplayList;\n        /**\n         * @private\n         * 渲染节点,不为空表示自身有绘制到屏幕的内容\n         */\n        $renderNode: sys.RenderNode;\n        $renderDirty: boolean;\n        /**\n         * @private\n         * 获取渲染节点\n         */\n        $getRenderNode(): sys.RenderNode;\n        $updateRenderMode(): void;\n        $renderMode: RenderMode;\n        /**\n         * @private\n         */\n        private $measureFiltersOffset(fromParent);\n        /**\n         * @private\n         * 获取相对于指定根节点的连接矩阵。\n         * @param root 根节点显示对象\n         * @param matrix 目标显示对象相对于舞台的完整连接矩阵。\n         */\n        $getConcatenatedMatrixAt(root: DisplayObject, matrix: Matrix): void;\n        /**\n         * @private\n         * 更新renderNode\n         */\n        $updateRenderNode(): void;\n        /**\n         * @private\n         */\n        $hitTest(stageX: number, stageY: number): DisplayObject;\n        /**\n         * Calculate the display object to determine whether it overlaps or crosses with the points specified by the x and y parameters. The x and y parameters specify the points in the coordinates of the stage, rather than the points in the display object container that contains display objects (except the situation where the display object container is a stage).\n         * Note: Don't use accurate pixel collision detection on a large number of objects. Otherwise, this will cause serious performance deterioration.\n         * @param x {number}  x coordinate of the object to be tested.\n         * @param y {number}  y coordinate of the object to be tested.\n         * @param shapeFlag {boolean} Whether to check the actual pixel of object (true) or check that of border (false).Write realized.\n         * @returns {boolean} If display object overlaps or crosses with the specified point, it is true; otherwise, it is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 计算显示对象，以确定它是否与 x 和 y 参数指定的点重叠或相交。x 和 y 参数指定舞台的坐标空间中的点，而不是包含显示对象的显示对象容器中的点（除非显示对象容器是舞台）。\n         * 注意，不要在大量物体中使用精确碰撞像素检测，这回带来巨大的性能开销\n         * @param x {number}  要测试的此对象的 x 坐标。\n         * @param y {number}  要测试的此对象的 y 坐标。\n         * @param shapeFlag {boolean} 是检查对象 (true) 的实际像素，还是检查边框 (false) 的实际像素。\n         * @returns {boolean} 如果显示对象与指定的点重叠或相交，则为 true；否则为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        hitTestPoint(x: number, y: number, shapeFlag?: boolean): boolean;\n        /**\n         * @private\n         */\n        static $enterFrameCallBackList: DisplayObject[];\n        /**\n         * @private\n         */\n        static $renderCallBackList: DisplayObject[];\n        /**\n         * @private\n         */\n        $addListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number, dispatchOnce?: boolean): void;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        removeEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean): void;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        dispatchEvent(event: Event): boolean;\n        /**\n         * @private\n         * 获取事件流列表。注意：Egret框架的事件流与Flash实现并不一致。\n         *\n         * 事件流有三个阶段：捕获，目标，冒泡。\n         * Flash里默认的的事件监听若不开启useCapture将监听目标和冒泡阶段。若开始capture将只能监听捕获当不包括目标的事件。\n         * 可以在Flash中写一个简单的测试：实例化一个非容器显示对象，例如TextField。分别监听useCapture为true和false时的鼠标事件。\n         * 点击后将只有useCapture为false的回调函数输出信息。也就带来一个问题「Flash的捕获阶段不能监听到最内层对象本身，只在父级列表有效」。\n         *\n         * 而HTML里的事件流设置useCapture为true时是能监听到目标阶段的，也就是目标阶段会被触发两次，在捕获和冒泡过程各触发一次。这样可以避免\n         * 前面提到的监听捕获无法监听目标本身的问题。\n         *\n         * Egret最终采用了HTML里目标节点触发两次的事件流方式。\n         */\n        $getPropagationList(target: DisplayObject): DisplayObject[];\n        /**\n         * @private\n         */\n        $dispatchPropagationEvent(event: Event, list: DisplayObject[], targetIndex: number): void;\n        /**\n         * @inheritDoc\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        willTrigger(type: string): boolean;\n        /**\n         * inspired by pixi.js\n         */\n        private _tint;\n        /**\n         * @private\n         */\n        $tintRGB: number;\n        /**\n         * Set a tint color for the current object\n         * @version Egret 5.2.24\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 给当前对象设置填充色\n         * @version Egret 5.2.24\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        tint: number;\n        /**\n         * @private\n         * inspired by pixi.js\n         */\n        $sortDirty: boolean;\n        sortChildren(): void;\n        /**\n         * @private\n         */\n        private _zIndex;\n        /**\n         * the z-order (front-to-back order) of the object\n         * @version Egret 5.2.24\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置对象的 Z 轴顺序（前后顺序）\n         * @version Egret 5.2.24\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        zIndex: number;\n        /**\n         * @private\n         */\n        $lastSortedIndex: number;\n        /**\n         * Allow objects to use zIndex sorting\n         * @version Egret 5.2.24\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 允许对象使用 zIndex 排序\n         * @version Egret 5.2.24\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        sortableChildren: boolean;\n    }\n}\ndeclare namespace egret {\n    let $TextureScaleFactor: number;\n    /**\n     * The Texture class encapsulates different image resources on different platforms.\n     * In HTML5, resource is an HTMLElement object\n     * In OpenGL / WebGL, resource is a texture ID obtained after the GPU is submitted\n     * The Texture class encapsulates the details implemented on the underlayer. Developers just need to focus on interfaces\n     * @see http://edn.egret.com/cn/docs/page/135 The use of texture packs\n     * @see http://edn.egret.com/cn/docs/page/123 Several ways of access to resources\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Texture.ts\n     * @language en_US\n     */\n    /**\n     * 纹理类是对不同平台不同的图片资源的封装\n     * 在HTML5中，资源是一个HTMLElement对象\n     * 在OpenGL / WebGL中，资源是一个提交GPU后获取的纹理id\n     * Texture类封装了这些底层实现的细节，开发者只需要关心接口即可\n     * @see http://edn.egret.com/cn/docs/page/135 纹理集的使用\n     * @see http://edn.egret.com/cn/docs/page/123 获取资源的几种方式\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Texture.ts\n     * @language zh_CN\n     */\n    class Texture extends HashObject {\n        /**\n         * Create an egret.Texture object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.Texture 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        /**\n         * Whether to destroy the corresponding BitmapData when the texture is destroyed\n         * @version Egret 5.0.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 销毁纹理时是否销毁对应BitmapData\n         * @version Egret 5.0.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        disposeBitmapData: boolean;\n        /**\n         * @private\n         * 表示这个纹理在 bitmapData 上的 x 起始位置\n         */\n        $bitmapX: number;\n        /**\n         * @private\n         * 表示这个纹理在 bitmapData 上的 y 起始位置\n         */\n        $bitmapY: number;\n        /**\n         * @private\n         * 表示这个纹理在 bitmapData 上的宽度\n         */\n        $bitmapWidth: number;\n        /**\n         * @private\n         * 表示这个纹理在 bitmapData 上的高度\n         */\n        $bitmapHeight: number;\n        /**\n         * @private\n         * 表示这个纹理显示了之后在 x 方向的渲染偏移量\n         */\n        $offsetX: number;\n        /**\n         * @private\n         * 表示这个纹理显示了之后在 y 方向的渲染偏移量\n         */\n        $offsetY: number;\n        /**\n         * @private\n         * 纹理宽度\n         */\n        private $textureWidth;\n        /**\n         * Texture width, read only\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 纹理宽度，只读属性，不可以设置\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly textureWidth: number;\n        $getTextureWidth(): number;\n        /**\n         * @private\n         * 纹理高度\n         */\n        private $textureHeight;\n        /**\n         * Texture height, read only\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 纹理高度，只读属性，不可以设置\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly textureHeight: number;\n        $getTextureHeight(): number;\n        $getScaleBitmapWidth(): number;\n        $getScaleBitmapHeight(): number;\n        /**\n         * @private\n         * 表示bitmapData.width\n         */\n        $sourceWidth: number;\n        /**\n         * @private\n         * 表示bitmapData.height\n         */\n        $sourceHeight: number;\n        /**\n         * @private\n         */\n        $bitmapData: BitmapData;\n        /**\n         * @private\n         */\n        $ktxData: ArrayBuffer;\n        /**\n         * @private\n         */\n        $rotated: boolean;\n        /**\n         * The BitmapData object being referenced.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 被引用的 BitmapData 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        bitmapData: BitmapData;\n        /**\n        * Set the BitmapData object.\n        * @version Egret 3.2.1\n        * @platform Web,Native\n        * @language en_US\n        */\n        /**\n         * 设置 BitmapData 对象。\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        _setBitmapData(value: BitmapData): void;\n        /**\n         * The KTX object being referenced.\n        * @version Egret 5.2.21\n        * @platform Web,Native\n        * @language en_US\n        */\n        /**\n         * 被引用的 KTXData 对象。\n         * @version Egret 5.2.21\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ktxData: ArrayBuffer;\n        /**\n        * Set the KTXData object.\n        * @version Egret 3.2.1\n        * @platform Web,Native\n        * @language en_US\n        */\n        /**\n         * 设置 KTXData 对象。\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        _setKtxData(value: ArrayBuffer): void;\n        /**\n         * @private\n         * 设置Texture数据\n         * @param bitmapX\n         * @param bitmapY\n         * @param bitmapWidth\n         * @param bitmapHeight\n         * @param offsetX\n         * @param offsetY\n         * @param textureWidth\n         * @param textureHeight\n         * @param sourceWidth\n         * @param sourceHeight\n         */\n        $initData(bitmapX: number, bitmapY: number, bitmapWidth: number, bitmapHeight: number, offsetX: number, offsetY: number, textureWidth: number, textureHeight: number, sourceWidth: number, sourceHeight: number, rotated?: boolean): void;\n        /**\n         * @deprecated\n         */\n        getPixel32(x: number, y: number): number[];\n        /**\n         * Obtain the color value for the specified pixel region\n         * @param x  The x coordinate of the pixel region\n         * @param y  The y coordinate of the pixel region\n         * @param width  The width of the pixel region\n         * @param height  The height of the pixel region\n         * @returns  Specifies the color value for the pixel region\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取指定像素区域的颜色值\n         * @param x  像素区域的X轴坐标\n         * @param y  像素区域的Y轴坐标\n         * @param width  像素区域的宽度\n         * @param height  像素区域的高度\n         * @returns  指定像素区域的颜色值\n         * @version Egret 3.2.1\n         * @platform Web\n         * @language zh_CN\n         */\n        getPixels(x: number, y: number, width?: number, height?: number): number[];\n        /**\n         * Convert base64 string, if the picture (or pictures included) cross-border or null\n         * @param type Type conversions, such as \"image / png\"\n         * @param rect The need to convert the area\n         * @param smoothing Whether to convert data to the smoothing process\n         * @returns {any} base64 string\n         * @version Egret 2.4\n         * @language en_US\n         */\n        /**\n         * 转换成base64字符串，如果图片（或者包含的图片）跨域，则返回null\n         * @param type 转换的类型，如  \"image/png\"\n         * @param rect 需要转换的区域\n         * @param {any} encoderOptions 编码用的参数\n         * @returns {any} base64字符串\n         * @version Egret 2.4\n         * @language zh_CN\n         */\n        toDataURL(type: string, rect?: egret.Rectangle, encoderOptions?: any): string;\n        /**\n         * Crop designated area and save it as image.\n         * native support only \"image / png\" and \"image / jpeg\"; Web browser because of the various implementations are not the same, it is recommended to use only these two kinds.\n         * @param type Type conversions, such as \"image / png\"\n         * @param filePath The path name of the image (the home directory for the game's private space, the path can not have \"../\",Web supports only pass names.)\n         * @param rect The need to convert the area\n         * @version Egret 2.4\n         * @platform Native\n         * @language en_US\n         */\n        /**\n         * 裁剪指定区域并保存成图片。\n         * native只支持 \"image/png\" 和 \"image/jpeg\"；Web中由于各个浏览器的实现不一样，因此建议也只用这2种。\n         * @param type 转换的类型，如  \"image/png\"\n         * @param filePath 图片的名称的路径（主目录为游戏的私有空间，路径中不能有 \"../\"，Web只支持传名称。）\n         * @param rect 需要转换的区域\n         * @version Egret 2.4\n         * @platform Native\n         * @language zh_CN\n         */\n        saveToFile(type: string, filePath: string, rect?: egret.Rectangle): void;\n        /**\n         * dispose texture\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放纹理\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        dispose(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The Event class is used as the base class for the creation of Event objects, which are passed as parameters to event\n     * listeners when an event occurs.The properties of the Event class carry basic information about an event, such as\n     * the event's type or whether the event's default behavior can be canceled. For many events, such as the events represented\n     * by the Event class constants, this basic information is sufficient. Other events, however, may require more detailed\n     * information. Events associated with a touch tap, for example, need to include additional information about the\n     * location of the touch event. You can pass such additional information to event listeners by extending the Event class,\n     * which is what the TouchEvent class does. Egret API defines several Event subclasses for common events that require\n     * additional information. Events associated with each of the Event subclasses are described in the documentation for\n     * each class.The methods of the Event class can be used in event listener functions to affect the behavior of the event\n     * object. Some events have an associated default behavior. Your event listener can cancel this behavior by calling the\n     * preventDefault() method. You can also make the current event listener the last one to process an event by calling\n     * the stopPropagation() or stopImmediatePropagation() method.\n     * @see egret.EventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/Event.ts\n     * @see http://edn.egret.com/cn/docs/page/798 取消触摸事件\n     * @language en_US\n     */\n    /**\n     * Event 类作为创建事件实例的基类，当发生事件时，Event 实例将作为参数传递给事件侦听器。Event 类的属性包含有关事件的基本信息，例如事件\n     * 的类型或者是否可以取消事件的默认行为。对于许多事件（如由 Event 类常量表示的事件），此基本信息就足够了。但其他事件可能需要更详细的信息。\n     * 例如，与触摸关联的事件需要包括有关触摸事件的位置信息。您可以通过扩展 Event 类（TouchEvent 类执行的操作）将此类其他信息传递给事件侦听器。\n     * Egret API 为需要其他信息的常见事件定义多个 Event 子类。与每个 Event 子类关联的事件将在每个类的文档中加以介绍。Event 类的方法可以在\n     * 事件侦听器函数中使用以影响事件对象的行为。某些事件有关联的默认行为，通过调用 preventDefault() 方法，您的事件侦听器可以取消此行为。\n     * 可以通过调用 stopPropagation() 或 stopImmediatePropagation() 方法，将当前事件侦听器作为处理事件的最后一个事件侦听器。\n     * @see egret.EventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/Event.ts\n     * @see http://edn.egret.com/cn/docs/page/798 取消触摸事件\n     * @language zh_CN\n     */\n    class Event extends HashObject {\n        /**\n         * Dispatched when a display object is added to the on stage display list, either directly or through the addition\n         * of a sub tree in which the display object is contained.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在将显示对象直接添加到舞台显示列表或将包含显示对象的子树添加至舞台显示列表中时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ADDED_TO_STAGE: string;\n        /**\n         * Dispatched when a display object is about to be removed from the display list, either directly or through the removal\n         * of a sub tree in which the display object is contained.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在从显示列表中直接删除显示对象或删除包含显示对象的子树时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static REMOVED_FROM_STAGE: string;\n        /**\n         * Dispatched when a display object is added to the display list.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将显示对象添加到显示列表中时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ADDED: string;\n        /**\n         * Dispatched when a display object is about to be removed from the display list.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将要从显示列表中删除显示对象时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static REMOVED: string;\n        /**\n         * [broadcast event] Dispatched when the playhead is entering a new frame.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * [广播事件] 进入新的一帧,监听此事件将会在下一帧开始时触发一次回调。这是一个广播事件，可以在任何一个显示对象上监听，无论它是否在显示列表中。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ENTER_FRAME: string;\n        /**\n         * Dispatched when the display list is about to be updated and rendered.\n         * Note: Every time you want to receive a render event,you must call the stage.invalidate() method.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 渲染事件，监听此事件将会在本帧末即将开始渲染的前一刻触发回调，这是一个广播事件，可以在任何一个显示对象上监听，无论它是否在显示列表中。\n         * 注意：每次您希望 Egret 发送 Event.RENDER 事件时，都必须调用 stage.invalidate() 方法，由于每帧只会触发一次屏幕刷新，\n         * 若在 Event.RENDER 回调函数执行期间再次调用stage.invalidate()，将会被忽略。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static RENDER: string;\n        /**\n         * Dispatched when the size of stage or UIComponent is changed.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 舞台尺寸或UI组件尺寸发生改变\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static RESIZE: string;\n        /**\n         * Dispatched when the value or selection of a property is chaned.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 属性值或状态发生改变。通常是按钮的选中状态，或者列表的选中项索引改变。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static CHANGE: string;\n        /**\n         * Dispatched when the value or selection of a property is going to change.you can cancel this by calling the\n         * preventDefault() method.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 属性值或状态即将发生改变,通常是按钮的选中状态，或者列表的选中项索引改变。可以通过调用 preventDefault() 方法阻止索引发生更改。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static CHANGING: string;\n        /**\n         * Dispatched when the net request is complete.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 网络请求加载完成\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static COMPLETE: string;\n        /**\n         * Dispatched when loop completed.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 循环完成。循环最后一次只派发 COMPLETE 事件，不派发 LOOP_COMPLETE 事件。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static LOOP_COMPLETE: string;\n        /**\n         * Dispatched when the TextInput instance gets focus.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * TextInput实例获得焦点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static FOCUS_IN: string;\n        /**\n         * Dispatched when the TextInput instance loses focus.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * TextInput实例失去焦点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static FOCUS_OUT: string;\n        /**\n         * Dispatched when the playback is ended.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 动画声音等播放完成\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ENDED: string;\n        /**\n         * 游戏激活\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static ACTIVATE: string;\n        /**\n         * 取消激活\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static DEACTIVATE: string;\n        /**\n         * Event.CLOSE 常量定义 close 事件对象的 type 属性的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static CLOSE: string;\n        /**\n         * Event.CONNECT 常量定义 connect 事件对象的 type 属性的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static CONNECT: string;\n        /**\n         * Event.LEAVE_STAGE 常量定义 leaveStage 事件对象的 type 属性的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static LEAVE_STAGE: string;\n        /**\n         * Event.SOUND_COMPLETE 常量定义 在声音完成播放后调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static SOUND_COMPLETE: string;\n        /**\n         * Creates an Event object to pass as a parameter to event listeners.\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @param data the optional data associated with this event\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个作为参数传递给事件侦听器的 Event 对象。\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param data 与此事件对象关联的可选数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean, data?: any);\n        /**\n         * the optional data associated with this event\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 与此事件对象关联的可选数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        data: any;\n        /**\n         * @private\n         */\n        $type: string;\n        /**\n         * The type of event. The type is case-sensitive.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 事件的类型。类型区分大小写。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly type: string;\n        /**\n         * @private\n         */\n        $bubbles: boolean;\n        /**\n         * Indicates whether an event is a bubbling event.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示事件是否为冒泡事件。如果事件可以冒泡，则此值为 true；否则为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly bubbles: boolean;\n        /**\n         * @private\n         */\n        $cancelable: boolean;\n        /**\n         * Indicates whether the behavior associated with the event can be prevented. If the behavior can be\n         * canceled, this value is true; otherwise it is false.\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示是否可以阻止与事件相关联的行为。如果可以取消该行为，则此值为 true；否则为 false。\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly cancelable: boolean;\n        /**\n         * @private\n         */\n        $eventPhase: number;\n        /**\n         * The current phase in the event flow. This property can contain the following numeric values:\n         * The capture phase (EventPhase.CAPTURING_PHASE).\n         * The target phase (EventPhase.AT_TARGET)\n         * The bubbling phase (EventPhase.BUBBLING_PHASE).\n         * @see egret.EventPhase\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 事件流中的当前阶段。此属性可以包含以下数值：\n         * 捕获阶段 (EventPhase.CAPTURING_PHASE)。\n         * 目标阶段 (EventPhase.AT_TARGET)。\n         * 冒泡阶段 (EventPhase.BUBBLING_PHASE)。\n         * @see egret.EventPhase\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly eventPhase: number;\n        /**\n         * @private\n         */\n        $currentTarget: any;\n        /**\n         * The object that is actively processing the Event object with an event listener. For example, if a\n         * user clicks an OK button, the current target could be the node containing that button or one of its ancestors\n         * that has registered an event listener for that event.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当前正在使用某个事件侦听器处理 Event 对象的对象。例如，如果用户单击“确定”按钮，\n         * 则当前目标可以是包含该按钮的节点，也可以是它的已为该事件注册了事件侦听器的始祖之一。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly currentTarget: any;\n        /**\n         * @private\n         */\n        $target: any;\n        /**\n         * The event target. This property contains the target node. For example, if a user clicks an OK button,\n         * the target node is the display list node containing that button.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 事件目标。此属性包含目标节点。例如，如果用户单击“确定”按钮，则目标节点就是包含该按钮的显示列表节点。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly target: any;\n        $setTarget(target: any): boolean;\n        /**\n         * @private\n         */\n        $isDefaultPrevented: boolean;\n        /**\n         * Checks whether the preventDefault() method has been called on the event. If the preventDefault() method has been\n         * called, returns true; otherwise, returns false.\n         * @returns If preventDefault() has been called, returns true; otherwise, returns false.\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 检查是否已对事件调用 preventDefault() 方法。\n         * @returns 如果已调用 preventDefault() 方法，则返回 true；否则返回 false。\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        isDefaultPrevented(): boolean;\n        /**\n         * Cancels an event's default behavior if that behavior can be canceled.Many events have associated behaviors that\n         * are carried out by default. For example, if a user types a character into a text input, the default behavior\n         * is that the character is displayed in the text input. Because the TextEvent.TEXT_INPUT event's default behavior\n         * can be canceled, you can use the preventDefault() method to prevent the character from appearing.\n         * You can use the Event.cancelable property to check whether you can prevent the default behavior associated with\n         * a particular event. If the value of Event.cancelable is true, then preventDefault() can be used to cancel the event;\n         * otherwise, preventDefault() has no effect.\n         * @see #cancelable\n         * @see #isDefaultPrevented\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果可以取消事件的默认行为，则取消该行为。\n         * 许多事件都有默认执行的关联行为。例如，如果用户在文本字段中键入一个字符，则默认行为就是在文本字段中显示该字符。\n         * 由于可以取消 TextEvent.TEXT_INPUT 事件的默认行为，因此您可以使用 preventDefault() 方法来防止显示该字符。\n         * 您可以使用 Event.cancelable 属性来检查是否可以防止与特定事件关联的默认行为。如果 Event.cancelable 的值为 true，\n         * 则可以使用 preventDefault() 来取消事件；否则，preventDefault() 无效。\n         * @see #cancelable\n         * @see #isDefaultPrevented\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        preventDefault(): void;\n        /**\n         * @private\n         */\n        $isPropagationStopped: boolean;\n        /**\n         * Prevents processing of any event listeners in nodes subsequent to the current node in the event flow. This method\n         * does not affect any event listeners in the current node (currentTarget). In contrast, the stopImmediatePropagation()\n         * method prevents processing of event listeners in both the current node and subsequent nodes. Additional calls to this\n         * method have no effect. This method can be called in any phase of the event flow.<br/>\n         * Note: This method does not cancel the behavior associated with this event; see preventDefault() for that functionality.\n         * @see #stopImmediatePropagation()\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 防止对事件流中当前节点的后续节点中的所有事件侦听器进行处理。此方法不会影响当前节点 currentTarget 中的任何事件侦听器。\n         * 相比之下，stopImmediatePropagation() 方法可以防止对当前节点中和后续节点中的事件侦听器进行处理。\n         * 对此方法的其它调用没有任何效果。可以在事件流的任何阶段中调用此方法。<br/>\n         * 注意：此方法不会取消与此事件相关联的行为；有关此功能的信息，请参阅 preventDefault()。\n         * @see #stopImmediatePropagation()\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        stopPropagation(): void;\n        /**\n         * @private\n         */\n        $isPropagationImmediateStopped: boolean;\n        /**\n         * Prevents processing of any event listeners in the current node and any subsequent nodes in the event flow.\n         * This method takes effect immediately, and it affects event listeners in the current node. In contrast, the\n         * stopPropagation() method doesn't take effect until all the event listeners in the current node finish processing.<br/>\n         * Note: This method does not cancel the behavior associated with this event; see preventDefault() for that functionality.\n         * @see #stopPropagation()\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 防止对事件流中当前节点中和所有后续节点中的事件侦听器进行处理。此方法会立即生效，并且会影响当前节点中的事件侦听器。\n         * 相比之下，在当前节点中的所有事件侦听器都完成处理之前，stopPropagation() 方法不会生效。<br/>\n         * 注意：此方法不会取消与此事件相关联的行为；有关此功能的信息，请参阅 preventDefault()。\n         * @see #stopPropagation()\n         * @see #preventDefault()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        stopImmediatePropagation(): void;\n        /**\n         * This method will be called automatically when you pass the event object as the parameters to the Event.release() method.\n         * If your custom event is designed for reusable,you should override this method to make sure all the references to external\n         * objects are cleaned. if not,it may cause memory leaking.\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当事件实例传递给Event.release()静态方法时，实例上的clean()方法将会被自动调用。\n         * 若此自定义事件的实例设计为可以循环复用的，为了避免引起内存泄露，自定义事件需要覆盖此方法来确保实例被缓存前断开对外部对象的一切引用。\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        protected clean(): void;\n        /**\n         * EventDispatcher object using the specified event object thrown Event. Objects thrown objects will be cached in the pool for the next round robin.\n         * @param target the event target\n         * @param type The type of the event. Event listeners can access this information through the inherited type property.\n         * @param bubbles Determines whether the Event object bubbles. Event listeners can access this information through\n         * the inherited bubbles property.\n         * @param data {any} data\n         * @method egret.Event.dispatchEvent\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的 EventDispatcher 对象来抛出 Event 事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @param type {string} 事件类型\n         * @param bubbles {boolean} 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param data {any} 事件data\n         * @method egret.Event.dispatchEvent\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchEvent(target: IEventDispatcher, type: string, bubbles?: boolean, data?: any): boolean;\n        /**\n         * @private\n         *\n         * @param EventClass\n         * @returns\n         */\n        static _getPropertyData(EventClass: any): any;\n        /**\n         * Gets one event instance from the object pool or create a new one. We highly recommend using the Event.create()\n         * and Event.release() methods to create and release an event object,it can reduce the number of reallocate objects,\n         * which allows you to get better code execution performance.<br/>\n         * Note: If you want to use this method to initialize your custom event object,you must make sure the constructor\n         * of your custom event is the same as the constructor of egret.Event.\n         * @param EventClass Event Class。\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @example\n         * <pre>\n         *    let event = Event.create(Event,type, bubbles);\n         *    event.data = data;    //optional,initializes custom data here\n         *    this.dispatchEvent(event);\n         *    Event.release(event);\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从对象池中取出或创建一个新的事件实例。我们建议您尽可能使用Event.create()和Event.release() 这一对方法来创建和释放事件对象，\n         * 这一对方法会将事件实例在内部缓存下来供下次循环使用，减少对象的创建次数,从而获得更高的代码运行性能。<br/>\n         * 注意：若使用此方法来创建自定义事件的实例，自定义的构造函数参数列表必须跟Event类一致。\n         * @param EventClass Event类名。\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @example\n         * <pre>\n         *    let event = Event.create(Event,type, bubbles);\n         *    event.data = data;  //可选，若指定义事件上需要附加其他参数，可以在获取实例后在此处设置。\n         *    this.dispatchEvent(event);\n         *    Event.release(event);\n         * </pre>\n         * @see #clean()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static create<T extends Event>(EventClass: {\n            new (type: string, bubbles?: boolean, cancelable?: boolean): T;\n            eventPool?: Event[];\n        }, type: string, bubbles?: boolean, cancelable?: boolean): T;\n        /**\n         * Releases an event object and cache it into the object pool.We highly recommend using the Event.create()\n         * and Event.release() methods to create and release an event object,it can reduce the number of reallocate objects,\n         * which allows you to get better code execution performance.<br/>\n         * Note: The parameters of this method only accepts an instance created by the Event.create() method.\n         * if not,it may throw an error.\n         * @example\n         * <pre>\n         *    let event = Event.create(Event,type, bubbles);\n         *    event.data = data; //optional,initializes custom data here\n         *    this.dispatchEvent(event);\n         *    Event.release(event);\n         * </pre>\n         * @see #clean()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放一个事件对象，并缓存到对象池。我们建议您尽可能使用Event.create()和Event.release() 这一对方法来创建和释放事件对象，\n         * 这一对方法会将事件实例在内部缓存下来供下次循环使用，减少对象的创建次数,从而获得更高的代码运行性能。<br/>\n         * 注意：此方法只能传入由Event.create()创建的事件实例，传入非法对象实例可能会导致报错。\n         * @example\n         * <pre>\n         *    let event = Event.create(Event,type, bubbles);\n         *    event.data = data;   //可选，若指定义事件上需要附加其他参数，可以在获取实例后在此处设置。\n         *    this.dispatchEvent(event);\n         *    Event.release(event);\n         * </pre>\n         * @see #clean()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static release(event: Event): void;\n    }\n}\n/**\n * Is debug mode.\n * @version Egret 2.5\n * @platform Web,Native\n * @language en_US\n */\n/**\n * 是否为 debug 模式。\n * @version Egret 2.5\n * @platform Web,Native\n * @language zh_CN\n */\ndeclare let DEBUG: boolean;\n/**\n * Is release mode.\n * @version Egret 2.5\n * @platform Web,Native\n * @language en_US\n */\n/**\n * 是否为 release 模式。\n * @version Egret 2.5\n * @platform Web,Native\n * @language zh_CN\n */\ndeclare let RELEASE: boolean;\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    function $error(code: number, ...params: any[]): void;\n    /**\n     * @private\n     */\n    function $warn(code: number, ...params: any[]): void;\n    /**\n     * @private\n     */\n    function getString(code: number, ...params: any[]): string;\n    /**\n     * @private\n     */\n    function $markCannotUse(instance: any, property: string, defaultVale: any): void;\n}\ndeclare namespace egret {\n    /**\n     * The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal\n     * axis and y represents the vertical axis.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Point.ts\n     * @language en_US\n     */\n    /**\n     * Point 对象表示二维坐标系统中的某个位置，其中 x 表示水平轴，y 表示垂直轴。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Point.ts\n     * @language zh_CN\n     */\n    class Point extends HashObject {\n        /**\n         * Releases a point instance to the object pool\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放一个Point实例到对象池\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static release(point: Point): void;\n        /**\n         * get a point instance from the object pool or create a new one.\n         * @param x The horizontal coordinate.\n         * @param y The vertical coordinate.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从对象池中取出或创建一个新的Point对象。\n         * @param x 该对象的x属性值，默认为0\n         * @param y 该对象的y属性值，默认为0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static create(x: number, y: number): Point;\n        /**\n         * Creates a new point. If you pass no parameters to this method, a point is created at (0,0).\n         * @param x The horizontal coordinate.\n         * @param y The vertical coordinate.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.Point 对象.若不传入任何参数，将会创建一个位于（0，0）位置的点。\n         * @param x 该对象的x属性值，默认为0\n         * @param y 该对象的y属性值，默认为0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(x?: number, y?: number);\n        /**\n         * The horizontal coordinate.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 该点的水平坐标。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        x: number;\n        /**\n         * The vertical coordinate.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 该点的垂直坐标。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        y: number;\n        /**\n         * The length of the line segment from (0,0) to this point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从 (0,0) 到此点的线段长度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly length: number;\n        /**\n         * Sets the members of Point to the specified values\n         * @param x The horizontal coordinate.\n         * @param y The vertical coordinate.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Point 的成员设置为指定值\n         * @param x 该对象的x属性值\n         * @param y 该对象的y属性值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setTo(x: number, y: number): Point;\n        /**\n         * Creates a copy of this Point object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 克隆点对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        clone(): Point;\n        /**\n         * Determines whether two points are equal. Two points are equal if they have the same x and y values.\n         * @param toCompare The point to be compared.\n         * @returns A value of true if the object is equal to this Point object; false if it is not equal.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定两个点是否相同。如果两个点具有相同的 x 和 y 值，则它们是相同的点。\n         * @param toCompare 要比较的点。\n         * @returns 如果该对象与此 Point 对象相同，则为 true 值，如果不相同，则为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        equals(toCompare: Point): boolean;\n        /**\n         * Returns the distance between pt1 and pt2.\n         * @param p1 The first point.\n         * @param p2 The second point.\n         * @returns The distance between the first and second points.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回 pt1 和 pt2 之间的距离。\n         * @param p1 第一个点\n         * @param p2 第二个点\n         * @returns 第一个点和第二个点之间的距离。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static distance(p1: Point, p2: Point): number;\n        /**\n         * Copies all of the point data from the source Point object into the calling Point object.\n         * @param sourcePoint The Point object from which to copy the data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将源 Point 对象中的所有点数据复制到调用方 Point 对象中。\n         * @param sourcePoint 要从中复制数据的 Point 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        copyFrom(sourcePoint: Point): void;\n        /**\n         * Adds the coordinates of another point to the coordinates of this point to create a new point.\n         * @param v The point to be added.\n         * @returns The new point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将另一个点的坐标添加到此点的坐标以创建一个新点。\n         * @param v 要添加的点。\n         * @returns 新点。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        add(v: Point): Point;\n        /**\n         * Determines a point between two specified points.\n         * The parameter f determines where the new interpolated point is located relative to the two end points specified by parameters pt1 and pt2. The closer the value of the parameter f is to 1.0, the closer the interpolated point is to the first point (parameter pt1). The closer the value of the parameter f is to 0, the closer the interpolated point is to the second point (parameter pt2).\n         * @param pt1 The first point.\n         * @param pt2 The second point.\n         * @param f The level of interpolation between the two points. Indicates where the new point will be, along the line between pt1 and pt2. If f=1, pt1 is returned; if f=0, pt2 is returned.\n         * @returns The new interpolated point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定两个指定点之间的点。\n         * 参数 f 确定新的内插点相对于参数 pt1 和 pt2 指定的两个端点所处的位置。参数 f 的值越接近 1.0，则内插点就越接近第一个点（参数 pt1）。参数 f 的值越接近 0，则内插点就越接近第二个点（参数 pt2）。\n         * @param pt1 第一个点。\n         * @param pt2 第二个点。\n         * @param f 两个点之间的内插级别。表示新点将位于 pt1 和 pt2 连成的直线上的什么位置。如果 f=1，则返回 pt1；如果 f=0，则返回 pt2。\n         * @returns 新的内插点。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static interpolate(pt1: Point, pt2: Point, f: number): Point;\n        /**\n         * Scales the line segment between (0,0) and the current point to a set length.\n         * @param thickness The scaling value. For example, if the current point is (0,5), and you normalize it to 1, the point returned is at (0,1).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 (0,0) 和当前点之间的线段缩放为设定的长度。\n         * @param thickness 缩放值。例如，如果当前点为 (0,5) 并且您将它规范化为 1，则返回的点位于 (0,1) 处。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        normalize(thickness: number): void;\n        /**\n         * Offsets the Point object by the specified amount. The value of dx is added to the original value of x to create the new x value. The value of dy is added to the original value of y to create the new y value.\n         * @param dx The amount by which to offset the horizontal coordinate, x.\n         * @param dy The amount by which to offset the vertical coordinate, y.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 按指定量偏移 Point 对象。dx 的值将添加到 x 的原始值中以创建新的 x 值。dy 的值将添加到 y 的原始值中以创建新的 y 值。\n         * @param dx 水平坐标 x 的偏移量。\n         * @param dy 水平坐标 y 的偏移量。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        offset(dx: number, dy: number): void;\n        /**\n         * Converts a pair of polar coordinates to a Cartesian point coordinate.\n         * @param len The length coordinate of the polar pair.\n         * @param angle The angle, in radians, of the polar pair.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将一对极坐标转换为笛卡尔点坐标。\n         * @param len 极坐标对的长度。\n         * @param angle 极坐标对的角度（以弧度表示）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static polar(len: number, angle: number): Point;\n        /**\n         * Subtracts the coordinates of another point from the coordinates of this point to create a new point.\n         * @param v The point to be subtracted.\n         * @returns The new point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从此点的坐标中减去另一个点的坐标以创建一个新点。\n         * @param v 要减去的点。\n         * @returns 新点。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        subtract(v: Point): Point;\n        /**\n         * Returns a string that contains the values of the x and y coordinates. The string has the form \"(x=x, y=y)\", so calling the toString() method for a point at 23,17 would return \"(x=23, y=17)\".\n         * @returns The string representation of the coordinates.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回包含 x 和 y 坐标的值的字符串。该字符串的格式为 \"(x=x, y=y)\"，因此为点 23,17 调用 toString() 方法将返回 \"(x=23, y=17)\"。\n         * @returns 坐标的字符串表示形式。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        toString(): string;\n    }\n    /**\n     * @private\n     * 仅供框架内复用，要防止暴露引用到外部。\n     */\n    let $TempPoint: Point;\n}\ndeclare namespace egret {\n    /**\n     * The DisplayObjectContainer class is a basic display list building block: a display list node that can contain children.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/DisplayObjectContainer.ts\n     * @language en_US\n     */\n    /**\n     * DisplayObjectContainer 类是基本显示列表构造块：一个可包含子项的显示列表节点。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/DisplayObjectContainer.ts\n     * @language zh_CN\n     */\n    class DisplayObjectContainer extends DisplayObject {\n        /**\n         * @private\n         */\n        static $EVENT_ADD_TO_STAGE_LIST: DisplayObject[];\n        /**\n         * @private\n         */\n        static $EVENT_REMOVE_FROM_STAGE_LIST: DisplayObject[];\n        /**\n         * Creates a new DisplayObjectContainer instance.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 实例化一个容器\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        /**\n         * Returns the number of children of this object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回此对象的子项数目。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly numChildren: number;\n        /**\n         * Set children sort mode.\n         * @param value {string} The sort mode\n         * @see egret.ChildrenSortMode\n         * @version Egret 5.2.19\n         * @platform Native\n         * @language en_US\n         */\n        /**\n         * 设置子项目的排序方式\n         * @param value {string} 排序方式\n         * @see egret.ChildrenSortMode\n         * @version Egret 5.2.19\n         * @platform Native\n         * @language en_US\n         */\n        setChildrenSortMode(value: string): void;\n        /**\n         * Adds a child DisplayObject instance to this DisplayObjectContainer instance. The child is added to the front\n         * (top) of all other children in this DisplayObjectContainer instance. (To add a child to a specific index position,\n         * use the addChildAt() method.)If you add a child object that already has a different display object container\n         * as a parent, the object is removed from the child list of the other display object container.\n         * @param child The DisplayObject instance to add as a child of this DisplayObjectContainer instance.\n         * @returns 在 child The DisplayObject instance that you pass in the child parameter.\n         * @see #addChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将一个 DisplayObject 子实例添加到该 DisplayObjectContainer 实例中。子项将被添加到该 DisplayObjectContainer 实例中其他\n         * 所有子项的前（上）面。（要将某子项添加到特定索引位置，请使用 addChildAt() 方法。）\n         * @param child 要作为该 DisplayObjectContainer 实例的子项添加的 DisplayObject 实例。\n         * @returns 在 child 参数中传递的 DisplayObject 实例。\n         * @see #addChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        addChild(child: DisplayObject): DisplayObject;\n        /**\n         * Adds a child DisplayObject instance to this DisplayObjectContainer instance. The child is added at the index position\n         * specified. An index of 0 represents the back (bottom) of the display list for this DisplayObjectContainer object.\n         * If you add a child object that already has a different display object container as a parent, the object is removed\n         * from the child list of the other display object container.\n         * @param child The DisplayObject instance to add as a child of this DisplayObjectContainer instance.\n         * @param index The index position to which the child is added. If you specify a currently occupied index position,\n         * the child object that exists at that position and all higher positions are moved up one position in the child list.\n         * @returns The DisplayObject instance that you pass in the child parameter.\n         * @see #addChild()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将一个 DisplayObject 子实例添加到该 DisplayObjectContainer 实例中。该子项将被添加到指定的索引位置。索引为 0 表示该\n         * DisplayObjectContainer 对象的显示列表的后（底）部。如果添加一个已将其它显示对象容器作为父项的子对象，则会从其它显示对象容器的子列表中删除该对象。\n         * @param child 要作为该 DisplayObjectContainer 实例的子项添加的 DisplayObject 实例。\n         * @param index 添加该子项的索引位置。 如果指定当前占用的索引位置，则该位置以及所有更高位置上的子对象会在子级列表中上移一个位置。\n         * @returns 在 child 参数中传递的 DisplayObject 实例。\n         * @see #addChild()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        addChildAt(child: DisplayObject, index: number): DisplayObject;\n        /**\n         * @private\n         */\n        $doAddChild(child: DisplayObject, index: number, notifyListeners?: boolean): DisplayObject;\n        /**\n         * Determines whether the specified display object is a child of the DisplayObjectContainer instance or the instance\n         * itself. The search includes the entire display list including this DisplayObjectContainer instance. Grandchildren,\n         * great-grandchildren, and so on each return true.\n         * @param child The child object to test.\n         * @returns true if the child object is a child of the DisplayObjectContainer or the container itself; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定指定显示对象是 DisplayObjectContainer 实例的子项或该实例本身。搜索包括整个显示列表（其中包括此 DisplayObjectContainer 实例）。\n         * 孙项、曾孙项等，每项都返回 true。\n         * @param child 要测试的子对象。\n         * @returns 如果 child 对象是 DisplayObjectContainer 的子项或容器本身，则为 true；否则为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        contains(child: DisplayObject): boolean;\n        /**\n         * Returns the child display object instance that exists at the specified index.\n         * @param index The index position of the child object.\n         * @returns The child display object at the specified index position.\n         * @see #getChildByName()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回位于指定索引处的子显示对象实例。\n         * @param index 子对象的索引位置。\n         * @returns 位于指定索引位置处的子显示对象。\n         * @see #getChildByName()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getChildAt(index: number): DisplayObject;\n        /**\n         * Returns the index position of a child DisplayObject instance.\n         * @param child The DisplayObject instance to identify.\n         * @returns The index position of the child display object to identify.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回 DisplayObject 的 child 实例的索引位置。\n         * @param child 要测试的子对象。\n         * @returns 要查找的子显示对象的索引位置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getChildIndex(child: egret.DisplayObject): number;\n        /**\n         * Returns the child display object that exists with the specified name. If more that one child display object has\n         * the specified name, the method returns the first object in the child list.The getChildAt() method is faster than\n         * the getChildByName() method. The getChildAt() method accesses a child from a cached array, whereas the getChildByName()\n         * method has to traverse a linked list to access a child.\n         * @param name The name of the child to return.\n         * @returns The child display object with the specified name.\n         * @see #getChildAt()\n         * @see egret.DisplayObject#name\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回具有指定名称的子显示对象。如果多个子显示对象具有指定名称，则该方法会返回子级列表中的第一个对象。\n         * getChildAt() 方法比 getChildByName() 方法快。getChildAt() 方法从缓存数组中访问子项，而 getChildByName() 方法则必须遍历链接的列表来访问子项。\n         * @param name 要返回的子项的名称。\n         * @returns 具有指定名称的子显示对象。\n         * @see #getChildAt()\n         * @see egret.DisplayObject#name\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getChildByName(name: string): DisplayObject;\n        /**\n         * Removes the specified child DisplayObject instance from the child list of the DisplayObjectContainer instance.\n         * The parent property of the removed child is set to null , and the object is garbage collected if no other references\n         * to the child exist. The index positions of any display objects above the child in the DisplayObjectContainer are\n         * decreased by 1.\n         * @param child The DisplayObject instance to remove.\n         * @returns The DisplayObject instance that you pass in the child parameter.\n         * @see #removeChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从 DisplayObjectContainer 实例的子列表中删除指定的 child DisplayObject 实例。将已删除子项的 parent 属性设置为 null；\n         * 如果不存在对该子项的任何其它引用，则将该对象作为垃圾回收。DisplayObjectContainer 中该子项之上的任何显示对象的索引位置都减去 1。\n         * @param child 要删除的 DisplayObject 实例。\n         * @returns 在 child 参数中传递的 DisplayObject 实例。\n         * @see #removeChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        removeChild(child: DisplayObject): DisplayObject;\n        /**\n         * Removes a child DisplayObject from the specified index position in the child list of the DisplayObjectContainer.\n         * The parent property of the removed child is set to null, and the object is garbage collected if no other references\n         * to the child exist. The index positions of any display objects above the child in the DisplayObjectContainer are decreased by 1.\n         * @param index The child index of the DisplayObject to remove.\n         * @returns The DisplayObject instance that was removed.\n         * @see #removeChild()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从 DisplayObjectContainer 的子列表中指定的 index 位置删除子 DisplayObject。将已删除子项的 parent 属性设置为 null；\n         * 如果没有对该子项的任何其他引用，则将该对象作为垃圾回收。DisplayObjectContainer 中该子项之上的任何显示对象的索引位置都减去 1。\n         * @param index 要删除的 DisplayObject 的子索引。\n         * @returns 已删除的 DisplayObject 实例。\n         * @see #removeChild()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        removeChildAt(index: number): DisplayObject;\n        /**\n         * @private\n         */\n        $doRemoveChild(index: number, notifyListeners?: boolean): DisplayObject;\n        /**\n         * Changes the position of an existing child in the display object container. This affects the layering of child objects.\n         * @param child The child DisplayObject instance for which you want to change the index number.\n         * @param index The resulting index number for the child display object.\n         * @see #addChildAt()\n         * @see #getChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 更改现有子项在显示对象容器中的位置。这会影响子对象的分层。\n         * @param child 要为其更改索引编号的 DisplayObject 子实例。\n         * @param index 生成的 child 显示对象的索引编号。当新的索引编号小于0或大于已有子元件数量时，新加入的DisplayObject对象将会放置于最上层。\n         * @see #addChildAt()\n         * @see #getChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setChildIndex(child: DisplayObject, index: number): void;\n        /**\n         * @private\n         */\n        private doSetChildIndex(child, index);\n        /**\n         * Swaps the z-order (front-to-back order) of the child objects at the two specified index positions in the child\n         * list. All other child objects in the display object container remain in the same index positions.\n         * @param index1 The index position of the first child object.\n         * @param index2 The index position of the second child object.\n         * @see #swapChildren()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在子级列表中两个指定的索引位置，交换子对象的 Z 轴顺序（前后顺序）。显示对象容器中所有其他子对象的索引位置保持不变。\n         * @param index1 第一个子对象的索引位置。\n         * @param index2 第二个子对象的索引位置。\n         * @see #swapChildren()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        swapChildrenAt(index1: number, index2: number): void;\n        /**\n         * Swaps the z-order (front-to-back order) of the two specified child objects. All other child objects in the\n         * display object container remain in the same index positions.\n         * @param child1 The first child object.\n         * @param child2 The second child object.\n         * @see #swapChildrenAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 交换两个指定子对象的 Z 轴顺序（从前到后顺序）。显示对象容器中所有其他子对象的索引位置保持不变。\n         * @param child1 第一个子对象。\n         * @param child2 第二个子对象。\n         * @see #swapChildrenAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        swapChildren(child1: DisplayObject, child2: DisplayObject): void;\n        /**\n         * @private\n         */\n        private doSwapChildrenAt(index1, index2);\n        /**\n         * Removes all child DisplayObject instances from the child list of the DisplayObjectContainer instance. The parent\n         * property of the removed children is set to null , and the objects are garbage collected if no other references to the children exist.\n         * @see #removeChild()\n         * @see #removeChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从 DisplayObjectContainer 实例的子级列表中删除所有 child DisplayObject 实例。\n         * @see #removeChild()\n         * @see #removeChildAt()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        removeChildren(): void;\n        /**\n         * @private\n         * 一个子项被添加到容器内，此方法不仅在操作addChild()时会被回调，在操作setChildIndex()或swapChildren时也会回调。\n         * 当子项索引发生改变时，会先触发$childRemoved()方法，然后触发$childAdded()方法。\n         */\n        $childAdded(child: DisplayObject, index: number): void;\n        /**\n         * @private\n         * 一个子项从容器内移除，此方法不仅在操作removeChild()时会被回调，在操作setChildIndex()或swapChildren时也会回调。\n         * 当子项索引发生改变时，会先触发$childRemoved()方法，然后触发$childAdded()方法。\n         */\n        $childRemoved(child: DisplayObject, index: number): void;\n        /**\n         * @private\n         */\n        $onAddToStage(stage: Stage, nestLevel: number): void;\n        /**\n         * @private\n         *\n         */\n        $onRemoveFromStage(): void;\n        /**\n         * @private\n         */\n        $measureChildBounds(bounds: Rectangle): void;\n        $touchChildren: boolean;\n        /**\n         * Determines whether or not the children of the object are touch, or user input device, enabled. If an object is\n         * enabled, a user can interact with it by using a touch or user input device.\n         * @default true\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定对象的子级是否支持触摸或用户输入设备。如果对象支持触摸或用户输入设备，用户可以通过使用触摸或用户输入设备与之交互。\n         * @default true\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        touchChildren: boolean;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getTouchChildren(): boolean;\n        /**\n         * @private\n         */\n        $setTouchChildren(value: boolean): boolean;\n        /**\n         * @private\n         */\n        $hitTest(stageX: number, stageY: number): DisplayObject;\n        private _sortChildrenFunc(a, b);\n        sortChildren(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * SpriteSheet is a mosaic of multiple sub-bitmaps, comprising a plurality of Texture objects.\n     * Each Texture object shares the set bitmap of SpriteSheet, but it points to its different areas.\n     * On WebGL / OpenGL, this operation can significantly improve performance.\n     * At the same time, SpriteSheet can carry out material integration easily to reduce the number of HTTP requests\n     * For specification of the SpriteSheet format, see the document https://github.com/egret-labs/egret-core/wiki/Egret-SpriteSheet-Specification\n     * @see http://edn.egret.com/cn/docs/page/135 The use of texture packs\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/SpriteSheet.ts\n     * @language en_US\n     */\n    /**\n     * SpriteSheet 是一张由多个子位图拼接而成的集合位图，它包含多个 Texture 对象。\n     * 每一个 Texture 都共享 SpriteSheet 的集合位图，但是指向它的不同的区域。\n     * 在WebGL / OpenGL上，这种做法可以显著提升性能\n     * 同时，SpriteSheet可以很方便的进行素材整合，降低HTTP请求数量\n     * SpriteSheet 格式的具体规范可以参见此文档  https://github.com/egret-labs/egret-core/wiki/Egret-SpriteSheet-Specification\n     * @see http://edn.egret.com/cn/docs/page/135 纹理集的使用\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/SpriteSheet.ts\n     * @language zh_CN\n     */\n    class SpriteSheet extends HashObject {\n        /**\n         * Create an egret.SpriteSheet object\n         * @param texture {Texture} Texture\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.SpriteSheet 对象\n         * @param texture {Texture} 纹理\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(texture: Texture);\n        /**\n         * @private\n         * 表示这个SpriteSheet的位图区域在bitmapData上的起始位置x。\n         */\n        private _bitmapX;\n        /**\n         * @private\n         * 表示这个SpriteSheet的位图区域在bitmapData上的起始位置y。\n         */\n        private _bitmapY;\n        /**\n         * @private\n         * 共享的位图数据\n         */\n        $texture: Texture;\n        /**\n         * @private\n         * 纹理缓存字典\n         */\n        _textureMap: MapLike<Texture>;\n        /**\n         * Obtain a cached Texture object according to the specified texture name\n         * @param name {string} Cache the name of this Texture object\n         * @returns {egret.Texture} The Texture object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 根据指定纹理名称获取一个缓存的 Texture 对象\n         * @param name {string} 缓存这个 Texture 对象所使用的名称\n         * @returns {egret.Texture} Texture 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getTexture(name: string): Texture;\n        /**\n         * Create a new Texture object for the specified area on SpriteSheet and cache it\n         * @param name {string} Cache the name of this Texture object. If the name already exists, the previous Texture object will be overwrited.\n         * @param bitmapX {number} Starting coordinate x of texture area on bitmapData\n         * @param bitmapY {number} Starting coordinate y of texture area on bitmapData\n         * @param bitmapWidth {number} Width of texture area on bitmapData\n         * @param bitmapHeight {number} Height of texture area on bitmapData\n         * @param offsetX {number} Starting point x for a non-transparent area of the original bitmap\n         * @param offsetY {number} Starting point y for a non-transparent area of the original bitmap\n         * @param textureWidth {number} Width of the original bitmap. If it is not passed, use the bitmapWidth  value.\n         * @param textureHeight {number} Height of the original bitmap. If it is not passed, use the bitmapHeight value.\n         * @returns {egret.Texture} The created Texture object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 为 SpriteSheet 上的指定区域创建一个新的 Texture 对象并缓存它\n         * @param name {string} 缓存这个 Texture 对象所使用的名称，如果名称已存在，将会覆盖之前的 Texture 对象\n         * @param bitmapX {number} 纹理区域在 bitmapData 上的起始坐标x\n         * @param bitmapY {number} 纹理区域在 bitmapData 上的起始坐标y\n         * @param bitmapWidth {number} 纹理区域在 bitmapData 上的宽度\n         * @param bitmapHeight {number} 纹理区域在 bitmapData 上的高度\n         * @param offsetX {number} 原始位图的非透明区域 x 起始点\n         * @param offsetY {number} 原始位图的非透明区域 y 起始点\n         * @param textureWidth {number} 原始位图的高度，若不传入，则使用 bitmapWidth 的值。\n         * @param textureHeight {number} 原始位图的宽度，若不传入，则使用 bitmapHeight 的值。\n         * @returns {egret.Texture} 创建的 Texture 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        createTexture(name: string, bitmapX: number, bitmapY: number, bitmapWidth: number, bitmapHeight: number, offsetX?: number, offsetY?: number, textureWidth?: number, textureHeight?: number): Texture;\n        /**\n         * dispose texture\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放纹理\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        dispose(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    let $locale_strings: any;\n    /**\n     * @private\n     */\n    let $language: string;\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 全局多语言翻译函数\n     * @param code 要查询的字符串代码\n     * @param args 替换字符串中{0}标志的参数列表\n     * @returns 返回拼接后的字符串\n     */\n    function tr(code: number, ...args: any[]): string;\n}\ndeclare namespace egret {\n    /**\n     * The Bitmap class represents display objects that represent bitmap images.\n     * The Bitmap() constructor allows you to create a Bitmap object that contains a reference to a BitmapData object.\n     * After you create a Bitmap object, use the addChild() or addChildAt() method of the parent DisplayObjectContainer\n     * instance to place the bitmap on the display list.A Bitmap object can share its texture reference among several\n     * Bitmap objects, independent of translation or rotation properties. Because you can create multiple Bitmap objects\n     * that reference the same texture object, multiple display objects can use the same complex texture object\n     * without incurring the memory overhead of a texture object for each display object instance.\n     *\n     * @see egret.Texture\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Bitmap.ts\n     * @language en_US\n     */\n    /**\n     * Bitmap 类表示用于显示位图图片的显示对象。\n     * 利用 Bitmap() 构造函数，可以创建包含对 BitmapData 对象引用的 Bitmap 对象。创建了 Bitmap 对象后，\n     * 使用父级 DisplayObjectContainer 实例的 addChild() 或 addChildAt() 方法可以将位图放在显示列表中。\n     * 一个 Bitmap 对象可在若干 Bitmap 对象之中共享其 texture 引用，与缩放或旋转属性无关。\n     * 由于能够创建引用相同 texture 对象的多个 Bitmap 对象，因此，多个显示对象可以使用相同的 texture 对象，\n     * 而不会因为每个显示对象实例使用一个 texture 对象而产生额外内存开销。\n     *\n     * @see egret.Texture\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Bitmap.ts\n     * @language zh_CN\n     */\n    class Bitmap extends DisplayObject {\n        /**\n         * Initializes a Bitmap object to refer to the specified Texture object.\n         * @param value The Texture object being referenced.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个引用指定 Texture 实例的 Bitmap 对象\n         * @param value 被引用的 Texture 实例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(value?: Texture);\n        protected $texture: Texture;\n        $bitmapData: BitmapData;\n        protected $bitmapX: number;\n        protected $bitmapY: number;\n        protected $bitmapWidth: number;\n        protected $bitmapHeight: number;\n        protected $offsetX: number;\n        protected $offsetY: number;\n        protected $textureWidth: number;\n        protected $textureHeight: number;\n        protected $sourceWidth: number;\n        protected $sourceHeight: number;\n        protected $smoothing: boolean;\n        protected $explicitBitmapWidth: number;\n        protected $explicitBitmapHeight: number;\n        protected createNativeDisplayObject(): void;\n        /**\n         * @private\n         * 显示对象添加到舞台\n         */\n        $onAddToStage(stage: Stage, nestLevel: number): void;\n        /**\n         * @private\n         * 显示对象从舞台移除\n         */\n        $onRemoveFromStage(): void;\n        /**\n         * The Texture object being referenced.\n         * If you pass the constructor of type BitmapData or last set for bitmapData, this value returns null.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 被引用的 Texture 对象。\n         * 如果传入构造函数的类型为 BitmapData 或者最后设置的为 bitmapData，则此值返回 null。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        texture: Texture;\n        /**\n         * @private\n         */\n        $setTexture(value: Texture): boolean;\n        $setBitmapData(value: any): void;\n        /**\n         * @private\n         */\n        protected setBitmapDataToWasm(data?: Texture): void;\n        /**\n         * @private\n         */\n        $refreshImageData(): void;\n        /**\n         * @private\n         */\n        private setImageData(bitmapData, bitmapX, bitmapY, bitmapWidth, bitmapHeight, offsetX, offsetY, textureWidth, textureHeight, sourceWidth, sourceHeight);\n        /**\n         * @private\n         */\n        $scale9Grid: egret.Rectangle;\n        /**\n         * Represent a Rectangle Area that the 9 scale area of Image.\n         * Notice: This property is valid only when <code>fillMode</code>\n         * is <code>BitmapFillMode.SCALE</code>.\n         *\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 矩形区域，它定义素材对象的九个缩放区域。\n         * 注意:此属性仅在<code>fillMode</code>为<code>BitmapFillMode.SCALE</code>时有效。\n         *\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        scale9Grid: egret.Rectangle;\n        protected $setScale9Grid(value: egret.Rectangle): void;\n        /**\n         * @private\n         */\n        $fillMode: string;\n        /**\n         * Determines how the bitmap fills in the dimensions.\n         * <p>When set to <code>BitmapFillMode.REPEAT</code>, the bitmap\n         * repeats to fill the region.</p>\n         * <p>When set to <code>BitmapFillMode.SCALE</code>, the bitmap\n         * stretches to fill the region.</p>\n         *\n         * @default <code>BitmapFillMode.SCALE</code>\n         *\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 确定位图填充尺寸的方式。\n         * <p>设置为 <code>BitmapFillMode.REPEAT</code>时，位图将重复以填充区域。</p>\n         * <p>设置为 <code>BitmapFillMode.SCALE</code>时，位图将拉伸以填充区域。</p>\n         *\n         * @default <code>BitmapFillMode.SCALE</code>\n         *\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        fillMode: string;\n        $setFillMode(value: string): boolean;\n        /**\n         * The default value of whether or not is smoothed when scaled.\n         * When object such as Bitmap is created,smoothing property will be set to this value.\n         * @default true。\n         * @version Egret 3.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 控制在缩放时是否进行平滑处理的默认值。\n         * 在 Bitmap 等对象创建时,smoothing 属性会被设置为该值。\n         * @default true。\n         * @version Egret 3.0\n         * @platform Web\n         * @language zh_CN\n         */\n        static defaultSmoothing: boolean;\n        /**\n         * Whether or not the bitmap is smoothed when scaled.\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 控制在缩放时是否对位图进行平滑处理。\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        smoothing: boolean;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setWidth(value: number): boolean;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setHeight(value: number): boolean;\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        $getWidth(): number;\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        $getHeight(): number;\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        /**\n         * @private\n         */\n        $updateRenderNode(): void;\n        private _pixelHitTest;\n        /**\n         * Specifies whether this object use precise hit testing by checking the alpha value of each pixel.If pixelHitTest\n         * is set to true,the transparent area of the bitmap will be touched through.<br/>\n         * Note:If the image is loaded from cross origin,that we can't access to the pixel data,so it might cause\n         * the pixelHitTest property invalid.\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否开启精确像素碰撞。设置为true显示对象本身的透明区域将能够被穿透。<br/>\n         * 注意：若图片资源是以跨域方式从外部服务器加载的，将无法访问图片的像素数据，而导致此属性失效。\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        pixelHitTest: boolean;\n        $hitTest(stageX: number, stageY: number): DisplayObject;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 渲染节点类型\n     */\n    const enum RenderNodeType {\n        /**\n         * 位图渲染节点\n         */\n        BitmapNode = 1,\n        /**\n         * 文本渲染节点\n         */\n        TextNode = 2,\n        /**\n         * 矢量渲染节点\n         */\n        GraphicsNode = 3,\n        /**\n         * 组渲染节点\n         */\n        GroupNode = 4,\n        /**\n         * Mesh 节点\n         */\n        MeshNode = 5,\n        /**\n         * 普通位图渲染节点\n         */\n        NormalBitmapNode = 6,\n    }\n    /**\n     * @private\n     * 渲染节点基类\n     */\n    class RenderNode {\n        /**\n         * 节点类型..\n         */\n        type: number;\n        /**\n         * 绘制数据\n         */\n        drawData: any[];\n        /**\n         * 绘制次数\n         */\n        protected renderCount: number;\n        /**\n         * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n         */\n        cleanBeforeRender(): void;\n        $getRenderCount(): number;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 路径类型\n     */\n    const enum PathType {\n        /**\n         * 纯色填充路径\n         */\n        Fill = 1,\n        /**\n         * 渐变填充路径\n         */\n        GradientFill = 2,\n        /**\n         * 线条路径\n         */\n        Stroke = 3,\n    }\n    /**\n     * @private\n     * 2D路径命令\n     */\n    const enum PathCommand {\n        MoveTo = 1,\n        LineTo = 2,\n        CurveTo = 3,\n        CubicCurveTo = 4,\n    }\n    /**\n     * @private\n     * 2D路径\n     */\n    class Path2D {\n        /**\n         * 路径类型\n         */\n        type: number;\n        $commands: number[];\n        $data: number | number[][];\n        protected commandPosition: number;\n        protected dataPosition: number;\n        /**\n         * 当前移动到的坐标X\n         * 注意：目前只有drawArc之前会被赋值\n         */\n        $lastX: number;\n        /**\n         * 当前移动到的坐标Y\n         * 注意：目前只有drawArc之前会被赋值\n         */\n        $lastY: number;\n        /**\n         * 将当前绘图位置移动到 (x, y)。如果缺少任何一个参数，则此方法将失败，并且当前绘图位置不改变。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         */\n        moveTo(x: number, y: number): void;\n        /**\n         * 使用当前线条样式绘制一条从当前绘图位置开始到 (x, y) 结束的直线；当前绘图位置随后会设置为 (x, y)。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         */\n        lineTo(x: number, y: number): void;\n        /**\n         * 使用当前线条样式和由 (controlX, controlY) 指定的控制点绘制一条从当前绘图位置开始到 (anchorX, anchorY) 结束的二次贝塞尔曲线。当前绘图位置随后设置为 (anchorX, anchorY)。\n         * 如果在调用 moveTo() 方法之前调用了 curveTo() 方法，则当前绘图位置的默认值为 (0, 0)。如果缺少任何一个参数，则此方法将失败，并且当前绘图位置不改变。\n         * 绘制的曲线是二次贝塞尔曲线。二次贝塞尔曲线包含两个锚点和一个控制点。该曲线内插这两个锚点，并向控制点弯曲。\n         * @param controlX 一个数字，指定控制点相对于父显示对象注册点的水平位置。\n         * @param controlY 一个数字，指定控制点相对于父显示对象注册点的垂直位置。\n         * @param anchorX 一个数字，指定下一个锚点相对于父显示对象注册点的水平位置。\n         * @param anchorY 一个数字，指定下一个锚点相对于父显示对象注册点的垂直位置。\n         */\n        curveTo(controlX: number, controlY: number, anchorX: number, anchorY: number): void;\n        /**\n         * 从当前绘图位置到指定的锚点绘制一条三次贝塞尔曲线。三次贝塞尔曲线由两个锚点和两个控制点组成。该曲线内插这两个锚点，并向两个控制点弯曲。\n         * @param controlX1 指定首个控制点相对于父显示对象的注册点的水平位置。\n         * @param controlY1 指定首个控制点相对于父显示对象的注册点的垂直位置。\n         * @param controlX2 指定第二个控制点相对于父显示对象的注册点的水平位置。\n         * @param controlY2 指定第二个控制点相对于父显示对象的注册点的垂直位置。\n         * @param anchorX 指定锚点相对于父显示对象的注册点的水平位置。\n         * @param anchorY 指定锚点相对于父显示对象的注册点的垂直位置。\n         */\n        cubicCurveTo(controlX1: number, controlY1: number, controlX2: number, controlY2: number, anchorX: number, anchorY: number): void;\n        /**\n         * 绘制一个矩形\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         */\n        drawRect(x: number, y: number, width: number, height: number): void;\n        /**\n         * 绘制一个圆角矩形。\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @param ellipseWidth 用于绘制圆角的椭圆的宽度（以像素为单位）。\n         * @param ellipseHeight 用于绘制圆角的椭圆的高度（以像素为单位）。 （可选）如果未指定值，则默认值与为 ellipseWidth 参数提供的值相匹配。\n         */\n        drawRoundRect(x: number, y: number, width: number, height: number, ellipseWidth: number, ellipseHeight?: number): void;\n        /**\n         * 绘制一个圆。\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param radius 圆的半径（以像素为单位）。\n         */\n        drawCircle(x: number, y: number, radius: number): void;\n        /**\n         * 绘制一个椭圆。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         */\n        drawEllipse(x: number, y: number, width: number, height: number): void;\n        /**\n         * 绘制一段圆弧路径。圆弧路径的圆心在 (x, y) 位置，半径为 r ，根据anticlockwise （默认为顺时针）指定的方向从 startAngle 开始绘制，到 endAngle 结束。\n         * @param x 圆弧中心（圆心）的 x 轴坐标。\n         * @param y 圆弧中心（圆心）的 y 轴坐标。\n         * @param radius 圆弧的半径。\n         * @param startAngle 圆弧的起始点， x轴方向开始计算，单位以弧度表示。\n         * 注意，必须在0~2π之间。\n         * @param endAngle 圆弧的终点， 单位以弧度表示。\n         * 注意，必须在0~2π之间。\n         * @param anticlockwise 如果为 true，逆时针绘制圆弧，反之，顺时针绘制。\n         */\n        drawArc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise: boolean): void;\n        /**\n         * 绘制一段圆弧路径\n         * @param x 圆弧中心（圆心）的 x 轴坐标。\n         * @param y 圆弧中心（圆心）的 y 轴坐标。\n         * @param radiusX 圆弧的半径 x。\n         * @param radiusY 圆弧的半径 y。\n         * @param startAngle 圆弧的起始点， x轴方向开始计算，单位以弧度表示。\n         * 注意：必须为正数。\n         * @param endAngle 圆弧的终点， 单位以弧度表示。\n         * 注意：与startAngle差值必须在0~2π之间。\n         * @param anticlockwise 如果为 true，逆时针绘制圆弧，反之，顺时针绘制。\n         * 注意：如果为true，endAngle必须小于startAngle，反之必须大于。\n         */\n        private arcToBezier(x, y, radiusX, radiusY, startAngle, endAngle, anticlockwise?);\n    }\n}\ndeclare namespace egret {\n    /**\n     * Writes an error message to the console if the assertion is false. If the assertion is true, nothing will happen.\n     * @param assertion Any boolean expression. If the assertion is false, the message will get written to the console.\n     * @param message the message written to the console\n     * @param optionalParams the extra messages written to the console\n     * @language en_US\n     */\n    /**\n     * 判断参数assertion是否为true，若为false则抛出异常并且在console输出相应信息，反之什么也不做。\n     * @param assertion 一个 boolean 表达式，若结果为false，则抛出错误并输出信息。\n     * @param message 要输出到控制台的信息\n     * @param optionalParams 要输出到控制台的额外可选信息\n     * @language zh_CN\n     */\n    function assert(assertion?: boolean, message?: string, ...optionalParams: any[]): void;\n    /**\n     * Writes a warning message to the console.\n     * @param message the message written to the console\n     * @param optionalParams the extra messages written to the console\n     * @language en_US\n     */\n    /**\n     * 输出一个警告信息到控制台。\n     * @param message 要输出到控制台的信息\n     * @param optionalParams 要输出到控制台的额外信息\n     * @language zh_CN\n     */\n    function warn(message?: any, ...optionalParams: any[]): void;\n    /**\n     * Writes an error message to the console.\n     * @param message the message written to the console\n     * @param optionalParams the extra messages written to the console\n     * @language en_US\n     */\n    /**\n     * 输出一个错误信息到控制台。\n     * @param message 要输出到控制台的信息\n     * @param optionalParams 要输出到控制台的额外信息\n     * @language zh_CN\n     */\n    function error(message?: any, ...optionalParams: any[]): void;\n    /**\n     * Writes an message to the console.\n     * @param message the message written to the console\n     * @param optionalParams the extra messages written to the console\n     * @language en_US\n     */\n    /**\n     * 输出一个日志信息到控制台。\n     * @param message 要输出到控制台的信息\n     * @param optionalParams 要输出到控制台的额外信息\n     * @language zh_CN\n     */\n    function log(message?: any, ...optionalParams: any[]): void;\n}\n/**\n * @private\n */\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    let fontMapping: {};\n}\n/**\n * @private\n */\ndeclare namespace egret_native {\n    function readUpdateFileSync(filePath: any): any;\n    function readResourceFileSync(filePath: any): any;\n    function sendInfoToPlugin(info: string): void;\n    function receivedPluginInfo(info: string): void;\n    function nrInit(): void;\n    function nrDownloadBuffers(callback: (displayCmdBuffer: Float32Array) => void): void;\n    function nrSetRenderMode(mode: number): void;\n    function nrRenderDisplayObject(id: number, scale: number, useClip: boolean, clipX: number, clipY: number, clipW: number, clipH: number): void;\n    function nrRenderDisplayObject2(id: number, offsetX: number, offsetY: number, forHitTest: boolean): void;\n    function nrLocalToGlobal(id: number, localX: number, localY: number): string;\n    function nrGlobalToLocal(id: number, globalX: number, globalY: number): string;\n    function nrGetTextFieldWidth(id: number): number;\n    function nrGetTextFieldHeight(id: number): number;\n    function nrGetTextWidth(id: number): number;\n    function nrGetTextHeight(id: number): number;\n    function nrResize(width: number, height: number): void;\n    function nrSetCanvasScaleFactor(factor: number, scalex: number, scaley: number): void;\n    function nrUpdate(): void;\n    function nrRender(): void;\n    function nrSendTextFieldData(textFieldId: number, strData: string): void;\n    function nrUpdateCallbackList(dt: number): void;\n    function nrActiveBuffer(id: number, width: number, height: number): void;\n    function nrGetPixels(x: number, y: number, width: number, height: number, pixels: Uint8Array): void;\n    function nrGetCustomImageId(type: number): number;\n    function nrSetCustomImageData(customImageId: number, pvrtcData: any, width: any, height: any, mipmapsCount: any, format: any): void;\n    class NrNode {\n        constructor(id: number, type: number);\n    }\n}\n/**\n * @private\n */\ndeclare namespace egret_native {\n    let rootWebGLBuffer: egret.sys.RenderBuffer;\n    let forHitTest: boolean;\n    let addModuleCallback: (callback: Function, thisObj: any) => void;\n    let initNativeRender: () => void;\n    let updateNativeRender: () => void;\n    let activateBuffer: (buffer: egret.sys.RenderBuffer) => void;\n    let getJsCustomFilterVertexSrc: (key: any) => any;\n    let getJsCustomFilterFragSrc: (key: any) => any;\n    let getJsCustomFilterUniforms: (key: any) => any;\n    let nrABIVersion: number;\n    let nrMinEgretVersion: string;\n}\ndeclare namespace egret_native {\n    /**\n     * @private\n     */\n    class NativeRenderSurface {\n        width: number;\n        height: number;\n        constructor(currRenderBuffer: any, w?: number, h?: number, root?: boolean);\n        resize(w: number, h: number): void;\n    }\n    /**\n     * @private\n     */\n    class NativeBitmapData {\n        $init(): any;\n        $id: any;\n    }\n    /**\n     * @private\n     */\n    class NativeDisplayObject {\n        id: number;\n        constructor(type: number);\n        setChildrenSortMode(mode: string): void;\n        addChildAt(childId: number, index: number): void;\n        removeChild(childId: number): void;\n        swapChild(index1: number, index2: number): void;\n        setX(value: number): void;\n        setY(value: number): void;\n        setRotation(value: number): void;\n        setScaleX(value: number): void;\n        setScaleY(value: number): void;\n        setSkewX(value: number): void;\n        setSkewY(value: number): void;\n        setAlpha(value: number): void;\n        setAnchorOffsetX(value: number): void;\n        setAnchorOffsetY(value: number): void;\n        setVisible(value: boolean): void;\n        setBlendMode(value: number): void;\n        setMaskRect(x: number, y: number, w: number, h: number): void;\n        setScrollRect(x: number, y: number, w: number, h: number): void;\n        setFilters(filters: Array<egret.Filter>): void;\n        static createFilter(filter: egret.Filter): void;\n        static setFilterPadding(filterId: number, paddingTop: number, paddingBottom: number, paddingLeft: number, paddingRight: number): void;\n        setMask(value: number): void;\n        static setSourceToNativeBitmapData(nativeBitmapData: egret_native.NativeBitmapData, source: any): any;\n        setTexture(texture: egret.Texture): void;\n        setBitmapDataToMesh(texture: egret.Texture): void;\n        setBitmapDataToParticle(texture: egret.Texture): void;\n        setWidth(value: number): void;\n        setHeight(value: number): void;\n        setCacheAsBitmap(value: boolean): void;\n        setBitmapFillMode(fillMode: string): void;\n        setScale9Grid(x: number, y: number, w: number, h: number): void;\n        setMatrix(a: number, b: number, c: number, d: number, tx: number, ty: number): void;\n        setIsTyping(value: boolean): void;\n        setDataToBitmapNode(id: number, texture: egret.Texture, arr: number[]): void;\n        setDataToMesh(vertexArr: number[], indiceArr: number[], uvArr: number[]): void;\n        static setDataToFilter(currFilter: egret.Filter): void;\n        static disposeNativeBitmapData(nativeBitmapData: egret_native.NativeBitmapData): void;\n        static disposeTextData(node: egret.TextField): void;\n        static disposeGraphicData(graphic: egret.Graphics): void;\n        setFontSize(value: number): void;\n        setLineSpacing(value: number): void;\n        setTextColor(value: number): void;\n        setTextFieldWidth(value: number): void;\n        setTextFieldHeight(value: number): void;\n        setFontFamily(value: string): void;\n        setTextFlow(textArr: Array<egret.ITextElement>): void;\n        setTextAlign(value: string): void;\n        setVerticalAlign(value: string): void;\n        setText(value: string): void;\n        setBold(value: boolean): void;\n        setItalic(value: boolean): void;\n        setWordWrap(value: boolean): void;\n        setMaxChars(value: number): void;\n        setType(value: string): void;\n        setStrokeColor(value: number): void;\n        setStroke(value: number): void;\n        setScrollV(value: number): void;\n        setMultiline(value: boolean): void;\n        setBorder(value: boolean): void;\n        setBorderColor(value: number): void;\n        setBackground(value: boolean): void;\n        setBackgroundColor(value: number): void;\n        setInputType(value: string): void;\n        setBeginFill(color: number, alpha?: number): void;\n        setBeginGradientFill(type: string, colors: number[], alphas: number[], ratios: number[], matrix: egret.Matrix): void;\n        setEndFill(): void;\n        setLineStyle(thickness?: number, color?: number, alpha?: number, pixelHinting?: boolean, scaleMode?: string, caps?: string, joints?: string, miterLimit?: number, lineDash?: number[]): void;\n        setDrawRect(x: number, y: number, width: number, height: number): void;\n        setDrawRoundRect(x: number, y: number, width: number, height: number, ellipseWidth: number, ellipseHeight?: number): void;\n        setDrawCircle(x: number, y: number, radius: number): void;\n        setDrawEllipse(x: number, y: number, width: number, height: number): void;\n        setMoveTo(x: number, y: number): void;\n        setLineTo(x: number, y: number): void;\n        setCurveTo(controlX: number, controlY: number, anchorX: number, anchorY: number): void;\n        setCubicCurveTo(controlX1: number, controlY1: number, controlX2: number, controlY2: number, anchorX: number, anchorY: number): void;\n        setDrawArc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\n        setGraphicsClear(): void;\n    }\n}\n/**\n * @private\n */\ndeclare namespace egret_native {\n    /**\n     * @private\n     */\n    const enum NativeObjectType {\n        /**\n         * 容器\n         */\n        CONTAINER = 0,\n        /**\n         * 位图\n         */\n        BITMAP = 1,\n        /**\n         * 位图数据\n         */\n        BITMAP_DATA = 2,\n        /**\n         * 滤镜\n         */\n        FILTER = 6,\n        /**\n         * 文本\n         */\n        TEXT = 7,\n        /**\n         * 矢量绘图\n         */\n        GRAPHICS = 8,\n        /**\n         * 含一个适量绘图的容器\n         */\n        SPRITE = 9,\n        /**\n         * 粒子系统\n         */\n        PARTICLE_SYSTEM = 10,\n        /**\n         * 位图文本\n         */\n        BITMAP_TEXT = 11,\n        /**\n         * 网格\n         */\n        MESH = 12,\n        /**\n         * 舞台（根容器）\n         */\n        STAGE = 13,\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    interface MapLike<T> {\n        [key: string]: T;\n        [key: number]: T;\n    }\n    /**\n     * @private\n     */\n    function createMap<T>(): MapLike<T>;\n}\ndeclare namespace egret {\n    /**\n     * @class egret.GlowFilter\n     * @classdesc\n     * 使用 GlowFilter 类可以对显示对象应用发光效果。在投影滤镜的 distance 和 angle 属性设置为 0 时，发光滤镜与投影滤镜极为相似。\n     * @extends egret.Filter\n     * @version Egret 3.1.4\n     * @platform Web,Native\n     */\n    class GlowFilter extends Filter {\n        /**\n         * @private\n         */\n        $red: number;\n        /**\n         * @private\n         */\n        $green: number;\n        /**\n         * @private\n         */\n        $blue: number;\n        /**\n         * Initializes a new GlowFilter instance.\n         * @method egret.GlowFilter#constructor\n         * @param color {number} The color of the glow. Valid values are in the hexadecimal format 0xRRGGBB. The default value is 0xFF0000.\n         * @param alpha {number} The alpha transparency value for the color. Valid values are 0 to 1. For example, .25 sets a transparency value of 25%. The default value is 1.\n         * @param blurX {number} The amount of horizontal blur. Valid values are 0 to 255 (floating point).\n         * @param blurY {number} The amount of vertical blur. Valid values are 0 to 255 (floating point).\n         * @param strength {number} The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the glow and the background. Valid values are 0 to 255.\n         * @param quality {number} The number of times to apply the filter.\n         * @param inner {boolean} Specifies whether the glow is an inner glow. The value true indicates an inner glow. The default is false, an outer glow (a glow around the outer edges of the object).\n         * @param knockout {number} Specifies whether the object has a knockout effect. A value of true makes the object's fill transparent and reveals the background color of the document. The default value is false (no knockout effect).\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 初始化 GlowFilter 对象\n         * @method egret.GlowFilter#constructor\n         * @param color {number} 光晕颜色，采用十六进制格式 0xRRGGBB。默认值为 0xFF0000。\n         * @param alpha {number} 颜色的 Alpha 透明度值。有效值为 0 到 1。例如，0.25 设置透明度值为 25%。\n         * @param blurX {number} 水平模糊量。有效值为 0 到 255（浮点）。\n         * @param blurY {number} 垂直模糊量。有效值为 0 到 255（浮点）。\n         * @param strength {number} 印记或跨页的强度。该值越高，压印的颜色越深，而且发光与背景之间的对比度也越强。有效值为 0 到 255。\n         * @param quality {number} 应用滤镜的次数。暂未实现。\n         * @param inner {boolean} 指定发光是否为内侧发光。值 true 指定发光是内侧发光。值 false 指定发光是外侧发光（对象外缘周围的发光）。\n         * @param knockout {number} 指定对象是否具有挖空效果。值为 true 将使对象的填充变为透明，并显示文档的背景颜色。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        constructor(color?: number, alpha?: number, blurX?: number, blurY?: number, strength?: number, quality?: number, inner?: boolean, knockout?: boolean);\n        /**\n         * @private\n         */\n        $color: number;\n        /**\n         * The color of the glow.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 光晕颜色。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        color: number;\n        /**\n         * @private\n         */\n        $alpha: number;\n        /**\n         * The alpha transparency value for the color.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 颜色的 Alpha 透明度值。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        alpha: number;\n        /**\n         * @private\n         */\n        $blurX: number;\n        /**\n         * The amount of horizontal blur.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 水平模糊量。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        blurX: number;\n        /**\n         * @private\n         */\n        $blurY: number;\n        /**\n         * The amount of vertical blur.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 垂直模糊量。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        blurY: number;\n        /**\n         * @private\n         */\n        $strength: number;\n        /**\n         * The strength of the imprint or spread.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 印记或跨页的强度。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        strength: number;\n        /**\n         * @private\n         */\n        $quality: number;\n        /**\n         * The number of times to apply the filter.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 应用滤镜的次数。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        quality: number;\n        /**\n         * @private\n         */\n        $inner: boolean;\n        /**\n         * Specifies whether the glow is an inner glow.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 指定发光是否为内侧发光。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        inner: boolean;\n        /**\n         * @private\n         */\n        $knockout: boolean;\n        /**\n         * Specifies whether the object has a knockout effect.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 指定对象是否具有挖空效果。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        knockout: boolean;\n        /**\n         * @private\n         */\n        $toJson(): string;\n        protected updatePadding(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The Stage class represents the main drawing area.The Stage object is not globally accessible. You need to access\n     * it through the stage property of a DisplayObject instance.<br/>\n     * The Stage class has several ancestor classes — Sprite, DisplayObject, and EventDispatcher — from which it inherits\n     * properties and methods. Many of these properties and methods are inapplicable to Stage objects.\n     * @event egret.Event.RESIZE Dispatched when the stageWidth or stageHeight property of the Stage object is changed.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Stage.ts\n     * @language en_US\n     */\n    /**\n     * Stage 类代表主绘图区。\n     * 可以利用 DisplayObject 实例的 stage 属性进行访问。<br/>\n     * Stage 类具有多个祖代类: Sprite、DisplayObject 和 EventDispatcher，属性和方法便是从这些类继承而来的。\n     * 从这些继承的许多属性和方法不适用于 Stage 对象。\n     * @event egret.Event.RESIZE 当stageWidth或stageHeight属性发生改变时调度\n     * @event egret.Event.DEACTIVATE 当stage失去焦点后调度\n     * @event egret.Event.ACTIVATE 当stage获得焦点后调度\n     *\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Stage.ts\n     * @language zh_CN\n     */\n    class Stage extends DisplayObjectContainer {\n        /**\n         * @private\n         * Stage不许允许自行实例化\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor();\n        protected createNativeDisplayObject(): void;\n        /**\n         * Gets and sets the frame rate of the stage. The frame rate is defined as frames per second. Valid range for the\n         * frame rate is from 0.01 to 1000 frames per second.<br/>\n         * Note: setting the frameRate property of one Stage object changes the frame rate for all Stage objects\n         * @default 30\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取并设置舞台的帧速率。帧速率是指每秒显示的帧数。帧速率的有效范围为每秒 0.01 到 60 个帧。<br/>\n         * 注意: 修改任何一个Stage的frameRate属性都会同步修改其他Stage的帧率。\n         * @default 30\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        frameRate: number;\n        /**\n         * @private\n         */\n        $stageWidth: number;\n        /**\n         * Indicates the width of the stage, in pixels.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 舞台的当前宽度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly stageWidth: number;\n        /**\n         * @private\n         */\n        $stageHeight: number;\n        /**\n         * Indicates the height of the stage, in pixels.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 舞台的当前高度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly stageHeight: number;\n        /**\n         * After you call the invalidate() method, when the display list is next rendered, the Egret runtime sends a render\n         * event to each display object that has registered to listen for the render event. You must call the invalidate()\n         * method each time you want the Egret runtime to send render events.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 调用 invalidate() 方法后，在显示列表下次呈现时，Egret 会向每个已注册侦听 Event.RENDER 事件的显示对象发送一个 Event.RENDER 事件。\n         * 每次您希望 Egret 发送 Event.RENDER 事件时，都必须调用 invalidate() 方法。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        invalidate(): void;\n        /**\n         * @deprecated\n         */\n        registerImplementation(interfaceName: string, instance: any): void;\n        /**\n         * @deprecated\n         */\n        getImplementation(interfaceName: string): any;\n        /**\n         * @private\n         * 设备屏幕引用\n         */\n        $screen: egret.sys.Screen;\n        $scaleMode: string;\n        /**\n         * A StageScaleMode class that specifies which scale mode to use. The following are valid values:<br/>\n         * <ul>\n         * <li>StageScaleMode.EXACT_FIT -- The entire application be visible in the specified area without trying to preserve the original aspect ratio. Distortion can occur, the application may be stretched or compressed.</li>\n         * <li>StageScaleMode.SHOW_ALL -- The entire application is visible in the specified area without distortion while maintaining the application of the original aspect ratio. Applications may display border.</li>\n         * <li>StageScaleMode.NO_SCALE -- The size of the entire application is fixed, so that even if the size of the player window changes, it remains unchanged. If the player window is smaller than the content, it may do some trimming.</li>\n         * <li>StageScaleMode.NO_BORDER -- Keep the original aspect ratio scaling application content, after scaling a narrow direction of application content to fill the viewport players on both sides in the other direction may exceed the viewport and the player is cut.</li>\n         * <li>StageScaleMode.FIXED_WIDTH -- Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, but only to keep the contents of the original application constant width, height may change.</li>\n         * <li>StageScaleMode.FIXED_HEIGHT -- Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, but only to keep the contents of the original application constant height, width may change.</li>\n         * </ul>\n         * @default egret.StageScaleMode.SHOW_ALL\n         * @language en_US\n         */\n        /**\n         * 一个 StageScaleMode 类中指定要使用哪种缩放模式的值。以下是有效值：<br/>\n         * <ul>\n         * <li>StageScaleMode.EXACT_FIT -- 整个应用程序在指定区域中可见，但不尝试保持原始高宽比。可能会发生扭曲，应用程序可能会拉伸或压缩显示。</li>\n         * <li>StageScaleMode.SHOW_ALL -- 整个应用程序在指定区域中可见，且不发生扭曲，同时保持应用程序的原始高宽比。应用程序的可能会显示边框。</li>\n         * <li>StageScaleMode.NO_SCALE -- 整个应用程序的大小固定，因此，即使播放器窗口的大小更改，它也会保持不变。如果播放器窗口比内容小，则可能进行一些裁切。</li>\n         * <li>StageScaleMode.NO_BORDER -- 保持原始宽高比缩放应用程序内容，缩放后应用程序内容的较窄方向填满播放器视口，另一个方向的两侧可能会超出播放器视口而被裁切。</li>\n         * <li>StageScaleMode.FIXED_WIDTH -- 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，但只保持应用程序内容的原始宽度不变，高度可能会改变。</li>\n         * <li>StageScaleMode.FIXED_HEIGHT -- 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，但只保持应用程序内容的原始高度不变，宽度可能会改变。</li>\n         * </ul>\n         * @default egret.StageScaleMode.SHOW_ALL\n         * @language zh_CN\n         */\n        scaleMode: string;\n        $orientation: string;\n        /**\n         * Horizontal and vertical screen display screen, can only be set under the current Native in the configuration file. A egret.OrientationMode class that specifies which display mode to use. The following are valid values:<br/>\n         * <ul>\n         * <li>egret.OrientationMode.AUTO -- Always follow the direction of application display screen, always guaranteed by the look down.</li>\n         * <li>egret.OrientationMode.PORTRAIT -- Applications remain portrait mode, namely horizontal screen look, the screen from left to right.</li>\n         * <li>egret.OrientationMode.LANDSCAPE -- Applications remain horizontal screen mode, namely vertical screen, the screen from right to left.</li>\n         * <li>egret.OrientationMode.LANDSCAPE_FLIPPED -- Applications remain horizontal screen mode, namely vertical screen, the screen from left to right.</li>\n         * </ul>\n         * @platform Web\n         * @version 2.4\n         * @language en_US\n         */\n        /**\n         * 屏幕横竖屏显示方式，目前 Native 下只能在配置文件里设置。一个 egret.OrientationMode 类中指定要使用哪种显示方式。以下是有效值：<br/>\n         * <ul>\n         * <li>egret.OrientationMode.AUTO -- 应用始终跟随屏幕的方向显示，始终保证由上往下看。</li>\n         * <li>egret.OrientationMode.PORTRAIT -- 应用始终保持竖屏模式，即横屏看时，屏幕由左往右看。</li>\n         * <li>egret.OrientationMode.LANDSCAPE -- 应用始终保持横屏模式，即竖屏看时，屏幕显示由右往左。</li>\n         * <li>egret.OrientationMode.LANDSCAPE_FLIPPED -- 应用始终保持横屏模式，即竖屏看时，屏幕显示由左往右。</li>\n         * </ul>\n         * @platform Web\n         * @version 2.4\n         * @language zh_CN\n         */\n        orientation: string;\n        /**\n         * Draw texture zoom ratio\n         * @default 1\n         * @language en_US\n         */\n        /**\n         * 绘制纹理的缩放比率，默认值为1\n         * @default 1\n         * @language zh_CN\n         */\n        textureScaleFactor: number;\n        $maxTouches: number;\n        /**\n         * Set the number of screens can simultaneously touch. Above this amount will not be triggered in response.\n         * @default 99\n         * @language en_US\n         */\n        /**\n         * 设置屏幕同时可以触摸的数量。高于这个数量将不会被触发响应。\n         * @default 99\n         * @language zh_CN\n         */\n        maxTouches: number;\n        /**\n         * Set resolution size\n         * @param width width\n         * @param height height\n         * @version Egret 2.5.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置分辨率尺寸\n         * @param width 宽度\n         * @param height 高度\n         * @version Egret 2.5.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setContentSize(width: number, height: number): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * A class that provides constant values for visual blend mode effects. These constants are used in the blendMode\n     * property of the DisplayObject class.\n     * @see egret.DisplayObject#blendMode\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/BlendMode.ts\n     * @see http://edn.egret.com/cn/docs/page/108 显示容器的概念与实现\n     * @language en_US\n     */\n    /**\n     * 提供混合模式可视效果的常量值的类,通常用于 DisplayObject 的 blendMode 属性上。\n     * @see egret.DisplayObject#blendMode\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/BlendMode.ts\n     * @see http://edn.egret.com/cn/docs/page/108 显示容器的概念与实现\n     * @language zh_CN\n     */\n    class BlendMode {\n        /**\n         * The display object appears in front of the background. Pixel values of the display object override the pixel\n         * values of the background. Where the display object is transparent, the background is visible.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 该显示对象出现在背景前面。显示对象的像素值会覆盖背景的像素值。在显示对象为透明的区域，背景是可见的。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static NORMAL: string;\n        /**\n         * Adds the values of the constituent colors of the display object to the colors of its background, applying a\n         * ceiling of 0xFF. This setting is commonly used for animating a lightening dissolve between two objects.<br/>\n         * For example, if the display object has a pixel with an RGB value of 0xAAA633, and the background pixel has an\n         * RGB value of 0xDD2200, the resulting RGB value for the displayed pixel is 0xFFC833 (because 0xAA + 0xDD > 0xFF,\n         * 0xA6 + 0x22 = 0xC8, and 0x33 + 0x00 = 0x33).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将显示对象的原色值添加到它的背景颜色中，上限值为 0xFF。此设置通常用于使两个对象间的加亮溶解产生动画效果。<br/>\n         * 例如，如果显示对象的某个像素的 RGB 值为 0xAAA633，背景像素的 RGB 值为 0xDD2200，则显示像素的结果 RGB 值为 0xFFC833\n         * （因为 0xAA + 0xDD > 0xFF，0xA6 + 0x22 = 0xC8，且 0x33 + 0x00 = 0x33）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ADD: string;\n        /**\n         * Erases the background based on the alpha value of the display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 根据显示对象的 Alpha 值擦除背景。Alpha 值不为0的区域将被擦除。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ERASE: string;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 转换 blendMode 字符串为数字。\n     */\n    function blendModeToNumber(blendMode: string): number;\n    /**\n     * @private\n     * 转换数字为 blendMode 字符串。\n     */\n    function numberToBlendMode(blendMode: number): string;\n}\ndeclare namespace egret {\n    /**\n     * The ChildrenSortMode class defines a pattern enumeration for children sort mode of egret.DisplayObjectContainer.\n     * @version Egret 5.2.19\n     * @platform Native\n     * @language en_US\n     */\n    /**\n     * BitmapFillMode 类定义egret.DisplayObjectContainer的子项目排序方式。\n     * @version Egret 5.2.19\n     * @platform Native\n     * @language zh_CN\n     */\n    const ChildrenSortMode: {\n        DEFAULT: string;\n        INCREASE_Y: string;\n        DECREASE_Y: string;\n    };\n}\ndeclare namespace egret {\n    /**\n     * The CapsStyle class is an enumeration of constant values that specify the caps style to use in drawing lines.\n     * The constants are provided for use as values in the caps parameter of the egret.Graphics.lineStyle() method.\n     * @see egret.Graphics#lineStyle()\n     * @version Egret 2.5\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * CapsStyle 类是可指定在绘制线条中使用的端点样式的常量值枚举。常量可用作 egret.Graphics.lineStyle() 方法的 caps 参数中的值。\n     * @see egret.Graphics#lineStyle()\n     * @version Egret 2.5\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    const CapsStyle: {\n        NONE: string;\n        ROUND: string;\n        SQUARE: string;\n    };\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    class WebGLUtils {\n        static compileProgram(gl: WebGLRenderingContext, vertexSrc: string, fragmentSrc: string): WebGLProgram;\n        static compileFragmentShader(gl: WebGLRenderingContext, shaderSrc: string): WebGLShader;\n        static compileVertexShader(gl: WebGLRenderingContext, shaderSrc: string): WebGLShader;\n        private static _compileShader(gl, shaderSrc, shaderType);\n        private static canUseWebGL;\n        static checkCanUseWebGL(): boolean;\n        static deleteWebGLTexture(webglTexture: WebGLTexture): void;\n        /**\n         * inspired by pixi.js\n         */\n        static premultiplyTint(tint: number, alpha: number): number;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The EventPhase class provides values for the eventPhase property of the Event class.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/EventPhase.ts\n     * @language en_US\n     */\n    /**\n     * EventPhase 可为 Event 类的 eventPhase 属性提供值。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/EventPhase.ts\n     * @language zh_CN\n     */\n    const enum EventPhase {\n        /**\n         * The capturing phase, which is the first phase of the event flow.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 捕获阶段。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        CAPTURING_PHASE = 1,\n        /**\n         * The target phase, which is the second phase of the event flow.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 目标阶段，是事件流的第二个阶段。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        AT_TARGET = 2,\n        /**\n         * The bubbling phase, which is the third phase of the event flow.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 冒泡阶段。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        BUBBLING_PHASE = 3,\n    }\n}\ndeclare namespace egret {\n    /**\n     * When the user changes the focus from one object in the display list to another object, the object dispatches a FocusEvent object. Currently only supports input text.\n     * Focus events: FocusEvent.FOCUS_IN FocusEvent.FOCUS_OUT\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 用户将焦点从显示列表中的一个对象更改到另一个对象时，对象将调度 FocusEvent 对象。目前只支持输入文本。\n     * 焦点事件：FocusEvent.FOCUS_IN FocusEvent.FOCUS_OUT\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class FocusEvent extends egret.Event {\n        /**\n         * Gets focus\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获得焦点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static FOCUS_IN: \"focusIn\";\n        /**\n         * Loses focus\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 失去焦点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static FOCUS_OUT: \"focusOut\";\n        /**\n         * Create a egret.FocusEvent objects\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.FocusEvent 对象\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean);\n    }\n}\ndeclare namespace egret {\n    interface Geolocation {\n        addEventListener<Z>(type: \"ioError\", listener: (this: Z, e: GeolocationEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): any;\n    }\n    /**\n     * The GeolocationEvent represents the position and altitude of the device on Earth,\n     * and show errors occurred while getting the location of the device.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/Geolocation.ts\n     * @see http://edn.egret.com/cn/docs/page/662 获取位置信息\n     * @language en_US\n     */\n    /**\n     * GeolocationEvent 提供设备的地理位置信息和获取位置时发生的错误信息\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/Geolocation.ts\n     * @see http://edn.egret.com/cn/docs/page/662 获取位置信息\n     * @language zh_CN\n     */\n    class GeolocationEvent extends Event {\n        /**\n         * The acquisition of the location information failed because of app don't have permission.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 由于用户拒绝访问位置信息，获取位置信息失败\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static PERMISSION_DENIED: string;\n        /**\n         * The acquisition of the location failed because at least one internal source of position returned an internal error.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设备位置服务不可用或者超时等原因没有得到位置信息\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static UNAVAILABLE: string;\n        /**\n         * The position's longitude in decimal degrees.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当前位置的经度信息\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        longitude: number;\n        /**\n         * The position's latitude in decimal degrees.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当前位置的纬度信息\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        latitude: number;\n        /**\n         * The velocity of the device in meters per second. This value can be null.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当前设备的速度 单位是 米/秒，这个值可能为 null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        speed: number;\n        /**\n         * The direction in which the device is traveling. This value, specified in degrees,\n         * indicates how far off from heading due north the device is. 0 degrees represents\n         * true true north, and the direction is determined clockwise (which means that east\n         * is 90 degrees and west is 270 degrees). If speed is 0, heading is NaN. If the\n         * device is unable to provide heading information, this value is null.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示设备正在前进的方向，单位是度。heading 表示从正北开始顺时针旋转到当前方向的角度，\n         * 比如正东是 90 度，正西是 270 度，如果 speed 是 0，heading 为 NaN。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        heading: number;\n        /**\n         * The position's altitude in metres, relative to sea level.\n         * This value can be null if the implementation cannot provide the data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 该位置的海拔信息，如果设备没有实现这个属性时，这个值有可能为 null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        altitude: number;\n        /**\n         * The accuracy of the latitude and longitude properties, expressed in meters.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 经纬度的准确性，单位是米\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        accuracy: number;\n        /**\n         * The accuracy of the altitude expressed in meters. This value can be null.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 该位置海拔信息的准确性，单位是米，这个值有可能为 null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        altitudeAccuracy: number;\n        /**\n         * The type of error occurred while get the location of the device. The value could be:\n         * @see egret.GeolocationEvent.PERMISSION_DENIED\n         * @see egret.GeolocationEvent.UNAVAILABLE\n         *\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取位置信息错误时的错误类型。值可能为：\n         * @see egret.GeolocationEvent.PERMISSION_DENIED\n         * @see egret.GeolocationEvent.UNAVAILABLE\n         *\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        errorType: string;\n        /**\n         * The error message occurred while get the location of the device.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取位置信息错误的错误信息\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        errorMessage: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * When a network request returns an HTTP status code, the application dispatches HTTPStatusEvent objects.\n     * Before error or completion events will always send HTTPStatusEvent object. HTTPStatusEvent object does not necessarily indicate an error condition; it simply reflects the HTTP status code provided by the network stack (if any).\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 在网络请求返回 HTTP 状态代码时，应用程序将调度 HTTPStatusEvent 对象。\n     * 在错误或完成事件之前，将始终发送 HTTPStatusEvent 对象。HTTPStatusEvent 对象不一定表示错误条件；它仅反映网络堆栈提供的 HTTP 状态代码（如果有的话）。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class HTTPStatusEvent extends Event {\n        /**\n         * HTTPStatusEvent.HTTP_STATUS constant defines the value of the type property httpStatus event object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * HTTPStatusEvent.HTTP_STATUS 常量定义 httpStatus 事件对象的 type 属性值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static HTTP_STATUS: \"httpStatus\";\n        /**\n         * Create a egret.HTTPStatusEvent objects\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.HTTPStatusEvent 对象\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean);\n        /**\n         * @private\n         */\n        private _status;\n        /**\n         * he server returns the HTTP status code.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 由服务器返回的 HTTP 状态代码。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly status: number;\n        /**\n         * EventDispatcher object using the specified event object thrown Event. The objects will be thrown in the object cache pool for the next round robin.\n         * @param target {egret.IEventDispatcher} Distribute event target\n         * @param status {number} The server returns the HTTP status code\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出Event事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @param status {number} 由服务器返回的 HTTP 状态代码\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchHTTPStatusEvent(target: IEventDispatcher, status: number): boolean;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The IEventDispatcher interface defines methods for adding or removing event listeners, checks whether specific types\n     * of event listeners are registered, and dispatches events. Event targets are an important part of the Egret event model.\n     * The event target serves as the focal point for how events flow through the display list hierarchy. When an event\n     * such as a touch tap occurs, an event object is dispatched into the event flow from the root of the display list.\n     * The event object makes a round-trip journey to the event target, which is conceptually divided into three phases: <br/>\n     * the capture phase includes the journey from the root to the last node before the event target's node; the target\n     * phase includes only the event target node; and the bubbling phase includes any subsequent nodes encountered on the\n     * return trip to the root of the display list.In general, the easiest way for a user-defined class to gain event\n     * dispatching capabilities is to extend EventDispatcher. If this is impossible (that is, if the class is already\n     * extending another class), you can instead implement the IEventDispatcher interface, create an EventDispatcher member,\n     * and write simple hooks to route calls into the aggregated EventDispatcher.\n     * @see egret.EventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/IEventDispatcher.ts\n     * @language en_US\n     */\n    /**\n     * IEventDispatcher 接口定义用于添加或删除事件侦听器的方法，检查是否已注册特定类型的事件侦听器，并调度事件。\n     * 事件目标是 Egret 事件模型的重要组成部分。事件目标是事件如何通过显示列表层次结构这一问题的焦点。当发生触摸轻拍事件时，\n     * 会将事件对象调度到从显示列表根开始的事件流中。事件对象进行到事件目标的往返行程，在概念上，此往返行程被划分为三个阶段：<br/>\n     * 捕获阶段包括从根到事件目标节点之前的最后一个节点的行程，目标阶段仅包括事件目标节点，冒泡阶段包括到显示列表的根的回程上遇到的任何后续节点。\n     * 通常，使用户定义的类能够调度事件的最简单方法是扩展 EventDispatcher。如果无法扩展（即，如果该类已经扩展了另一个类），\n     * 则可以实现 IEventDispatcher 接口，创建 EventDispatcher 成员，并编写一些简单的挂钩，将调用连接到聚合的 EventDispatcher 中。\n     * @see egret.EventDispatcher\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/IEventDispatcher.ts\n     * @language zh_CN\n     */\n    interface IEventDispatcher extends HashObject {\n        /**\n         * Registers an event listener object with an EventDispatcher object so that the listener receives notification of an\n         * event. You can register event listeners on all nodes in the display list for a specific type of event, phase,\n         * and priority.After you successfully register an event listener, you cannot change its priority through additional\n         * calls to on(). To change a listener's priority, you must first call removeEventListener(). Then you can register the\n         * listener again with the new priority level.After the listener is registered, subsequent calls to on() with a\n         * different value for either type or useCapture result in the creation of a separate listener registration. <br/>\n         * When you no longer need an event listener, remove it by calling EventDispatcher.removeEventListener(); otherwise, memory\n         * problems might result. Objects with registered event listeners are not automatically removed from memory because\n         * the garbage collector does not remove objects that still have references.Copying an EventDispatcher instance does\n         * not copy the event listeners attached to it. (If your newly created node needs an event listener, you must attach\n         * the listener after creating the node.) However, if you move an EventDispatcher instance, the event listeners attached\n         * to it move along with it.If the event listener is being registered on a node while an event is also being processed\n         * on this node, the event listener is not triggered during the current phase but may be triggered during a later phase\n         * in the event flow, such as the bubbling phase.If an event listener is removed from a node while an event is being\n         * processed on the node, it is still triggered by the current actions. After it is removed, the event listener is\n         * never invoked again (unless it is registered again for future processing).\n         * @param type The type of event.\n         * @param listener The listener function that processes the event. This function must accept an event object as\n         * its only parameter and must return nothing, as this example shows: function(evt:Event):void  The function can\n         * have any name.\n         * @param thisObject the listener function's \"this\"\n         * @param useCapture Determines whether the listener works in the capture phase or the bubbling phases. If useCapture\n         * is set to true, the listener processes the event only during the capture phase and not in the bubbling phase.\n         * If useCapture is false, the listener processes the event only during the bubbling phase. To listen for the event\n         * in all three phases, call on() twice, once with useCapture set to true, then again with useCapture set to false.\n         * @param  priority The priority level of the event listener. Priorities are designated by a integer. The higher\n         * the number, the higher the priority. All listeners with priority n are processed before listeners of priority n-1.\n         * If two or more listeners share the same priority, they are processed in the order in which they were added.\n         * The default priority is\n         * @see #once()\n         * @see #removeEventListener()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用 EventDispatcher 对象注册事件侦听器对象，以使侦听器能够接收事件通知。可以为特定类型的事件、阶段和优先级在显示列表的所有节\n         * 点上注册事件侦听器。成功注册一个事件侦听器后，无法通过额外调用 on() 来更改其优先级。要更改侦听器的优先级，必须\n         * 先调用 removeEventListener()。然后，可以使用新的优先级再次注册该侦听器。注册该侦听器后，如果继续调用具有不同 type 或 useCapture\n         * 值的 on()，则会创建单独的侦听器注册。<br/>\n         * 如果不再需要某个事件侦听器，可调用 EventDispatcher.removeEventListener()\n         * 删除它；否则会产生内存问题。由于垃圾回收器不会删除仍包含引用的对象，因此不会从内存中自动删除使用已注册事件侦听器的对象。复制\n         * EventDispatcher 实例时并不复制其中附加的事件侦听器。（如果新近创建的节点需要一个事件侦听器，必须在创建该节点后附加该侦听器。）\n         * 但是，如果移动 EventDispatcher 实例，则其中附加的事件侦听器也会随之移动。如果在正在处理事件的节点上注册事件侦听器，则不会在当\n         * 前阶段触发事件侦听器，但会在事件流的稍后阶段触发，如冒泡阶段。如果从正在处理事件的节点中删除事件侦听器，则该事件侦听器仍由当前操\n         * 作触发。删除事件侦听器后，决不会再次调用该事件侦听器（除非再次注册以备将来处理）。\n         * @param type 事件的类型。\n         * @param listener 处理事件的侦听器函数。此函数必须接受 Event 对象作为其唯一的参数，并且不能返回任何结果，\n         * 如下面的示例所示： function(evt:Event):void 函数可以有任何名称。\n         * @param thisObject 侦听函数绑定的this对象\n         * @param useCapture 确定侦听器是运行于捕获阶段还是运行于冒泡阶段。如果将 useCapture 设置为 true，\n         * 则侦听器只在捕获阶段处理事件，而不在冒泡阶段处理事件。如果 useCapture 为 false，则侦听器只在冒泡阶段处理事件。\n         * 要在两个阶段都侦听事件，请调用 on() 两次：一次将 useCapture 设置为 true，一次将 useCapture 设置为 false。\n         * @param  priority 事件侦听器的优先级。优先级由一个带符号的整数指定。数字越大，优先级越高。优先级为 n 的所有侦听器会在\n         * 优先级为 n -1 的侦听器之前得到处理。如果两个或更多个侦听器共享相同的优先级，则按照它们的添加顺序进行处理。默认优先级为 0。\n         * @see #once()\n         * @see #removeEventListener()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): void;\n        /**\n         * Registers an event listener object with an EventDispatcher object so that the listener receives notification of an\n         * event. Different from the on() method,the listener receives notification only once,and then it will be removed\n         * automatically.\n         * @param type The type of event.\n         * @param listener The listener function that processes the event. This function must accept an event object as\n         * its only parameter and must return nothing, as this example shows: function(evt:Event):void  The function can\n         * have any name.\n         * @param thisObject the listener function's \"this\"\n         * @param useCapture Determines whether the listener works in the capture phase or the bubbling phases. If useCapture\n         * is set to true, the listener processes the event only during the capture phase and not in the bubbling phase.\n         * If useCapture is false, the listener processes the event only during the bubbling phase. To listen for the event\n         * in all three phases, call on() twice, once with useCapture set to true, then again with useCapture set to false.\n         * @param  priority The priority level of the event listener. Priorities are designated by a integer. The higher\n         * the number, the higher the priority. All listeners with priority n are processed before listeners of priority n-1.\n         * If two or more listeners share the same priority, they are processed in the order in which they were added.\n         * The default priority is\n         * @see #on()\n         * @see #removeEventListener()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 添加仅回调一次的事件侦听器，此方法与on()方法不同，on()方法会持续产生回调，而此方法在第一次回调时就会自动移除监听。\n         * @param type 事件的类型。\n         * @param listener 处理事件的侦听器函数。此函数必须接受 Event 对象作为其唯一的参数，并且不能返回任何结果，\n         * 如下面的示例所示： function(evt:Event):void 函数可以有任何名称。\n         * @param thisObject 侦听函数绑定的this对象\n         * @param useCapture 确定侦听器是运行于捕获阶段还是运行于冒泡阶段。如果将 useCapture 设置为 true，\n         * 则侦听器只在捕获阶段处理事件，而不在冒泡阶段处理事件。如果 useCapture 为 false，则侦听器只在冒泡阶段处理事件。\n         * 要在两个阶段都侦听事件，请调用 once() 两次：一次将 useCapture 设置为 true，一次将 useCapture 设置为 false。\n         * @param  priority 事件侦听器的优先级。优先级由一个带符号整数指定。数字越大，优先级越高。优先级为 n 的所有侦听器会在\n         * 优先级为 n -1 的侦听器之前得到处理。如果两个或更多个侦听器共享相同的优先级，则按照它们的添加顺序进行处理。默认优先级为 0。\n         * @see #on()\n         * @see #removeEventListener()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        once(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): void;\n        /**\n         * Removes a listener from the EventDispatcher object. If there is no matching listener registered with the\n         * EventDispatcher object, a call to this method has no effect.\n         * @param type The type of event.\n         * @param listener The listener object to remove.\n         * @param thisObject the listener function's \"this\"\n         * @param useCapture Specifies whether the listener was registered for the capture phase or the bubbling phases.\n         * If the listener was registered for both the capture phase and the bubbling phases, two calls to removeEventListener()\n         * are required to remove both: one call with useCapture set to true, and another call with useCapture set to false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从 EventDispatcher 对象中删除侦听器。如果没有向 EventDispatcher 对象注册任何匹配的侦听器，则对此方法的调用没有任何效果。\n         * @param type 事件的类型。\n         * @param listener 要删除的侦听器对象\n         * @param thisObject 侦听函数绑定的this对象\n         * @param useCapture 指出是为捕获阶段还是为冒泡阶段注册了侦听器。如果为捕获阶段以及冒泡阶段注册了侦听器，则需要对\n         * removeEventListener() 进行两次调用才能将这两个侦听器删除：一次调用将 useCapture 设置为 true，另一次调用将 useCapture 设置为 false。。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        removeEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean): void;\n        /**\n         * Checks whether the EventDispatcher object has any listeners registered for a specific type of event. This allows\n         * you to determine where an EventDispatcher object has altered handling of an event type in the event flow hierarchy.\n         * To determine whether a specific event type will actually trigger an event listener, use IEventDispatcher.willTrigger().\n         * The difference between hasEventListener() and willTrigger() is that hasEventListener() examines only the object to\n         * which it belongs, whereas willTrigger() examines the entire event flow for the event specified by the type parameter.\n         * @param type The type of event.\n         * @returns A value of true if a listener of the specified type is registered; false otherwise.\n         * @see #willTrigger()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 检查 EventDispatcher 对象是否为特定事件类型注册了任何侦听器。这样，您就可以确定 EventDispatcher 对象在事件流层次结构中的哪个\n         * 位置改变了对事件类型的处理。要确定特定事件类型是否确实会触发事件侦听器，请使用 IEventDispatcher.willTrigger()。hasEventListener()\n         * 与 willTrigger() 的区别是：hasEventListener() 只检查它所属的对象，而 willTrigger() 检查整个事件流以查找由 type 参数指定的事件。\n         * @param type 事件的类型。\n         * @returns 如果指定类型的侦听器已注册，则值为 true；否则，值为 false。\n         * @see #willTrigger()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        hasEventListener(type: string): boolean;\n        /**\n         * Dispatches an event into the event flow. The event target is the EventDispatcher object upon which dispatchEvent() is called.\n         * @param event The event object dispatched into the event flow.\n         * @returns A value of true unless preventDefault() is called on the event, in which case it returns false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将事件分派到事件流中。事件目标是对其调用 dispatchEvent() 方法的 EventDispatcher 对象。\n         * @param event 调度到事件流中的 Event 对象。\n         * @returns 如果成功调度了事件，则值为 true。值 false 表示失败或对事件调用了 preventDefault()。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        dispatchEvent(event: Event): boolean;\n        /**\n         * Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the\n         * specified event type. This method returns true if an event listener is triggered during any phase of the event\n         * flow when an event of the specified type is dispatched to this EventDispatcher object or any of its descendants.\n         * @param type The type of event.\n         * @returns A value of true if a listener of the specified type will be triggered; false otherwise.\n         * @see #hasEventListener()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 检查是否用此 EventDispatcher 对象或其任何始祖为指定事件类型注册了事件侦听器。将指定类型的事件调度给此\n         * EventDispatcher 对象或其任一后代时，如果在事件流的任何阶段触发了事件侦听器，则此方法返回 true。\n         * hasEventListener() 与 willTrigger() 方法的区别是：hasEventListener() 只检查它所属的对象，\n         * 而 willTrigger() 方法检查整个事件流以查找由 type 参数指定的事件。\n         * @param type 事件类型\n         * @returns 是否注册过监听器，如果注册过返回true，反之返回false\n         * @see #hasEventListener()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        willTrigger(type: string): boolean;\n    }\n}\ndeclare namespace egret {\n    interface HttpRequest {\n        addEventListener<Z>(type: \"ioError\", listener: (this: Z, e: IOErrorEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): any;\n    }\n    /**\n     * @classdesc IO流事件，当错误导致输入或输出操作失败时调度 IOErrorEvent 对象。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/IOErrorEvent.ts\n     * @language en_US\n     */\n    /**\n     * @classdesc IO流事件，当错误导致输入或输出操作失败时调度 IOErrorEvent 对象。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/IOErrorEvent.ts\n     * @language zh_CN\n     */\n    class IOErrorEvent extends Event {\n        /**\n         * io error\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * io发生错误\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static IO_ERROR: \"ioError\";\n        /**\n         * Create a egret.IOErrorEvent objects\n         * @param type {string} Type of event, accessible as Event.type.\n         * @param bubbles {boolean} Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable {boolean} Determine whether the Event object can be canceled. The default value is false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.IOErrorEvent 对象\n         * @param type {string} 事件的类型，可以作为 Event.type 访问。\n         * @param bubbles {boolean} 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable {boolean} 确定是否可以取消 Event 对象。默认值为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean);\n        /**\n         * EventDispatcher object using the specified event object thrown Event. The objects will be thrown in the object cache pool for the next round robin.\n         * @param target {egret.IEventDispatcher} Distribute event target\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出Event事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchIOErrorEvent(target: IEventDispatcher): boolean;\n    }\n}\ndeclare namespace egret {\n    /**\n     * MotionEvent represents the device's movement\n     * Acceleration and accelerationIncludingGravity to represents the device's acceleration\n     * RotationRate to represents the device's rotation\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/Motion.ts\n     * @language en_US\n     */\n    /**\n     * MotionEvent 类呈现设备运动的具体信息\n     * Acceleration 和 accelerationIncludingGravity 呈现设备三个维度的加速度信息\n     * RotationRate 呈现设备的旋转状态信息\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/Motion.ts\n     * @language zh_CN\n     */\n    class MotionEvent extends Event {\n        /**\n         * An object giving the acceleration of the device on the three axis X, Y and Z. Acceleration is expressed in m/s2.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * acceleration 表示设备在 X Y Z 轴方将的加速度信息，单位是  m/s2，不包含重力\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        acceleration: DeviceAcceleration;\n        /**\n         * An object giving the acceleration of the device on the three axis X, Y and Z with the effect of gravity. Acceleration is expressed in m/s2.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * acceleration 表示设备在 X Y Z 轴方将的加速度信息，单位是  m/s2，包含重力\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        accelerationIncludingGravity: DeviceAcceleration;\n        /**\n         * An object giving the rate of change of the device's orientation on the three orientation axis alpha, beta and gamma. Rotation rate is express in degrees per seconds.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * rotationRate 表示设备在 alpha、 beta 和 gamma 三个轴向的角速度信息，单位是 角度每秒\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        rotationRate: DeviceRotationRate;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The OrientationEvent provides information from the physical orientation of the device.\n     * Note: Currently, Browsers on the iOS and Android does not handle the coordinates the same way.\n     * Take care about this while using them.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/DeviceOrientation.ts\n     * @language en_US\n     */\n    /**\n     * OrientationEvent 提供设备的方向信息\n     * 注意: 目前各个浏览器和操作系统处理方向的方式不完全相同，请根据使用场景做相应的校正，\n     * 比如使用两次方向数据的变化而不是直接使用方向的值\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/sensor/DeviceOrientation.ts\n     * @language zh_CN\n     */\n    class OrientationEvent extends Event {\n        /**\n         * A number representing the motion of the device around the z axis,\n         * express in degrees with values ranging from 0 to 360\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示设备绕 Z 轴的角度，单位是 角度 范围是 0 到 360\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        alpha: number;\n        /**\n         * A number representing the motion of the device around the x axis,\n         * express in degrees with values ranging from -180 to 180.\n         * This represents a front to back motion of the device.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示设备绕 X 轴的角度，单位是 角度 范围是 -180 到 180.\n         * 这个值表示设备从前向后的旋转状态\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        beta: number;\n        /**\n         * A number representing the motion of the device around the y axis,\n         * express in degrees with values ranging from -90 to 90.\n         * This represents a left to right motion of the device.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示设备绕 Y 轴的角度，单位是 角度 范围是 -90 到 90.\n         * 这个值表示设备从前向后的旋转状态\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        gamma: number;\n    }\n}\ndeclare namespace egret {\n    interface HttpRequest {\n        addEventListener<Z>(type: \"progress\", listener: (this: Z, e: ProgressEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): any;\n    }\n    /**\n     * When a load operation has begun or a socket has received data, ProgressEvent object is dispatched.\n     * There are two types of progress events: ProgressEvent.PROGRESS and ProgressEvent.SOCKET_DATA.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 当加载操作已开始或套接字已接收到数据时，将调度 ProgressEvent 对象。\n     * 有两种类型的进程事件：ProgressEvent.PROGRESS 和 ProgressEvent.SOCKET_DATA。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class ProgressEvent extends egret.Event {\n        /**\n         * Changes in the loading progress\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 加载进度发生变化\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static PROGRESS: \"progress\";\n        /**\n         * Get the data\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取到数据\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static SOCKET_DATA: \"socketData\";\n        /**\n         * Number of items or bytes when the listener processes the event。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在侦听器处理事件时加载的项数或字节数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        bytesLoaded: number;\n        /**\n         * If the loading process succeeds, the total number or the total number of bytes that will be loaded term.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果加载过程成功，将加载的总项数或总字节数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        bytesTotal: number;\n        /**\n         * 创建一个 egret.ProgressEvent 对象\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @param bytesLoaded {number} Number of items or bytes loaded\n         * @param bytesTotal {number} The total number of items or bytes loaded\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.ProgressEvent 对象\n         * @param type  事件的类型，可以作为 Event.type 访问。\n         * @param bubbles  确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param bytesLoaded {number} 加载的项数或字节数\n         * @param bytesTotal {number} 加载的总项数或总字节数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean, bytesLoaded?: number, bytesTotal?: number);\n        /**\n         * EventDispatcher object using the specified event object thrown Event. The objects will be thrown in the object cache pool for the next round robin.\n         * @param target {egret.IEventDispatcher} Distribute event target\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bytesLoaded {number} Number of items or bytes loaded\n         * @param bytesTotal {number} The total number of items or bytes loaded\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出Event事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @param type {string} 事件类型\n         * @param bytesLoaded {number} 加载的项数或字节数\n         * @param bytesTotal {number} 加载的总项数或总字节数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchProgressEvent(target: IEventDispatcher, type: string, bytesLoaded?: number, bytesTotal?: number): boolean;\n    }\n}\ndeclare namespace egret {\n    interface Stage {\n        addEventListener<Z>(type: \"orientationChange\", listener: (this: Z, e: StageOrientationEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): any;\n    }\n    /**\n     * When the direction of the stage of change, Stage object dispatches StageOrientationEvent object.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/StageOrientationEvent.ts\n     * @language en_US\n     */\n    /**\n     * 当舞台的方向更改时，Stage 对象将调度 StageOrientationEvent 对象。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/StageOrientationEvent.ts\n     * @language zh_CN\n     */\n    class StageOrientationEvent extends Event {\n        /**\n         * After screen rotation distribute events.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 屏幕旋转后派发的事件。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ORIENTATION_CHANGE: \"orientationChange\";\n        /**\n         * Creating contains specific information related to the event and the stage direction of StageOrientationEvent object.\n         * @param type Event types:StageOrientationEvent.ORIENTATION_CHANGE\n         * @param bubbles It indicates whether the Event object participates in the bubbling stage of the event flow.\n         * @param cancelable It indicates whether the Event object can be canceled.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建包含与舞台方向事件相关的特定信息的 StageOrientationEvent 对象。\n         * @param type 事件的类型：StageOrientationEvent.ORIENTATION_CHANGE\n         * @param bubbles 表示 Event 对象是否参与事件流的冒泡阶段。\n         * @param cancelable 表示是否可以取消 Event 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean);\n        /**\n         * 派发一个屏幕旋转的事件。\n         * @param target {egret.IEventDispatcher} 派发事件目标\n         * @param type {egret.IEventDispatcher} 派发事件类型\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 派发一个屏幕旋转的事件。\n         * @param target {egret.IEventDispatcher} Distribute event target\n         * @param type {egret.IEventDispatcher} Distribute event type\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchStageOrientationEvent(target: IEventDispatcher, type: string): boolean;\n    }\n}\ndeclare namespace egret {\n    /**\n     * When a user clicks a hyperlink rich text object dispatches TextEvent object. Text Event Type: TextEvent.LINK.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TextEvent.ts\n     * @language en_US\n     */\n    /**\n     * 用户在富文本中单击超链接时，对象将调度 TextEvent 对象。文本事件类型：TextEvent.LINK。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TextEvent.ts\n     * @language zh_CN\n     */\n    class TextEvent extends Event {\n        /**\n         * TextEvent create an object that contains information about text events.\n         * @param type Type of event, you can access the TextEvent.type.\n         * @param bubbles Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determine whether the Event object can be canceled. The default value is false.\n         * @param text One or more characters of text entered by the user. Event listeners can access this information through the text property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 TextEvent 对象，其中包含有关文本事件的信息。\n         * @param type 事件的类型，可以作为 TextEvent.type 访问。\n         * @param bubbles 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param text 用户输入的一个或多个文本字符。事件侦听器可以通过 text 属性访问此信息。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean, text?: string);\n        /**\n         * It defines the value of the type property of a link event object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 定义 link 事件对象的 type 属性值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static LINK: \"link\";\n        /**\n         * In TextEvent.LINK event, event corresponding string.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在 TextEvent.LINK 事件中，event对应的字符串。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        text: string;\n        /**\n         * EventDispatcher object using the specified event object thrown TextEvent. The objects will be thrown in the object cache pool for the next round robin.\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param text  Text TextEvent object assignment\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出TextEvent事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target 派发事件目标\n         * @param type  事件类型\n         * @param text  TextEvent对象的text赋值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchTextEvent(target: IEventDispatcher, type: string, text: string): boolean;\n    }\n}\ndeclare namespace egret {\n    interface Timer {\n        addEventListener<Z>(type: \"timer\" | \"timerComplete\", listener: (this: Z, e: TimerEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): any;\n    }\n    /**\n     * A Timer object dispatches a TimerEvent objects whenever the Timer object reaches the interval specified by the Timer.delay property.\n     * @see egret.Timer\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TimerEvent.ts\n     * @language en_US\n     */\n    /**\n     * 每当 Timer 对象达到由 Timer.delay 属性指定的间隔时，Timer 对象即会调度 TimerEvent 对象。\n     * @see egret.Timer\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TimerEvent.ts\n     * @language zh_CN\n     */\n    class TimerEvent extends Event {\n        /**\n         * Dispatched whenever a Timer object reaches an interval specified according to the Timer.delay property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 每当 Timer 对象达到根据 Timer.delay 属性指定的间隔时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TIMER: \"timer\";\n        /**\n         * Dispatched whenever it has completed the number of requests set by Timer.repeatCount.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 每当它完成 Timer.repeatCount 设置的请求数后调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TIMER_COMPLETE: \"timerComplete\";\n        /**\n         * Creates an Event object with specific information relevant to timer events.\n         * @param type The type of the event. Event listeners can access this information through the inherited type property.\n         * @param bubbles Determines whether the Event object bubbles. Event listeners can access this information through\n         * the inherited bubbles property.\n         * @param cancelable Determines whether the Event object can be canceled. Event listeners can access this information\n         * through the inherited cancelable property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 Event 对象，其中包含有关 timer 事件的特定信息。\n         * @param type 事件的类型。事件侦听器可以通过继承的 type 属性访问此信息。\n         * @param bubbles 确定 Event 对象是否冒泡。事件侦听器可以通过继承的 bubbles 属性访问此信息。\n         * @param cancelable 确定是否可以取消 Event 对象。事件侦听器可以通过继承的 cancelable 属性访问此信息。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean);\n        /**\n         * Instructs Egret runtime to render after processing of this event completes, if the display list has been modified.\n         * @example\n         * <pre>\n         *    function onTimer(event:TimerEvent):void {\n         *        if (40 < mySp.x && mySp.x < 375) {\n         *            mySp.x-= 50;\n         *        } else {\n         *            mySp.x=374;\n         *        }\n         *        event.updateAfterEvent();\n         *    }\n         *\n         *    let moveTimer:Timer=new Timer(50,250);\n         *    moveTimer.addEventListener(TimerEvent.TIMER,onTimer);\n         *    moveTimer.start();\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果已修改显示列表，调用此方法将会忽略帧频限制，在此事件处理完成后立即重绘屏幕。\n         * @example\n         * <pre>\n         *    function onTimer(event:TimerEvent):void {\n         *        if (40 < mySp.x && mySp.x < 375) {\n         *            mySp.x-= 50;\n         *        } else {\n         *            mySp.x=374;\n         *        }\n         *        event.updateAfterEvent();\n         *    }\n         *\n         *    let moveTimer:Timer=new Timer(50,250);\n         *    moveTimer.addEventListener(TimerEvent.TIMER,onTimer);\n         *    moveTimer.start();\n         * </pre>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        updateAfterEvent(): void;\n        /**\n         * uses a specified target to dispatchEvent an event. Using this method can reduce the number of\n         * reallocate event objects, which allows you to get better code execution performance.\n         * @param target the event target\n         * @param type The type of the event. Event listeners can access this information through the inherited type property.\n         * @param bubbles Determines whether the Event object bubbles. Event listeners can access this information through\n         * the inherited bubbles property.\n         * @param cancelable Determines whether the Event object can be canceled. Event listeners can access this information\n         * through the inherited cancelable property.\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target 事件派发目标\n         * @param type 事件的类型。事件侦听器可以通过继承的 type 属性访问此信息。\n         * @param bubbles 确定 Event 对象是否冒泡。事件侦听器可以通过继承的 bubbles 属性访问此信息。\n         * @param cancelable 确定是否可以取消 Event 对象。事件侦听器可以通过继承的 cancelable 属性访问此信息。\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchTimerEvent(target: IEventDispatcher, type: string, bubbles?: boolean, cancelable?: boolean): boolean;\n    }\n}\ndeclare namespace egret {\n    class CompressedTextureData {\n        glInternalFormat: number;\n        width: number;\n        height: number;\n        byteArray: Uint8Array;\n        face: number;\n        level: number;\n    }\n    const etc_alpha_mask = \"etc_alpha_mask\";\n    const engine_default_empty_texture = \"engine_default_empty_texture\";\n    const is_compressed_texture = \"is_compressed_texture\";\n    const glContext = \"glContext\";\n    const UNPACK_PREMULTIPLY_ALPHA_WEBGL = \"UNPACK_PREMULTIPLY_ALPHA_WEBGL\";\n    /**\n     * A BitmapData object contains an array of pixel data. This data can represent either a fully opaque bitmap or a\n     * transparent bitmap that contains alpha channel data. Either type of BitmapData object is stored as a buffer of 32-bit\n     * integers. Each 32-bit integer determines the properties of a single pixel in the bitmap.<br/>\n     * Each 32-bit integer is a combination of four 8-bit channel values (from 0 to 255) that describe the alpha transparency\n     * and the red, green, and blue (ARGB) values of the pixel. (For ARGB values, the most significant byte represents the\n     * alpha channel value, followed by red, green, and blue.)\n     * @see egret.Bitmap\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * BitmapData 对象是一个包含像素数据的数组。此数据可以表示完全不透明的位图，或表示包含 Alpha 通道数据的透明位图。\n     * 以上任一类型的 BitmapData 对象都作为 32 位整数的缓冲区进行存储。每个 32 位整数确定位图中单个像素的属性。<br/>\n     * 每个 32 位整数都是四个 8 位通道值（从 0 到 255）的组合，这些值描述像素的 Alpha 透明度以及红色、绿色、蓝色 (ARGB) 值。\n     * （对于 ARGB 值，最高有效字节代表 Alpha 通道值，其后的有效字节分别代表红色、绿色和蓝色通道值。）\n     * @see egret.Bitmap\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class BitmapData extends HashObject {\n        /**\n         * The width of the bitmap image in pixels.\n         * @readOnly\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 位图图像的宽度，以像素为单位。\n         * @readOnly\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        width: number;\n        /**\n         * The height of the bitmap image in pixels.\n         * @readOnly\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 位图图像的高度，以像素为单位。\n         * @readOnly\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        height: number;\n        /**\n         * Original bitmap image.\n         * HTMLImageElement|HTMLCanvasElement|HTMLVideoElement\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @private\n         * @language en_US\n         */\n        /**\n         * 原始位图图像。\n         * HTMLImageElement|HTMLCanvasElement|HTMLVideoElement\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @private\n         * @language zh_CN\n         */\n        $source: any;\n        /**\n         * WebGL texture.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @private\n         * @language en_US\n         */\n        /**\n         * WebGL纹理。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @private\n         * @language zh_CN\n         */\n        webGLTexture: any;\n        /**\n         * Texture format.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 纹理格式。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        format: string;\n        /**\n         * @private\n         * webgl纹理生成后，是否删掉原始图像数据\n         */\n        $deleteSource: boolean;\n        /**\n         * @private\n         * id\n         */\n        $nativeBitmapData: egret_native.NativeBitmapData;\n        /**\n         * @private\n         *\n         */\n        readonly compressedTextureData: Array<Array<CompressedTextureData>>;\n        debugCompressedTextureURL: string;\n        etcAlphaMask: Nullable<BitmapData>;\n        /**\n         * Initializes a BitmapData object to refer to the specified source object.\n         * @param source The source object being referenced.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个引用指定 source 实例的 BitmapData 对象\n         * @param source 被引用的 source 实例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(source: any);\n        source: any;\n        static create(type: \"arraybuffer\", data: ArrayBuffer, callback?: (bitmapData: BitmapData) => void): BitmapData;\n        static create(type: \"base64\", data: string, callback?: (bitmapData: BitmapData) => void): BitmapData;\n        $dispose(): void;\n        private static _displayList;\n        static $addDisplayObject(displayObject: DisplayObject, bitmapData: BitmapData): void;\n        static $removeDisplayObject(displayObject: DisplayObject, bitmapData: BitmapData): void;\n        static $invalidate(bitmapData: BitmapData): void;\n        static $dispose(bitmapData: BitmapData): void;\n        private _getCompressedTextureData(level, face);\n        getCompressed2dTextureData(): CompressedTextureData;\n        hasCompressed2d(): boolean;\n        clearCompressedTextureData(): void;\n    }\n}\ndeclare namespace egret {\n    interface DisplayObject {\n        addEventListener<Z>(type: \"touchMove\" | \"touchBegin\" | \"touchEnd\" | \"touchCancel\" | \"touchTap\" | \"touchReleaseOutside\" | \"touchRollOut\" | \"touchRollOver\", listener: (this: Z, e: TouchEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): any;\n    }\n    /**\n     * The TouchEvent class lets you handle events on devices that detect user contact with the device (such as a finger\n     * on a touch screen).When a user interacts with a device such as a mobile phone or tablet with a touch screen, the\n     * user typically touches the screen with his or her fingers or a pointing device. You can develop applications that\n     * respond to basic touch events (such as a single finger tap) with the TouchEvent class. Create event listeners using\n     * the event types defined in this class.\n     * Note: When objects are nested on the display list, touch events target the deepest possible nested object that is\n     * visible in the display list. This object is called the target node. To have a target node's ancestor (an object\n     * containing the target node in the display list) receive notification of a touch event, use EventDispatcher.addEventListener()\n     * on the ancestor node with the type parameter set to the specific touch event you want to detect.\n     *\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TouchEvent.ts\n     * @language en_US\n     */\n    /**\n     * 使用 TouchEvent 类，您可以处理设备上那些检测用户与设备之间的接触的事件。\n     * 当用户与带有触摸屏的移动电话或平板电脑等设备交互时，用户通常使用手指或指针设备接触屏幕。可使用 TouchEvent\n     * 类开发响应基本触摸事件（如单个手指点击）的应用程序。使用此类中定义的事件类型创建事件侦听器。\n     * 注意：当对象嵌套在显示列表中时，触摸事件的目标将是显示列表中可见的最深的可能嵌套对象。\n     * 此对象称为目标节点。要使目标节点的祖代（祖代是一个包含显示列表中所有目标节点的对象，从舞台到目标节点的父节点均包括在内）\n     * 接收触摸事件的通知，请对祖代节点使用 EventDispatcher.on() 并将 type 参数设置为要检测的特定触摸事件。\n     *\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/events/TouchEvent.ts\n     * @language zh_CN\n     */\n    class TouchEvent extends Event {\n        /**\n         * Dispatched when the user touches the device, and is continuously dispatched until the point of contact is removed.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户触碰设备时进行调度，而且会连续调度，直到接触点被删除。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TOUCH_MOVE: \"touchMove\";\n        /**\n         * Dispatched when the user first contacts a touch-enabled device (such as touches a finger to a mobile phone or tablet with a touch screen).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户第一次触摸启用触摸的设备时（例如，用手指触摸配有触摸屏的移动电话或平板电脑）调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TOUCH_BEGIN: \"touchBegin\";\n        /**\n         * Dispatched when the user removes contact with a touch-enabled device (such as lifts a finger off a mobile phone\n         * or tablet with a touch screen).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户移除与启用触摸的设备的接触时（例如，将手指从配有触摸屏的移动电话或平板电脑上抬起）调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TOUCH_END: \"touchEnd\";\n        /**\n         * Dispatched when an event of some kind occurred that canceled the touch.\n         * Such as the eui.Scroller will dispatch 'TOUCH_CANCEL' when it start move, the 'TOUCH_END' and 'TOUCH_TAP' will not be triggered.\n         * @version Egret 3.0.1\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 由于某个事件取消了触摸时触发。比如 eui.Scroller 在开始滚动后会触发 'TOUCH_CANCEL' 事件，不再触发后续的 'TOUCH_END' 和 'TOUCH_TAP' 事件\n         * @version Egret 3.0.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TOUCH_CANCEL: \"touchCancel\";\n        /**\n         * Dispatched when the user lifts the point of contact over the same DisplayObject instance on which the contact\n         * was initiated on a touch-enabled device.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户在触摸设备上与开始触摸的同一 DisplayObject 实例上抬起接触点时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TOUCH_TAP: \"touchTap\";\n        /**\n         * Dispatched when the user lifts the point of contact over the different DisplayObject instance on which the contact\n         * was initiated on a touch-enabled device (such as presses and releases a finger from a single point over a display\n         * object on a mobile phone or tablet with a touch screen).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当用户在触摸设备上与开始触摸的不同 DisplayObject 实例上抬起接触点时调度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TOUCH_RELEASE_OUTSIDE: \"touchReleaseOutside\";\n        /**\n         * Creates an Event object that contains information about touch events.\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @param stageX The horizontal coordinate at which the event occurred in global Stage coordinates.\n         * @param stageY The vertical coordinate at which the event occurred in global Stage coordinates.\n         * @param touchPointID A unique identification number assigned to the touch point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 TouchEvent 对象，其中包含有关Touch事件的信息\n         * @param type 事件的类型，可以作为 Event.type 访问。\n         * @param bubbles 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param stageX 事件发生点在全局舞台坐标系中的水平坐标\n         * @param stageY 事件发生点在全局舞台坐标系中的垂直坐标\n         * @param touchPointID 分配给触摸点的唯一标识号\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(type: string, bubbles?: boolean, cancelable?: boolean, stageX?: number, stageY?: number, touchPointID?: number);\n        /**\n         * @private\n         */\n        $initTo(stageX: number, stageY: number, touchPointID: number): void;\n        /**\n         * @private\n         */\n        $stageX: number;\n        /**\n         * The horizontal coordinate at which the event occurred in global Stage coordinates.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 事件发生点在全局舞台坐标中的水平坐标。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly stageX: number;\n        /**\n         * @private\n         */\n        $stageY: number;\n        /**\n         * The vertical coordinate at which the event occurred in global Stage coordinates.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 事件发生点在全局舞台坐标中的垂直坐标。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly stageY: number;\n        private _localX;\n        /**\n         * The horizontal coordinate at which the event occurred relative to the display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 事件发生点相对于所属显示对象的水平坐标。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly localX: number;\n        private _localY;\n        /**\n         * The vertical coordinate at which the event occurred relative to the display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 事件发生点相对于所属显示对象的垂直坐标。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly localY: number;\n        private targetChanged;\n        /**\n         * @private\n         */\n        private getLocalXY();\n        $setTarget(target: any): boolean;\n        /**\n         * A unique identification number assigned to the touch point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 分配给触摸点的唯一标识号\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        touchPointID: number;\n        /**\n         * Instructs Egret runtime to render after processing of this event completes, if the display list has been modified.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果已修改显示列表，调用此方法将会忽略帧频限制，在此事件处理完成后立即重绘屏幕。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        updateAfterEvent(): void;\n        /**\n         * Whether the touch is pressed (true) or not pressed (false).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示触摸已按下 (true) 还是未按下 (false)。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        touchDown: boolean;\n        /**\n         * uses a specified target to dispatchEvent an event. Using this method can reduce the number of\n         * reallocate event objects, which allows you to get better code execution performance.\n         * @param target the event target\n         * @param type  The type of the event, accessible as Event.type.\n         * @param bubbles  Determines whether the Event object participates in the bubbling stage of the event flow. The default value is false.\n         * @param cancelable Determines whether the Event object can be canceled. The default values is false.\n         * @param stageX The horizontal coordinate at which the event occurred in global Stage coordinates.\n         * @param stageY The vertical coordinate at which the event occurred in global Stage coordinates.\n         * @param touchPointID A unique identification number (as an int) assigned to the touch point.\n         *\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         *\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的EventDispatcher对象来抛出Event事件对象。抛出的对象将会缓存在对象池上，供下次循环复用。\n         * @param target 派发事件目标\n         * @param type 事件的类型，可以作为 Event.type 访问。\n         * @param bubbles 确定 Event 对象是否参与事件流的冒泡阶段。默认值为 false。\n         * @param cancelable 确定是否可以取消 Event 对象。默认值为 false。\n         * @param stageX 事件发生点在全局舞台坐标系中的水平坐标\n         * @param stageY 事件发生点在全局舞台坐标系中的垂直坐标\n         * @param touchPointID 分配给触摸点的唯一标识号\n         *\n         * @see egret.Event.create()\n         * @see egret.Event.release()\n         *\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static dispatchTouchEvent(target: IEventDispatcher, type: string, bubbles?: boolean, cancelable?: boolean, stageX?: number, stageY?: number, touchPointID?: number, touchDown?: boolean): boolean;\n    }\n}\ndeclare namespace egret {\n    /**\n     * h5 and native interaction.\n     * @see http://edn.egret.com/cn/article/index/id/714 Egret basic skills to communicate with Native\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/external/ExternalInterface.ts\n     * @language en_US\n     */\n    /**\n     * h5与native交互。\n     * @see http://edn.egret.com/cn/article/index/id/714 Egret 与 Native 通信基本技巧\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/external/ExternalInterface.ts\n     * @language zh_CN\n     */\n    interface ExternalInterface {\n    }\n    let ExternalInterface: {\n        /**\n         * Call functionName, and the value passed to the native.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 调用 functionName，并将value传入到native中。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        call(functionName: string, value: string): void;\n        /**\n         * FunctionName callback listener, you need to have to call functionName this field in native rather than such a call.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 监听 functionName 回调，需要在native中有调用 functionName 这个字段，而不是 此类的call。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        addCallback(functionName: string, listener: (value: string) => void): void;\n    };\n}\ndeclare namespace egret {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    const enum BitmapFilterQuality {\n        /**\n         * 定义低品质滤镜设置\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        LOW = 1,\n        /**\n         * 定义中等品质滤镜设置\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        MEDIUM = 2,\n        /**\n         * 定义高品质滤镜设置\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        HIGH = 3,\n    }\n}\ndeclare namespace egret {\n    /**\n     * The BlurFilter class lets you apply a blur visual effect to display objects. A blur effect softens the details of an image.\n     * You can produce blurs that range from a softly unfocused look to a Gaussian blur, a hazy appearance like viewing an image through semi-opaque glass.\n     * @version Egret 3.0.1\n     * @platform Web\n     * @see http://edn.egret.com/cn/docs/page/947#模糊滤镜 模糊滤镜\n     * @language en_US\n     */\n    /**\n     * 可使用 BlurFilter 类将模糊视觉效果应用于显示对象。模糊效果可以柔化图像的细节。\n     * 您可以生成一些模糊效果，范围从创建一个柔化的、未聚焦的外观到高斯模糊（就像通过半透明玻璃查看图像一样的朦胧的外观）。\n     * @version Egret 3.1.0\n     * @platform Web\n     * @see http://edn.egret.com/cn/docs/page/947#模糊滤镜 模糊滤镜\n     * @language zh_CN\n     */\n    class BlurFilter extends Filter {\n        /**\n         * Initializes a BlurFilter object.\n         * @param blurX {number} The amount of horizontal blur. Valid values are 0 to 255 (floating point).\n         * @param blurY {number} The amount of vertical blur. Valid values are 0 to 255 (floating point).\n         * @param quality {number} The number of times to apply the filter.\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 创建一个 BlurFilter 对象。\n         * @param blurX {number} 水平模糊量。有效值为 0 到 255（浮点）。\n         * @param blurY {number} 垂直模糊量。有效值为 0 到 255（浮点）。\n         * @param quality {number} 应用滤镜的次数。暂未实现。\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        constructor(blurX?: number, blurY?: number, quality?: number);\n        /**\n         * @private\n         */\n        blurXFilter: IBlurXFilter;\n        /**\n         * @private\n         */\n        blurYFilter: IBlurYFilter;\n        /**\n         * @private\n         */\n        $quality: number;\n        /**\n         * The amount of horizontal blur.\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 水平模糊量。\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        blurX: number;\n        /**\n         * @private\n         */\n        $blurX: number;\n        /**\n         * The amount of vertical blur.\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 垂直模糊量。\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        blurY: number;\n        /**\n         * @private\n         */\n        $blurY: number;\n        /**\n         * @private\n         */\n        $toJson(): string;\n        protected updatePadding(): void;\n        onPropertyChange(): void;\n    }\n    /**\n     * @private\n     */\n    interface IBlurXFilter extends Filter {\n        type: string;\n        $uniforms: any;\n        blurX: number;\n    }\n    /**\n     * @private\n     */\n    interface IBlurYFilter extends Filter {\n        type: string;\n        $uniforms: any;\n        blurY: number;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The ColorMatrixFilter class lets you apply a 4 x 5 matrix transformation on the RGBA color and alpha values of every pixel in the input image to produce a result with a new set of RGBA color and alpha values.\n     * It allows saturation changes, hue rotation, luminance to alpha, and various other effects.\n     * @version Egret 3.1.0\n     * @platform Web\n     * @see http://edn.egret.com/cn/docs/page/947 颜色矩阵滤镜\n     * @language en_US\n     */\n    /**\n     * 使用 ColorMatrixFilter 类可以将 4 x 5 矩阵转换应用于输入图像上的每个像素的 RGBA 颜色和 Alpha 值，以生成具有一组新的 RGBA 颜色和 Alpha 值的结果。\n     * 该类允许饱和度更改、色相旋转、亮度为 Alpha 以及各种其他效果。\n     * @version Egret 3.1.0\n     * @platform Web\n     * @see http://edn.egret.com/cn/docs/page/947 颜色矩阵滤镜\n     * @language zh_CN\n     */\n    class ColorMatrixFilter extends Filter {\n        /**\n         * @private\n         */\n        $matrix: number[];\n        /**\n         * @private\n         */\n        private matrix2;\n        /**\n         * Initializes a ColorMatrixFilter object.\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 创建一个 ColorMatrixFilter 对象。\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        constructor(matrix?: number[]);\n        /**\n         * A comma delimited list of 20 doubles that comprise a 4x5 matrix applied to the rendered element.\n         * The matrix is in row major order -- that is, the first five elements are multipled by the vector [srcR,srcG,srcB,srcA,1] to determine the output red value, the second five determine the output green value, etc.\n         * The value must either be an array or comma delimited string of 20 numbers.\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 构成应用于所呈示的元素的一个 4x5 矩阵的、以逗号分隔的 20 个双精度数的列表。\n         * 矩阵以行作为主要顺序，即用第一行五个元素乘以矢量 [srcR,srcG,srcB,srcA,1] 以确定输出的红色值，用第二行的五个元素确定输出的绿色值，等等。\n         * 该值必须为 20 个数字组成的数组或以逗号分隔的字符串。\n         * @version Egret 3.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        matrix: number[];\n        /**\n         * @private\n         */\n        private setMatrix(value);\n        /**\n         * @private\n         */\n        $toJson(): string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * custom filter, now support WebGL mode only.\n     * @version Egret 4.1.0\n     * @platform Web\n     * @language en_US\n     */\n    /**\n     * 自定义滤镜，目前仅支持WebGL模式\n     * @version Egret 4.1.0\n     * @platform Web\n     * @language zh_CN\n     */\n    class CustomFilter extends Filter {\n        /**\n         * @private\n         */\n        $vertexSrc: string;\n        /**\n         * @private\n         */\n        $fragmentSrc: string;\n        /**\n         * @private\n         */\n        $shaderKey: string;\n        /**\n         * @private\n         */\n        type: string;\n        private $padding;\n        /**\n         * The inner margin of the filter.\n         * If the desired area of the custom filter is larger than the original area (stroke, etc.), you need to set it manually.\n         * @version Egret 4.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 滤镜的内边距\n         * 如果自定义滤镜所需区域比原区域大（描边等），需要手动设置\n         * @version Egret 4.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        padding: number;\n        /**\n         * The initial value of the uniform in the shader (key, value one-to-one correspondence), currently only supports numbers and arrays.\n         * @version Egret 4.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 着色器中uniform的初始值（key，value一一对应），目前仅支持数字和数组。\n         * @version Egret 4.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        readonly uniforms: any;\n        /**\n         * Initialize the CustomFilter object.\n         * @param vertexSrc Custom vertex shader program.\n         * @param fragmentSrc Custom fragment shader program.\n         * @param uniforms The initial value of the uniform in the shader (key, value one-to-one correspondence), currently only supports numbers and arrays.\n         * @version Egret 4.1.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 初始化 CustomFilter 对象\n         * @param vertexSrc 自定义的顶点着色器程序。\n         * @param fragmentSrc 自定义的片段着色器程序。\n         * @param uniforms 着色器中uniform的初始值（key，value一一对应），目前仅支持数字和数组。\n         * @version Egret 4.1.0\n         * @platform Web\n         * @language zh_CN\n         */\n        constructor(vertexSrc: string, fragmentSrc: string, uniforms?: any);\n        onPropertyChange(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @class egret.DropShadowFilter\n     * @classdesc\n     * 可使用 DropShadowFilter 类向显示对象添加投影。\n     * @extends egret.GlowFilter\n     * @version Egret 3.1.4\n     * @platform Web,Native\n     */\n    class DropShadowFilter extends GlowFilter {\n        /**\n         * Initializes a new DropShadowFilter instance.\n         * @method egret.DropShadowFilter#constructor\n         * @param distance {number} The offset distance of the bevel. Valid values are in pixels (floating point).\n         * @param angle {number} The angle of the bevel. Valid values are from 0 to 360°.\n         * @param color {number} The color of the glow. Valid values are in the hexadecimal format 0xRRGGBB. The default value is 0xFF0000.\n         * @param alpha {number} The alpha transparency value for the color. Valid values are 0 to 1. For example, .25 sets a transparency value of 25%. The default value is 1.\n         * @param blurX {number} The amount of horizontal blur. Valid values are 0 to 255 (floating point).\n         * @param blurY {number} The amount of vertical blur. Valid values are 0 to 255 (floating point).\n         * @param strength {number} The strength of the imprint or spread. The higher the value, the more color is imprinted and the stronger the contrast between the glow and the background. Valid values are 0 to 255.\n         * @param quality {number} The number of times to apply the filter.\n         * @param inner {boolean} Specifies whether the glow is an inner glow. The value true indicates an inner glow. The default is false, an outer glow (a glow around the outer edges of the object).\n         * @param knockout {number} Specifies whether the object has a knockout effect. A value of true makes the object's fill transparent and reveals the background color of the document. The default value is false (no knockout effect).\n         * @param hideObject {number} Indicates whether or not the object is hidden. The value true indicates that the object itself is not drawn; only the shadow is visible. The default is false, meaning that the object is shown.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 初始化 DropShadowFilter 对象\n         * @method egret.DropShadowFilter#constructor\n         * @param distance {number} 阴影的偏移距离，以像素为单位。\n         * @param angle {number} 阴影的角度，0 到 360 度（浮点）。\n         * @param color {number} 光晕颜色，采用十六进制格式 0xRRGGBB。默认值为 0xFF0000。\n         * @param alpha {number} 颜色的 Alpha 透明度值。有效值为 0 到 1。例如，0.25 设置透明度值为 25%。\n         * @param blurX {number} 水平模糊量。有效值为 0 到 255（浮点）。\n         * @param blurY {number} 垂直模糊量。有效值为 0 到 255（浮点）。\n         * @param strength {number} 印记或跨页的强度。该值越高，压印的颜色越深，而且发光与背景之间的对比度也越强。有效值为 0 到 255。\n         * @param quality {number} 应用滤镜的次数。暂未实现。\n         * @param inner {boolean} 指定发光是否为内侧发光。值 true 指定发光是内侧发光。值 false 指定发光是外侧发光（对象外缘周围的发光）。\n         * @param knockout {number} 指定对象是否具有挖空效果。值为 true 将使对象的填充变为透明，并显示文档的背景颜色。\n         * @param hideObject {number} 表示是否隐藏对象。如果值为 true，则表示没有绘制对象本身，只有阴影是可见的。默认值为 false（显示对象）。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        constructor(distance?: number, angle?: number, color?: number, alpha?: number, blurX?: number, blurY?: number, strength?: number, quality?: number, inner?: boolean, knockout?: boolean, hideObject?: boolean);\n        /**\n         * @private\n         */\n        $distance: number;\n        /**\n         * The offset distance of the bevel.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 阴影的偏移距离，以像素为单位。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        distance: number;\n        /**\n         * @private\n         */\n        $angle: number;\n        /**\n         * The angle of the bevel.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 阴影的角度。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        angle: number;\n        /**\n         * @private\n         */\n        $hideObject: boolean;\n        /**\n         * Indicates whether or not the object is hidden.\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 表示是否隐藏对象。\n         * @version Egret 3.1.4\n         * @platform Web\n         * @language zh_CN\n         */\n        hideObject: boolean;\n        /**\n         * @private\n         */\n        $toJson(): string;\n        protected updatePadding(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The GradientType class provides values for the type parameter in the beginGradientFill() methods of the egret.Graphics class.\n     *\n     * @see egret.Graphics#beginGradientFill()\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * GradientType 类为 egret.Graphics 类的 beginGradientFill() 方法中的 type 参数提供值。\n     *\n     * @see egret.Graphics#beginGradientFill()\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class GradientType {\n        /**\n         * Value used to specify a linear gradient fill.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于指定线性渐变填充的值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static LINEAR: string;\n        /**\n         * Value used to specify a radial gradient fill.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于指定放射状渐变填充的值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static RADIAL: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The Graphics class contains a set of methods for creating vector shape. Display objects that support drawing include Sprite and Shape objects. Each class in these classes includes the graphics attribute that is a Graphics object.\n     * The following auxiliary functions are provided for ease of use: drawRect(), drawRoundRect(), drawCircle(), and drawEllipse().\n     * @see http://edn.egret.com/cn/docs/page/136 Draw Rectangle\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Graphics.ts\n     * @language en_US\n     */\n    /**\n     * Graphics 类包含一组可用来创建矢量形状的方法。支持绘制的显示对象包括 Sprite 和 Shape 对象。这些类中的每一个类都包括 graphics 属性，该属性是一个 Graphics 对象。\n     * 以下是为便于使用而提供的一些辅助函数：drawRect()、drawRoundRect()、drawCircle() 和 drawEllipse()。\n     * @see http://edn.egret.com/cn/docs/page/136 绘制矩形\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Graphics.ts\n     * @language zh_CN\n     */\n    class Graphics extends HashObject {\n        /**\n         * Initializes a Graphics object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 Graphics 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        /**\n         * @private\n         */\n        $renderNode: sys.GraphicsNode;\n        /**\n         * 绑定到的目标显示对象\n         */\n        $targetDisplay: DisplayObject;\n        $targetIsSprite: boolean;\n        /**\n         * @private\n         * 设置绑定到的目标显示对象\n         */\n        $setTarget(target: DisplayObject): void;\n        /**\n         * 当前移动到的坐标X\n         */\n        private lastX;\n        /**\n         * 当前移动到的坐标Y\n         */\n        private lastY;\n        /**\n         * 当前正在绘制的填充\n         */\n        private fillPath;\n        /**\n         * 当前正在绘制的线条\n         */\n        private strokePath;\n        /**\n         * 线条的左上方宽度\n         */\n        private topLeftStrokeWidth;\n        /**\n         * 线条的右下方宽度\n         */\n        private bottomRightStrokeWidth;\n        /**\n         * 对1像素和3像素特殊处理，向右下角偏移0.5像素，以显示清晰锐利的线条。\n         */\n        private setStrokeWidth(width);\n        /**\n         * Specify a simple single color fill that will be used for subsequent calls to other Graphics methods (for example, lineTo() and drawCircle()) when drawing.\n         * Calling the clear() method will clear the fill.\n         * @param color Filled color\n         * @param alpha Filled Alpha value\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定一种简单的单一颜色填充，在绘制时该填充将在随后对其他 Graphics 方法（如 lineTo() 或 drawCircle()）的调用中使用。\n         * 调用 clear() 方法会清除填充。\n         * @param color 填充的颜色\n         * @param alpha 填充的 Alpha 值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        beginFill(color: number, alpha?: number): void;\n        /**\n         * Specifies a gradient fill used by subsequent calls to other Graphics methods (such as lineTo() or drawCircle()) for the object.\n         * Calling the clear() method clears the fill.\n         * @param type A value from the GradientType class that specifies which gradient type to use: GradientType.LINEAR or GradientType.RADIAL.\n         * @param colors An array of RGB hexadecimal color values used in the gradient; for example, red is 0xFF0000, blue is 0x0000FF, and so on. You can specify up to 15 colors. For each color, specify a corresponding value in the alphas and ratios parameters.\n         * @param alphas An array of alpha values for the corresponding colors in the colors array;\n         * @param ratios An array of color distribution ratios; valid values are 0-255.\n         * @param matrix A transformation matrix as defined by the egret.Matrix class. The egret.Matrix class includes a createGradientBox() method, which lets you conveniently set up the matrix for use with the beginGradientFill() method.\n         * @platform Web,Native\n         * @version Egret 2.4\n         * @language en_US\n         */\n        /**\n         * 指定一种渐变填充，用于随后调用对象的其他 Graphics 方法（如 lineTo() 或 drawCircle()）。\n         * 调用 clear() 方法会清除填充。\n         * @param type 用于指定要使用哪种渐变类型的 GradientType 类的值：GradientType.LINEAR 或 GradientType.RADIAL。\n         * @param colors 渐变中使用的 RGB 十六进制颜色值的数组（例如，红色为 0xFF0000，蓝色为 0x0000FF，等等）。对于每种颜色，请在 alphas 和 ratios 参数中指定对应值。\n         * @param alphas colors 数组中对应颜色的 alpha 值数组。\n         * @param ratios 颜色分布比率的数组。有效值为 0 到 255。\n         * @param matrix 一个由 egret.Matrix 类定义的转换矩阵。egret.Matrix 类包括 createGradientBox() 方法，通过该方法可以方便地设置矩阵，以便与 beginGradientFill() 方法一起使用\n         * @platform Web,Native\n         * @version Egret 2.4\n         * @language zh_CN\n         */\n        beginGradientFill(type: string, colors: number[], alphas: number[], ratios: number[], matrix?: egret.Matrix): void;\n        /**\n         * Apply fill to the lines and curves added after the previous calling to the beginFill() method.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 对从上一次调用 beginFill()方法之后添加的直线和曲线应用填充。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        endFill(): void;\n        /**\n         * Specify a line style that will be used for subsequent calls to Graphics methods such as lineTo() and drawCircle().\n         * @param thickness An integer, indicating the thickness of the line in points. Valid values are 0 to 255. If a number is not specified, or if the parameter is undefined, a line is not drawn. If a value less than 0 is passed, the default value is 0. Value 0 indicates hairline thickness; the maximum thickness is 255. If a value greater than 255 is passed, the default value is 255.\n         * @param color A hexadecimal color value of the line (for example, red is 0xFF0000, and blue is 0x0000FF, etc.). If no value is specified, the default value is 0x000000 (black). Optional.\n         * @param alpha Indicates Alpha value of the line's color. Valid values are 0 to 1. If no value is specified, the default value is 1 (solid). If the value is less than 0, the default value is 0. If the value is greater than 1, the default value is 1.\n         * @param pixelHinting A boolean value that specifies whether to hint strokes to full pixels. This affects both the position of anchors of a curve and the line stroke size itself. With pixelHinting set to true, the line width is adjusted to full pixel width. With pixelHinting set to false, disjoints can appear for curves and straight lines.\n         * @param scaleMode Specifies the scale mode to be used\n         * @param caps Specifies the value of the CapsStyle class of the endpoint type at the end of the line. (default = CapsStyle.ROUND)\n         * @param joints Specifies the type of joint appearance of corner.  (default = JointStyle.ROUND)\n         * @param miterLimit Indicates the limit number of cut miter.\n         * @param lineDash set the line dash.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定一种线条样式以用于随后对 lineTo() 或 drawCircle() 等 Graphics 方法的调用。\n         * @param thickness 一个整数，以点为单位表示线条的粗细，有效值为 0 到 255。如果未指定数字，或者未定义该参数，则不绘制线条。如果传递的值小于 0，则默认值为 0。值 0 表示极细的粗细；最大粗细为 255。如果传递的值大于 255，则默认值为 255。\n         * @param color 线条的十六进制颜色值（例如，红色为 0xFF0000，蓝色为 0x0000FF 等）。如果未指明值，则默认值为 0x000000（黑色）。可选。\n         * @param alpha 表示线条颜色的 Alpha 值的数字；有效值为 0 到 1。如果未指明值，则默认值为 1（纯色）。如果值小于 0，则默认值为 0。如果值大于 1，则默认值为 1。\n         * @param pixelHinting 布尔型值，指定是否提示笔触采用完整像素。它同时影响曲线锚点的位置以及线条笔触大小本身。在 pixelHinting 设置为 true 的情况下，线条宽度会调整到完整像素宽度。在 pixelHinting 设置为 false 的情况下，对于曲线和直线可能会出现脱节。\n         * @param scaleMode 用于指定要使用的比例模式\n         * @param caps 用于指定线条末端处端点类型的 CapsStyle 类的值。默认值：CapsStyle.ROUND\n         * @param joints 指定用于拐角的连接外观的类型。默认值：JointStyle.ROUND\n         * @param miterLimit 用于表示剪切斜接的极限值的数字。\n         * @param lineDash 设置虚线样式。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        lineStyle(thickness?: number, color?: number, alpha?: number, pixelHinting?: boolean, scaleMode?: string, caps?: string, joints?: string, miterLimit?: number, lineDash?: number[]): void;\n        /**\n         * Draw a rectangle\n         * @param x x position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param y y position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param width Width of the rectangle (in pixels).\n         * @param height Height of the rectangle (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一个矩形\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        drawRect(x: number, y: number, width: number, height: number): void;\n        /**\n         * Draw a rectangle with rounded corners.\n         * @param x x position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param y y position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param width Width of the rectangle (in pixels).\n         * @param height Height of the rectangle (in pixels).\n         * @param ellipseWidth Width used to draw an ellipse with rounded corners (in pixels).\n         * @param ellipseHeight Height used to draw an ellipse with rounded corners (in pixels). (Optional) If no value is specified, the default value matches the value of the ellipseWidth parameter.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一个圆角矩形。\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @param ellipseWidth 用于绘制圆角的椭圆的宽度（以像素为单位）。\n         * @param ellipseHeight 用于绘制圆角的椭圆的高度（以像素为单位）。 （可选）如果未指定值，则默认值与为 ellipseWidth 参数提供的值相匹配。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        drawRoundRect(x: number, y: number, width: number, height: number, ellipseWidth: number, ellipseHeight?: number): void;\n        /**\n         * Draw a circle.\n         * @param x x position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param y y position of the center, relative to the registration point of the parent display object (in pixels).\n         * @param r Radius of the circle (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一个圆。\n         * @param x 圆心相对于父显示对象注册点的 x 位置（以像素为单位）。\n         * @param y 相对于父显示对象注册点的圆心的 y 位置（以像素为单位）。\n         * @param radius 圆的半径（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        drawCircle(x: number, y: number, radius: number): void;\n        /**\n         * Draw an ellipse.\n         * @param x A number indicating the horizontal position, relative to the registration point of the parent display object (in pixels).\n         * @param y A number indicating the vertical position, relative to the registration point of the parent display object (in pixels).\n         * @param width Width of the rectangle (in pixels).\n         * @param height Height of the rectangle (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一个椭圆。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        drawEllipse(x: number, y: number, width: number, height: number): void;\n        /**\n         * Move the current drawing position to (x, y). If any of these parameters is missed, calling this method will fail and the current drawing position keeps unchanged.\n         * @param x A number indicating the horizontal position, relative to the registration point of the parent display object (in pixels).\n         * @param y A number indicating the vertical position, relative to the registration point of the parent display object (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将当前绘图位置移动到 (x, y)。如果缺少任何一个参数，则此方法将失败，并且当前绘图位置不改变。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        moveTo(x: number, y: number): void;\n        /**\n         * Draw a straight line from the current drawing position to (x, y) using the current line style; the current drawing position is then set to (x, y).\n         * @param x A number indicating the horizontal position, relative to the registration point of the parent display object (in pixels).\n         * @param y A number indicating the vertical position, relative to the registration point of the parent display object (in pixels).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用当前线条样式绘制一条从当前绘图位置开始到 (x, y) 结束的直线；当前绘图位置随后会设置为 (x, y)。\n         * @param x 一个表示相对于父显示对象注册点的水平位置的数字（以像素为单位）。\n         * @param y 一个表示相对于父显示对象注册点的垂直位置的数字（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        lineTo(x: number, y: number): void;\n        /**\n         * Draw a quadratic Bezier curve from the current drawing position to (anchorX, anchorY) using the current line style according to the control points specified by (controlX, controlY). The current drawing position is then set to (anchorX, anchorY).\n         * If the curveTo() method is called before the moveTo() method, the default value of the current drawing position is (0, 0). If any of these parameters is missed, calling this method will fail and the current drawing position keeps unchanged.\n         * The drawn curve is a quadratic Bezier curve. A quadratic Bezier curve contains two anchor points and one control point. The curve interpolates the two anchor points and bends to the control point.\n         * @param controlX A number indicating the horizontal position of the control point, relative to the registration point of the parent display object.\n         * @param controlY A number indicating the vertical position of the control point, relative to the registration point of the parent display object.\n         * @param anchorX A number indicating the horizontal position of the next anchor point, relative to the registration point of the parent display object.\n         * @param anchorY A number indicating the vertical position of the next anchor point, relative to the registration point of the parent display object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用当前线条样式和由 (controlX, controlY) 指定的控制点绘制一条从当前绘图位置开始到 (anchorX, anchorY) 结束的二次贝塞尔曲线。当前绘图位置随后设置为 (anchorX, anchorY)。\n         * 如果在调用 moveTo() 方法之前调用了 curveTo() 方法，则当前绘图位置的默认值为 (0, 0)。如果缺少任何一个参数，则此方法将失败，并且当前绘图位置不改变。\n         * 绘制的曲线是二次贝塞尔曲线。二次贝塞尔曲线包含两个锚点和一个控制点。该曲线内插这两个锚点，并向控制点弯曲。\n         * @param controlX 一个数字，指定控制点相对于父显示对象注册点的水平位置。\n         * @param controlY 一个数字，指定控制点相对于父显示对象注册点的垂直位置。\n         * @param anchorX 一个数字，指定下一个锚点相对于父显示对象注册点的水平位置。\n         * @param anchorY 一个数字，指定下一个锚点相对于父显示对象注册点的垂直位置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        curveTo(controlX: number, controlY: number, anchorX: number, anchorY: number): void;\n        /**\n         * Draws a cubic Bezier curve from the current drawing position to the specified anchor. Cubic Bezier curves consist of two anchor points and two control points. The curve interpolates the two anchor points and two control points to the curve.\n         * @param controlX1 Specifies the first control point relative to the registration point of the parent display the horizontal position of the object.\n         * @param controlY1 Specifies the first control point relative to the registration point of the parent display the vertical position of the object.\n         * @param controlX2 Specify the second control point relative to the registration point of the parent display the horizontal position of the object.\n         * @param controlY2 Specify the second control point relative to the registration point of the parent display the vertical position of the object.\n         * @param anchorX Specifies the anchor point relative to the registration point of the parent display the horizontal position of the object.\n         * @param anchorY Specifies the anchor point relative to the registration point of the parent display the vertical position of the object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从当前绘图位置到指定的锚点绘制一条三次贝塞尔曲线。三次贝塞尔曲线由两个锚点和两个控制点组成。该曲线内插这两个锚点，并向两个控制点弯曲。\n         * @param controlX1 指定首个控制点相对于父显示对象的注册点的水平位置。\n         * @param controlY1 指定首个控制点相对于父显示对象的注册点的垂直位置。\n         * @param controlX2 指定第二个控制点相对于父显示对象的注册点的水平位置。\n         * @param controlY2 指定第二个控制点相对于父显示对象的注册点的垂直位置。\n         * @param anchorX 指定锚点相对于父显示对象的注册点的水平位置。\n         * @param anchorY 指定锚点相对于父显示对象的注册点的垂直位置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        cubicCurveTo(controlX1: number, controlY1: number, controlX2: number, controlY2: number, anchorX: number, anchorY: number): void;\n        /**\n         * adds an arc to the path which is centered at (x, y) position with radius r starting at startAngle and ending\n         * at endAngle going in the given direction by anticlockwise (defaulting to clockwise).\n         * @param x The x coordinate of the arc's center.\n         * @param y The y coordinate of the arc's center.\n         * @param radius The arc's radius.\n         * @param startAngle The angle at which the arc starts, measured clockwise from the positive x axis and expressed in radians.\n         * @param endAngle The angle at which the arc ends, measured clockwise from the positive x axis and expressed in radians.\n         * @param anticlockwise if true, causes the arc to be drawn counter-clockwise between the two angles. By default it is drawn clockwise.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 绘制一段圆弧路径。圆弧路径的圆心在 (x, y) 位置，半径为 r ，根据anticlockwise （默认为顺时针）指定的方向从 startAngle 开始绘制，到 endAngle 结束。\n         * @param x 圆弧中心（圆心）的 x 轴坐标。\n         * @param y 圆弧中心（圆心）的 y 轴坐标。\n         * @param radius 圆弧的半径。\n         * @param startAngle 圆弧的起始点， x轴方向开始计算，单位以弧度表示。\n         * @param endAngle 圆弧的终点， 单位以弧度表示。\n         * @param anticlockwise 如果为 true，逆时针绘制圆弧，反之，顺时针绘制。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        drawArc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;\n        private dirty();\n        /**\n         * @private\n         * 测量圆弧的矩形大小\n         */\n        private arcBounds(x, y, radius, startAngle, endAngle);\n        /**\n         * Clear graphics that are drawn to this Graphics object, and reset fill and line style settings.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 清除绘制到此 Graphics 对象的图形，并重置填充和线条样式设置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        clear(): void;\n        /**\n         * @private\n         */\n        private minX;\n        /**\n         * @private\n         */\n        private minY;\n        /**\n         * @private\n         */\n        private maxX;\n        /**\n         * @private\n         */\n        private maxY;\n        /**\n         * @private\n         */\n        private extendBoundsByPoint(x, y);\n        /**\n         * @private\n         */\n        private extendBoundsByX(x);\n        /**\n         * @private\n         */\n        private extendBoundsByY(y);\n        /**\n         * @private\n         */\n        private updateNodeBounds();\n        /**\n         * 是否已经包含上一次moveTo的坐标点\n         */\n        private includeLastPosition;\n        /**\n         * 更新当前的lineX和lineY值，并标记尺寸失效。\n         * @private\n         */\n        private updatePosition(x, y);\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        /**\n         * @private\n         *\n         */\n        $hitTest(stageX: number, stageY: number): DisplayObject;\n        /**\n         * @private\n         */\n        $onRemoveFromStage(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The Matrix class represents a transformation matrix that determines how to map points from one coordinate space to\n     * another. You can perform various graphical transformations on a display object by setting the properties of a Matrix\n     * object, applying that Matrix object to the matrix property of a display object, These transformation functions include\n     * translation (x and y repositioning), rotation, scaling, and skewing.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Matrix.ts\n     * @language en_US\n     */\n    /**\n     * Matrix 类表示一个转换矩阵，它确定如何将点从一个坐标空间映射到另一个坐标空间。\n     * 您可以对一个显示对象执行不同的图形转换，方法是设置 Matrix 对象的属性，将该 Matrix\n     * 对象应用于显示对象的 matrix 属性。这些转换函数包括平移（x 和 y 重新定位）、旋转、缩放和倾斜。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Matrix.ts\n     * @language zh_CN\n     */\n    class Matrix extends HashObject {\n        /**\n         * Releases a matrix instance to the object pool\n         * @param matrix matrix that Needs to be recycled\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放一个Matrix实例到对象池\n         * @param matrix 需要回收的 matrix\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static release(matrix: Matrix): void;\n        /**\n         * get a matrix instance from the object pool or create a new one.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从对象池中取出或创建一个新的Matrix对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static create(): Matrix;\n        /**\n         * Creates a new Matrix object with the specified parameters.\n         * @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image..\n         * @param tx The distance by which to translate each point along the x axis.\n         * @param ty The distance by which to translate each point along the y axis.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定参数创建一个 Matrix 对象\n         * @param a 缩放或旋转图像时影响像素沿 x 轴定位的值。\n         * @param b 旋转或倾斜图像时影响像素沿 y 轴定位的值。\n         * @param c 旋转或倾斜图像时影响像素沿 x 轴定位的值。\n         * @param d 缩放或旋转图像时影响像素沿 y 轴定位的值。\n         * @param tx 沿 x 轴平移每个点的距离。\n         * @param ty 沿 y 轴平移每个点的距离。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(a?: number, b?: number, c?: number, d?: number, tx?: number, ty?: number);\n        /**\n         * The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 缩放或旋转图像时影响像素沿 x 轴定位的值\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        a: number;\n        /**\n         * The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 旋转或倾斜图像时影响像素沿 y 轴定位的值\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        b: number;\n        /**\n         * The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 旋转或倾斜图像时影响像素沿 x 轴定位的值\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        c: number;\n        /**\n         * The value that affects the positioning of pixels along the y axis when scaling or rotating an image.\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 缩放或旋转图像时影响像素沿 y 轴定位的值\n         * @default 1\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        d: number;\n        /**\n         * The distance by which to translate each point along the x axis.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 沿 x 轴平移每个点的距离\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        tx: number;\n        /**\n         * The distance by which to translate each point along the y axis.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 沿 y 轴平移每个点的距离\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        ty: number;\n        /**\n         * Returns a new Matrix object that is a clone of this matrix, with an exact copy of the contained object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回一个新的 Matrix 对象，它是此矩阵的克隆，带有与所含对象完全相同的副本。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        clone(): Matrix;\n        /**\n         * Concatenates a matrix with the current matrix, effectively combining the geometric effects of the two. In mathematical\n         * terms, concatenating two matrixes is the same as combining them using matrix multiplication.\n         * @param other The matrix to be concatenated to the source matrix.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将某个矩阵与当前矩阵连接，从而将这两个矩阵的几何效果有效地结合在一起。在数学术语中，将两个矩阵连接起来与使用矩阵乘法将它们结合起来是相同的。\n         * @param other 要连接到源矩阵的矩阵。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        concat(other: Matrix): void;\n        /**\n         * Copies all of the matrix data from the source Point object into the calling Matrix object.\n         * @param other  The Matrix object from which to copy the data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将源 Matrix 对象中的所有矩阵数据复制到调用方 Matrix 对象中。\n         * @param other 要拷贝的目标矩阵\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        copyFrom(other: Matrix): Matrix;\n        /**\n         * Sets each matrix property to a value that causes a null transformation. An object transformed by applying an\n         * identity matrix will be identical to the original. After calling the identity() method, the resulting matrix\n         * has the following properties: a=1, b=0, c=0, d=1, tx=0, ty=0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 为每个矩阵属性设置一个值，该值将导致矩阵无转换。通过应用恒等矩阵转换的对象将与原始对象完全相同。\n         * 调用 identity() 方法后，生成的矩阵具有以下属性：a=1、b=0、c=0、d=1、tx=0 和 ty=0。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        identity(): void;\n        /**\n         * Performs the opposite transformation of the original matrix. You can apply an inverted matrix to an object to\n         * undo the transformation performed when applying the original matrix.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 执行原始矩阵的逆转换。\n         * 您可以将一个逆矩阵应用于对象来撤消在应用原始矩阵时执行的转换。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        invert(): void;\n        /**\n         * @private\n         */\n        $invertInto(target: Matrix): void;\n        /**\n         * Applies a rotation transformation to the Matrix object.\n         * The rotate() method alters the a, b, c, and d properties of the Matrix object.\n         * @param angle The rotation angle in radians.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 对 Matrix 对象应用旋转转换。\n         * rotate() 方法将更改 Matrix 对象的 a、b、c 和 d 属性。\n         * @param angle 以弧度为单位的旋转角度。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        rotate(angle: number): void;\n        /**\n         * Applies a scaling transformation to the matrix. The x axis is multiplied by sx, and the y axis it is multiplied by sy.\n         * The scale() method alters the a and d properties of the Matrix object.\n         * @param sx A multiplier used to scale the object along the x axis.\n         * @param sy A multiplier used to scale the object along the y axis.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 对矩阵应用缩放转换。x 轴乘以 sx，y 轴乘以 sy。\n         * scale() 方法将更改 Matrix 对象的 a 和 d 属性。\n         * @param sx 用于沿 x 轴缩放对象的乘数。\n         * @param sy 用于沿 y 轴缩放对象的乘数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        scale(sx: number, sy: number): void;\n        /**\n         * Sets the members of Matrix to the specified values\n         * @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image..\n         * @param tx The distance by which to translate each point along the x axis.\n         * @param ty The distance by which to translate each point along the y axis.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Matrix 的成员设置为指定值\n         * @param a 缩放或旋转图像时影响像素沿 x 轴定位的值。\n         * @param b 旋转或倾斜图像时影响像素沿 y 轴定位的值。\n         * @param c 旋转或倾斜图像时影响像素沿 x 轴定位的值。\n         * @param d 缩放或旋转图像时影响像素沿 y 轴定位的值。\n         * @param tx 沿 x 轴平移每个点的距离。\n         * @param ty 沿 y 轴平移每个点的距离。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setTo(a: number, b: number, c: number, d: number, tx: number, ty: number): Matrix;\n        /**\n         * Returns the result of applying the geometric transformation represented by the Matrix object to the specified point.\n         * @param pointX The x coordinate for which you want to get the result of the Matrix transformation.\n         * @param pointY The y coordinate for which you want to get the result of the Matrix transformation.\n         * @param resultPoint A reusable instance of Point for saving the results. Passing this parameter can reduce the\n         * number of reallocate objects, which allows you to get better code execution performance.\n         * @returns The point resulting from applying the Matrix transformation.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回将 Matrix 对象表示的几何转换应用于指定点所产生的结果。\n         * @param pointX 想要获得其矩阵转换结果的点的x坐标。\n         * @param pointY 想要获得其矩阵转换结果的点的y坐标。\n         * @param resultPoint 框架建议尽可能减少创建对象次数来优化性能，可以从外部传入一个复用的Point对象来存储结果，若不传入将创建一个新的Point对象返回。\n         * @returns 由应用矩阵转换所产生的点。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        transformPoint(pointX: number, pointY: number, resultPoint?: Point): Point;\n        /**\n         * Translates the matrix along the x and y axes, as specified by the dx and dy parameters.\n         * @param dx The amount of movement along the x axis to the right, in pixels.\n         * @param dy The amount of movement down along the y axis, in pixels.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 沿 x 和 y 轴平移矩阵，由 dx 和 dy 参数指定。\n         * @param dx 沿 x 轴向右移动的量（以像素为单位）。\n         * @param dy 沿 y 轴向下移动的量（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        translate(dx: number, dy: number): void;\n        /**\n         * Determines whether two matrixes are equal.\n         * @param other The matrix to be compared.\n         * @returns A value of true if the object is equal to this Matrix object; false if it is not equal.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否与另一个矩阵数据相等\n         * @param other 要比较的另一个矩阵对象。\n         * @returns 是否相等，ture表示相等。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        equals(other: Matrix): boolean;\n        /**\n         * prepend matrix\n         * @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image..\n         * @param tx The distance by which to translate each point along the x axis.\n         * @param ty The distance by which to translate each point along the y axis.\n         * @returns matrix\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 前置矩阵\n         * @param a 缩放或旋转图像时影响像素沿 x 轴定位的值\n         * @param b 缩放或旋转图像时影响像素沿 y 轴定位的值\n         * @param c 缩放或旋转图像时影响像素沿 x 轴定位的值\n         * @param d 缩放或旋转图像时影响像素沿 y 轴定位的值\n         * @param tx 沿 x 轴平移每个点的距离\n         * @param ty 沿 y 轴平移每个点的距离\n         * @returns 矩阵自身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        prepend(a: number, b: number, c: number, d: number, tx: number, ty: number): Matrix;\n        /**\n         * append matrix\n         * @param a The value that affects the positioning of pixels along the x axis when scaling or rotating an image.\n         * @param b The value that affects the positioning of pixels along the y axis when rotating or skewing an image.\n         * @param c The value that affects the positioning of pixels along the x axis when rotating or skewing an image.\n         * @param d The value that affects the positioning of pixels along the y axis when scaling or rotating an image..\n         * @param tx The distance by which to translate each point along the x axis.\n         * @param ty The distance by which to translate each point along the y axis.\n         * @returns matrix\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 后置矩阵\n         * @param a 缩放或旋转图像时影响像素沿 x 轴定位的值\n         * @param b 缩放或旋转图像时影响像素沿 y 轴定位的值\n         * @param c 缩放或旋转图像时影响像素沿 x 轴定位的值\n         * @param d 缩放或旋转图像时影响像素沿 y 轴定位的值\n         * @param tx 沿 x 轴平移每个点的距离\n         * @param ty 沿 y 轴平移每个点的距离\n         * @returns 矩阵自身\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        append(a: number, b: number, c: number, d: number, tx: number, ty: number): Matrix;\n        /**\n         * Given a point in the pretransform coordinate space, returns the coordinates of that point after the transformation occurs.\n         * Unlike the standard transformation applied using the transformPoint() method, the deltaTransformPoint() method's transformation does not consider the translation parameters tx and ty.\n         * @param point The point for which you want to get the result of the matrix transformation.\n         * @returns The point resulting from applying the matrix transformation.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果给定预转换坐标空间中的点，则此方法返回发生转换后该点的坐标。\n         * 与使用 transformPoint() 方法应用的标准转换不同，deltaTransformPoint() 方法的转换不考虑转换参数 tx 和 ty。\n         * @param point 想要获得其矩阵转换结果的点\n         * @returns 由应用矩阵转换所产生的点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        deltaTransformPoint(point: Point): Point;\n        /**\n         * Returns a text value listing the properties of the Matrix object.\n         * @returns A string containing the values of the properties of the Matrix object: a, b, c, d, tx, and ty.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回将 Matrix 对象表示的几何转换应用于指定点所产生的结果。\n         * @returns 一个字符串，它包含 Matrix 对象的属性值：a、b、c、d、tx 和 ty。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        toString(): string;\n        /**\n         * Includes parameters for scaling, rotation, and translation. When applied to a matrix it sets the matrix's values based on those parameters.\n         * @param scaleX The factor by which to scale horizontally.\n         * @param scaleY The factor by which scale vertically.\n         * @param rotation The amount to rotate, in radians.\n         * @param tx The number of pixels to translate (move) to the right along the x axis.\n         * @param ty The number of pixels to translate (move) down along the y axis.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 包括用于缩放、旋转和转换的参数。当应用于矩阵时，该方法会基于这些参数设置矩阵的值。\n         * @param scaleX 水平缩放所用的系数\n         * @param scaleY 垂直缩放所用的系数\n         * @param rotation 旋转量（以弧度为单位）\n         * @param tx 沿 x 轴向右平移（移动）的像素数\n         * @param ty 沿 y 轴向下平移（移动）的像素数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        createBox(scaleX: number, scaleY: number, rotation?: number, tx?: number, ty?: number): void;\n        /**\n         * Creates the specific style of matrix expected by the beginGradientFill() and lineGradientStyle() methods of the Graphics class.\n         * Width and height are scaled to a scaleX/scaleY pair and the tx/ty values are offset by half the width and height.\n         * @param width The width of the gradient box.\n         * @param height The height of the gradient box.\n         * @param rotation The amount to rotate, in radians.\n         * @param tx The distance, in pixels, to translate to the right along the x axis. This value is offset by half of the width parameter.\n         * @param ty The distance, in pixels, to translate down along the y axis. This value is offset by half of the height parameter.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建 Graphics 类的 beginGradientFill() 和 lineGradientStyle() 方法所需的矩阵的特定样式。\n         * 宽度和高度被缩放为 scaleX/scaleY 对，而 tx/ty 值偏移了宽度和高度的一半。\n         * @param width 渐变框的宽度\n         * @param height 渐变框的高度\n         * @param rotation 旋转量（以弧度为单位）\n         * @param tx 沿 x 轴向右平移的距离（以像素为单位）。此值将偏移 width 参数的一半\n         * @param ty 沿 y 轴向下平移的距离（以像素为单位）。此值将偏移 height 参数的一半\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        createGradientBox(width: number, height: number, rotation?: number, tx?: number, ty?: number): void;\n        /**\n         * @private\n         */\n        $transformBounds(bounds: Rectangle): void;\n        /**\n         * @private\n         */\n        private getDeterminant();\n        /**\n         * @private\n         */\n        $getScaleX(): number;\n        /**\n         * @private\n         */\n        $getScaleY(): number;\n        /**\n         * @private\n         */\n        $getSkewX(): number;\n        /**\n         * @private\n         */\n        $getSkewY(): number;\n        /**\n         * @private\n         */\n        $updateScaleAndRotation(scaleX: number, scaleY: number, skewX: number, skewY: number): void;\n        /**\n         * @private\n         * target = other * this\n         */\n        $preMultiplyInto(other: Matrix, target: Matrix): void;\n    }\n    /**\n     * @private\n     * 仅供框架内复用，要防止暴露引用到外部。\n     */\n    let $TempMatrix: Matrix;\n}\ndeclare namespace egret {\n    /**\n     * A Rectangle object is an area defined by its position, as indicated by its top-left corner point (x, y) and by its\n     * width and its height.<br/>\n     * The x, y, width, and height properties of the Rectangle class are independent of each other; changing the value of\n     * one property has no effect on the others. However, the right and bottom properties are integrally related to those\n     * four properties. For example, if you change the value of the right property, the value of the width property changes;\n     * if you change the bottom property, the value of the height property changes.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Rectangle.ts\n     * @language en_US\n     */\n    /**\n     * Rectangle 对象是按其位置（由它左上角的点 (x, y) 确定）以及宽度和高度定义的区域。<br/>\n     * Rectangle 类的 x、y、width 和 height 属性相互独立；更改一个属性的值不会影响其他属性。\n     * 但是，right 和 bottom 属性与这四个属性是整体相关的。例如，如果更改 right 属性的值，则 width\n     * 属性的值将发生变化；如果更改 bottom 属性，则 height 属性的值将发生变化。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/geom/Rectangle.ts\n     * @language zh_CN\n     */\n    class Rectangle extends HashObject {\n        /**\n         * Releases a rectangle instance to the object pool.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 释放一个Rectangle实例到对象池\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static release(rect: Rectangle): void;\n        /**\n         * get a rectangle instance from the object pool or create a new one.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从对象池中取出或创建一个新的Rectangle对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static create(): Rectangle;\n        /**\n         * Creates a new Rectangle object with the top-left corner specified by the x and y parameters and with the specified\n         * width and height parameters.\n         * @param x The x coordinate of the top-left corner of the rectangle.\n         * @param y The y coordinate of the top-left corner of the rectangle.\n         * @param width The width of the rectangle, in pixels.\n         * @param height The height of the rectangle, in pixels.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个新 Rectangle 对象，其左上角由 x 和 y 参数指定，并具有指定的 width 和 height 参数。\n         * @param x 矩形左上角的 x 坐标。\n         * @param y 矩形左上角的 y 坐标。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(x?: number, y?: number, width?: number, height?: number);\n        /**\n         * The x coordinate of the top-left corner of the rectangle.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 矩形左上角的 x 坐标。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        x: number;\n        /**\n         * The y coordinate of the top-left corner of the rectangle.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 矩形左上角的 y 坐标。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        y: number;\n        /**\n         * The width of the rectangle, in pixels.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 矩形的宽度（以像素为单位）。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        width: number;\n        /**\n         * 矩形的高度（以像素为单位）。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * The height of the rectangle, in pixels.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        height: number;\n        /**\n         * The sum of the x and width properties.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * x 和 width 属性的和。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        right: number;\n        /**\n         * The sum of the y and height properties.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * y 和 height 属性的和。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        bottom: number;\n        /**\n         * The x coordinate of the top-left corner of the rectangle. Changing the left property of a Rectangle object has\n         * no effect on the y and height properties. However it does affect the width property, whereas changing the x value\n         * does not affect the width property.\n         * The value of the left property is equal to the value of the x property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 矩形左上角的 x 坐标。更改 Rectangle 对象的 left 属性对 y 和 height 属性没有影响。但是，它会影响 width 属性，而更改 x 值不会影响 width 属性。\n         * left 属性的值等于 x 属性的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        left: number;\n        /**\n         * The y coordinate of the top-left corner of the rectangle. Changing the top property of a Rectangle object has\n         * no effect on the x and width properties. However it does affect the height property, whereas changing the y\n         * value does not affect the height property.<br/>\n         * The value of the top property is equal to the value of the y property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 矩形左上角的 y 坐标。更改 Rectangle 对象的 top 属性对 x 和 width 属性没有影响。但是，它会影响 height 属性，而更改 y 值不会影响 height 属性。<br/>\n         * top 属性的值等于 y 属性的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        top: number;\n        /**\n         * The location of the Rectangle object's top-left corner, determined by the x and y coordinates of the point.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 由该点的 x 和 y 坐标确定的 Rectangle 对象左上角的位置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        topLeft: Point;\n        /**\n         * The location of the Rectangle object's bottom-right corner, determined by the values of the right and bottom properties.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 由 right 和 bottom 属性的值确定的 Rectangle 对象的右下角的位置。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        bottomRight: Point;\n        /**\n         * Copies all of rectangle data from the source Rectangle object into the calling Rectangle object.\n         * @param sourceRect The Rectangle object from which to copy the data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将源 Rectangle 对象中的所有矩形数据复制到调用方 Rectangle 对象中。\n         * @param sourceRect 要从中复制数据的 Rectangle 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        copyFrom(sourceRect: Rectangle): Rectangle;\n        /**\n         * Sets the members of Rectangle to the specified values\n         * @param x The x coordinate of the top-left corner of the rectangle.\n         * @param y The y coordinate of the top-left corner of the rectangle.\n         * @param width The width of the rectangle, in pixels.\n         * @param height The height of the rectangle, in pixels.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Rectangle 的成员设置为指定值\n         * @param x 矩形左上角的 x 坐标。\n         * @param y 矩形左上角的 y 坐标。\n         * @param width 矩形的宽度（以像素为单位）。\n         * @param height 矩形的高度（以像素为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setTo(x: number, y: number, width: number, height: number): Rectangle;\n        /**\n         * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object.\n         * @param x The x coordinate (horizontal position) of the point.\n         * @param y The y coordinate (vertical position) of the point.\n         * @returns A value of true if the Rectangle object contains the specified point; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定由此 Rectangle 对象定义的矩形区域内是否包含指定的点。\n         * @param x 检测点的x轴\n         * @param y 检测点的y轴\n         * @returns 如果检测点位于矩形内，返回true，否则，返回false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        contains(x: number, y: number): boolean;\n        /**\n         * If the Rectangle object specified in the toIntersect parameter intersects with this Rectangle object, returns\n         * the area of intersection as a Rectangle object. If the rectangles do not intersect, this method returns an empty\n         * Rectangle object with its properties set to 0.\n         * @param toIntersect The Rectangle object to compare against to see if it intersects with this Rectangle object.\n         * @returns A Rectangle object that equals the area of intersection. If the rectangles do not intersect, this method\n         * returns an empty Rectangle object; that is, a rectangle with its x, y, width, and height properties set to 0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果在 toIntersect 参数中指定的 Rectangle 对象与此 Rectangle 对象相交，则返回交集区域作为 Rectangle 对象。如果矩形不相交，\n         * 则此方法返回一个空的 Rectangle 对象，其属性设置为 0。\n         * @param toIntersect 要对照比较以查看其是否与此 Rectangle 对象相交的 Rectangle 对象。\n         * @returns 等于交集区域的 Rectangle 对象。如果该矩形不相交，则此方法返回一个空的 Rectangle 对象；即，其 x、y、width 和\n         * height 属性均设置为 0 的矩形。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        intersection(toIntersect: Rectangle): Rectangle;\n        /**\n         * Increases the size of the Rectangle object by the specified amounts, in pixels.\n         * The center point of the Rectangle object stays the same, and its size increases to the left and right by the dx value, and to the top and the bottom by the dy value.\n         * @param dx The value to be added to the left and the right of the Rectangle object.\n         * @param dy The value to be added to the top and the bottom of the Rectangle.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 按指定量增加 Rectangle 对象的大小（以像素为单位）\n         * 保持 Rectangle 对象的中心点不变，使用 dx 值横向增加它的大小，使用 dy 值纵向增加它的大小。\n         * @param dx Rectangle 对象横向增加的值。\n         * @param dy Rectangle 对象纵向增加的值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        inflate(dx: number, dy: number): void;\n        /**\n         * @private\n         */\n        $intersectInPlace(clipRect: Rectangle): Rectangle;\n        /**\n         * Determines whether the object specified in the toIntersect parameter intersects with this Rectangle object.\n         * This method checks the x, y, width, and height properties of the specified Rectangle object to see if it\n         * intersects with this Rectangle object.\n         * @param toIntersect The Rectangle object to compare against this Rectangle object.\n         * @returns A value of true if the specified object intersects with this Rectangle object; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定在 toIntersect 参数中指定的对象是否与此 Rectangle 对象相交。此方法检查指定的 Rectangle\n         * 对象的 x、y、width 和 height 属性，以查看它是否与此 Rectangle 对象相交。\n         * @param toIntersect 要与此 Rectangle 对象比较的 Rectangle 对象。\n         * @returns 如果两个矩形相交，返回true，否则返回false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        intersects(toIntersect: Rectangle): boolean;\n        /**\n         * Determines whether or not this Rectangle object is empty.\n         * @returns A value of true if the Rectangle object's width or height is less than or equal to 0; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定此 Rectangle 对象是否为空。\n         * @returns 如果 Rectangle 对象的宽度或高度小于等于 0，则返回 true 值，否则返回 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        isEmpty(): boolean;\n        /**\n         * Sets all of the Rectangle object's properties to 0. A Rectangle object is empty if its width or height is less than or equal to 0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Rectangle 对象的所有属性设置为 0。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setEmpty(): void;\n        /**\n         * Returns a new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object.\n         * @returns A new Rectangle object with the same values for the x, y, width, and height properties as the original Rectangle object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回一个新的 Rectangle 对象，其 x、y、width 和 height 属性的值与原始 Rectangle 对象的对应值相同。\n         * @returns 新的 Rectangle 对象，其 x、y、width 和 height 属性的值与原始 Rectangle 对象的对应值相同。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        clone(): Rectangle;\n        /**\n         * Determines whether the specified point is contained within the rectangular region defined by this Rectangle object.\n         * This method is similar to the Rectangle.contains() method, except that it takes a Point object as a parameter.\n         * @param point The point, as represented by its x and y coordinates.\n         * @returns A value of true if the Rectangle object contains the specified point; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定由此 Rectangle 对象定义的矩形区域内是否包含指定的点。\n         * 此方法与 Rectangle.contains() 方法类似，只不过它采用 Point 对象作为参数。\n         * @param point 包含点对象\n         * @returns 如果包含，返回true，否则返回false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        containsPoint(point: Point): boolean;\n        /**\n         * Determines whether the Rectangle object specified by the rect parameter is contained within this Rectangle object.\n         * A Rectangle object is said to contain another if the second Rectangle object falls entirely within the boundaries of the first.\n         * @param rect The Rectangle object being checked.\n         * @returns A value of true if the Rectangle object that you specify is contained by this Rectangle object; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定此 Rectangle 对象内是否包含由 rect 参数指定的 Rectangle 对象。\n         * 如果一个 Rectangle 对象完全在另一个 Rectangle 的边界内，我们说第二个 Rectangle 包含第一个 Rectangle。\n         * @param rect 所检查的 Rectangle 对象\n         * @returns 如果此 Rectangle 对象包含您指定的 Rectangle 对象，则返回 true 值，否则返回 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        containsRect(rect: egret.Rectangle): boolean;\n        /**\n         * Determines whether the object specified in the toCompare parameter is equal to this Rectangle object.\n         * This method compares the x, y, width, and height properties of an object against the same properties of this Rectangle object.\n         * @param The rectangle to compare to this Rectangle object.\n         * @returns A value of true if the object has exactly the same values for the x, y, width, and height properties as this Rectangle object; otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 确定在 toCompare 参数中指定的对象是否等于此 Rectangle 对象。\n         * 此方法将某个对象的 x、y、width 和 height 属性与此 Rectangle 对象所对应的相同属性进行比较。\n         * @param toCompare 要与此 Rectangle 对象进行比较的矩形。\n         * @returns 如果对象具有与此 Rectangle 对象完全相同的 x、y、width 和 height 属性值，则返回 true 值，否则返回 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        equals(toCompare: Rectangle): boolean;\n        /**\n         * Increases the size of the Rectangle object. This method is similar to the Rectangle.inflate() method except it takes a Point object as a parameter.\n         * @param point 此 Point 对象的 x 属性用于增加 Rectangle 对象的水平尺寸。y 属性用于增加 Rectangle 对象的垂直尺寸。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 增加 Rectangle 对象的大小。此方法与 Rectangle.inflate() 方法类似，只不过它采用 Point 对象作为参数。\n         * @param point The x property of this Point object is used to increase the horizontal dimension of the Rectangle object. The y property is used to increase the vertical dimension of the Rectangle object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        inflatePoint(point: Point): void;\n        /**\n         * Adjusts the location of the Rectangle object, as determined by its top-left corner, by the specified amounts.\n         * @param dx Moves the x value of the Rectangle object by this amount.\n         * @param dy Moves the y value of the Rectangle object by this amount.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 按指定量调整 Rectangle 对象的位置（由其左上角确定）。\n         * @param dx 将 Rectangle 对象的 x 值移动此数量。\n         * @param dy 将 Rectangle 对象的 t 值移动此数量。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        offset(dx: number, dy: number): void;\n        /**\n         * Adjusts the location of the Rectangle object using a Point object as a parameter. This method is similar to the Rectangle.offset() method, except that it takes a Point object as a parameter.\n         * @param point A Point object to use to offset this Rectangle object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 Point 对象用作参数来调整 Rectangle 对象的位置。此方法与 Rectangle.offset() 方法类似，只不过它采用 Point 对象作为参数。\n         * @param point 要用于偏移此 Rectangle 对象的 Point 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        offsetPoint(point: Point): void;\n        /**\n         * Builds and returns a string that lists the horizontal and vertical positions and the width and height of the Rectangle object.\n         * @returns A string listing the value of each of the following properties of the Rectangle object: x, y, width, and height.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 生成并返回一个字符串，该字符串列出 Rectangle 对象的水平位置和垂直位置以及高度和宽度。\n         * @returns 一个字符串，它列出了 Rectangle 对象的下列各个属性的值：x、y、width 和 height。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        toString(): string;\n        /**\n         * Adds two rectangles together to create a new Rectangle object, by filling in the horizontal and vertical space between the two rectangles.\n         * @param toUnion A Rectangle object to add to this Rectangle object.\n         * @returns A new Rectangle object that is the union of the two rectangles.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 通过填充两个矩形之间的水平和垂直空间，将这两个矩形组合在一起以创建一个新的 Rectangle 对象。\n         * @param toUnion 要添加到此 Rectangle 对象的 Rectangle 对象。\n         * @returns 充当两个矩形的联合的新 Rectangle 对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        union(toUnion: Rectangle): Rectangle;\n        /**\n         * @private\n         */\n        $getBaseWidth(angle: number): number;\n        /**\n         * @private\n         */\n        $getBaseHeight(angle: number): number;\n    }\n    /**\n     * @private\n     * 仅供框架内复用，要防止暴露引用到外部。\n     */\n    let $TempRectangle: Rectangle;\n}\ndeclare namespace egret {\n}\ndeclare namespace egret {\n    /**\n     * The JointStyle class is an enumeration of constant values that specify the joint style to use in drawing lines.\n     * These constants are provided for use as values in the joints parameter of the egret.Graphics.lineStyle() method.\n     * @see egret.Graphics#lineStyle()\n     * @version Egret 2.5\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * JointStyle 类是指定要在绘制线条中使用的联接点样式的常量值枚举。提供的这些常量用作 egret.Graphics.lineStyle() 方法的 joints 参数中的值。\n     * @see egret.Graphics#lineStyle()\n     * @version Egret 2.5\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    const JointStyle: {\n        BEVEL: string;\n        MITER: string;\n        ROUND: string;\n    };\n}\ndeclare namespace egret {\n}\n/**\n * @version Egret 2.4\n * @platform Web,Native\n * @includeExample egret/localStorage/localStorage.ts\n */\ndeclare namespace egret.localStorage {\n    /**\n     * Read data\n     * @param key {string} Name of the key to be read\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 读取数据\n     * @param key {string} 要读取的键名称\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let getItem: (key: string) => string;\n    /**\n     * Save data\n     * @param key {string} Name of the key to be saved\n     * @param value {string} Value to be saved\n     * @returns {boolean} Whether data is saved successfully\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 保存数据\n     * @param key {string} 要保存的键名称\n     * @param value {string} 要保存的值\n     * @returns {boolean} 数据保存是否成功\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let setItem: (key: string, value: string) => boolean;\n    /**\n     * Delete data\n     * @param key {string} Name of the key to be deleted\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 删除数据\n     * @param key {string} 要删除的键名称\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let removeItem: (key: string) => void;\n    /**\n     * Clear all data\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 将所有数据清空\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let clear: () => void;\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * @param channel\n     */\n    function $pushSoundChannel(channel: SoundChannel): void;\n    /**\n     * @private\n     * @param channel\n     */\n    function $popSoundChannel(channel: SoundChannel): boolean;\n}\ndeclare namespace egret {\n    /**\n     * The Sound class lets you work with sound in an application.\n     * The Sound class lets you create a Sound object, load and play an external audio file into that object.\n     * More detailed control of the sound is performed through the SoundChannel\n     *\n     * @event egret.Event.COMPLETE Dispatch when the audio resource is loaded and ready to play\n     * @event egret.IOErrorEvent.IO_ERROR Dispatch when the audio resource is failed to load\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/media/Sound.ts\n     * @language en_US\n     */\n    /**\n     * Sound 允许您在应用程序中使用声音。使用 Sound 类可以创建 Sound 对象、将外部音频文件加载到该对象并播放该文件。\n     * 可通过 SoundChannel 对声音执行更精细的控制，如控制音量和监控播放进度。\n     * @see http://edn.egret.com/cn/docs/page/156 音频系统\n     *\n     * @event egret.Event.COMPLETE 音频加载完成时抛出\n     * @event egret.IOErrorEvent.IO_ERROR 音频加载失败时抛出\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/media/Sound.ts\n     * @language zh_CN\n     */\n    interface Sound extends EventDispatcher {\n        /**\n         * Initiates loading of an external audio file from the specified URL.\n         * @param url Audio file URL\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 启动从指定 URL 加载外部音频文件的过程。\n         * @param url 需要加载的音频文件URL\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        load(url: string): void;\n        /**\n         * Generates a new SoundChannel object to play back the sound.\n         * @param startTime The initial position in seconds at which playback should start, (default = 0)\n         * @param loops Plays, the default value is 0. Greater than 0 to the number of plays, such as 1 to play 1, less than or equal to 0, to loop.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 生成一个新的 SoundChannel 对象来播放该声音。此方法返回 SoundChannel 对象，访问该对象可停止声音调整音量。\n         * @param startTime 应开始播放的初始位置（以秒为单位），默认值是 0\n         * @param loops 播放次数，默认值是 0，循环播放。 大于 0 为播放次数，如 1 为播放 1 次；小于等于 0，为循环播放。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        play(startTime?: number, loops?: number): SoundChannel;\n        /**\n         * Closes the stream, causing any download of data to cease\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 关闭该流，从而停止所有数据的下载。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        close(): void;\n        /**\n         * Type, default is egret.Sound.EFFECT.\n         * In the native and runtime environment, while only play a background music, sound length so as not to be too long.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 类型，默认为 egret.Sound.EFFECT。\n         * 在 native 和 runtime 环境下，背景音乐同时只能播放一个，音效长度尽量不要太长。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        type: string;\n        /**\n         * Length of the current sound (in seconds).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language en_US\n         */\n        /**\n         * 当前声音的长度（以秒为单位）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language zh_CN\n         */\n        length: number;\n    }\n    /**\n     * @copy egret.Sound\n     */\n    let Sound: {\n        /**\n         * Create Sound object, load an external audio file and play\n         * @param url Audio file URL, Sound will start to load the media if url is not empty\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建 Sound 对象、将外部音频文件加载到该对象并播放该文件\n         * @param url 需要加载的音频文件URL,如果指定了 url, Sound会立即开始加载指定的媒体文件\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        new (): Sound;\n        /**\n         * Background music\n         * @default \"music\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 背景音乐\n         * @default \"music\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        MUSIC: string;\n        /**\n         * EFFECT\n         * @default \"effect\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 音效\n         * @default \"effect\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        EFFECT: string;\n    };\n}\ndeclare namespace egret {\n    /**\n     * The SoundChannel class controls a sound in an application.\n     * Every sound is assigned to a sound channel, and the application\n     * can have multiple sound channels that are mixed together.\n     * The SoundChannel class contains a stop() method, properties for\n     * set the volume of the channel\n     *\n     * @event egret.Event.SOUND_COMPLETE Dispatch when a sound has finished playing at last time\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/media/Sound.ts\n     * @language en_US\n     */\n    /**\n     * SoundChannel 类控制应用程序中的声音。每个声音均分配给一个声道，而且应用程序可以具有混合在一起的多个声道。\n     * SoundChannel 类包含 stop() 方法、用于设置音量和监视播放进度的属性。\n     *\n     * @event egret.Event.SOUND_COMPLETE 音频最后一次播放完成时抛出\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/media/Sound.ts\n    * @language zh_CN\n    */\n    interface SoundChannel extends IEventDispatcher {\n        /**\n         * The volume, ranging from 0 (silent) to 1 (full volume).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 音量范围从 0（静音）至 1（最大音量）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        volume: number;\n        /**\n         *  When the sound is playing, the position property indicates\n         * in seconds the current point that is being played in the sound file.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language en_US\n         */\n        /**\n         * 当播放声音时，position 属性表示声音文件中当前播放的位置（以秒为单位）\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language zh_CN\n         */\n        position: number;\n        /**\n         * Stops the sound playing in the channel.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 停止在该声道中播放声音。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        stop(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The Video class lets you work with video in an application.\n     * The Video class lets you create a Video object, load and play an external video file into that object.\n     * Note: On most mobile device, the video is playback in the full screen mode.<br/>\n     *\n     * @param url URL of the media to play, Video will start to load if the url is not empty\n     *\n     * @event egret.Event.COMPLETE Dispatch when the video resource is loaded and ready to play\n     * @event egret.Event.ENDED Dispatch when the video playback ended\n     * @event egret.IOErrorEvent.IO_ERROR when the video is failed to load\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/media/Video.ts\n     * @language en_US\n     */\n    /**\n     * Video 允许您在应用程序中使用视频。使用 Video 类可以创建 Video 对象、将外部视频文件加载到该对象并播放该文件。<br/>\n     * 注意: 在大多数移动设备中，视频是强制全屏播放的，所以你可以直接调用 play() 方法全屏播放视频，不用将它绘制在Stage中。\n     * @see http://edn.egret.com/cn/docs/page/657 视频系统\n     *\n     * @param url 要播放的视频的URL，如果url不为空，Video会立即加载这个视频\n     *\n     * @event egret.Event.COMPLETE 视频加载完成时抛出\n     * @event egret.Event.ENDED 视频播放完成时抛出\n     * @event egret.IOErrorEvent.IO_ERROR 视频加载失败时触发\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/media/Video.ts\n     * @language zh_CN\n     */\n    interface Video extends DisplayObject {\n        /**\n         * Initiates loading of an external video file from the specified URL.\n         * @param url Audio file URL\n         * * @param cache Should cache the video，only  used in Native\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 启动从指定 URL 加载外部视频文件的过程。\n         * @param url 需要加载的视频文件URL\n         * @param cache 是否需要缓存到本地，只在 Native 上使用\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        load(url: string, cache?: boolean): void;\n        /**\n         * Play back the video.\n         * @param startTime The initial position in seconds at which playback should start, (default = 0)\n         * @param loop Defines should play the video again when the video is ended. (default = false)\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 播放该视频\n         * @param startTime 应开始播放的初始位置（以秒为单位），默认值是视频上次结束的位置\n         * @param loop 是否需要循环播放，默认值是 false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        play(startTime?: number, loop?: boolean): any;\n        /**\n         * Closes the stream, causing any download of data to cease\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 关闭该流，从而停止所有数据的下载。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        close(): void;\n        /**\n         * The URL of the video you want to play.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 想要播放的视频的URL\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        src: string;\n        /**\n         * The URL of an image you want to display before the video is loaded or video cannot been draw on the canvas on some mobile device.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 视频加载前，或者在不支持将 video 画在 canvas 的设备上，想要显示的视频截图地址。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        poster: string;\n        /**\n         * Should play the video in fullscreen mode (default = true).\n         * Currently only supports full-screen mobile terminal web.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否全屏播放这个视频（默认值是 true）。\n         * 目前移动端 web 只支持全屏。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        fullscreen: boolean;\n        /**\n         * The volume, ranging from 0 (silent) to 1 (full volume).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 音量范围从 0（静音）至 1（最大音量）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        volume: number;\n        /**\n         * When the video is playing, the position property indicates\n         * in seconds the current point that is being played in the video file.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当播放视频时，position 属性表示视频文件中当前播放的位置（以秒为单位）\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        position: number;\n        /**\n         * Pause the video playing.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 暂停播放。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        pause(): void;\n        /**\n         * Get bitmapData of the video file, you can use the video as bitmapData on the stage.\n         * Note: On most mobile device, the video is playback in the full screen mode.\n         * So you can just use the play() method instead of draw it on the Stage\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         *  获取视频的 bitmapData, 你可以将视频绘制到舞台上。\n         * 注意： 在大多数移动设备中，视频是全屏播放的，所以你可以直接调用 play() 方法全屏播放视频，不用将它绘制在Stage中。\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        bitmapData?: BitmapData;\n        /**\n         * Whether current video is paused.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language en_US\n         */\n        /**\n         * 当前视频是否在暂停状态。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @readOnly\n         * @language zh_CN\n         */\n        paused: boolean;\n        /**\n         * Length of the current video (in seconds).\n         * @version Egret 3.0.8\n         * @platform Web,Native\n         * @readOnly\n         * @language en_US\n         */\n        /**\n         * 当前视频的长度（以秒为单位）。\n         * @version Egret 3.0.8\n         * @platform Web,Native\n         * @readOnly\n         * @language zh_CN\n         */\n        length: number;\n    }\n    /**\n     * @copy egret.Video\n     */\n    let Video: {\n        new (url?: string, cache?: boolean): Video;\n    };\n}\ndeclare namespace egret {\n    /**\n     * The HttpMethod class provides values that specify whether the HttpRequest object should use the POST method\n     * or the GET method when sending data to a server.\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * HttpRequestMethod 类提供了一些值，这些值可指定在将数据发送到服务器时，\n     * HttpRequest 对象应使用 POST 方法还是 GET 方法。\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    namespace HttpMethod {\n        /**\n         * Specifies that the HttpRequest object is a GET.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 HttpRequest 对象是一个 GET。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const GET = \"GET\";\n        /**\n         * Specifies that the HttpRequest object is a POST.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示 HttpRequest 对象是一个 POST。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const POST = \"POST\";\n    }\n}\ndeclare namespace egret {\n    /**\n     * The HttpRequest class downloads data from a URL as text or binary data. It is useful for downloading text files,\n     * XML, or other information to be used in a dynamic, data-driven application. A HttpRequest object downloads all\n     * of the data from a URL before making it available to code in the applications. It sends out notifications about\n     * the progress of the download, which you can monitor through the bytesLoaded and bytesTotal properties,\n     * as well as through dispatched events.\n     * @event egret.Event.COMPLETE Dispatched when the net request is complete.\n     * @event egret.Event.IO_ERROR Dispatched when the net request is failed.\n     * @event egret.ProgressEvent.PROGRESS Dispatched when data is received as the download operation progresses.\n     * @see egret.HttpMethod\n     * @see egret.HttpResponseType\n     * @includeExample egret/net/HttpRequestExample.ts\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * HttpRequest 类以文本或二进制数据的形式从 URL 下载数据。\n     * HttpRequest 对象会先从 URL 中下载所有数据，然后才将数据用于应用程序中的代码。它会发出有关下载进度的通知，\n     * 通过 bytesLoaded 和 bytesTotal 属性以及已调度的事件，可以监视下载进度。\n     * @event egret.Event.COMPLETE 加载完成\n     * @event egret.Event.IO_ERROR 加载失败\n     * @event egret.ProgressEvent.PROGRESS 加载进度，可通过event.bytesLoaded和event.bytesTotal统计进度信息。\n     * @see egret.HttpMethod\n     * @see egret.HttpResponseType\n     * @includeExample egret/net/HttpRequestExample.ts\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface HttpRequest extends EventDispatcher {\n        /**\n         * The data received from the load operation.  The format of the data depends on the setting of the responseType property.\n         * @readOnly\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 本次请求返回的数据，数据类型根据 responseType 设置的值确定。\n         * @readOnly\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        response: any;\n        /**\n         * Controls whether the downloaded data is received as text (HttpResponseType.TEXT) or raw binary data (HttpResponseType.ArrayBuffer)<br/>\n         * Note:If you attempt to set this property to an invalid value, Egret runtime set the value to HttpResponseType.TEXT.\n         * @default egret.HttpResponseType.TEXT\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置返回的数据格式为文本（HttpResponseType.TEXT）还是二进制数据（HttpResponseType.ArrayBuffer）<br/>\n         * 注意：若尝试设置此属性为一个非法的值，运行时将使用HttpResponseType.TEXT。\n         * @default egret.HttpResponseType.TEXT\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        responseType: string;\n        /**\n         * Can be set to a time in milliseconds.When set to a non-zero value will cause fetching to terminate after the given time has passed.\n         * @default egret.HttpResponseType.TEXT\n         * @version Egret 5.2.15\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 代表着一个请求在被自动终止前所消耗的毫秒数。默认值为 0，意味着没有超时。\n         * @default egret.HttpResponseType.TEXT\n         * @version Egret 5.2.15\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        timeout: number;\n        /**\n         * indicates whether or not cross-site Access-Control requests should be made using credentials such as cookies\n         * or authorization headers. (This never affects same-site requests.)\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表明在进行跨站(cross-site)的访问控制(Access-Control)请求时，是否使用认证信息(例如cookie或授权的header)。(这个标志不会影响同站的请求)\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        withCredentials: boolean;\n        /**\n         * Initializes a request.<br/>\n         * Note: Calling this method for an already active request (one for which open() or openRequest() has already been\n         * called) is the equivalent of calling abort().\n         * @param url The URL to send the request to.\n         * @param method The HTTP method to use, please use the const value in the HttpMethod class.\n         * @see egret.HttpMethod\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 初始化一个请求.<br/>\n         * 注意: 若在已经发出请求的对象上调用此方法，相当于立即调用abort().\n         * @param url 该请求所要访问的URL该请求所要访问的URL\n         * @param method 请求所使用的HTTP方法， 请使用 HttpMethod 定义的枚举值.\n         * @see egret.HttpMethod\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        open(url: string, method?: string): void;\n        /**\n         * Sends the request.\n         * @param data the data to send.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 发送请求.\n         * @param data 需要发送的数据\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        send(data?: any): void;\n        /**\n         * Aborts the request if it has already been sent.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果请求已经被发送,则立刻中止请求.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        abort(): void;\n        /**\n         * Returns all the response headers as a string, or null if no response has been received.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回所有响应头信息(响应头名和值), 如果响应头还没接受,则返回\"\".\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getAllResponseHeaders(): string;\n        /**\n         * Sets the value of an HTTP request header. You must call setRequestHeader() after open().\n         * @param header The name of the header whose value is to be set.\n         * @param value The value to set as the body of the header.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 给指定的HTTP请求头赋值.在这之前,您必须确认已经调用 open() 方法打开了一个url.\n         * @param header 将要被赋值的请求头名称.\n         * @param value 给指定的请求头赋的值.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setRequestHeader(header: string, value: string): void;\n        /**\n         * Returns the string containing the text of the specified header, or null if either the response has not yet been\n         * received or the header doesn't exist in the response.\n         * @param header The name of the header whose value is to be get.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回指定的响应头的值, 如果响应头还没被接受,或该响应头不存在,则返回\"\".\n         * @param header 要返回的响应头名称\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getResponseHeader(header: string): string;\n    }\n    /**\n     * Creates a HttpRequest object.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 创建一个 HttpRequest 实例。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let HttpRequest: {\n        new (): HttpRequest;\n    };\n}\ndeclare namespace egret {\n    /**\n     * The HttpResponseType class provides values that specify how downloaded data is received.\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * URLLoaderDataFormat 类提供了一些用于指定如何接收已下载数据的值。\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class HttpResponseType {\n        /**\n         * Specifies that downloaded data is received as text. This is the default value of HttpRequest.responseType\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回字符串。HttpRequest.responseType属性的默认值。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TEXT: string;\n        /**\n         * Specifies that downloaded data is received as raw binary data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 返回二进制的ArrayBuffer对象。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ARRAY_BUFFER: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The Loader class is used to load image (JPG, PNG, or GIF) files. Use the load() method to initiate loading.\n     * The loaded image data is in the data property of ImageLoader.\n     * @event egret.Event.COMPLETE Dispatched when the net request is complete.\n     * @event egret.IOErrorEvent.IO_ERROR Dispatched when the net request is failed.\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/net/ImageLoaderExample.ts\n     * @see http://edn.egret.com/cn/docs/page/590 加载位图文件\n     * @language en_US\n     */\n    /**\n     * ImageLoader 类可用于加载图像（JPG、PNG 或 GIF）文件。使用 load() 方法来启动加载。被加载的图像对象数据将存储在 ImageLoader.data 属性上 。\n     * @event egret.Event.COMPLETE 加载完成\n     * @event egret.IOErrorEvent.IO_ERROR 加载失败\n     * @see egret.HttpRequest\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/net/ImageLoaderExample.ts\n     * @see http://edn.egret.com/cn/docs/page/590 加载位图文件\n     * @language zh_CN\n     */\n    interface ImageLoader extends EventDispatcher {\n        /**\n         * The data received from the load operation.\n         * @default null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用 load() 方法加载成功的 BitmapData 图像数据。\n         * @default null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        data: BitmapData;\n        /**\n         * Specifies whether or not cross-site Access-Control requests should be made when loading a image from foreign origins.<br/>\n         * possible values are:\"anonymous\",\"use-credentials\" or null.\n         * @default null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当从其他站点加载一个图片时，指定是否启用跨域资源共享(CORS)，默认值为null。<br/>\n         * 可以设置为\"anonymous\",\"use-credentials\"或null,设置为其他值将等同于\"anonymous\"。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        crossOrigin: string;\n        /**\n         * start a load operation。<br/>\n         * Note: Calling this method for an already active request (one for which load() has already been\n         * called) will abort the last load operation immediately.\n         * @param url 要加载的图像文件的地址。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 启动一次图像加载。<br/>\n         * 注意：若之前已经调用过加载请求，重新调用 load() 将终止先前的请求，并开始新的加载。\n         * @param url 要加载的图像文件的地址。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        load(url: string): void;\n    }\n    /**\n     * Creates a ImageLoader object\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 创建一个 ImageLoader 实例\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let ImageLoader: {\n        /**\n         * constructor\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 构造函数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        new (): ImageLoader;\n        /**\n         * Specifies whether to enable cross-origin resource sharing, If ImageLoader instance has been set crossOrigin property will be used to set the property.\n         * @version Egret 2.5.7\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指定是否启用跨域资源共享,如果ImageLoader实例有设置过crossOrigin属性将使用设置的属性\n         * @version Egret 2.5.7\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        crossOrigin: string;\n    };\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 显示列表\n     */\n    class DisplayList extends HashObject {\n        /**\n         * 创建一个DisplayList对象，若内存不足或无法创建RenderBuffer，将会返回null。\n         */\n        static create(target: DisplayObject): DisplayList;\n        /**\n         * @private\n         * 创建一个DisplayList对象\n         */\n        constructor(root: DisplayObject);\n        private isStage;\n        /**\n         * 位图渲染节点\n         */\n        $renderNode: RenderNode;\n        /**\n         * @private\n         * 获取渲染节点\n         */\n        $getRenderNode(): sys.RenderNode;\n        /**\n         * @private\n         */\n        renderBuffer: RenderBuffer;\n        /**\n         * @private\n         */\n        offsetX: number;\n        /**\n         * @private\n         */\n        offsetY: number;\n        /**\n         * @private\n         */\n        private offsetMatrix;\n        /**\n         * @private\n         * 显示列表根节点\n         */\n        root: DisplayObject;\n        /**\n         * @private\n         * 设置剪裁边界，不再绘制完整目标对象，画布尺寸由外部决定，超过边界的节点将跳过绘制。\n         */\n        setClipRect(width: number, height: number): void;\n        $canvasScaleX: number;\n        $canvasScaleY: number;\n        /**\n         * @private\n         * 绘制根节点显示对象到目标画布，返回draw的次数。\n         */\n        drawToSurface(): number;\n        private bitmapData;\n        /**\n         * @private\n         * 改变画布的尺寸，由于画布尺寸修改会清空原始画布。所以这里将原始画布绘制到一个新画布上，再与原始画布交换。\n         */\n        changeSurfaceSize(): void;\n        static $canvasScaleFactor: number;\n        /**\n         * @private\n         */\n        static $canvasScaleX: number;\n        static $canvasScaleY: number;\n        /**\n         * @private\n         */\n        static $setCanvasScale(x: number, y: number): void;\n    }\n}\ndeclare namespace egret {\n    type runEgretOptions = {\n        renderMode?: string;\n        audioType?: number;\n        screenAdapter?: sys.IScreenAdapter;\n        antialias?: boolean;\n        canvasScaleFactor?: number;\n        calculateCanvasScaleFactor?: (context: CanvasRenderingContext2D) => number;\n        /**\n         * 以下目前仅供小游戏使用\n         * The following are for mini-games only\n         */\n        entryClassName?: string;\n        scaleMode?: string;\n        frameRate?: number;\n        contentWidth?: number;\n        contentHeight?: number;\n        orientation?: string;\n        maxTouches?: number;\n        showFPS?: boolean;\n        showLog?: boolean;\n        fpsStyles?: string;\n    };\n    /**\n     * egret project entry function\n     * @param options An object containing the initialization properties for egret engine.\n     * @language en_US\n     */\n    /**\n     * egret工程入口函数\n     * @param options 一个可选对象，包含初始化Egret引擎需要的参数。\n     * @language zh_CN\n     */\n    function runEgret(options?: runEgretOptions): void;\n    /**\n     * Refresh the screen display\n     * @language en_US\n     */\n    /**\n     * 刷新屏幕显示\n     * @language zh_CN\n     */\n    function updateAllScreens(): void;\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    interface FPSDisplay {\n        /**\n         * 更新FPS信息\n         */\n        update(datas: FPSData): void;\n        /**\n         * 插入一条log信息\n         */\n        updateInfo(info: string): void;\n        /**\n         * 插入一条warn信息\n         */\n        updateWarn(info: string): void;\n        /**\n         * 插入一条error信息\n         */\n        updateError(info: string): void;\n    }\n    /**\n     * @private\n     */\n    let FPSDisplay: {\n        new (stage: Stage, showFPS: boolean, showLog: boolean, logFilter: string, styles: Object): FPSDisplay;\n    };\n}\n/**\n * @private\n */\ninterface FPSData extends Object {\n    fps: number;\n    draw: number;\n    costTicker: number;\n    costRender: number;\n}\ndeclare namespace egret.sys {\n    let $TempStage: egret.Stage;\n    /**\n     * @private\n     * Egret播放器\n     */\n    class Player extends HashObject {\n        /**\n         * @private\n         * 实例化一个播放器对象。\n         */\n        constructor(buffer: RenderBuffer, stage: Stage, entryClassName: string);\n        /**\n         * @private\n         */\n        private createDisplayList(stage, buffer);\n        /**\n         * @private\n         */\n        private screenDisplayList;\n        /**\n         * @private\n         * 入口类的完整类名\n         */\n        private entryClassName;\n        /**\n         * @private\n         * 舞台引用\n         */\n        stage: Stage;\n        /**\n         * @private\n         * 入口类实例\n         */\n        private root;\n        /**\n         * @private\n         */\n        private isPlaying;\n        /**\n         * @private\n         * 启动播放器\n         */\n        start(): void;\n        /**\n         * @private\n         */\n        private initialize();\n        /**\n         * @private\n         * 停止播放器，停止后将不能重新启动。\n         */\n        stop(): void;\n        /**\n         * @private\n         * 暂停播放器，后续可以通过调用start()重新启动播放器。\n         */\n        pause(): void;\n        /**\n         * @private\n         * 渲染屏幕\n         */\n        $render(triggerByFrame: boolean, costTicker: number): void;\n        /**\n         * @private\n         * 更新舞台尺寸\n         * @param stageWidth 舞台宽度（以像素为单位）\n         * @param stageHeight 舞台高度（以像素为单位）\n         */\n        updateStageSize(stageWidth: number, stageHeight: number): void;\n        /**\n         * @private\n         * 显示FPS。\n         */\n        displayFPS(showFPS: boolean, showLog: boolean, logFilter: string, styles: Object): void;\n        /**\n         * @private\n         */\n        private showFPS;\n        /**\n         * @private\n         */\n        private showLog;\n        /**\n         * @private\n         */\n        private stageDisplayList;\n    }\n    /**\n     * @private\n     */\n    let $logToFPS: (info: string) => void;\n    /**\n     * @private\n     */\n    let $warnToFPS: (info: string) => void;\n    /**\n     * @private\n     */\n    let $errorToFPS: (info: string) => void;\n}\n/**\n * @private\n */\ndeclare module egret {\n    /**\n     * @private\n     */\n    var nativeRender: boolean;\n}\ndeclare namespace egret {\n    /** !!!!!!!!inspired by Babylon.js!!!!!!!!!!!!!\n     * for description see https://www.khronos.org/opengles/sdk/tools/KTX/\n     * for file layout see https://www.khronos.org/opengles/sdk/tools/KTX/file_format_spec/\n     * Current families are astc, dxt, pvrtc, etc2, & etc1.\n     * @returns The extension selected.\n     */\n    class KTXContainer {\n        /** contents of the KTX container file */ arrayBuffer: any;\n        private static readonly HEADER_LEN;\n        private static readonly COMPRESSED_2D;\n        private static readonly COMPRESSED_3D;\n        private static readonly TEX_2D;\n        private static readonly TEX_3D;\n        /**\n         * Gets the openGL type\n         */\n        glType: number;\n        /**\n         * Gets the openGL type size\n         */\n        glTypeSize: number;\n        /**\n         * Gets the openGL format\n         */\n        glFormat: number;\n        /**\n         * Gets the openGL internal format\n         */\n        glInternalFormat: number;\n        /**\n         * Gets the base internal format\n         */\n        glBaseInternalFormat: number;\n        /**\n         * Gets image width in pixel\n         */\n        pixelWidth: number;\n        /**\n         * Gets image height in pixel\n         */\n        pixelHeight: number;\n        /**\n         * Gets image depth in pixels\n         */\n        pixelDepth: number;\n        /**\n         * Gets the number of array elements\n         */\n        numberOfArrayElements: number;\n        /**\n         * Gets the number of faces\n         */\n        numberOfFaces: number;\n        /**\n         * Gets the number of mipmap levels\n         */\n        numberOfMipmapLevels: number;\n        /**\n         * Gets the bytes of key value data\n         */\n        bytesOfKeyValueData: number;\n        /**\n         * Gets the load type\n         */\n        loadType: number;\n        /**\n         * If the container has been made invalid (eg. constructor failed to correctly load array buffer)\n         */\n        isInvalid: boolean;\n        /**\n         * Creates a new KhronosTextureContainer\n         * @param arrayBuffer contents of the KTX container file\n         * @param facesExpected should be either 1 or 6, based whether a cube texture or or\n         * @param threeDExpected provision for indicating that data should be a 3D texture, not implemented\n         * @param textureArrayExpected provision for indicating that data should be a texture array, not implemented\n         */\n        constructor(/** contents of the KTX container file */ arrayBuffer: any, facesExpected: number, threeDExpected?: boolean, textureArrayExpected?: boolean);\n        /**\n         * Uploads KTX content to a Babylon Texture.\n         * It is assumed that the texture has already been created & is currently bound\n         * @hidden\n         */\n        uploadLevels(bitmapData: egret.BitmapData, loadMipmaps: boolean): void;\n        private _upload2DCompressedLevels(bitmapData, loadMipmaps);\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 共享的用于碰撞检测的渲染缓冲\n     */\n    let customHitTestBuffer: sys.RenderBuffer;\n    /**\n     * @private\n     * 共享的用于canvas碰撞检测的渲染缓冲\n     */\n    let canvasHitTestBuffer: sys.RenderBuffer;\n    /**\n     * @private\n     * 渲染缓冲\n     */\n    interface RenderBuffer {\n        /**\n         * 呈现最终绘图结果的画布。\n         * @readOnly\n         */\n        surface: any;\n        /**\n         * 渲染上下文。\n         * @readOnly\n         */\n        context: any;\n        /**\n         * 渲染缓冲的宽度，以像素为单位。\n         * @readOnly\n         */\n        width: number;\n        /**\n         * 渲染缓冲的高度，以像素为单位。\n         * @readOnly\n         */\n        height: number;\n        /**\n         * 改变渲染缓冲的大小并清空缓冲区\n         * @param width 改变后的宽\n         * @param height 改变后的高\n         * @param useMaxSize 若传入true，则将改变后的尺寸与已有尺寸对比，保留较大的尺寸。\n         */\n        resize(width: number, height: number, useMaxSize?: boolean): void;\n        /**\n         * 获取指定区域的像素\n         */\n        getPixels(x: number, y: number, width?: number, height?: number): number[];\n        /**\n         * 转换成base64字符串，如果图片（或者包含的图片）跨域，则返回null\n         * @param type 转换的类型，如: \"image/png\",\"image/jpeg\"\n         */\n        toDataURL(type?: string, ...args: any[]): string;\n        /**\n         * 清空缓冲区数据\n         */\n        clear(): void;\n        /**\n         * 销毁渲染缓冲\n         */\n        destroy(): void;\n    }\n    /**\n     * @private\n     */\n    let RenderBuffer: {\n        /**\n         * 创建一个RenderTarget。\n         * 注意：若内存不足或创建缓冲区失败，将会抛出错误异常。\n         * @param width 渲染缓冲的初始宽\n         * @param height 渲染缓冲的初始高\n         * @param root 是否为舞台buffer\n         */\n        new (width?: number, height?: number, root?: boolean): RenderBuffer;\n    };\n    /**\n     * @private\n     */\n    let CanvasRenderBuffer: {\n        /**\n         * 创建一个CanvasRenderBuffer。\n         * 注意：若内存不足或创建缓冲区失败，将会抛出错误异常。\n         * @param width 渲染缓冲的初始宽\n         * @param height 渲染缓冲的初始高\n         */\n        new (width?: number, height?: number): RenderBuffer;\n    };\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 设备屏幕\n     */\n    interface Screen {\n        /**\n         * @private\n         * 更新屏幕视口尺寸\n         */\n        updateScreenSize(): any;\n        /**\n         * @private\n         * 更新触摸数量\n         */\n        updateMaxTouches(): any;\n        /**\n         * @private\n         * 设置分辨率尺寸\n         */\n        setContentSize(width: number, height: number): any;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 屏幕适配器接口，当播放器视口尺寸改变时，屏幕适配器将被用于计算当前对应的舞台显示尺寸。\n     */\n    interface IScreenAdapter {\n        /**\n         * @private\n         * 计算舞台显示尺寸\n         * @param scaleMode 当前的缩放模式\n         * @param screenWidth 播放器视口宽度\n         * @param screenHeight 播放器视口高度\n         * @param contentWidth 初始化内容宽度\n         * @param contentHeight 初始化内容高度\n         */\n        calculateStageSize(scaleMode: string, screenWidth: number, screenHeight: number, contentWidth: number, contentHeight: number): StageDisplaySize;\n    }\n    /**\n     * @private\n     * 舞台显示尺寸数据\n     */\n    interface StageDisplaySize {\n        /**\n         * @private\n         * 舞台宽度\n         */\n        stageWidth: number;\n        /**\n         * @private\n         * 舞台高度\n         */\n        stageHeight: number;\n        /**\n         * @private\n         * 显示宽度，若跟舞台宽度不同，将会产生缩放。\n         */\n        displayWidth: number;\n        /**\n         * @private\n         * 显示高度，若跟舞台高度不同，将会产生缩放。\n         */\n        displayHeight: number;\n    }\n    /**\n     * @private\n     * 屏幕适配器实例，开发者可以通过给这个变量赋值实现了IScreenAdapter接口的实例，从而注入自定义的屏幕适配器。\n     */\n    let screenAdapter: IScreenAdapter;\n    /**\n     * @private\n     * 屏幕适配器默认实现，开发者可以实现自定义规则的屏幕适配器。并在初始化加载时将适配器的实例赋值给egret.sys.screenAdapter上，从而替换掉默认适配器。\n     */\n    class DefaultScreenAdapter extends HashObject implements IScreenAdapter {\n        /**\n         * @private\n         */\n        constructor();\n        /**\n         * @private\n         * 计算舞台显示尺寸\n         * @param scaleMode 当前的缩放模式\n         * @param screenWidth 播放器视口宽度\n         * @param screenHeight 播放器视口高度\n         * @param contentWidth 初始化内容宽度\n         * @param contentHeight 初始化内容高度\n         */\n        calculateStageSize(scaleMode: string, screenWidth: number, screenHeight: number, contentWidth: number, contentHeight: number): StageDisplaySize;\n    }\n}\ndeclare namespace egret {\n    /**\n     * StageScaleMode class provides values for the stage zoom mode.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/player/StageScaleMode.ts\n     * @language en_US\n     */\n    /**\n     * StageScaleMode 类为舞台缩放模式提供值。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/player/StageScaleMode.ts\n     * @language zh_CN\n     */\n    class StageScaleMode {\n        /**\n         * Do not scale application content. Even when you change the player viewport size, it remains unchanged. If the player is smaller than the viewport content, possibly with some cropping.<br/>\n         * In this mode, the stage size (Stage.stageWidth, Stage.stageHeight) always with the player viewport size consistent.\n         * @language en_US\n         */\n        /**\n         * 不缩放应用程序内容。即使在更改播放器视口大小时，它仍然保持不变。如果播放器视口比内容小，则可能进行一些裁切。<br/>\n         * 在此模式下，舞台尺寸（Stage.stageWidth,Stage.stageHeight）始终跟播放器视口大小保持一致。\n         * @language zh_CN\n         */\n        static NO_SCALE: string;\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling a wide directions application content to fill the viewport players on both sides in the other direction may not be wide enough and left black bars.<br/>\n         * In this mode, the stage size (Stage.stageWidth, Stage.stageHeight) is always equal to the initialization incoming external application content size.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容的较宽方向填满播放器视口，另一个方向的两侧可能会不够宽而留有黑边。<br/>\n         * 在此模式下，舞台尺寸(Stage.stageWidth,Stage.stageHeight)始终等于初始化时外部传入的应用程序内容尺寸。\n         * @language zh_CN\n         */\n        static SHOW_ALL: string;\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling a narrow direction of application content to fill the viewport players on both sides in the other direction may exceed the viewport and the player is cut.<br/>\n         * In this mode, the stage size (Stage.stageWidth, Stage.stageHeight) is always equal to the initialization incoming external application content size.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容的较窄方向填满播放器视口，另一个方向的两侧可能会超出播放器视口而被裁切。<br/>\n         * 在此模式下，舞台尺寸(Stage.stageWidth,Stage.stageHeight)始终等于初始化时外部传入的应用程序内容尺寸。\n         * @language zh_CN\n         */\n        static NO_BORDER: string;\n        /**\n         * Do not keep the original aspect ratio scaling application content, after scaling application content just fill the player viewport.<br/>\n         * In this mode, the stage size (Stage.stageWidth, Stage.stageHeight) is always equal to the initialization incoming external application content size.\n         * @language en_US\n         */\n        /**\n         * 不保持原始宽高比缩放应用程序内容，缩放后应用程序内容正好填满播放器视口。<br/>\n         * 在此模式下，舞台尺寸(Stage.stageWidth,Stage.stageHeight)始终等于初始化时外部传入的应用程序内容尺寸。\n         * @language zh_CN\n         */\n        static EXACT_FIT: string;\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, but only to keep the contents of the original application constant width, height may change.<br/>\n         * In this mode, the stage width (Stage.stageWidth) is always equal to initialize external incoming application content width. Stage height (Stage.stageHeight) by the current scale with the player viewport height decision.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，但只保持应用程序内容的原始宽度不变，高度可能会改变。<br/>\n         * 在此模式下，舞台宽度(Stage.stageWidth)始终等于初始化时外部传入的应用程序内容宽度。舞台高度(Stage.stageHeight)由当前的缩放比例与播放器视口高度决定。\n         * @language zh_CN\n         */\n        static FIXED_WIDTH: string;\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, but only to keep the contents of the original application constant height, width may change.<br/>\n         * In this mode, the stage height (Stage.stageHeight) is always equal to initialize external incoming application content height. Stage width (Stage.stageWidth) by the current scale with the player viewport width decision.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，但只保持应用程序内容的原始高度不变，宽度可能会改变。<br/>\n         * 在此模式下，舞台高度(Stage.stageHeight)始终等于初始化时外部传入的应用程序内容高度。舞台宽度(Stage.stageWidth)由当前的缩放比例与播放器视口宽度决定。\n         * @language zh_CN\n         */\n        static FIXED_HEIGHT: string;\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player,a narrow direction may not be wide enough and fill.<br/>\n         * In this mode, the stage height (Stage.stageHeight) and the stage width (Stage.stageWidth) by the current scale with the player viewport size.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，应用程序内容的较窄方向可能会不够宽而填充。<br/>\n         * 在此模式下，舞台高度(Stage.stageHeight)和舞台宽度(Stage.stageWidth)由当前的缩放比例与播放器视口宽高决定。\n         * @language zh_CN\n         */\n        static FIXED_NARROW: string;\n        /**\n         * Keep the original aspect ratio scaling application content, after scaling application content in the horizontal and vertical directions to fill the viewport player, a wide direction may exceed the viewport and the player is cut.<br/>\n         * In this mode, the stage height (Stage.stageHeight) and the stage width (Stage.stageWidth) by the current scale with the player viewport size.\n         * @language en_US\n         */\n        /**\n         * 保持原始宽高比缩放应用程序内容，缩放后应用程序内容在水平和垂直方向都填满播放器视口，应用程序内容的较宽方向的两侧可能会超出播放器视口而被裁切。<br/>\n         * 在此模式下，舞台高度(Stage.stageHeight)和舞台宽度(Stage.stageWidth)由当前的缩放比例与播放器视口宽高决定。\n         * @language zh_CN\n         */\n        static FIXED_WIDE: string;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     */\n    let systemRenderer: SystemRenderer;\n    /**\n     * @private\n     * 用于碰撞检测绘制\n     */\n    let canvasRenderer: SystemRenderer;\n    /**\n     * @private\n     * 显示渲染器接口\n     */\n    interface SystemRenderer {\n        /**\n         * 渲染一个显示对象\n         * @param displayObject 要渲染的显示对象\n         * @param buffer 渲染缓冲\n         * @param matrix 要叠加的矩阵\n         * @param forRenderTexture 绘制目标是RenderTexture的标志\n         * @returns drawCall触发绘制的次数\n         */\n        render(displayObject: DisplayObject, buffer: RenderBuffer, matrix: Matrix, forRenderTexture?: boolean): number;\n        /**\n         * 将一个RenderNode对象绘制到渲染缓冲\n         * @param node 要绘制的节点\n         * @param buffer 渲染缓冲\n         * @param matrix 要叠加的矩阵\n         * @param forHitTest 绘制结果是用于碰撞检测。若为true，当渲染GraphicsNode时，会忽略透明度样式设置，全都绘制为不透明的。\n         */\n        drawNodeToBuffer(node: sys.RenderNode, buffer: RenderBuffer, matrix: Matrix, forHitTest?: boolean): void;\n    }\n    /**\n     *\n     */\n    interface RenderContext {\n    }\n    /**\n     * 创建一个canvas。\n     */\n    function mainCanvas(width?: number, height?: number): HTMLCanvasElement;\n    function createCanvas(width?: number, height?: number): HTMLCanvasElement;\n    /**\n    * 重新设置主canvas的大小\n    */\n    function resizeContext(renderContext: RenderContext, width: number, height: number, useMaxSize?: boolean): void;\n    /**\n    * 获得系统的渲染运行时\n    */\n    function getContextWebGL(surface: HTMLCanvasElement): WebGLRenderingContext;\n    function getContext2d(surface: HTMLCanvasElement): CanvasRenderingContext2D;\n    /**\n    * 仅通过bitmapData创建纹理\n    */\n    function createTexture(renderContext: RenderContext, bitmapData: BitmapData | HTMLCanvasElement): WebGLTexture;\n    /**\n    * 通过 width, height, data创建纹理\n    */\n    function _createTexture(renderContext: RenderContext, width: number, height: number, data: any): WebGLTexture;\n    /**\n     * 画texture\n     **/\n    function drawTextureElements(renderContext: RenderContext, data: any, offset: number): number;\n    /**\n     * 测量文本的宽度\n     * @param context\n     * @param text\n     */\n    function measureTextWith(context: CanvasRenderingContext2D, text: string): number;\n    /**\n     * 为CanvasRenderBuffer创建一个canvas\n     * @param defaultFunc\n     * @param width\n     * @param height\n     * @param root\n     */\n    function createCanvasRenderBufferSurface(defaultFunc: (width?: number, height?: number) => HTMLCanvasElement, width?: number, height?: number, root?: boolean): HTMLCanvasElement;\n    /**\n     * 改变渲染缓冲的大小并清空缓冲区\n     * @param renderContext\n     * @param width\n     * @param height\n     * @param useMaxSize\n     */\n    function resizeCanvasRenderBuffer(renderContext: RenderContext, width: number, height: number, useMaxSize?: boolean): void;\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     */\n    let $START_TIME: number;\n    /**\n     * @private\n     * 是否要广播Event.RENDER事件的标志。\n     */\n    let $invalidateRenderFlag: boolean;\n    /**\n     * @private\n     * 需要立即刷新屏幕的标志\n     */\n    let $requestRenderingFlag: boolean;\n    /**\n     * Egret心跳计时器\n     */\n    class SystemTicker {\n        /**\n         * @private\n         */\n        constructor();\n        /**\n         * @private\n         */\n        private playerList;\n        /**\n         * @private\n         * 注册一个播放器实例并运行\n         */\n        $addPlayer(player: Player): void;\n        /**\n         * @private\n         * 停止一个播放器实例的运行。\n         */\n        $removePlayer(player: Player): void;\n        /**\n         * @private\n         */\n        private callBackList;\n        /**\n         * @private\n         */\n        private thisObjectList;\n        /**\n         * @private\n         */\n        $startTick(callBack: (timeStamp: number) => boolean, thisObject: any): void;\n        /**\n         * @private\n         */\n        $stopTick(callBack: (timeStamp: number) => boolean, thisObject: any): void;\n        /**\n         * @private\n         */\n        private getTickIndex(callBack, thisObject);\n        /**\n         * @private\n         *\n         */\n        private concatTick();\n        /**\n         * @private\n         * 全局帧率\n         */\n        $frameRate: number;\n        /**\n         * @private\n         */\n        private frameInterval;\n        /**\n         * @private\n         */\n        private frameDeltaTime;\n        /**\n         * @private\n         */\n        private lastTimeStamp;\n        /**\n         * @private\n         * 设置全局帧率\n         */\n        $setFrameRate(value: number): boolean;\n        /**\n         * @private\n         */\n        private lastCount;\n        /**\n         * @private\n         * ticker 花销的时间\n         */\n        private costEnterFrame;\n        /**\n         * @private\n         * 是否被暂停\n         */\n        private isPaused;\n        /**\n         * Pause the ticker.\n         * @version Egret 5.0.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 暂停心跳\n         * @version Egret 5.0.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        pause(): void;\n        /**\n         * Resume the ticker.\n         * @version Egret 5.0.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 恢复心跳\n         * @version Egret 5.0.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        resume(): void;\n        /**\n         * @private\n         * 执行一次刷新\n         */\n        update(forceUpdate?: boolean): void;\n        /**\n         * @private\n         * 执行一次屏幕渲染\n         */\n        private render(triggerByFrame, costTicker);\n        /**\n         * @private\n         * 广播EnterFrame事件。\n         */\n        private broadcastEnterFrame();\n        /**\n         * @private\n         * 广播Render事件。\n         */\n        private broadcastRender();\n        /**\n         * @private\n         */\n        private callLaters();\n        /**\n         * @private\n         */\n        private callLaterAsyncs();\n    }\n}\ndeclare module egret {\n    namespace lifecycle {\n        type LifecyclePlugin = (context: LifecycleContext) => void;\n        /**\n         * @private\n         */\n        let stage: egret.Stage;\n        /**\n         * @private\n         */\n        let contexts: LifecycleContext[];\n        class LifecycleContext {\n            pause(): void;\n            resume(): void;\n            onUpdate?: () => void;\n        }\n        let onResume: () => void;\n        let onPause: () => void;\n        function addLifecycleListener(plugin: LifecyclePlugin): void;\n    }\n    /**\n     * 心跳计时器单例\n     */\n    let ticker: sys.SystemTicker;\n}\n/**\n * @private\n */\ndeclare let egret_stages: egret.Stage[];\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 用户交互操作管理器\n     */\n    class TouchHandler extends HashObject {\n        private maxTouches;\n        private useTouchesCount;\n        /**\n         * @private\n         */\n        constructor(stage: Stage);\n        /**\n         * @private\n         * 设置同时触摸数量\n         */\n        $initMaxTouches(): void;\n        /**\n         * @private\n         */\n        private stage;\n        /**\n         * @private\n         */\n        private touchDownTarget;\n        /**\n         * @private\n         * 触摸开始（按下）\n         * @param x 事件发生处相对于舞台的坐标x\n         * @param y 事件发生处相对于舞台的坐标y\n         * @param touchPointID 分配给触摸点的唯一标识号\n         */\n        onTouchBegin(x: number, y: number, touchPointID: number): void;\n        /**\n         * @private\n         */\n        private lastTouchX;\n        /**\n         * @private\n         */\n        private lastTouchY;\n        /**\n         * @private\n         * 触摸移动\n         * @param x 事件发生处相对于舞台的坐标x\n         * @param y 事件发生处相对于舞台的坐标y\n         * @param touchPointID 分配给触摸点的唯一标识号\n         */\n        onTouchMove(x: number, y: number, touchPointID: number): void;\n        /**\n         * @private\n         * 触摸结束（弹起）\n         * @param x 事件发生处相对于舞台的坐标x\n         * @param y 事件发生处相对于舞台的坐标y\n         * @param touchPointID 分配给触摸点的唯一标识号\n         */\n        onTouchEnd(x: number, y: number, touchPointID: number): void;\n        /**\n         * @private\n         * 获取舞台坐标下的触摸对象\n         */\n        private findTarget(stageX, stageY);\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 位图渲染节点\n     */\n    class BitmapNode extends RenderNode {\n        constructor();\n        /**\n         * 要绘制的位图\n         */\n        image: BitmapData;\n        /**\n         * 控制在缩放时是否对位图进行平滑处理。\n         */\n        smoothing: boolean;\n        /**\n         * 相对偏移矩阵。\n         */\n        matrix: egret.Matrix;\n        /**\n         * 图片宽度。WebGL渲染使用\n         */\n        imageWidth: number;\n        /**\n         * 图片高度。WebGL渲染使用\n         */\n        imageHeight: number;\n        /**\n         * 使用的混合模式\n         */\n        blendMode: number;\n        /**\n         * 相对透明度\n         */\n        alpha: number;\n        /**\n         * 颜色变换滤镜\n         */\n        filter: ColorMatrixFilter;\n        /**\n         * 翻转\n         */\n        rotated: boolean;\n        /**\n         * 绘制一次位图\n         */\n        drawImage(sourceX: number, sourceY: number, sourceW: number, sourceH: number, drawX: number, drawY: number, drawW: number, drawH: number): void;\n        /**\n         * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n         */\n        cleanBeforeRender(): void;\n        static $updateTextureData(node: sys.NormalBitmapNode, image: BitmapData, bitmapX: number, bitmapY: number, bitmapWidth: number, bitmapHeight: number, offsetX: number, offsetY: number, textureWidth: number, textureHeight: number, destW: number, destH: number, sourceWidth: number, sourceHeight: number, fillMode: string, smoothing: boolean): void;\n        /**\n         * @private\n         * 绘制九宫格位图\n         */\n        static $updateTextureDataWithScale9Grid(node: sys.NormalBitmapNode, image: BitmapData, scale9Grid: egret.Rectangle, bitmapX: number, bitmapY: number, bitmapWidth: number, bitmapHeight: number, offsetX: number, offsetY: number, textureWidth: number, textureHeight: number, destW: number, destH: number, sourceWidth: number, sourceHeight: number, smoothing: boolean): void;\n        /**\n         * @private\n         */\n        private static drawClipImage(node, scale, bitmapX, bitmapY, scaledBitmapW, scaledBitmapH, offsetX, offsetY, destW, destH, startX?, startY?);\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 矢量渲染节点\n     */\n    class GraphicsNode extends RenderNode {\n        constructor();\n        /**\n         * 指定一种简单的单一颜色填充，在绘制时该填充将在随后对其他 Graphics 方法（如 lineTo() 或 drawCircle()）的调用中使用。\n         * @param color 填充的颜色\n         * @param alpha 填充的 Alpha 值\n         * @param beforePath 插入在指定的路径命令之前绘制，通常是插入到当前正在绘制的线条路径之前，以确保线条总在填充的上方。\n         */\n        beginFill(color: number, alpha?: number, beforePath?: Path2D): Path2D;\n        /**\n         * 指定一种简单的单一颜色填充，在绘制时该填充将在随后对其他 Graphics 方法（如 lineTo() 或 drawCircle()）的调用中使用。\n         * 调用 clear() 方法会清除填充。\n         * @param type 用于指定要使用哪种渐变类型的 GradientType 类的值：GradientType.LINEAR 或 GradientType.RADIAL。\n         * @param colors 渐变中使用的 RGB 十六进制颜色值的数组（例如，红色为 0xFF0000，蓝色为 0x0000FF，等等）。对于每种颜色，请在 alphas 和 ratios 参数中指定对应值。\n         * @param alphas colors 数组中对应颜色的 alpha 值数组。\n         * @param ratios 颜色分布比率的数组。有效值为 0 到 255。\n         * @param matrix 一个由 egret.Matrix 类定义的转换矩阵。egret.Matrix 类包括 createGradientBox() 方法，通过该方法可以方便地设置矩阵，以便与 beginGradientFill() 方法一起使用\n         * @param beforePath 插入在指定的路径命令之前绘制，通常是插入到当前正在绘制的线条路径之前，以确保线条总在填充的上方。\n         */\n        beginGradientFill(type: string, colors: number[], alphas: number[], ratios: number[], matrix?: egret.Matrix, beforePath?: Path2D): Path2D;\n        /**\n         * 指定一种线条样式以用于随后对 lineTo() 或 drawCircle() 等 Graphics 方法的调用。\n         * @param thickness 一个整数，以点为单位表示线条的粗细，有效值为 0 到 255。如果未指定数字，或者未定义该参数，则不绘制线条。如果传递的值小于 0，则默认值为 0。值 0 表示极细的粗细；最大粗细为 255。如果传递的值大于 255，则默认值为 255。\n         * @param color 线条的十六进制颜色值（例如，红色为 0xFF0000，蓝色为 0x0000FF 等）。如果未指明值，则默认值为 0x000000（黑色）。可选。\n         * @param alpha 表示线条颜色的 Alpha 值的数字；有效值为 0 到 1。如果未指明值，则默认值为 1（纯色）。如果值小于 0，则默认值为 0。如果值大于 1，则默认值为 1。\n         * @param caps 用于指定线条末端处端点类型的 CapsStyle 类的值。默认值：CapsStyle.ROUND\n         * @param joints 指定用于拐角的连接外观的类型。默认值：JointStyle.ROUND\n         * @param miterLimit 用于表示剪切斜接的极限值的数字。\n         */\n        lineStyle(thickness?: number, color?: number, alpha?: number, caps?: string, joints?: string, miterLimit?: number, lineDash?: number[]): StrokePath;\n        /**\n         * 清空所有缓存的绘制数据\n         */\n        clear(): void;\n        /**\n         * 覆盖父类方法，不自动清空缓存的绘图数据，改为手动调用clear()方法清空。\n         */\n        cleanBeforeRender(): void;\n        /**\n         * 绘制x偏移\n         */\n        x: number;\n        /**\n         * 绘制y偏移\n         */\n        y: number;\n        /**\n         * 绘制宽度\n         */\n        width: number;\n        /**\n         * 绘制高度\n         */\n        height: number;\n        /**\n         * 脏渲染标记\n         * 暂时调用lineStyle,beginFill,beginGradientFill标记,实际应该draw时候标记在Path2D\n         */\n        dirtyRender: boolean;\n        $texture: WebGLTexture;\n        $textureWidth: number;\n        $textureHeight: number;\n        $canvasScaleX: number;\n        $canvasScaleY: number;\n        /**\n         * 清除非绘制的缓存数据\n         */\n        clean(): void;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 组渲染节点,用于组合多个渲染节点\n     */\n    class GroupNode extends RenderNode {\n        /**\n         * 相对偏移矩阵。\n         */\n        matrix: egret.Matrix;\n        constructor();\n        addNode(node: RenderNode): void;\n        /**\n         * 覆盖父类方法，不自动清空缓存的绘图数据，改为手动调用clear()方法清空。\n         * 这里只是想清空绘制命令，因此不调用super\n         */\n        cleanBeforeRender(): void;\n        $getRenderCount(): number;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * Mesh 渲染节点\n     */\n    class MeshNode extends RenderNode {\n        constructor();\n        /**\n         * 要绘制的位图\n         */\n        image: BitmapData;\n        /**\n         * 控制在缩放时是否对位图进行平滑处理。\n         */\n        smoothing: boolean;\n        /**\n         * 图片宽度。WebGL渲染使用\n         */\n        imageWidth: number;\n        /**\n         * 图片高度。WebGL渲染使用\n         */\n        imageHeight: number;\n        /**\n         * 相对偏移矩阵。\n         */\n        matrix: egret.Matrix;\n        /**\n         * UV 坐标。\n         */\n        uvs: number[];\n        /**\n         * 顶点坐标。\n         */\n        vertices: number[];\n        /**\n         * 顶点索引。\n         */\n        indices: number[];\n        /**\n         * 顶点索引。\n         */\n        bounds: Rectangle;\n        /**\n         * 使用的混合模式\n         */\n        blendMode: number;\n        /**\n         * 相对透明度\n         */\n        alpha: number;\n        /**\n         * 颜色变换滤镜\n         */\n        filter: ColorMatrixFilter;\n        /**\n         * 翻转\n         */\n        rotated: boolean;\n        /**\n         * 绘制一次位图\n         */\n        drawMesh(sourceX: number, sourceY: number, sourceW: number, sourceH: number, drawX: number, drawY: number, drawW: number, drawH: number): void;\n        /**\n         * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n         */\n        cleanBeforeRender(): void;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 位图渲染节点\n     */\n    class NormalBitmapNode extends RenderNode {\n        constructor();\n        /**\n         * 要绘制的位图\n         */\n        image: BitmapData;\n        /**\n         * 控制在缩放时是否对位图进行平滑处理。\n         */\n        smoothing: boolean;\n        /**\n         * 图片宽度。WebGL渲染使用\n         */\n        imageWidth: number;\n        /**\n         * 图片高度。WebGL渲染使用\n         */\n        imageHeight: number;\n        /**\n         * 翻转\n         */\n        rotated: boolean;\n        sourceX: number;\n        sourceY: number;\n        sourceW: number;\n        sourceH: number;\n        drawX: number;\n        drawY: number;\n        drawW: number;\n        drawH: number;\n        /**\n         * 绘制一次位图\n         */\n        drawImage(sourceX: number, sourceY: number, sourceW: number, sourceH: number, drawX: number, drawY: number, drawW: number, drawH: number): void;\n        /**\n         * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n         */\n        cleanBeforeRender(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    class Mesh extends Bitmap {\n        constructor(value?: Texture);\n        protected createNativeDisplayObject(): void;\n        /**\n         * @private\n         */\n        protected setBitmapDataToWasm(data?: Texture): void;\n        /**\n         * @private\n         */\n        $updateRenderNode(): void;\n        /**\n         * @private\n         */\n        private _verticesDirty;\n        private _bounds;\n        /**\n         * @private\n         */\n        $updateVertices(): void;\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 文本格式\n     */\n    interface TextFormat {\n        /**\n         * 颜色值\n         */\n        textColor?: number;\n        /**\n         * 描边颜色值\n         */\n        strokeColor?: number;\n        /**\n         * 字号\n         */\n        size?: number;\n        /**\n         * 描边大小\n         */\n        stroke?: number;\n        /**\n         * 是否加粗\n         */\n        bold?: boolean;\n        /**\n         * 是否倾斜\n         */\n        italic?: boolean;\n        /**\n         * 字体名称\n         */\n        fontFamily?: string;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 文本渲染节点\n     */\n    class TextNode extends RenderNode {\n        constructor();\n        /**\n         * 颜色值\n         */\n        textColor: number;\n        /**\n         * 描边颜色值\n         */\n        strokeColor: number;\n        /**\n         * 字号\n         */\n        size: number;\n        /**\n         * 描边大小\n         */\n        stroke: number;\n        /**\n         * 是否加粗\n         */\n        bold: boolean;\n        /**\n         * 是否倾斜\n         */\n        italic: boolean;\n        /**\n         * 字体名称\n         */\n        fontFamily: string;\n        /**\n         * 绘制一行文本\n         */\n        drawText(x: number, y: number, text: string, format: TextFormat): void;\n        /**\n         * 绘制x偏移\n         */\n        x: number;\n        /**\n         * 绘制y偏移\n         */\n        y: number;\n        /**\n         * 绘制宽度\n         */\n        width: number;\n        /**\n         * 绘制高度\n         */\n        height: number;\n        /**\n         * 脏渲染标记\n         */\n        dirtyRender: boolean;\n        $texture: WebGLTexture;\n        $textureWidth: number;\n        $textureHeight: number;\n        $canvasScaleX: number;\n        $canvasScaleY: number;\n        /**\n         * 清除非绘制的缓存数据\n         */\n        clean(): void;\n        /**\n         * 在显示对象的$updateRenderNode()方法被调用前，自动清空自身的drawData数据。\n         */\n        cleanBeforeRender(): void;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 填充路径\n     */\n    class FillPath extends Path2D {\n        constructor();\n        /**\n         * 填充颜色\n         */\n        fillColor: number;\n        /**\n         * 填充透明度\n         */\n        fillAlpha: number;\n    }\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 渐变填充路径\n     */\n    class GradientFillPath extends Path2D {\n        constructor();\n        gradientType: string;\n        colors: number[];\n        alphas: number[];\n        ratios: number[];\n        matrix: Matrix;\n    }\n}\ndeclare namespace egret {\n    /**\n     * OrientationMode 类为舞台初始旋转模式提供值。\n     */\n    const OrientationMode: {\n        AUTO: string;\n        PORTRAIT: string;\n        LANDSCAPE: string;\n        LANDSCAPE_FLIPPED: string;\n    };\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     * 线条路径。\n     * 注意：当线条宽度（lineWidth）为1或3像素时，需要特殊处理，往右下角偏移0.5像素，以显示清晰锐利的线条。\n     */\n    class StrokePath extends Path2D {\n        constructor();\n        /**\n         * 线条宽度。\n         * 注意：绘制时对1像素和3像素要特殊处理，整体向右下角偏移0.5像素，以显示清晰锐利的线条。\n         */\n        lineWidth: number;\n        /**\n         * 线条颜色\n         */\n        lineColor: number;\n        /**\n         * 线条透明度\n         */\n        lineAlpha: number;\n        /**\n         * 端点样式,\"none\":无端点,\"round\":圆头端点,\"square\":方头端点\n         */\n        caps: string;\n        /**\n         * 联接点样式,\"bevel\":斜角连接,\"miter\":尖角连接,\"round\":圆角连接\n         */\n        joints: string;\n        /**\n         * 用于表示剪切斜接的极限值的数字。\n         */\n        miterLimit: number;\n        /**\n         * 描述交替绘制线段和间距（坐标空间单位）长度的数字。\n         */\n        lineDash: number[];\n    }\n}\n/**\n * @private\n */\ninterface CanvasRenderingContext2D {\n    imageSmoothingEnabled: boolean;\n    $imageSmoothingEnabled: boolean;\n    $offsetX: number;\n    $offsetY: number;\n}\ndeclare namespace egret {\n    class CanvasRenderer {\n        private nestLevel;\n        render(displayObject: DisplayObject, buffer: sys.RenderBuffer, matrix: Matrix, forRenderTexture?: boolean): number;\n        /**\n         * @private\n         * 绘制一个显示对象\n         */\n        private drawDisplayObject(displayObject, context, offsetX, offsetY, isStage?);\n        private drawWithFilter(displayObject, context, offsetX, offsetY);\n        private drawWithClip(displayObject, context, offsetX, offsetY);\n        private drawWithScrollRect(displayObject, context, offsetX, offsetY);\n        drawNodeToBuffer(node: sys.RenderNode, buffer: sys.RenderBuffer, matrix: Matrix, forHitTest?: boolean): void;\n        /**\n         * 将一个DisplayObject绘制到渲染缓冲，用于RenderTexture绘制\n         * @param displayObject 要绘制的显示对象\n         * @param buffer 渲染缓冲\n         * @param matrix 要叠加的矩阵\n         */\n        drawDisplayToBuffer(displayObject: DisplayObject, buffer: sys.RenderBuffer, matrix: Matrix): number;\n        private renderNode(node, context, forHitTest?);\n        private renderNormalBitmap(node, context);\n        private renderBitmap(node, context);\n        private renderMesh(node, context);\n        renderText(node: sys.TextNode, context: CanvasRenderingContext2D): void;\n        private renderingMask;\n        /**\n         * @private\n         */\n        renderGraphics(node: sys.GraphicsNode, context: CanvasRenderingContext2D, forHitTest?: boolean): number;\n        private renderPath(path, context);\n        private renderGroup(groupNode, context);\n        private createRenderBuffer(width, height, useForFilters?);\n    }\n    /**\n     * @private\n     * 获取字体字符串\n     */\n    function getFontString(node: sys.TextNode, format: sys.TextFormat): string;\n    /**\n     * @private\n     * 获取RGBA字符串\n     */\n    function getRGBAString(color: number, alpha: number): string;\n}\ndeclare namespace egret {\n    /**\n     * Orientation monitor the orientation of the device, send CHANGE event when the orientation is changed\n     *\n     * @event egret.Event.CHANGE device's orientation is changed\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/sensor/DeviceOrientation.ts\n     * @see http://edn.egret.com/cn/docs/page/661 获取设备旋转角度\n     * @language en_US\n     */\n    /**\n     * Orientation 监听设备方向的变化，当方向变化时派发 CHANGE 事件\n     * @event egret.Event.CHANGE 设备方向改变时派发\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/sensor/DeviceOrientation.ts\n     * @see http://edn.egret.com/cn/docs/page/661 获取设备旋转角度\n     * @language zh_CN\n     */\n    interface DeviceOrientation extends EventDispatcher {\n        /**\n         * Start to monitor the device's orientation\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 开始监听设备方向变化\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        start(): void;\n        /**\n         * Stop monitor the device's orientation\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 停止监听设备方向变化\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        stop(): void;\n    }\n    /**\n     * @copy egret.Orientation\n     */\n    let DeviceOrientation: {\n        new (): DeviceOrientation;\n    };\n}\ndeclare namespace egret {\n    /**\n     * The Geolocation able to obtain the position of the device.\n     * Geolocation will emit CHANGE event when the device's location is changed.\n     * It will emit IO_ERROR event if the location request is denied\n     * or there is no location service on the device.\n     *\n     * @event egret.Event.CHANGE The device's location is changed\n     * @event egret.Event.IO_ERROR Error occurred while getting the location\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/sensor/Geolocation.ts\n     * @language en_US\n     */\n    /**\n     * Geolocation 能够从设备的定位服务获取设备的当前位置。\n     * 当设备的位置发生改变时 Geolocation 会派发 CHANGE 事件。\n     * 当定位请求被拒绝或该设备没有定位服务时 Geolocation 会派发 IO_ERROR 事件。\n     *\n     * @event egret.Event.CHANGE 设备位置发生改变\n     * @event egret.Event.IO_ERROR 获取设备位置时发生错误\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/sensor/Geolocation.ts\n     * @language zh_CN\n     */\n    interface Geolocation extends EventDispatcher {\n        /**\n         * Start to monitor the device's location\n         * @returns\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 开始监听设备位置信息\n         * @returns\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        start(): void;\n        /**\n         * Stop monitor the device's location\n         * @returns\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 停止监听设备位置信息\n         * @returns\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        stop(): void;\n    }\n    /**\n     * @copy egret.Geolocation\n     */\n    let Geolocation: {\n        /**\n         * constructor\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 构造函数\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        new (): Geolocation;\n    };\n}\ndeclare namespace egret {\n    /**\n     * @copy egret.Motion\n     */\n    let Motion: {\n        new (): Motion;\n    };\n    /**\n     * The Motion class emits events based on activity detected by the device's motion sensor.\n     * This data represents the device's movement along a 3-dimensional axis. When the device moves,\n     * the sensor detects this movement and emit the CHANGE event. @see egret.MotionEvent\n     *\n     * @event egret.Event.CHANGE device is moved\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/sensor/Motion.ts\n     * @language en_US\n     */\n    /**\n     * Motion 类从用户设备读取运动状态信息并派发 CHANGE 事件。\n     * 当设备移动时，传感器会检测到此移动并返回设备加速度，重力和旋转数据。@see egret.MotionEvent\n     * Motion 类提供了 start 和 stop 方法，来启动和停止运动信息检查\n     *\n     * @event egret.Event.CHANGE 运动状态发生改变\n     * @version Egret 2.4\n     * @platform Web\n     * @includeExample egret/sensor/Motion.ts\n     * @language zh_CN\n     */\n    interface Motion extends EventDispatcher {\n        /**\n         * Start to monitor device movement\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 开始监听设备运动状态\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        start(): void;\n        /**\n         * Stop monitor device movement\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 停止监听设备运动状态\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        stop(): void;\n    }\n    /**\n     * A DeviceRotationRate object provides information about the rate at which\n     * the device is rotating around all three axes.\n     * @version Egret 2.4\n     * @platform Web\n     * @language en_US\n     */\n    /**\n     * DeviceRotationRate 提供设备围绕三个轴旋转的角速度信息，单位是 角度/秒\n     * @version Egret 2.4\n     * @platform Web\n     * @language zh_CN\n     */\n    interface DeviceRotationRate {\n        /**\n         * The amount of rotation around the Z axis, in degrees per second.\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 设备绕 Z 轴旋转的角速度信息，单位是 度/秒\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        alpha: number;\n        /**\n         * The amount of rotation around the X axis, in degrees per second.\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 设备绕 X 轴旋转的角速度信息，单位是 度/秒\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        beta: number;\n        /**\n         * The amount of rotation around the Y axis, in degrees per second.\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 设备绕 Y 轴旋转的角速度信息，单位是 度/秒\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        gamma: number;\n    }\n    /**\n     * A DeviceAcceleration object provides information about the amount\n     * of acceleration the device is experiencing along all three axes.\n     * Acceleration is expressed in m/s2.\n     * @version Egret 2.4\n     * @platform Web\n     * @language en_US\n     */\n    /**\n     * DeviceAcceleration 提供设备在三个维度的加速度信息，加速度值的单位是 m/s2\n     * @version Egret 2.4\n     * @platform Web\n     * @language zh_CN\n     */\n    interface DeviceAcceleration {\n        /**\n         * The amount of acceleration along the X axis\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * X 轴方向的加速度值\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        x: number;\n        /**\n         * The amount of acceleration along the Y axis\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * Y 轴方向的加速度值\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        y: number;\n        /**\n         * The amount of acceleration along the Z axis\n         * @version Egret 2.4\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * Z 轴方向的加速度值\n         * @version Egret 2.4\n         * @platform Web\n         * @language zh_CN\n         */\n        z: number;\n    }\n}\ndeclare namespace egret {\n    /**\n     * Type of operation.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 运行类型的类型。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    namespace RuntimeType {\n        /**\n         * Running on Web\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 运行在Web上\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const WEB = \"web\";\n        /**\n         * Running on NATIVE\n         * @version Egret 2.4\n         * @deprecated\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 运行在NATIVE上\n         * @version Egret 2.4\n         * @deprecated\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const NATIVE = \"native\";\n        /**\n         * Running on Runtime2.0\n         * @version Egret 5.1.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 运行在Runtime2.0上\n         * @version Egret 5.1.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        const RUNTIME2 = \"runtime2\";\n        /**\n         * Running on Alipay\n         * @version Egret 5.2.23\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在支付宝小游戏上\n         * @version Egret 5.2.26\n         * @platform All\n         * @language zh_CN\n         */\n        const MYGAME = \"mygame\";\n        /**\n         * Running on WeChat mini game\n         * @version Egret 5.1.5\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在微信小游戏上\n         * @version Egret 5.1.5\n         * @platform All\n         * @language zh_CN\n         */\n        const WXGAME = \"wxgame\";\n        /**\n         * Running on Baidu mini game\n         * @version Egret 5.2.13\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在百度小游戏上\n         * @version Egret 5.2.13\n         * @platform All\n         * @language zh_CN\n         */\n        const BAIDUGAME = \"baidugame\";\n        /**\n         * Running on Xiaomi quick game\n         * @version Egret 5.2.14\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在小米快游戏上\n         * @version Egret 5.2.14\n         * @platform All\n         * @language zh_CN\n         */\n        const QGAME = \"qgame\";\n        /**\n         * Running on OPPO mini game\n         * @version Egret 5.2.14\n         * @platform All\n         * @language en_US\n         */\n        /**\n         * 运行在 Oppo 小游戏上\n         * @version Egret 5.2.14\n         * @platform All\n         * @language zh_CN\n         */\n        const OPPOGAME = \"oppogame\";\n        /**\n        * Running on QQ mini game\n        * @version Egret 5.2.25\n        * @platform All\n        * @language en_US\n        */\n        /**\n        * 运行在 QQ 小游戏上\n        * @version Egret 5.2.25\n        * @platform All\n        * @language zh_CN\n        */\n        const QQGAME = \"qqgame\";\n        /**\n         * Running on vivo mini game\n         * @version Egret 5.2.23\n         * @platform All\n         * @language en_US\n         */\n        /**\n        * 运行在 vivo 小游戏上\n        * @version Egret 5.2.23\n        * @platform All\n        * @language zh_CN\n        */\n        const VIVOGAME = \"vivogame\";\n    }\n    interface SupportedCompressedTexture {\n        pvrtc: boolean;\n        etc1: boolean;\n    }\n    /**\n     * The Capabilities class provides properties that describe the system and runtime that are hosting the application.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/system/Capabilities.ts\n     * @language en_US\n     */\n    /**\n     * Capabilities 类提供一些属性，这些属性描述了承载应用程序的系统和运行时。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/system/Capabilities.ts\n     * @language zh_CN\n     */\n    class Capabilities {\n        /**\n         * Specifies the language code of the system on which the content is running. The language is specified as a lowercase\n         * two-letter language code from ISO 639-1. For Chinese, an additional uppercase two-letter country code from ISO 3166\n         * distinguishes between Simplified and Traditional Chinese.<br/>\n         * The following table lists the possible values,but not limited to them:\n         * <ul>\n         * <li>Simplified    Chinese  zh-CN</li>\n         * <li>Traditional   Chinese  zh-TW</li>\n         * <li>English       en</li>\n         * <li>Japanese      ja</li>\n         * <li>Korean        ko</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示运行内容的系统的语言代码。语言指定为 ISO 639-1 中的小写双字母语言代码。\n         * 对于中文，另外使用 ISO 3166 中的大写双字母国家/地区代码，以区分简体中文和繁体中文。<br/>\n         * 以下是可能但不限于的语言和值：\n         * <ul>\n         * <li>简体中文  zh-CN</li>\n         * <li>繁体中文  zh-TW</li>\n         * <li>英语      en</li>\n         * <li>日语      ja</li>\n         * <li>韩语      ko</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly language: string;\n        /**\n         * Specifies whether the system is running in a mobile device.(such as a mobile phone or tablet)\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示程序内容是否运行在移动设备中（例如移动电话或平板电脑）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly isMobile: boolean;\n        /**\n         * Specifies the current operating system. The os property can return the following strings:\n         * <ul>\n         * <li>iPhone            \"iOS\"</li>\n         * <li>Android Phone     \"Android\"</li>\n         * <li>Windows Phone     \"Windows Phone\"</li>\n         * <li>Windows Desktop   \"Windows PC\"</li>\n         * <li>Mac Desktop       \"Mac OS\"</li>\n         * <li>Unknown OS        \"Unknown\"</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指示当前的操作系统。os 属性返回下列字符串：\n         * <ul>\n         * <li>苹果手机操作系统     \"iOS\"</li>\n         * <li>安卓手机操作系统     \"Android\"</li>\n         * <li>微软手机操作系统     \"Windows Phone\"</li>\n         * <li>微软桌面操作系统     \"Windows PC\"</li>\n         * <li>苹果桌面操作系统     \"Mac OS\"</li>\n         * <li>未知操作系统        \"Unknown\"</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly os: string;\n        /**\n         * It indicates the current type of operation. runtimeType property returns the following string:\n         * <ul>\n         * <li>Run on Web     egret.RuntimeType.WEB</li>\n         * <li>Run on Runtime2.0     egret.RuntimeType.RUNTIME2</li>\n         * <li>Run on WeChat mini game     egret.RuntimeType.WXGAME</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 指示当前的运行类型。runtimeType 属性返回下列字符串：\n         * <ul>\n         * <li>运行在Web上     egret.RuntimeType.WEB</li>\n         * <li>运行在Runtime2.0上     egret.RuntimeType.RUNTIME2</li>\n         * <li>运行在微信小游戏上    egret.RuntimeType.WXGAME</li>\n         * </ul>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly runtimeType: string;\n        /***\n         * version of Egret.\n         * @type {string}\n         * @version Egret 3.2.0\n         * @platform Web,Native\n         * @language en_US\n         */\n        /***\n         * Egret 的版本号。\n         * @type {string}\n         * @version Egret 3.2.0\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly engineVersion: string;\n        /***\n         * current render mode.\n         * @type {string}\n         * @version Egret 3.0.7\n         * @platform Web,Native\n         * @language en_US\n         */\n        /***\n         * 当前渲染模式。\n         * @type {string}\n         * @version Egret 3.0.7\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly renderMode: string;\n        /***\n         * Clients border width.\n         * The value before the document class initialization is always 0.\n         * This value will change after the distribution Event.RESIZE and StageOrientationEvent.ORIENTATION_CHANGE.\n         * @version Egret 3.1.3\n         * @platform Web,Native\n         * @language en_US\n         */\n        /***\n         * 客户端边界宽度。\n         * 该值在文档类初始化之前始终是0。\n         * 该值在派发 Event.RESIZE 以及 StageOrientationEvent.ORIENTATION_CHANGE 之后会发生改变。\n         * @version Egret 3.1.3\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly boundingClientWidth: number;\n        /***\n         * Clients border height.\n         * The value before the document class initialization is always 0.\n         * This value will change after the distribution Event.RESIZE and StageOrientationEvent.ORIENTATION_CHANGE.\n         * @version Egret 3.1.3\n         * @platform Web,Native\n         * @language en_US\n         */\n        /***\n         * 客户端边界高度。\n         * 该值在文档类初始化之前始终是0。\n         * 该值在派发 Event.RESIZE 以及 StageOrientationEvent.ORIENTATION_CHANGE 之后会发生改变。\n         * @version Egret 3.1.3\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static readonly boundingClientHeight: number;\n        /***\n         * supported compressed texture\n         * @version Egret 5.2.19\n         * @platform Web,Native\n         * @language en_US\n         */\n        /***\n         * supported compressed texture\n         * @version Egret 5.2.19\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static supportedCompressedTexture: SupportedCompressedTexture;\n    }\n}\ndeclare namespace egret {\n    /**\n     * RenderTexture is a dynamic texture\n     * @extends egret.Texture\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/RenderTexture.ts\n     * @language en_US\n     */\n    /**\n     * RenderTexture 是动态纹理类，他实现了将显示对象及其子对象绘制成为一个纹理的功能\n     * @extends egret.Texture\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/RenderTexture.ts\n     * @language zh_CN\n     */\n    class RenderTexture extends egret.Texture {\n        constructor();\n        $renderBuffer: sys.RenderBuffer;\n        /**\n         * The specified display object is drawn as a texture\n         * @param displayObject {egret.DisplayObject} the display to draw\n         * @param clipBounds {egret.Rectangle} clip rect\n         * @param scale {number} scale factor\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将指定显示对象绘制为一个纹理\n         * @param displayObject {egret.DisplayObject} 需要绘制的显示对象\n         * @param clipBounds {egret.Rectangle} 绘制矩形区域\n         * @param scale {number} 缩放比例\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        drawToTexture(displayObject: egret.DisplayObject, clipBounds?: Rectangle, scale?: number): boolean;\n        /**\n         * @inheritDoc\n         */\n        getPixel32(x: number, y: number): number[];\n        /**\n         * @inheritDoc\n         */\n        dispose(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * Adds an interface-name-to-implementation-class mapping to the registry.\n     * @param interfaceName the interface name to register. For example：\"eui.IAssetAdapter\",\"eui.Theme\"\n     * @param instance the instance to register.\n     * @version Egret 3.2.1\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 注册一个接口实现。\n     * @param interfaceName 注入的接口名称。例如：\"eui.IAssetAdapter\",\"eui.Theme\"\n     * @param instance 实现此接口的实例。\n     * @version Egret 3.2.1\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function registerImplementation(interfaceName: string, instance: any): void;\n    /**\n     * Returns the singleton instance of the implementation class that was registered for the specified interface.\n     * This method is usually called by egret framework.\n     * @param interfaceName The interface name to identify. For example：\"eui.IAssetAdapter\",\"eui.Theme\"\n     * @returns the singleton instance of the implementation class\n     * @version Egret 3.2.1\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 获取一个接口实现。此方法通常由框架内部调用。获取项目注入的自定义实现实例。\n     * @param interfaceName 要获取的接口名称。例如：\"eui.IAssetAdapter\",\"eui.Theme\"\n     * @returns 返回实现此接口的实例。\n     * @version Egret 3.2.1\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function getImplementation(interfaceName: string): any;\n}\ndeclare namespace egret {\n    /**\n     * This class is used to create lightweight shapes using the drawing application program interface (API). The Shape\n     * class includes a graphics property, which lets you access methods from the Graphics class.\n     * @see egret.Graphics\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Shape.ts\n     * @language en_US\n     */\n    /**\n     * 此类用于使用绘图应用程序编程接口 (API) 创建简单形状。Shape 类含有 graphics 属性，通过该属性您可以访问各种矢量绘图方法。\n     * @see egret.Graphics\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Shape.ts\n     * @language zh_CN\n     */\n    class Shape extends DisplayObject {\n        /**\n         * Creates a new Shape object.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 Shape 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        protected createNativeDisplayObject(): void;\n        /**\n         * @private\n         */\n        $graphics: Graphics;\n        /**\n         * Specifies the Graphics object belonging to this Shape object, where vector drawing commands can occur.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取 Shape 中的 Graphics 对象。可通过此对象执行矢量绘图命令。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly graphics: Graphics;\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        $hitTest(stageX: number, stageY: number): DisplayObject;\n        /**\n         * @private\n         */\n        $onRemoveFromStage(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * Bitmap font, texture set of a font. It is generally used as the value of the BitmapText.font attribute.\n     * @see http://bbs.egret-labs.org/thread-918-1-1.html TextureMerger\n     * @see http://bbs.egret-labs.org/forum.php?mod=viewthread&tid=251 Text(Containing the specific usage of the bitmap font )\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/BitmapFont.ts\n     * @language en_US\n     */\n    /**\n     * 位图字体,是一个字体的纹理集，通常作为BitmapText.font属性的值。\n     * @see http://bbs.egret-labs.org/thread-918-1-1.html TextureMerger\n     * @see http://bbs.egret-labs.org/forum.php?mod=viewthread&tid=251 文本(含位图字体具体用法)\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/BitmapFont.ts\n     * @language zh_CN\n     */\n    class BitmapFont extends SpriteSheet {\n        /**\n         * Create an egret.BitmapFont object\n         * @param texture {egret.Texture} Texture set that use TextureMerger create\n         * @param config {any} Configure data that use TextureMerger create\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.BitmapFont 对象\n         * @param texture {egret.Texture} 使用TextureMerger生成的纹理集\n         * @param config {any} 使用TextureMerger生成的配置数据\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(texture: Texture, config: any);\n        /**\n         * @private\n         */\n        private charList;\n        /**\n         * Obtain corresponding texture through the name attribute\n         * @param name {string} name Attribute\n         * @returns {egret.Texture}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 通过 name 属性获取对应纹理\n         * @param name {string} name属性\n         * @returns {egret.Texture}\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        getTexture(name: string): Texture;\n        /**\n         * @private\n         */\n        getConfig(name: string, key: string): number;\n        /**\n         * @private\n         */\n        private firstCharHeight;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        _getFirstCharHeight(): number;\n        /**\n         * @private\n         *\n         * @param fntText\n         * @returns\n         */\n        private parseConfig(fntText);\n        /**\n         * @private\n         *\n         * @param configText\n         * @param key\n         * @returns\n         */\n        private getConfigByKey(configText, key);\n    }\n}\ndeclare namespace egret {\n    /**\n     * Bitmap font adopts the Bitmap+SpriteSheet mode to render text.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/BitmapText.ts\n     * @language en_US\n     */\n    /**\n     * 位图字体采用了Bitmap+SpriteSheet的方式来渲染文字。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/BitmapText.ts\n     * @language zh_CN\n     */\n    class BitmapText extends DisplayObject {\n        /**\n         * Create an egret.BitmapText object\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 创建一个 egret.BitmapText 对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        protected createNativeDisplayObject(): void;\n        private $smoothing;\n        /**\n         * Whether or not is smoothed when scaled.\n         * @default true。\n         * @version Egret 3.0\n         * @platform Web\n         * @language en_US\n         */\n        /**\n         * 控制在缩放时是否进行平滑处理。\n         * @default true。\n         * @version Egret 3.0\n         * @platform Web\n         * @language zh_CN\n         */\n        smoothing: boolean;\n        private $text;\n        /**\n         * A string to display in the text field.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 要显示的文本内容\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        text: string;\n        /**\n         * @private\n         */\n        $setText(value: string): boolean;\n        protected $textFieldWidth: number;\n        /**\n         * @private\n         */\n        $getWidth(): number;\n        /**\n         * @private\n         */\n        $setWidth(value: number): boolean;\n        private $textLinesChanged;\n        /**\n         * @private\n         */\n        $invalidateContentBounds(): void;\n        protected $textFieldHeight: number;\n        /**\n         * @private\n         */\n        $getHeight(): number;\n        /**\n         * @private\n         */\n        $setHeight(value: number): boolean;\n        protected $font: BitmapFont;\n        protected $fontStringChanged: boolean;\n        /**\n         * The name of the font to use, or a comma-separated list of font names, the type of value must be BitmapFont.\n         * @default null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 要使用的字体的名称或用逗号分隔的字体名称列表，类型必须是 BitmapFont。\n         * @default null\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        font: Object;\n        $setFont(value: any): boolean;\n        private $lineSpacing;\n        /**\n         /**\n         * An integer representing the amount of vertical space between lines.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个整数，表示行与行之间的垂直间距量\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        lineSpacing: number;\n        $setLineSpacing(value: number): boolean;\n        private $letterSpacing;\n        /**\n         * An integer representing the amount of distance between characters.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个整数，表示字符之间的距离。\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        letterSpacing: number;\n        $setLetterSpacing(value: number): boolean;\n        private $textAlign;\n        /**\n         * Horizontal alignment of text.\n         * @default：egret.HorizontalAlign.LEFT\n         * @version Egret 2.5.6\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本的水平对齐方式。\n         * @default：egret.HorizontalAlign.LEFT\n         * @version Egret 2.5.6\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        textAlign: string;\n        $setTextAlign(value: string): boolean;\n        private $verticalAlign;\n        /**\n         * Vertical alignment of text.\n         * @default：egret.VerticalAlign.TOP\n         * @version Egret 2.5.6\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文字的垂直对齐方式。\n         * @default：egret.VerticalAlign.TOP\n         * @version Egret 2.5.6\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        verticalAlign: string;\n        $setVerticalAlign(value: string): boolean;\n        /**\n         * A ratio of the width of the space character. This value is multiplied by the height of the first character is the space character width.\n         * @default 0.33\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个空格字符的宽度比例。这个数值乘以第一个字符的高度即为空格字符的宽。\n         * @default 0.33\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static EMPTY_FACTOR: number;\n        /**\n         * @private\n         */\n        $updateRenderNode(): void;\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        private $textWidth;\n        /**\n         * Get the BitmapText measured width\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取位图文本测量宽度\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly textWidth: number;\n        private $textHeight;\n        /**\n         * Get Text BitmapText height\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取位图文本测量高度\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly textHeight: number;\n        /**\n         * @private\n         */\n        private $textOffsetX;\n        /**\n         * @private\n         */\n        private $textOffsetY;\n        /**\n         * @private\n         */\n        private $textStartX;\n        /**\n         * @private\n         */\n        private $textStartY;\n        /**\n         * @private\n         */\n        private textLines;\n        /**\n         * @private 每一行文字的宽度\n         */\n        private $textLinesWidth;\n        /**\n         * @private\n         */\n        $lineHeights: number[];\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getTextLines(): string[];\n    }\n}\ndeclare namespace egret {\n    /**\n     * The HorizontalAlign class defines the possible values for the horizontal alignment.\n     * @see egret.TextField#textAlign\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * HorizontalAlign 类为水平对齐方式定义可能的值。\n     * @see egret.TextField#textAlign\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class HorizontalAlign {\n        /**\n         * Horizontally align content to the left of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将内容与容器的左侧对齐。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static LEFT: string;\n        /**\n         * Horizontally align content to the right of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将内容与容器的右侧对齐。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static RIGHT: string;\n        /**\n         * Horizontally align content in the center of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在容器的水平中心对齐内容。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static CENTER: string;\n        /**\n         * Horizontal alignment with both edges.\n         * Note: TextFiled does not support this alignment method.\n         * @constant egret.HorizontalAlign.JUSTIFY\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 水平两端对齐。\n         * 注意：TextFiled不支持此对齐方式。\n         * @constant egret.HorizontalAlign.JUSTIFY\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static JUSTIFY: string;\n        /**\n         * Align the content of the child items, relative to the container. This operation will adjust uniformly the size of all the child items to be the Content Width \\\" of the container \\\".\n         * The Content Width \\\" of the container \\\" is the size of the max. child item. If the size of all child items are less than the width of the container, they will be adjusted to the width of the container.\n         * Note: TextFiled does not support this alignment method.\n         * @constant egret.HorizontalAlign.CONTENT_JUSTIFY\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 相对于容器对子项进行内容对齐。这会将所有子项的大小统一调整为容器的\"内容宽度\"。\n         * 容器的\"内容宽度\"是最大子项的大小,如果所有子项都小于容器的宽度，则会将所有子项的大小调整为容器的宽度。\n         * 注意：TextFiled不支持此对齐方式。\n         * @constant egret.HorizontalAlign.CONTENT_JUSTIFY\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static CONTENT_JUSTIFY: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * Convert the text in html format to the object that can be assigned to the egret.TextField#textFlow property\n     * @see http://edn.egret.com/cn/docs/page/146 Text mixed in a variety of style\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/HtmlTextParser.ts\n     * @language en_US\n     */\n    /**\n     * 将html格式文本转换为可赋值给 egret.TextField#textFlow 属性的对象\n     * @see http://edn.egret.com/cn/docs/page/146 多种样式文本混合\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/HtmlTextParser.ts\n     * @language zh_CN\n     */\n    class HtmlTextParser {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor();\n        private replaceArr;\n        private initReplaceArr();\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        private replaceSpecial(value);\n        /**\n         * @private\n         */\n        private resutlArr;\n        /**\n         * Convert the text in html format to the object that can be assigned to the egret.TextField#textFlow property\n         * @param htmltext {string} Text in html\n         * @returns {Array<egret.ITextElement>} 可赋值给 egret.TextField#textFlow Object that can be assigned to the egret.TextField#textFlow property\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将html格式文本转换为可赋值给 egret.TextField#textFlow 属性的对象\n         * @param htmltext {string} html文本\n         * @returns {Array<egret.ITextElement>} 可赋值给 egret.TextField#textFlow 属性的对象\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        parse(htmltext: string): egret.ITextElement[];\n        parser(htmltext: string): Array<egret.ITextElement>;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        private addToResultArr(value);\n        private changeStringToObject(str);\n        /**\n         * @private\n         *\n         * @returns\n         */\n        private getHeadReg();\n        /**\n         * @private\n         *\n         * @param info\n         * @param head\n         * @param value\n         */\n        private addProperty(info, head, value);\n        /**\n         * @private\n         */\n        private stackArray;\n        /**\n         * @private\n         *\n         * @param infoStr\n         */\n        private addToArray(infoStr);\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    interface IHitTextElement {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        lineIndex: number;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        textElementIndex: number;\n    }\n    /**\n     * Text Style\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 文本样式\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface ITextStyle {\n        /**\n         * text color\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @see http://edn.egret.com/cn/docs/page/146 多种样式混合文本的基本结构\n         * @language en_US\n         */\n        /**\n         * 颜色值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @see http://edn.egret.com/cn/docs/page/146 多种样式混合文本的基本结构\n         * @language zh_CN\n         */\n        textColor?: number;\n        /**\n         * stroke color\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 描边颜色值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        strokeColor?: number;\n        /**\n         * size\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 字号\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        size?: number;\n        /**\n         * stroke width\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 描边大小\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        stroke?: number;\n        /**\n         * whether bold\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否加粗\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        bold?: boolean;\n        /**\n         * whether italic\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否倾斜\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        italic?: boolean;\n        /**\n         * fontFamily\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 字体名称\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        fontFamily?: string;\n        /**\n         * Link events or address\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 链接事件或者地址\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        href?: string;\n        /**\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        target?: string;\n        /**\n         * Is underlined\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否加下划线\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        underline?: boolean;\n    }\n    /**\n     * Used to build the basic structure of text with a variety of mixed styles, mainly for setting textFlow property\n     * @see http://edn.egret.com/cn/docs/page/146 Text mixed in a variety of style\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 用于建立多种样式混合文本的基本结构，主要用于设置 textFlow 属性\n     * @see http://edn.egret.com/cn/docs/page/146 多种样式文本混合\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface ITextElement {\n        /**\n         * String Content\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 字符串内容\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        text: string;\n        /**\n         * Text Style\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本样式\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        style?: ITextStyle;\n    }\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    interface IWTextElement extends ITextElement {\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        width: number;\n    }\n    /**\n     * 文本最终解析的一行数据格式\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    interface ILineElement {\n        /**\n         * 文本占用宽度\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        width: number;\n        /**\n         * 文本占用高度\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        height: number;\n        /**\n         * 当前文本字符总数量（包括换行符）\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        charNum: number;\n        /**\n         * 是否含有换行符\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        hasNextLine: boolean;\n        /**\n         * 本行文本内容\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        elements: Array<IWTextElement>;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    class InputController extends HashObject {\n        /**\n         * @private\n         */\n        stageText: egret.StageText;\n        /**\n         * @private\n         */\n        private stageTextAdded;\n        /**\n         * @private\n         */\n        private _text;\n        /**\n         * @private\n         */\n        private _isFocus;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor();\n        /**\n         *\n         * @param text\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        init(text: TextField): void;\n        /**\n         * @private\n         *\n         */\n        _addStageText(): void;\n        /**\n         * @private\n         *\n         */\n        _removeStageText(): void;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        _getText(): string;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        _setText(value: string): void;\n        /**\n         * @private\n         */\n        _setColor(value: number): void;\n        /**\n         * @private\n         *\n         * @param event\n         */\n        private focusHandler(event);\n        /**\n         * @private\n         *\n         * @param event\n         */\n        private blurHandler(event);\n        private tempStage;\n        private onMouseDownHandler(event);\n        $onFocus(): void;\n        private onStageDownHandler(event);\n        /**\n         * @private\n         *\n         * @param event\n         */\n        private updateTextHandler(event);\n        /**\n         * @private\n         *\n         */\n        private resetText();\n        /**\n         * @private\n         *\n         */\n        _hideInput(): void;\n        /**\n         * @private\n         *\n         */\n        private updateInput();\n        /**\n         * @private\n         *\n         */\n        _updateProperties(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    interface StageText extends EventDispatcher {\n        /**\n         * @private\n         */\n        $textfield: egret.TextField;\n        /**\n         * @private\n         *\n         * @param textfield\n         */\n        $setTextField(textfield: egret.TextField): boolean;\n        /**\n         * @private\n         *\n         */\n        $resetStageText(): void;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getText(): string;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setText(value: string): boolean;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setColor(value: number): boolean;\n        /**\n         * @private\n         *\n         */\n        $show(): void;\n        /**\n         * @private\n         *\n         */\n        $hide(): void;\n        /**\n         * @private\n         *\n         */\n        $addToStage(): void;\n        /**\n         * @private\n         *\n         */\n        $removeFromStage(): void;\n        /**\n         * @private\n         *\n         */\n        $onBlur(): void;\n    }\n    /**\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    let StageText: {\n        new (): StageText;\n    };\n}\ndeclare namespace egret.sys {\n    /**\n     * @private\n     */\n    const enum TextKeys {\n        /**\n         * @private\n         */\n        fontSize = 0,\n        /**\n         * @private\n         */\n        lineSpacing = 1,\n        /**\n         * @private\n         */\n        textColor = 2,\n        /**\n         * @private\n         */\n        textFieldWidth = 3,\n        /**\n         * @private\n         */\n        textFieldHeight = 4,\n        /**\n         * @private\n         */\n        textWidth = 5,\n        /**\n         * @private\n         */\n        textHeight = 6,\n        /**\n         * @private\n         */\n        textDrawWidth = 7,\n        /**\n         * @private\n         */\n        fontFamily = 8,\n        /**\n         * @private\n         */\n        textAlign = 9,\n        /**\n         * @private\n         */\n        verticalAlign = 10,\n        /**\n         * @private\n         */\n        textColorString = 11,\n        /**\n         * @private\n         */\n        fontString = 12,\n        /**\n         * @private\n         */\n        text = 13,\n        /**\n         * @private\n         */\n        measuredWidths = 14,\n        /**\n         * @private\n         */\n        bold = 15,\n        /**\n         * @private\n         */\n        italic = 16,\n        /**\n         * @private\n         */\n        fontStringChanged = 17,\n        /**\n         * @private\n         */\n        textLinesChanged = 18,\n        /**\n         * @private\n         */\n        wordWrap = 19,\n        /**\n         * @private\n         */\n        displayAsPassword = 20,\n        /**\n         * @private\n         */\n        maxChars = 21,\n        /**\n         * @private\n         */\n        selectionActivePosition = 22,\n        /**\n         * @private\n         */\n        selectionAnchorPosition = 23,\n        /**\n         * @private\n         */\n        type = 24,\n        /**\n         * @private\n         */\n        strokeColor = 25,\n        /**\n         * @private\n         */\n        strokeColorString = 26,\n        /**\n         * @private\n         */\n        stroke = 27,\n        /**\n         * @private\n         */\n        scrollV = 28,\n        /**\n         * @private\n         */\n        numLines = 29,\n        /**\n         * @private\n         */\n        multiline = 30,\n        /**\n         * @private\n         */\n        border = 31,\n        /**\n         * @private\n         */\n        borderColor = 32,\n        /**\n         * @private\n         */\n        background = 33,\n        /**\n         * @private\n         */\n        backgroundColor = 34,\n        /**\n         * @private\n         */\n        restrictAnd = 35,\n        /**\n         * @private\n         */\n        restrictNot = 36,\n        /**\n         * @private\n         */\n        inputType = 37,\n        /**\n         * @private\n         */\n        textLinesChangedForNativeRender = 38,\n    }\n}\ndeclare namespace egret {\n    /**\n     * TextField is the text rendering class of egret. It conducts rendering by using the browser / device API. Due to different ways of font rendering in different browsers / devices, there may be differences in the rendering\n     * If developers expect  no differences among all platforms, please use BitmapText\n     * @see http://edn.egret.com/cn/docs/page/141 Create Text\n     *\n     * @event egret.Event.CHANGE Dispatched when entering text user input。\n     * @event egret.FocusEvent.FOCUS_IN Dispatched after the focus to enter text.\n     * @event egret.FocusEvent.FOCUS_OUT Enter the text loses focus after dispatch.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/TextField.ts\n     * @language en_US\n     */\n    /**\n     * TextField是egret的文本渲染类，采用浏览器/设备的API进行渲染，在不同的浏览器/设备中由于字体渲染方式不一，可能会有渲染差异\n     * 如果开发者希望所有平台完全无差异，请使用BitmapText\n     * @see http://edn.egret.com/cn/docs/page/141 创建文本\n     *\n     * @event egret.Event.CHANGE 输入文本有用户输入时调度。\n     * @event egret.FocusEvent.FOCUS_IN 聚焦输入文本后调度。\n     * @event egret.FocusEvent.FOCUS_OUT 输入文本失去焦点后调度。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/text/TextField.ts\n     * @language zh_CN\n     */\n    class TextField extends DisplayObject {\n        /**\n         * default fontFamily\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 默认文本字体\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static default_fontFamily: string;\n        /**\n         * default size in pixels of text\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 默认文本字号大小\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static default_size: number;\n        /**\n         * default color of the text.\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 默认文本颜色\n         * @version Egret 3.2.1\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static default_textColor: number;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor();\n        protected createNativeDisplayObject(): void;\n        /**\n         * @private\n         */\n        $TextField: Object;\n        /**\n         * @private\n         */\n        private isInput();\n        $inputEnabled: boolean;\n        $setTouchEnabled(value: boolean): void;\n        /**\n         * The name of the font to use, or a comma-separated list of font names.\n         * @default \"Arial\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 要使用的字体的名称或用逗号分隔的字体名称列表。\n         * @default \"Arial\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        fontFamily: string;\n        $setFontFamily(value: string): boolean;\n        /**\n         * The size in pixels of text\n         * @default 30\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本的字号大小。\n         * @default 30\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        size: number;\n        $setSize(value: number): boolean;\n        /**\n         * Specifies whether the text is boldface.\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否显示为粗体。\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        bold: boolean;\n        $setBold(value: boolean): boolean;\n        /**\n         * Determines whether the text is italic font.\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 是否显示为斜体。\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        italic: boolean;\n        $setItalic(value: boolean): boolean;\n        /**\n         * @private\n         *\n         */\n        private invalidateFontString();\n        /**\n         * Horizontal alignment of text.\n         * @default：egret.HorizontalAlign.LEFT\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本的水平对齐方式。\n         * @default：egret.HorizontalAlign.LEFT\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        textAlign: string;\n        $setTextAlign(value: string): boolean;\n        /**\n         * Vertical alignment of text.\n         * @default：egret.VerticalAlign.TOP\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文字的垂直对齐方式。\n         * @default：egret.VerticalAlign.TOP\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        verticalAlign: string;\n        $setVerticalAlign(value: string): boolean;\n        /**\n         * An integer representing the amount of vertical space between lines.\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个整数，表示行与行之间的垂直间距量\n         * @default 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        lineSpacing: number;\n        $setLineSpacing(value: number): boolean;\n        /**\n         * Color of the text.\n         * @default 0x000000\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本颜色\n         * @default 0x000000\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        textColor: number;\n        $setTextColor(value: number): boolean;\n        /**\n         * A Boolean value that indicates whether the text field word wrap. If the value is true, then the text field by word wrap;\n         * if the value is false, the text field by newline characters.\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 一个布尔值，表示文本字段是否按单词换行。如果值为 true，则该文本字段按单词换行；\n         * 如果值为 false，则该文本字段按字符换行。\n         * @default false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        wordWrap: boolean;\n        $setWordWrap(value: boolean): void;\n        protected inputUtils: InputController;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Type of the text field.\n         * Any one of the following TextFieldType constants: TextFieldType.DYNAMIC (specifies the dynamic text field that users can not edit), or TextFieldType.INPUT (specifies the dynamic text field that users can edit).\n         * @default egret.TextFieldType.DYNAMIC\n         * @language en_US\n         */\n        /**\n         * 文本字段的类型。\n         * 以下 TextFieldType 常量中的任一个：TextFieldType.DYNAMIC（指定用户无法编辑的动态文本字段），或 TextFieldType.INPUT（指定用户可以编辑的输入文本字段）。\n         * @default egret.TextFieldType.DYNAMIC\n         * @language zh_CN\n         */\n        type: string;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setType(value: string): boolean;\n        /**\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         */\n        /**\n         * Pop-up keyboard type.\n         * Any of a TextFieldInputType constants.\n         * @language en_US\n         */\n        /**\n         * 弹出键盘的类型。\n         * TextFieldInputType 常量中的任一个。\n         * @language zh_CN\n         */\n        inputType: string;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Serve as a string of the current text field in the text\n         * @language en_US\n         */\n        /**\n         * 作为文本字段中当前文本的字符串\n         * @language zh_CN\n         */\n        text: string;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getText(): string;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setBaseText(value: string): boolean;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setText(value: string): boolean;\n        /**\n         * Specify whether the text field is a password text field.\n         * If the value of this property is true, the text field is treated as a password text field and hides the input characters using asterisks instead of the actual characters. If false, the text field is not treated as a password text field.\n         * @default false\n         * @language en_US\n         */\n        /**\n         * 指定文本字段是否是密码文本字段。\n         * 如果此属性的值为 true，则文本字段被视为密码文本字段，并使用星号而不是实际字符来隐藏输入的字符。如果为 false，则不会将文本字段视为密码文本字段。\n         * @default false\n         * @language zh_CN\n         */\n        displayAsPassword: boolean;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setDisplayAsPassword(value: boolean): boolean;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Represent the stroke color of the text.\n         * Contain three 8-bit numbers with RGB color components; for example, 0xFF0000 is red, 0x00FF00 is green.\n         * @default 0x000000\n         * @language en_US\n         */\n        /**\n         * 表示文本的描边颜色。\n         * 包含三个 8 位 RGB 颜色成分的数字；例如，0xFF0000 为红色，0x00FF00 为绿色。\n         * @default 0x000000\n         * @language zh_CN\n         */\n        strokeColor: number;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setStrokeColor(value: number): boolean;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Indicate the stroke width.\n         * 0 means no stroke.\n         * @default 0\n         * @language en_US\n         */\n        /**\n         * 表示描边宽度。\n         * 0为没有描边。\n         * @default 0\n         * @language zh_CN\n         */\n        stroke: number;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setStroke(value: number): boolean;\n        /**\n         * The maximum number of characters that the text field can contain, as entered by a user. \\n A script can insert more text than maxChars allows; the maxChars property indicates only how much text a user can enter. If the value of this property is 0, a user can enter an unlimited amount of text.\n         * The default value is 0.\n         * @default 0\n         * @language en_US\n         */\n        /**\n         * 文本字段中最多可包含的字符数（即用户输入的字符数）。\n         * 脚本可以插入比 maxChars 允许的字符数更多的文本；maxChars 属性仅表示用户可以输入多少文本。如果此属性的值为 0，则用户可以输入无限数量的文本。\n         * @default 0\n         * @language zh_CN\n         */\n        maxChars: number;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setMaxChars(value: number): boolean;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Vertical position of text in a text field. scrollV property helps users locate specific passages in a long article, and create scrolling text fields.\n         * Vertically scrolling units are lines, and horizontal scrolling unit is pixels.\n         * If the first displayed line is the first line in the text field, scrollV is set to 1 (instead of 0).\n         * @language en_US\n         */\n        /**\n         * 文本在文本字段中的垂直位置。scrollV 属性可帮助用户定位到长篇文章的特定段落，还可用于创建滚动文本字段。\n         * 垂直滚动的单位是行，而水平滚动的单位是像素。\n         * 如果显示的第一行是文本字段中的第一行，则 scrollV 设置为 1（而非 0）。\n         * @language zh_CN\n         */\n        scrollV: number;\n        /**\n         * The maximum value of scrollV\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * scrollV 的最大值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly maxScrollV: number;\n        /**\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly selectionBeginIndex: number;\n        /**\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly selectionEndIndex: number;\n        /**\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        readonly caretIndex: number;\n        /**\n         * @private\n         *\n         * @param beginIndex\n         * @param endIndex\n         */\n        $setSelection(beginIndex: number, endIndex: number): boolean;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getLineHeight(): number;\n        /**\n         * Number of lines of text.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本行数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly numLines: number;\n        /**\n         * Indicate whether field is a multiline text field. Note that this property is valid only when the type is TextFieldType.INPUT.\n         * If the value is true, the text field is multiline; if the value is false, the text field is a single-line text field. In a field of type TextFieldType.INPUT, the multiline value determines whether the Enter key creates a new line (a value of false, and the Enter key is ignored).\n         * @default false\n         * @language en_US\n         */\n        /**\n         * 表示字段是否为多行文本字段。注意，此属性仅在type为TextFieldType.INPUT时才有效。\n         * 如果值为 true，则文本字段为多行文本字段；如果值为 false，则文本字段为单行文本字段。在类型为 TextFieldType.INPUT 的字段中，multiline 值将确定 Enter 键是否创建新行（如果值为 false，则将忽略 Enter 键）。\n         * @default false\n         * @language zh_CN\n         */\n        multiline: boolean;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setMultiline(value: boolean): boolean;\n        /**\n         * Indicates a user can enter into the text field character set. If you restrict property is null, you can enter any character. If you restrict property is an empty string, you can not enter any character. If you restrict property is a string of characters, you can enter only characters in the string in the text field. The string is scanned from left to right. You can use a hyphen (-) to specify a range. Only restricts user interaction; a script may put any text into the text field. <br/>\n                  * If the string of characters caret (^) at the beginning, all characters are initially accepted, then the string are excluded from receiving ^ character. If the string does not begin with a caret (^) to, any characters are initially accepted and then a string of characters included in the set of accepted characters. <br/>\n                  * The following example allows only uppercase characters, spaces, and numbers in the text field: <br/>\n                  * My_txt.restrict = \"A-Z 0-9\"; <br/>\n                  * The following example includes all characters except lowercase letters: <br/>\n                  * My_txt.restrict = \"^ a-z\"; <br/>\n                  * If you need to enter characters \\ ^, use two backslash \"\\\\ -\" \"\\\\ ^\": <br/>\n                  * Can be used anywhere in the string ^ to rule out including characters and switch between characters, but can only be used to exclude a ^. The following code includes only uppercase letters except uppercase Q: <br/>\n                  * My_txt.restrict = \"A-Z ^ Q\"; <br/>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @default null\n         * @language en_US\n         */\n        /**\n         * 表示用户可输入到文本字段中的字符集。如果 restrict 属性的值为 null，则可以输入任何字符。如果 restrict 属性的值为空字符串，则不能输入任何字符。如果 restrict 属性的值为一串字符，则只能在文本字段中输入该字符串中的字符。从左向右扫描该字符串。可以使用连字符 (-) 指定一个范围。只限制用户交互；脚本可将任何文本放入文本字段中。<br/>\n         * 如果字符串以尖号 (^) 开头，则先接受所有字符，然后从接受字符集中排除字符串中 ^ 之后的字符。如果字符串不以尖号 (^) 开头，则最初不接受任何字符，然后将字符串中的字符包括在接受字符集中。<br/>\n         * 下例仅允许在文本字段中输入大写字符、空格和数字：<br/>\n         * my_txt.restrict = \"A-Z 0-9\";<br/>\n         * 下例包含除小写字母之外的所有字符：<br/>\n         * my_txt.restrict = \"^a-z\";<br/>\n         * 如果需要输入字符 \\ ^，请使用2个反斜杠 \"\\\\-\" \"\\\\^\" ：<br/>\n         * 可在字符串中的任何位置使用 ^，以在包含字符与排除字符之间进行切换，但是最多只能有一个 ^ 用来排除。下面的代码只包含除大写字母 Q 之外的大写字母：<br/>\n         * my_txt.restrict = \"A-Z^Q\";<br/>\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @default null\n         * @language zh_CN\n         */\n        restrict: string;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setWidth(value: number): boolean;\n        /**\n         * @private\n         *\n         * @param value\n         */\n        $setHeight(value: number): boolean;\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        $getWidth(): number;\n        /**\n         * @private\n         * 获取显示宽度\n         */\n        $getHeight(): number;\n        /**\n         * @private\n         */\n        private textNode;\n        /**\n         * @private\n         */\n        $graphicsNode: sys.GraphicsNode;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Specifies whether the text field has a border.\n         * If true, the text field has a border. If false, the text field has no border.\n         * Use borderColor property to set the border color.\n         * @default false\n         * @language en_US\n         */\n        /**\n         * 指定文本字段是否具有边框。\n         * 如果为 true，则文本字段具有边框。如果为 false，则文本字段没有边框。\n         * 使用 borderColor 属性来设置边框颜色。\n         * @default false\n         * @language zh_CN\n         */\n        border: boolean;\n        /**\n         * @private\n         */\n        $setBorder(value: boolean): void;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * The color of the text field border.\n         * Even currently is no border can be retrieved or set this property, but only if the text field has the border property is set to true, the color is visible.\n         * @default 0x000000\n         * @language en_US\n         */\n        /**\n         * 文本字段边框的颜色。\n         * 即使当前没有边框，也可检索或设置此属性，但只有当文本字段已将 border 属性设置为 true 时，才可以看到颜色。\n         * @default 0x000000\n         * @language zh_CN\n         */\n        borderColor: number;\n        /**\n         * @private\n         */\n        $setBorderColor(value: number): void;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Specifies whether the text field has a background fill.\n         * If true, the text field has a background fill. If false, the text field has no background fill.\n         * Use the backgroundColor property to set the background color of the text field.\n         * @default false\n         * @language en_US\n         */\n        /**\n         * 指定文本字段是否具有背景填充。\n         * 如果为 true，则文本字段具有背景填充。如果为 false，则文本字段没有背景填充。\n         * 使用 backgroundColor 属性来设置文本字段的背景颜色。\n         * @default false\n         * @language zh_CN\n         */\n        background: boolean;\n        /**\n         * @private\n         */\n        $setBackground(value: boolean): void;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Color of the text field background.\n         * Even currently is no background, can be retrieved or set this property, but only if the text field has the background property set to true, the color is visible.\n         * @default 0xFFFFFF\n         * @language en_US\n         */\n        /**\n         * 文本字段背景的颜色。\n         * 即使当前没有背景，也可检索或设置此属性，但只有当文本字段已将 background 属性设置为 true 时，才可以看到颜色。\n         * @default 0xFFFFFF\n         * @language zh_CN\n         */\n        backgroundColor: number;\n        /**\n         * @private\n         */\n        $setBackgroundColor(value: number): void;\n        /**\n         * @private\n         *\n         */\n        private fillBackground(lines?);\n        /**\n         * Enter the text automatically entered into the input state, the input type is text only and may only be invoked in the user interaction.\n         * @version Egret 3.0.8\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 输入文本自动进入到输入状态，仅在类型是输入文本并且是在用户交互下才可以调用。\n         * @version Egret 3.0.8\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        setFocus(): void;\n        /**\n         * @private\n         *\n         */\n        $onRemoveFromStage(): void;\n        /**\n         * @private\n         *\n         * @param stage\n         * @param nestLevel\n         */\n        $onAddToStage(stage: Stage, nestLevel: number): void;\n        $invalidateTextField(): void;\n        $getRenderBounds(): Rectangle;\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        $updateRenderNode(): void;\n        /**\n         * @private\n         */\n        private isFlow;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * Set rich text\n         * @language en_US\n         */\n        /**\n         * 设置富文本\n         * @see http://edn.egret.com/cn/index.php/article/index/id/146\n         * @language zh_CN\n         */\n        textFlow: Array<egret.ITextElement>;\n        /**\n         * @private\n         *\n         * @param text\n         * @returns\n         */\n        private changeToPassText(text);\n        /**\n         * @private\n         */\n        private textArr;\n        /**\n         * @private\n         *\n         * @param textArr\n         */\n        private setMiddleStyle(textArr);\n        /**\n         * Get the text measured width\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取文本测量宽度\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly textWidth: number;\n        /**\n         * Get Text measuring height\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取文本测量高度\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly textHeight: number;\n        /**\n         * @private\n         * @param text\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        appendText(text: string): void;\n        /**\n         * @private\n         * @param element\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        appendElement(element: egret.ITextElement): void;\n        /**\n         * @private\n         */\n        private linesArr;\n        $getLinesArr(): Array<egret.ILineElement>;\n        /**\n         * @private\n         *\n         * @returns\n         */\n        $getLinesArr2(): Array<egret.ILineElement>;\n        /**\n         * @private\n         */\n        $isTyping: boolean;\n        /**\n         * @private\n         */\n        $setIsTyping(value: boolean): void;\n        /**\n         * @private\n         * 返回要绘制的下划线列表\n         */\n        private drawText();\n        private addEvent();\n        private removeEvent();\n        private onTapHandler(e);\n    }\n    interface TextField {\n        addEventListener<Z>(type: \"link\", listener: (this: Z, e: TextEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener<Z>(type: \"focusIn\" | \"focusOut\", listener: (this: Z, e: FocusEvent) => void, thisObject: Z, useCapture?: boolean, priority?: number): any;\n        addEventListener(type: string, listener: Function, thisObject: any, useCapture?: boolean, priority?: number): any;\n    }\n}\ndeclare namespace egret {\n    /**\n     * TextFieldInputType class is an enumeration of constant value used in setting the inputType property of the TextField class.\n     * @version Egret 3.1.2\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * TextFieldInputType 类是在设置 TextField 类的 inputType 属性时使用的常数值的枚举。\n     * @version Egret 3.1.2\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class TextFieldInputType {\n        /**\n         * The default\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 默认 input 类型\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TEXT: string;\n        /**\n         * Telephone Number Inputs\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 电话号码 input 类型\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TEL: string;\n        /**\n         * Password Inputs\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * password 类型\n         * @version Egret 3.1.2\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static PASSWORD: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * TextFieldType class is an enumeration of constant value used in setting the type property of the TextField class.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * TextFieldType 类是在设置 TextField 类的 type 属性时使用的常数值的枚举。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class TextFieldType {\n        /**\n         * Used to specify dynamic text\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于指定动态文本\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static DYNAMIC: string;\n        /**\n         * Used to specify the input text\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 用于指定输入文本\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static INPUT: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @private\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    class TextFieldUtils {\n        /**\n         * 获取第一个绘制的行数\n         * @param textfield 文本\n         * @returns {number} 行数，从0开始\n         * @private\n         */\n        static $getStartLine(textfield: egret.TextField): number;\n        /**\n         * 获取水平比例\n         * @param textfield 文本\n         * @returns {number} 水平比例\n         * @private\n         */\n        static $getHalign(textfield: egret.TextField): number;\n        /**\n         * @private\n         *\n         * @param textfield\n         * @returns\n         */\n        static $getTextHeight(textfield: egret.TextField): number;\n        /**\n         * 获取垂直比例\n         * @param textfield 文本\n         * @returns {number} 垂直比例\n         * @private\n         */\n        static $getValign(textfield: egret.TextField): number;\n        /**\n         * 根据x、y获取文本项\n         * @param textfield 文本\n         * @param x x坐标值\n         * @param y y坐标值\n         * @returns 文本单项\n         * @private\n         */\n        static $getTextElement(textfield: egret.TextField, x: number, y: number): ITextElement;\n        /**\n         * 获取文本点击块\n         * @param textfield 文本\n         * @param x x坐标值\n         * @param y y坐标值\n         * @returns 文本点击块\n         * @private\n         */\n        static $getHit(textfield: egret.TextField, x: number, y: number): IHitTextElement;\n        /**\n         * 获取当前显示多少行\n         * @param textfield 文本\n         * @returns {number} 显示的行数\n         * @private\n         */\n        static $getScrollNum(textfield: egret.TextField): number;\n    }\n}\n/**\n * @private\n */\ndeclare namespace egret.sys {\n    /**\n     * 测量文本在指定样式下的宽度。\n     * @param text 要测量的文本内容。\n     * @param fontFamily 字体名称\n     * @param fontSize 字体大小\n     * @param bold 是否粗体\n     * @param italic 是否斜体\n     */\n    let measureText: (text: string, fontFamily: string, fontSize: number, bold: boolean, italic: boolean) => number;\n}\ndeclare namespace egret {\n    /**\n     * The VerticalAlign class defines the possible values for the vertical alignment.\n     * @see egret.TextField#verticalAlign\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * VerticalAlign 类为垂直对齐方式定义可能的值。\n     * @see egret.TextField#verticalAlign\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class VerticalAlign {\n        /**\n         * Vertically align content to the top of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将内容与容器的顶部对齐。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static TOP: string;\n        /**\n         * Vertically align content to the bottom of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将内容与容器的底部对齐。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static BOTTOM: string;\n        /**\n         * Vertically align content in the middle of the container.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在容器的垂直中心对齐内容。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static MIDDLE: string;\n        /**\n         * Vertical alignment with both edges\n         * Note: TextFiled does not support this alignment method.\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 垂直两端对齐\n         * 注意：TextFiled不支持此对齐方式。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static JUSTIFY: string;\n        /**\n         * Align the content of the child items, relative to the container. This operation will adjust uniformly the size of all the child items to be the Content Height \\\" of the container \\\".\n         * The Content Height \\\" of the container \\\" is the size of the max. child item. If the size of all child items are less than the height of the container, they will be adjusted to the height of the container.\n         * Note: TextFiled does not support this alignment method.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 相对于容器对子项进行内容对齐。这会将所有子项的大小统一调整为容器的\"内容高度\"。\n         * 容器的\"内容高度\"是最大子项的大小,如果所有子项都小于容器的高度，则会将所有子项的大小调整为容器的高度。\n         * 注意：TextFiled不支持此对齐方式。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static CONTENT_JUSTIFY: string;\n    }\n}\ndeclare namespace egret {\n    /**\n    * @language en_US\n    * The Base64Util class provides methods for encoding and decoding base64.\n    * @version Egret 2.4\n    * @platform Web,Native\n    * @includeExample egret/utils/Base64Util.ts\n    */\n    /**\n     * @language zh_CN\n     * Base64Util 类提供用于编解码base64的方法。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/Base64Util.ts\n     */\n    class Base64Util {\n        /**\n         * @language en_US\n         * encode base64.\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * @language zh_CN\n         * 编码base64。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static encode(arraybuffer: ArrayBuffer): string;\n        /**\n         * @language en_US\n         * decode base64.\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * @language zh_CN\n         * 解码base64。\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        static decode(base64: string): ArrayBuffer;\n    }\n}\n/**\n * @private\n */\ndeclare let chars: string;\n/**\n * @private\n */\ndeclare let lookup: Uint8Array;\ndeclare namespace egret {\n    /**\n     * The Endian class contains values that denote the byte order used to represent multibyte numbers.\n     * The byte order is either bigEndian (most significant byte first) or littleEndian (least significant byte first).\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * Endian 类中包含一些值，它们表示用于表示多字节数字的字节顺序。\n     * 字节顺序为 bigEndian（最高有效字节位于最前）或 littleEndian（最低有效字节位于最前）。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class Endian {\n        /**\n         * Indicates the least significant byte of the multibyte number appears first in the sequence of bytes.\n         * The hexadecimal number 0x12345678 has 4 bytes (2 hexadecimal digits per byte). The most significant byte is 0x12. The least significant byte is 0x78. (For the equivalent decimal number, 305419896, the most significant digit is 3, and the least significant digit is 6).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示多字节数字的最低有效字节位于字节序列的最前面。\n         * 十六进制数字 0x12345678 包含 4 个字节（每个字节包含 2 个十六进制数字）。最高有效字节为 0x12。最低有效字节为 0x78。（对于等效的十进制数字 305419896，最高有效数字是 3，最低有效数字是 6）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static LITTLE_ENDIAN: string;\n        /**\n         * Indicates the most significant byte of the multibyte number appears first in the sequence of bytes.\n         * The hexadecimal number 0x12345678 has 4 bytes (2 hexadecimal digits per byte).  The most significant byte is 0x12. The least significant byte is 0x78. (For the equivalent decimal number, 305419896, the most significant digit is 3, and the least significant digit is 6).\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 表示多字节数字的最高有效字节位于字节序列的最前面。\n         * 十六进制数字 0x12345678 包含 4 个字节（每个字节包含 2 个十六进制数字）。最高有效字节为 0x12。最低有效字节为 0x78。（对于等效的十进制数字 305419896，最高有效数字是 3，最低有效数字是 6）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static BIG_ENDIAN: string;\n    }\n    const enum EndianConst {\n        LITTLE_ENDIAN = 0,\n        BIG_ENDIAN = 1,\n    }\n    /**\n     * The ByteArray class provides methods and attributes for optimized reading and writing as well as dealing with binary data.\n     * Note: The ByteArray class is applied to the advanced developers who need to access data at the byte layer.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/ByteArray.ts\n     * @language en_US\n     */\n    /**\n     * ByteArray 类提供用于优化读取、写入以及处理二进制数据的方法和属性。\n     * 注意：ByteArray 类适用于需要在字节层访问数据的高级开发人员。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/ByteArray.ts\n     * @language zh_CN\n     */\n    class ByteArray {\n        /**\n         * @private\n         */\n        protected bufferExtSize: number;\n        protected data: DataView;\n        protected _bytes: Uint8Array;\n        /**\n         * @private\n         */\n        protected _position: number;\n        /**\n         *\n         * 已经使用的字节偏移量\n         * @protected\n         * @type {number}\n         * @memberOf ByteArray\n         */\n        protected write_position: number;\n        /**\n         * Changes or reads the byte order; egret.EndianConst.BIG_ENDIAN or egret.EndianConst.LITTLE_EndianConst.\n         * @default egret.EndianConst.BIG_ENDIAN\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 更改或读取数据的字节顺序；egret.EndianConst.BIG_ENDIAN 或 egret.EndianConst.LITTLE_ENDIAN。\n         * @default egret.EndianConst.BIG_ENDIAN\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        endian: string;\n        protected $endian: EndianConst;\n        /**\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        constructor(buffer?: ArrayBuffer | Uint8Array, bufferExtSize?: number);\n        /**\n         * @deprecated\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        setArrayBuffer(buffer: ArrayBuffer): void;\n        /**\n         * 可读的剩余字节数\n         *\n         * @returns\n         *\n         * @memberOf ByteArray\n         */\n        readonly readAvailable: number;\n        /**\n         * @private\n         */\n        buffer: ArrayBuffer;\n        readonly rawBuffer: ArrayBuffer;\n        readonly bytes: Uint8Array;\n        /**\n         * @private\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        /**\n         * @private\n         */\n        dataView: DataView;\n        /**\n         * @private\n         */\n        readonly bufferOffset: number;\n        /**\n         * The current position of the file pointer (in bytes) to move or return to the ByteArray object. The next time you start reading reading method call in this position, or will start writing in this position next time call a write method.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将文件指针的当前位置（以字节为单位）移动或返回到 ByteArray 对象中。下一次调用读取方法时将在此位置开始读取，或者下一次调用写入方法时将在此位置开始写入。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        position: number;\n        /**\n         * The length of the ByteArray object (in bytes).\n                  * If the length is set to be larger than the current length, the right-side zero padding byte array.\n                  * If the length is set smaller than the current length, the byte array is truncated.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * ByteArray 对象的长度（以字节为单位）。\n         * 如果将长度设置为大于当前长度的值，则用零填充字节数组的右侧。\n         * 如果将长度设置为小于当前长度的值，将会截断该字节数组。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        length: number;\n        protected _validateBuffer(value: number): void;\n        /**\n         * The number of bytes that can be read from the current position of the byte array to the end of the array data.\n         * When you access a ByteArray object, the bytesAvailable property in conjunction with the read methods each use to make sure you are reading valid data.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 可从字节数组的当前位置到数组末尾读取的数据的字节数。\n         * 每次访问 ByteArray 对象时，将 bytesAvailable 属性与读取方法结合使用，以确保读取有效的数据。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly bytesAvailable: number;\n        /**\n         * Clears the contents of the byte array and resets the length and position properties to 0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 清除字节数组的内容，并将 length 和 position 属性重置为 0。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        clear(): void;\n        /**\n         * Read a Boolean value from the byte stream. Read a simple byte. If the byte is non-zero, it returns true; otherwise, it returns false.\n         * @return If the byte is non-zero, it returns true; otherwise, it returns false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取布尔值。读取单个字节，如果字节非零，则返回 true，否则返回 false\n         * @return 如果字节不为零，则返回 true，否则返回 false\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readBoolean(): boolean;\n        /**\n         * Read signed bytes from the byte stream.\n         * @return An integer ranging from -128 to 127\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取带符号的字节\n         * @return 介于 -128 和 127 之间的整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readByte(): number;\n        /**\n         * Read data byte number specified by the length parameter from the byte stream. Starting from the position specified by offset, read bytes into the ByteArray object specified by the bytes parameter, and write bytes into the target ByteArray\n         * @param bytes ByteArray object that data is read into\n         * @param offset Offset (position) in bytes. Read data should be written from this position\n         * @param length Byte number to be read Default value 0 indicates reading all available data\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取 length 参数指定的数据字节数。从 offset 指定的位置开始，将字节读入 bytes 参数指定的 ByteArray 对象中，并将字节写入目标 ByteArray 中\n         * @param bytes 要将数据读入的 ByteArray 对象\n         * @param offset bytes 中的偏移（位置），应从该位置写入读取的数据\n         * @param length 要读取的字节数。默认值 0 导致读取所有可用的数据\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readBytes(bytes: ByteArray, offset?: number, length?: number): void;\n        /**\n         * Read an IEEE 754 double-precision (64 bit) floating point number from the byte stream\n         * @return Double-precision (64 bit) floating point number\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个 IEEE 754 双精度（64 位）浮点数\n         * @return 双精度（64 位）浮点数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readDouble(): number;\n        /**\n         * Read an IEEE 754 single-precision (32 bit) floating point number from the byte stream\n         * @return Single-precision (32 bit) floating point number\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个 IEEE 754 单精度（32 位）浮点数\n         * @return 单精度（32 位）浮点数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readFloat(): number;\n        /**\n         * Read a 32-bit signed integer from the byte stream.\n         * @return A 32-bit signed integer ranging from -2147483648 to 2147483647\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个带符号的 32 位整数\n         * @return 介于 -2147483648 和 2147483647 之间的 32 位带符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readInt(): number;\n        /**\n         * Read a 16-bit signed integer from the byte stream.\n         * @return A 16-bit signed integer ranging from -32768 to 32767\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个带符号的 16 位整数\n         * @return 介于 -32768 和 32767 之间的 16 位带符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readShort(): number;\n        /**\n         * Read unsigned bytes from the byte stream.\n         * @return A unsigned integer ranging from 0 to 255\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取无符号的字节\n         * @return 介于 0 和 255 之间的无符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readUnsignedByte(): number;\n        /**\n         * Read a 32-bit unsigned integer from the byte stream.\n         * @return A 32-bit unsigned integer ranging from 0 to 4294967295\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个无符号的 32 位整数\n         * @return 介于 0 和 4294967295 之间的 32 位无符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readUnsignedInt(): number;\n        /**\n         * Read a 16-bit unsigned integer from the byte stream.\n         * @return A 16-bit unsigned integer ranging from 0 to 65535\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个无符号的 16 位整数\n         * @return 介于 0 和 65535 之间的 16 位无符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readUnsignedShort(): number;\n        /**\n         * Read a UTF-8 character string from the byte stream Assume that the prefix of the character string is a short unsigned integer (use byte to express length)\n         * @return UTF-8 character string\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个 UTF-8 字符串。假定字符串的前缀是无符号的短整型（以字节表示长度）\n         * @return UTF-8 编码的字符串\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readUTF(): string;\n        /**\n         * Read a UTF-8 byte sequence specified by the length parameter from the byte stream, and then return a character string\n         * @param Specify a short unsigned integer of the UTF-8 byte length\n         * @return A character string consists of UTF-8 bytes of the specified length\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 从字节流中读取一个由 length 参数指定的 UTF-8 字节序列，并返回一个字符串\n         * @param length 指明 UTF-8 字节长度的无符号短整型数\n         * @return 由指定长度的 UTF-8 字节组成的字符串\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readUTFBytes(length: number): string;\n        /**\n         * Write a Boolean value. A single byte is written according to the value parameter. If the value is true, write 1; if the value is false, write 0.\n         * @param value A Boolean value determining which byte is written. If the value is true, write 1; if the value is false, write 0.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 写入布尔值。根据 value 参数写入单个字节。如果为 true，则写入 1，如果为 false，则写入 0\n         * @param value 确定写入哪个字节的布尔值。如果该参数为 true，则该方法写入 1；如果该参数为 false，则该方法写入 0\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeBoolean(value: boolean): void;\n        /**\n         * Write a byte into the byte stream\n         * The low 8 bits of the parameter are used. The high 24 bits are ignored.\n         * @param value A 32-bit integer. The low 8 bits will be written into the byte stream\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个字节\n         * 使用参数的低 8 位。忽略高 24 位\n         * @param value 一个 32 位整数。低 8 位将被写入字节流\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeByte(value: number): void;\n        /**\n         * Write the byte sequence that includes length bytes in the specified byte array, bytes, (starting at the byte specified by offset, using a zero-based index), into the byte stream\n         * If the length parameter is omitted, the default length value 0 is used and the entire buffer starting at offset is written. If the offset parameter is also omitted, the entire buffer is written\n         * If the offset or length parameter is out of range, they are clamped to the beginning and end of the bytes array.\n         * @param bytes ByteArray Object\n         * @param offset A zero-based index specifying the position into the array to begin writing\n         * @param length An unsigned integer specifying how far into the buffer to write\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将指定字节数组 bytes（起始偏移量为 offset，从零开始的索引）中包含 length 个字节的字节序列写入字节流\n         * 如果省略 length 参数，则使用默认长度 0；该方法将从 offset 开始写入整个缓冲区。如果还省略了 offset 参数，则写入整个缓冲区\n         * 如果 offset 或 length 超出范围，它们将被锁定到 bytes 数组的开头和结尾\n         * @param bytes ByteArray 对象\n         * @param offset 从 0 开始的索引，表示在数组中开始写入的位置\n         * @param length 一个无符号整数，表示在缓冲区中的写入范围\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeBytes(bytes: ByteArray, offset?: number, length?: number): void;\n        /**\n         * Write an IEEE 754 double-precision (64 bit) floating point number into the byte stream\n         * @param value Double-precision (64 bit) floating point number\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个 IEEE 754 双精度（64 位）浮点数\n         * @param value 双精度（64 位）浮点数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeDouble(value: number): void;\n        /**\n         * Write an IEEE 754 single-precision (32 bit) floating point number into the byte stream\n         * @param value Single-precision (32 bit) floating point number\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个 IEEE 754 单精度（32 位）浮点数\n         * @param value 单精度（32 位）浮点数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeFloat(value: number): void;\n        /**\n         * Write a 32-bit signed integer into the byte stream\n         * @param value An integer to be written into the byte stream\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个带符号的 32 位整数\n         * @param value 要写入字节流的整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeInt(value: number): void;\n        /**\n         * Write a 16-bit integer into the byte stream. The low 16 bits of the parameter are used. The high 16 bits are ignored.\n         * @param value A 32-bit integer. Its low 16 bits will be written into the byte stream\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个 16 位整数。使用参数的低 16 位。忽略高 16 位\n         * @param value 32 位整数，该整数的低 16 位将被写入字节流\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeShort(value: number): void;\n        /**\n         * Write a 32-bit unsigned integer into the byte stream\n         * @param value An unsigned integer to be written into the byte stream\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个无符号的 32 位整数\n         * @param value 要写入字节流的无符号整数\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeUnsignedInt(value: number): void;\n        /**\n         * Write a 16-bit unsigned integer into the byte stream\n         * @param value An unsigned integer to be written into the byte stream\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 在字节流中写入一个无符号的 16 位整数\n         * @param value 要写入字节流的无符号整数\n         * @version Egret 2.5\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeUnsignedShort(value: number): void;\n        /**\n         * Write a UTF-8 string into the byte stream. The length of the UTF-8 string in bytes is written first, as a 16-bit integer, followed by the bytes representing the characters of the string\n         * @param value Character string value to be written\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 UTF-8 字符串写入字节流。先写入以字节表示的 UTF-8 字符串长度（作为 16 位整数），然后写入表示字符串字符的字节\n         * @param value 要写入的字符串值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeUTF(value: string): void;\n        /**\n         * Write a UTF-8 string into the byte stream. Similar to the writeUTF() method, but the writeUTFBytes() method does not prefix the string with a 16-bit length word\n         * @param value Character string value to be written\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 将 UTF-8 字符串写入字节流。类似于 writeUTF() 方法，但 writeUTFBytes() 不使用 16 位长度的词为字符串添加前缀\n         * @param value 要写入的字符串值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        writeUTFBytes(value: string): void;\n        /**\n         *\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         */\n        toString(): string;\n        /**\n         * @private\n         * 将 Uint8Array 写入字节流\n         * @param bytes 要写入的Uint8Array\n         * @param validateBuffer\n         */\n        _writeUint8Array(bytes: Uint8Array | ArrayLike<number>, validateBuffer?: boolean): void;\n        /**\n         * @param len\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @private\n         */\n        validate(len: number): boolean;\n        /**********************/\n        /**********************/\n        /**\n         * @private\n         * @param len\n         * @param needReplace\n         */\n        protected validateBuffer(len: number): void;\n        /**\n         * @private\n         * UTF-8 Encoding/Decoding\n         */\n        private encodeUTF8(str);\n        /**\n         * @private\n         *\n         * @param data\n         * @returns\n         */\n        private decodeUTF8(data);\n        /**\n         * @private\n         *\n         * @param code_point\n         */\n        private encoderError(code_point);\n        /**\n         * @private\n         *\n         * @param fatal\n         * @param opt_code_point\n         * @returns\n         */\n        private decoderError(fatal, opt_code_point?);\n        /**\n         * @private\n         */\n        private EOF_byte;\n        /**\n         * @private\n         */\n        private EOF_code_point;\n        /**\n         * @private\n         *\n         * @param a\n         * @param min\n         * @param max\n         */\n        private inRange(a, min, max);\n        /**\n         * @private\n         *\n         * @param n\n         * @param d\n         */\n        private div(n, d);\n        /**\n         * @private\n         *\n         * @param string\n         */\n        private stringToCodePoints(string);\n    }\n}\ndeclare namespace egret {\n    /**\n     * The Sprite class is a basic display list building block: a display list node that can contain children.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Sprite.ts\n     * @language en_US\n     */\n    /**\n     * Sprite 类是基本显示列表构造块：一个可包含子项的显示列表节点。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/Sprite.ts\n     * @language zh_CN\n     */\n    class Sprite extends DisplayObjectContainer {\n        /**\n         * Creates a new Sprite instance.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 实例化一个容器\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor();\n        protected createNativeDisplayObject(): void;\n        /**\n         * @private\n         */\n        $graphics: Graphics;\n        /**\n         * Specifies the Graphics object belonging to this Shape object, where vector drawing commands can occur.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 获取 Shape 中的 Graphics 对象。可通过此对象执行矢量绘图命令。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly graphics: Graphics;\n        $hitTest(stageX: number, stageY: number): DisplayObject;\n        /**\n         * @private\n         */\n        $measureContentBounds(bounds: Rectangle): void;\n        /**\n         * @private\n         */\n        $onRemoveFromStage(): void;\n    }\n}\ndeclare namespace egret {\n    /**\n     * Registers the runtime class information for a class.This method adds some strings which represent the class name or\n     * some interface names to the class definition. After the registration,you can use egret.is() method to do the type checking\n     * for the instance of this class.<br/>\n     * Note:If you use the TypeScript programming language, the egret command line tool will automatically generate the registration code line.\n     * You don't need to manually call this method.\n     *\n     * @example the following code shows how to register the runtime class information for the EventDispatcher class and do the type checking:\n     * <pre>\n     *      egret.registerClass(egret.EventDispatcher,\"egret.EventDispatcher\",[\"egret.IEventDispatcher\"]);\n     *      let dispatcher = new egret.EventDispatcher();\n     *      egret.log(egret.is(dispatcher, \"egret.IEventDispatcher\"));  //true。\n     *      egret.log(egret.is(dispatcher, \"egret.EventDispatcher\"));   //true。\n     *      egret.log(egret.is(dispatcher, \"egret.Bitmap\"));   //false。\n     * </pre>\n     * @param classDefinition the class definition to be registered.\n     * @param className  a unique identification string of the specific class\n     * @param interfaceNames a list of unique identification string of the specific interfaces.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 为一个类定义注册运行时类信息,用此方法往类定义上注册它自身以及所有接口对应的字符串。\n     * 在运行时，这个类的实例将可以使用 egret.is() 方法传入一个字符串来判断实例类型。\n     * @example 以下代码演示了如何为EventDispatcher类注册运行时类信息并判断类型：\n     * <pre>\n     *      //为egret.EventDispatcher类注册运行时类信息，由于它实现了IEventDispatcher接口，这里应同时传入接口名对应的字符串。\n     *      egret.registerClass(egret.EventDispatcher,\"egret.EventDispatcher\",[\"egret.IEventDispatcher\"]);\n     *      let dispatcher = new egret.EventDispatcher();\n     *      egret.log(egret.is(dispatcher, \"egret.IEventDispatcher\"));  //true。\n     *      egret.log(egret.is(dispatcher, \"egret.EventDispatcher\"));   //true。\n     *      egret.log(egret.is(dispatcher, \"egret.Bitmap\"));   //false。\n     * </pre>\n     * 注意：若您使用 TypeScript 来编写程序，egret 命令行会自动帮您生成类信息注册代码行到最终的 Javascript 文件中。因此您不需要手动调用此方法。\n     *\n     * @param classDefinition 要注册的类定义。\n     * @param className 要注册的类名。\n     * @param interfaceNames 要注册的类所实现的接口名列表。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function registerClass(classDefinition: any, className: string, interfaceNames?: string[]): void;\n}\ndeclare namespace egret {\n    /**\n     * The BitmapFillMode class defines the image fill mode of Bitmap.\n     * The BitmapFillMode class defines a pattern enumeration for adjusting size. These patterns determine how Bitmap fill the size designated by the layout system.\n     * @see http://edn.egret.com/cn/docs/page/134 Texture filling way\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/BitmapFillMode.ts\n     * @language en_US\n     */\n    /**\n     * BitmapFillMode 类定义Bitmap的图像填充方式。\n     * BitmapFillMode 类定义了调整大小模式的一个枚举，这些模式确定 Bitmap 如何填充由布局系统指定的尺寸。\n     * @see http://edn.egret.com/cn/docs/page/134 纹理的填充方式\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/display/BitmapFillMode.ts\n     * @language zh_CN\n     */\n    const BitmapFillMode: {\n        REPEAT: string;\n        SCALE: string;\n        CLIP: string;\n    };\n}\ndeclare namespace egret {\n    /**\n     * Logger is an entrance for the log processing namespace of the engine\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * Logger是引擎的日志处理模块入口\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    class Logger {\n        /**\n         * open all\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 全开\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ALL: string;\n        /**\n         * level: DEBUG\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等级为 DEBUG\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static DEBUG: string;\n        /**\n         * level: INFO\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等级为 INFO\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static INFO: string;\n        /**\n         * level: WARN\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等级为 WARN\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static WARN: string;\n        /**\n         * level: ERROR\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 等级为 ERROR\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static ERROR: string;\n        /**\n         * close all\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 全关\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static OFF: string;\n        /**\n         * Set the current need to open the log level. Grade level are: ALL <DEBUG <INFO <WARN <ERROR <OFF<br/>\n         * This feature is only in DEBUG mode to take effect. <br/>\n         * <Ul>\n         * <Li> Logger.ALL - all levels of log can be printed out. </ li>\n         * <Li> Logger.DEBUG - print debug, info, log, warn, error. </ li>\n         * <Li> Logger.INFO - print info, log, warn, error. </ li>\n         * <Li> Logger.WARN - can print warn, error. </ li>\n         * <Li> Logger.ERROR - You can print error. </ li>\n         * <Li> Logger.OFF - all closed. </ li>\n         * </ Ul>\n         *param LogType from this level to start printing.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置当前需要开启的log级别。级别等级分别为：ALL < DEBUG < INFO < WARN < ERROR < OFF<br/>\n         * 此功能只在 DEBUG 模式下才生效。<br/>\n         * <ul>\n         * <li>Logger.ALL -- 所有等级的log都可以打印出来。</li>\n         * <li>Logger.DEBUG -- 可以打印debug、info、log、warn、error。</li>\n         * <li>Logger.INFO -- 可以打印info、log、warn、error。</li>\n         * <li>Logger.WARN -- 可以打印warn、error。</li>\n         * <li>Logger.ERROR -- 可以打印error。</li>\n         * <li>Logger.OFF -- 全部关闭。</li>\n         * </ul>\n         * @param logType 从这个等级开始打印。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static logLevel: string;\n    }\n}\ndeclare namespace egret {\n    /**\n     * @version Egret 2.4\n     * @platform Web,Native\n     */\n    class NumberUtils {\n        /**\n         * Judge whether it is a numerical value\n         * @param value Parameter that needs to be judged\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 判断是否是数值\n         * @param value 需要判断的参数\n         * @returns\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static isNumber(value: any): boolean;\n        /**\n         * Obtain the approximate sin value of the corresponding angle value\n         * @param value {number} Angle value\n         * @returns {number} sin value\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 得到对应角度值的sin近似值\n         * @param value {number} 角度值\n         * @returns {number} sin值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static sin(value: number): number;\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        private static sinInt(value);\n        /**\n         * Obtain the approximate cos value of the corresponding angle value\n         * @param value {number} Angle value\n         * @returns {number} cos value\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 得到对应角度值的cos近似值\n         * @param value {number} 角度值\n         * @returns {number} cos值\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        static cos(value: number): number;\n        /**\n         * @private\n         *\n         * @param value\n         * @returns\n         */\n        private static cosInt(value);\n        static convertStringToHashCode(str: string): number;\n    }\n}\n/**\n * @private\n */\ndeclare let egret_sin_map: {};\n/**\n * @private\n */\ndeclare let egret_cos_map: {};\n/**\n * @private\n */\ndeclare let DEG_TO_RAD: number;\ndeclare namespace egret {\n    /**\n     * The Timer class is the interface to timers, which let you run code on a specified time sequence. Use the start()\n     * method to start a timer. Add an event listener for the timer event to set up code to be run on the timer interval.<br/>\n     * You can create Timer objects to run once or repeat at specified intervals to execute code on a schedule. Depending\n     * on the framerate or the runtime environment (available memory and other factors), the runtime may dispatchEvent events at\n     * slightly offset intervals.\n     * @see egret.TimerEvent\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/Timer.ts\n     * @language en_US\n     */\n    /**\n     * Timer 类是计时器的接口，它使您能按指定的时间序列运行代码。\n     * 使用 start() 方法来启动计时器。为 timer 事件添加事件侦听器，以便将代码设置为按计时器间隔运行。\n     * 可以创建 Timer 对象以运行一次或按指定间隔重复运行，从而按计划执行代码。\n     * 根据 Egret 的帧速率或运行时环境（可用内存和其他因素），运行时调度事件的间隔可能稍有不同。\n     * @see egret.TimerEvent\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/Timer.ts\n     * @language zh_CN\n     */\n    class Timer extends EventDispatcher {\n        /**\n         * Constructs a new Timer object with the specified delay and repeatCount states.\n         * @param delay The delay between timer events, in milliseconds. A delay lower than 20 milliseconds is not recommended.\n         * Timer frequency is limited to 60 frames per second, meaning a delay lower than 16.6 milliseconds causes runtime problems.\n         * @param repeatCount Specifies the number of repetitions. If zero, the timer repeats indefinitely.If nonzero,\n         * the timer runs the specified number of times and then stops.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 使用指定的 delay 和 repeatCount 状态构造新的 Timer 对象。\n         * @param delay 计时器事件间的延迟（以毫秒为单位）。建议 delay 不要低于 20 毫秒。计时器频率不得超过 60 帧/秒，这意味着低于 16.6 毫秒的延迟可导致出现运行时问题。\n         * @param repeatCount 指定重复次数。如果为零，则计时器将持续不断重复运行。如果不为 0，则将运行计时器，运行次数为指定的次数，然后停止。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        constructor(delay: number, repeatCount?: number);\n        /**\n         * @private\n         */\n        private _delay;\n        /**\n         * The delay between timer events, in milliseconds. A delay lower than 20 milliseconds is not recommended.<br/>\n         * Note: Timer frequency is limited to 60 frames per second, meaning a delay lower than 16.6 milliseconds causes runtime problems.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 计时器事件间的延迟（以毫秒为单位）。如果在计时器正在运行时设置延迟间隔，则计时器将按相同的 repeatCount 迭代重新启动。<br/>\n         * 注意：建议 delay 不要低于 20 毫秒。计时器频率不得超过 60 帧/秒，这意味着低于 16.6 毫秒的延迟可导致出现运行时问题。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        delay: number;\n        /**\n         * The total number of times the timer is set to run. If the repeat count is set to 0, the timer continues indefinitely,\n         * until the stop() method is invoked or the program stops. If the repeat count is nonzero, the timer runs the specified\n         * number of times. If repeatCount is set to a total that is the same or less then currentCount the timer stops and will not fire again.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 设置的计时器运行总次数。如果重复计数设置为 0，则计时器将持续不断运行，或直至调用了 stop() 方法或节目停止。\n         * 如果重复计数不为 0，则将运行计时器，运行次数为指定的次数。如果设置的 repeatCount 总数等于或小于 currentCount，则计时器将停止并且不会再次触发。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        repeatCount: number;\n        /**\n         * @private\n         */\n        private _currentCount;\n        /**\n         * The total number of times the timer has fired since it started at zero. If the timer has been reset, only the fires since the reset are counted.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 计时器从 0 开始后触发的总次数。如果已重置了计时器，则只会计入重置后的触发次数。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly currentCount: number;\n        /**\n         * @private\n         */\n        private _running;\n        /**\n         * The timer's current state; true if the timer is running, otherwise false.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 计时器的当前状态；如果计时器正在运行，则为 true，否则为 false。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        readonly running: boolean;\n        /**\n         * Stops the timer, if it is running, and sets the currentCount property back to 0, like the reset button of a stopwatch.\n         * Then, when start() is called, the timer instance runs for the specified number of repetitions, as set by the repeatCount value.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果计时器正在运行，则停止计时器，并将 currentCount 属性设回为 0，这类似于秒表的重置按钮。然后，在调用 start() 后，将运行计时器实例，运行次数为指定的重复次数（由 repeatCount 值设置）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        reset(): void;\n        /**\n         * Starts the timer, if it is not already running.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 如果计时器尚未运行，则启动计时器。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        start(): void;\n        /**\n         * Stops the timer. When start() is called after stop(), the timer instance runs for the remaining number of\n         * repetitions, as set by the repeatCount property.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 停止计时器。如果在调用 stop() 后调用 start()，则将继续运行计时器实例，运行次数为剩余的 重复次数（由 repeatCount 属性设置）。\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        stop(): void;\n        /**\n         * @private\n         */\n        private updateInterval;\n        /**\n         * @private\n         */\n        private lastCount;\n        /**\n         * @private\n         */\n        private lastTimeStamp;\n        /**\n         * @private\n         * Ticker以60FPS频率刷新此方法\n         */\n        $update(timeStamp: number): boolean;\n    }\n}\ndeclare namespace egret {\n    /**\n     * The XMLNode class is the base class for all xml node.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * XML节点基类\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface XMLNode {\n        /**\n         * a integer representing the type of the node, 1：XML，2：XMLAttribute，3：XMLText\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 节点类型，1：XML，2：XMLAttribute，3：XMLText\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        nodeType: number;\n        /**\n         * the parent node of this xml node.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 节点所属的父级节点\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        parent: XML;\n    }\n    /**\n     * The XML class contains properties for working with XML objects.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/XML.ts\n     * @language en_US\n     */\n    /**\n     * XML 类包含用于处理 XML 对象的属性。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/XML.ts\n     * @language zh_CN\n     */\n    interface XML extends XMLNode {\n        /**\n         * the attributes of this xml node.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当前节点上的属性列表\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        attributes: any;\n        /**\n         * the children of the xml node.\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 当前节点的子节点列表\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        children: XMLNode[];\n        /**\n         * the full name of this xml node. For example,the name of <s:Button/> is \"s:Button\".\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 节点完整名称。例如节点 <s:Button/> 的 name 为：\"s:Button\"\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        name: string;\n        /**\n         * thie namesapce prefix of this xml node.For example,the prefix of <s:Button/> is \"s\".\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 节点的命名空间前缀。例如节点 <s:Button/> 的 prefix 为：s\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        prefix: string;\n        /**\n         * the local name of this xml node. For example,the local name of <s:Button/> is \"Button\".\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 节点的本地名称。例如节点 <s:Button/> 的 localName 为：Button\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        localName: string;\n        /**\n         * the namesapce uri of this xml node.For example,the namespace uri of <s:Skin xmlns:s=\"http://ns.egret.com/eui\"/> is \"http://ns.egret.com/eui\".\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 节点的命名空间地址。例如节点 <s:Skin xmlns:s=\"http://ns.egret.com/eui\"/> 的 namespace 为： http://ns.egret.com/eui\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        namespace: string;\n    }\n    /**\n     * The XMLText class represents a string node in the XML.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * XMLText 类表示在XML中的文本节点\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    interface XMLText extends XMLNode {\n        /**\n         * the text content\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language en_US\n         */\n        /**\n         * 文本内容\n         * @version Egret 2.4\n         * @platform Web,Native\n         * @language zh_CN\n         */\n        text: string;\n    }\n    /**\n     * The XML class contains properties for working with XML objects.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * XML 类包含用于处理 XML 对象的属性。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let XML: {\n        /**\n         * parses a text to XML instance.\n         * @param text the text to be parsed.\n         * @language en_US\n         */\n        /**\n         * 解析字符串为XML对象\n         * @param text 要解析的XML对象。\n         * @language zh_CN\n         */\n        parse(text: string): XML;\n    };\n}\ndeclare namespace egret {\n    /**\n     * @private\n     */\n    let $callLaterFunctionList: any[];\n    /**\n     * @private\n     */\n    let $callLaterThisList: any[];\n    /**\n     * @private\n     */\n    let $callLaterArgsList: any[];\n    /**\n     * Delay the function to run unless screen is redrawn.\n     * @param method {Function} The function to be delayed to run\n     * @param thisObject {any} this reference of callback function\n     * @param ...args {any} Function parameter list\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/callLater.ts\n     * @language en_US\n     */\n    /**\n     * 延迟函数到屏幕重绘前执行。\n     * @param method {Function} 要延迟执行的函数\n     * @param thisObject {any} 回调函数的this引用\n     * @param ...args {any} 函数参数列表\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/callLater.ts\n     * @language zh_CN\n     */\n    function callLater(method: Function, thisObject: any, ...args: any[]): void;\n    /**\n     * @private\n     */\n    let $callAsyncFunctionList: any[];\n    /**\n     * @private\n     */\n    let $callAsyncThisList: any[];\n    /**\n     * @private\n     */\n    let $callAsyncArgsList: any[];\n    /**\n     * 异步调用函数\n     * @param method {Function} 要异步调用的函数\n     * @param thisObject {any} 函数的this引用\n     * @param ...args {any} 函数参数列表\n     * @private\n     */\n    function $callAsync(method: Function, thisObject: any, ...args: any[]): void;\n}\ndeclare namespace egret {\n    /**\n     * Call setter properties of the parent class, instead of the other writing languages, such as super.alpha = 1;\n     * @param currentClass The current class class name, non-string\n     * @param thisObj The current object. Always this\n     * @param type Setter property names need to call\n     * @param values Value passed to the parent class\n     *\n     * @exmaple egret.superSetter(egret.Sprite, this, \"alpha\", 1);\n     * @language en_US\n     */\n    /**\n     * 调用父类的setter属性，代替其他语言的写法，如 super.alpha = 1;\n     * @param currentClass 当前 class 类名，非字符串\n     * @param thisObj 当前对象。永远都this\n     * @param type 需要调用的setter属性名称\n     * @param values 传给父类的值\n     *\n     * @exmaple egret.superSetter(egret.Sprite, this, \"alpha\", 1);\n     * @language zh_CN\n     */\n    function superSetter(currentClass: any, thisObj: any, type: string, ...values: any[]): any;\n    /**\n     * Get getter property value of the parent class. Instead of writing in other languages, such as super.alpha;\n     * @param currentClass The current class class name, non-string\n     * @param thisObj The current object. Always this\n     * @param type Setter property names need to call\n     * @returns {any} The value returned by the parent\n     *\n     * @exmaple egret.superGetter(egret.Sprite, this, \"alpha\");\n     * @language en_US\n     */\n    /**\n     * 获取父类的getter属性值。代替其他语言的写法，如 super.alpha;\n     * @param currentClass 当前 class 类名，非字符串\n     * @param thisObj 当前对象。永远都this\n     * @param type 需要调用的getter属性名称\n     * @returns {any} 父类返回的值\n     *\n     * @exmaple egret.superGetter(egret.Sprite, this, \"alpha\");\n     * @language zh_CN\n     */\n    function superGetter(currentClass: any, thisObj: any, type: string): any;\n}\ndeclare namespace egret {\n    /**\n     * Returns a reference to the class object of the class specified by the name parameter.\n     * @param name The name of a class.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getDefinitionByName.ts\n     * @language en_US\n     */\n    /**\n     * 返回 name 参数指定的类的类对象引用。\n     * @param name 类的名称。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getDefinitionByName.ts\n     * @language zh_CN\n     */\n    function getDefinitionByName(name: string): any;\n}\ndeclare namespace egret {\n    /**\n     * Get browser or Runtime parameters, returns an empty string if not set\n     * Get the url parameter corresponds to the browser, access to the corresponding parameter in the Runtime setOption\n     * @method egret.getOption\n     * @param key {string} Parameters key\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 获取浏览器或者Runtime参数，如果没有设置返回空字符串\n     * 在浏览器中相当于获取url中参数，在Runtime获取对应setOption参数\n     * @method egret.getOption\n     * @param key {string} 参数key\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    let getOption: (key: string) => string;\n}\ndeclare namespace egret {\n    /**\n     * Return the fully qualified class name of an object\n     * @param value The object for which a fully qualified class name is desired. Any JavaScript value may be passed to\n     * this method including all available JavaScript types, object instances, primitive types such as number, and class objects.\n     * @returns A string containing the fully qualified class name.\n     * @example\n     * <pre>\n     *  egret.getQualifiedClassName(egret.DisplayObject) //return \"egret.DisplayObject\"\n     * </pre>\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getQualifiedClassName.ts\n     * @language en_US\n     */\n    /**\n     * 返回对象的完全限定类名。\n     * @param value 需要完全限定类名称的对象，可以将任何 JavaScript 值传递给此方法，包括所有可用的 JavaScript 类型、对象实例、原始类型\n     * （如number)和类对象\n     * @returns 包含完全限定类名称的字符串。\n     * @example\n     * <pre>\n     *  egret.getQualifiedClassName(egret.DisplayObject) //返回 \"egret.DisplayObject\"\n     * </pre>\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getQualifiedClassName.ts\n     * @language zh_CN\n     */\n    function getQualifiedClassName(value: any): string;\n}\ndeclare namespace egret {\n    /**\n     * Returns the fully qualified class name of the base class of the object specified by the value parameter.\n     * @param value The object for which a parent class is desired. Any JavaScript value may be passed to this method including\n     * all available JavaScript types, object instances, primitive types such as number, and class objects.\n     * @returns  A fully qualified base class name, or null if none exists.\n     * @example\n     * <pre>\n     *  egret.getQualifiedSuperclassName(egret.Bitmap) //return \"egret.DisplayObject\"\n     * </pre>\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getQualifiedSuperclassName.ts\n     * @language en_US\n     */\n    /**\n     * 返回 value 参数指定的对象的基类的完全限定类名。\n     * @param value 需要取得父类的对象，可以将任何 JavaScript 值传递给此方法，包括所有可用的 JavaScript 类型、对象实例、原始类型（如number）和类对象\n     * @returns 完全限定的基类名称，或 null（如果不存在基类名称）。\n     * @example\n     * <pre>\n     *  egret.getQualifiedSuperclassName(egret.Sprite) //返回 \"egret.DisplayObject\"\n     * </pre>\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getQualifiedSuperclassName.ts\n     * @language zh_CN\n     */\n    function getQualifiedSuperclassName(value: any): string;\n}\ndeclare namespace egret {\n    /**\n     * Used to compute relative time.this method returns the number of milliseconds since the Egret framework was initialized\n     * @returns The number of milliseconds since the Egret framework was initialized\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getTimer.ts\n     * @language en_US\n     */\n    /**\n     * 用于计算相对时间。此方法返回自启动 Egret 框架以来经过的毫秒数。\n     * @returns 启动 Egret 框架以来经过的毫秒数。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/getTimer.ts\n     * @language zh_CN\n     */\n    function getTimer(): number;\n}\ndeclare namespace egret {\n    /**\n     * Check whether a public definition exists in the specified application domain. The definition can be that of a class, a naming space or a function.\n     * @param name {string} Name of the definition.\n     * @returns {boolean} Whether the public definition exists\n     * @example\n     * egret.hasDefinition(\"egret.DisplayObject\") //return true\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/hasDefinition.ts\n     * @language en_US\n     */\n    /**\n     * 检查指定的应用程序域之内是否存在一个公共定义。该定义可以是一个类、一个命名空间或一个函数的定义。\n     * @param name {string} 定义的名称。\n     * @returns {boolean} 公共定义是否存在\n     * @example\n     * egret.hasDefinition(\"egret.DisplayObject\") //返回 true\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/hasDefinition.ts\n     * @language zh_CN\n     */\n    function hasDefinition(name: string): boolean;\n}\ndeclare namespace egret {\n    /**\n     * Indicates whether an object is a instance of the class or interface specified as the parameter.This method has better performance\n     * compared width the instanceOf operator,and it can indicate whether an object is a instance of the specific interface.\n     * @param instance the instance to be checked.\n     * @param typeName the string value representing a specific class or interface.\n     * @returns A value of true if the object is a instance of the class or interface specified as the parameter.\n     * @example\n     * <pre>\n     *     let instance = new egret.Sprite();\n     *     egret.log(egret.is(instance,\"egret.Sprite\"))  //true\n     *     egret.log(egret.is(instance,\"egret.DisplayObjectContainer\"))  //true\n     *     egret.log(egret.is(instance,\"egret.Bitmap\"))  //false\n     * </pre>\n     * @see egret.registerClass()\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 检查指定对象是否为 Egret 框架内指定接口或类或其子类的实例。此方法与使用 instanceOf 关键字相比具有更高的性能，并且能判断接口的实现。\n     * @param instance 要判断的实例。\n     * @param typeName 类或接口的完全名称.\n     * @returns 返回true表示当前对象是指定类或接口的实例。\n     * @example\n     * <pre>\n     *     let instance = new egret.Sprite();\n     *     egret.log(egret.is(instance,\"egret.Sprite\"))  //true\n     *     egret.log(egret.is(instance,\"egret.DisplayObjectContainer\"))  //true\n     *     egret.log(egret.is(instance,\"egret.Bitmap\"))  //false\n     * </pre>\n     * @see egret.registerClass()\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function is(instance: any, typeName: string): boolean;\n}\ndeclare namespace egret {\n    /**\n     * Register and start a timer,which will notify the callback method at a rate of 60 FPS ,and pass the current time stamp as parameters.<br/>\n     * Note: After the registration,it will notify the callback method continuously,you can call the stopTick () method to stop it.\n     * @param callBack the call back method. the timeStamp parameter of this method represents the number of milliseconds\n     * since the Egret framework was initialized. If the return value of this method is true, it will force Egret runtime\n     * to render after processing of this method completes.\n     * @param thisObject the call back method's \"this\"\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 注册并启动一个计时器，通常会以60FPS的速率触发回调方法，并传入当前时间戳。注意：注册后将会持续触发回调方法，若要停止回调，需要手动调用stopTick()方法。\n     * @param callBack 要执行的回调方法。参数 timeStamp 表示从启动Egret框架开始经过的时间(毫秒)。\n     * 若回调方法返回值为true，其作用与TimerEvent.updateAfterEvent()类似，将会忽略帧频限制，在此方法处理完成后立即重绘屏幕。\n     * @param thisObject 回调方法的this对象引用。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function startTick(callBack: (timeStamp: number) => boolean, thisObject: any): void;\n}\ndeclare namespace egret {\n    /**\n     * Stops the timer started by the egret.startTick() method.\n     * @param callBack the call back method. the timeStamp parameter of this method represents the number of milliseconds\n     * since the Egret framework was initialized. If the return value of this method is true, it will force Egret runtime\n     * to render after processing of this method completes.\n     * @param thisObject the call back method's \"this\"\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language en_US\n     */\n    /**\n     * 停止之前用 startTick() 方法启动的计时器。\n     * @param callBack 要执行的回调方法。参数 timeStamp 表示从启动Egret框架开始经过的时间(毫秒)。\n     * 若回调方法返回值为true，其作用与TimerEvent.updateAfterEvent()类似，将会忽略帧频限制，在此方法处理完成后立即重绘屏幕。\n     * @param thisObject 回调方法的this对象引用。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @language zh_CN\n     */\n    function stopTick(callBack: (timeStamp: number) => boolean, thisObject: any): void;\n}\ndeclare namespace egret {\n    /**\n     * Transfer number to color character string\n     * @param value {number} color value ,such as 0xffffff\n     * @returns {string} Color character string, for example, #ffffff.\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/toColorString.ts\n     * @language en_US\n     */\n    /**\n     * 转换数字为颜色字符串\n     * @param value {number} 颜色值，例如 0xffffff\n     * @returns {string} 颜色字符串，例如\"#ffffff\"。\n     * @version Egret 2.4\n     * @platform Web,Native\n     * @includeExample egret/utils/toColorString.ts\n     * @language zh_CN\n     */\n    function toColorString(value: number): string;\n}\n/**\n * @private\n */\ninterface PlayerOption {\n    /**\n     * 入口类完整类名\n     */\n    entryClassName?: string;\n    /**\n     * 默认帧率\n     */\n    frameRate?: number;\n    /**\n     * 屏幕适配模式\n     */\n    scaleMode?: string;\n    /**\n     * 初始内容宽度\n     */\n    contentWidth?: number;\n    /**\n     * 初始内容高度\n     */\n    contentHeight?: number;\n    /**\n     * 屏幕方向\n     */\n    orientation?: string;\n    /**\n     * 显示FPS\n     */\n    showFPS?: boolean;\n    /**\n     *\n     */\n    fpsStyles?: Object;\n    /**\n     * 显示日志\n     */\n    showLog?: boolean;\n    /**\n     * 过滤日志的正则表达式\n     */\n    logFilter?: string;\n    /**\n     *\n     */\n    maxTouches?: number;\n    /**\n     *\n     */\n    textureScaleFactor?: number;\n}\n"
  },
  {
    "path": "source/lib/rawinflate.d.ts",
    "content": "declare module Zlib {\r\n    class RawInflate {\r\n    \tconstructor(input: any, opt_params?: any);\r\n    \tdecompress():any;\r\n    }\r\n}"
  },
  {
    "path": "source/package.json",
    "content": "{\n  \"name\": \"fairygui-egret\",\n  \"version\": \"1.0.0\",\n  \"description\": \"\",\n  \"main\": \"index.js\",\n  \"directories\": {\n    \"lib\": \"lib\"\n  },\n  \"author\": \"\",\n  \"license\": \"MIT\",\n  \"devDependencies\": {\n    \"@babel/core\": \"^7.6.0\",\n    \"babel-preset-es2015\": \"^6.24.1\",\n    \"browserify\": \"^14.3.0\",\n    \"gulp\": \"^3.9.1\",\n    \"gulp-babel\": \"^8.0.0\",\n    \"gulp-concat\": \"^2.6.1\",\n    \"gulp-minify\": \"^3.1.0\",\n    \"gulp-string-replace\": \"^1.1.2\",\n    \"gulp-typescript\": \"^3.1.6\",\n    \"gulp-uglify\": \"^3.0.2\",\n    \"tsify\": \"^3.0.1\",\n    \"typescript\": \"^2.2.2\",\n    \"vinyl-source-stream\": \"^1.1.0\",\n    \"watchify\": \"^3.9.0\",\n    \"gulp-inject-string\": \"^1.1.2\"\n  }\n}\n"
  },
  {
    "path": "source/src/AsyncOperation.ts",
    "content": "module fgui {\r\n\r\n    export class AsyncOperation {\r\n        public callback: (obj: GObject) => void;\r\n        public callbackObj: any;\r\n\r\n        private _itemList: Array<DisplayListItem>;\r\n        private _objectPool: Array<GObject>;\r\n        private _index: number;\r\n\r\n        public constructor() {\r\n            this._itemList = new Array<DisplayListItem>();\r\n            this._objectPool = new Array<GObject>();\r\n        }\r\n\r\n        public createObject(pkgName: string, resName: string): void {\r\n            var pkg: UIPackage = UIPackage.getByName(pkgName);\r\n            if (pkg) {\r\n                var pi: PackageItem = pkg.getItemByName(resName);\r\n                if (!pi)\r\n                    throw new Error(\"resource not found: \" + resName);\r\n\r\n                this.internalCreateObject(pi);\r\n            }\r\n            else\r\n                throw new Error(\"package not found: \" + pkgName);\r\n        }\r\n\r\n        public createObjectFromURL(url: string): void {\r\n            var pi: PackageItem = UIPackage.getItemByURL(url);\r\n            if (pi)\r\n                this.internalCreateObject(pi);\r\n            else\r\n                throw new Error(\"resource not found: \" + url);\r\n        }\r\n\r\n        public cancel(): void {\r\n            GTimers.inst.remove(this.run, this);\r\n            this._itemList.length = 0;\r\n            var cnt: number = this._objectPool.length;\r\n            if (cnt > 0) {\r\n                for (var i: number = 0; i < cnt; i++)\r\n                    this._objectPool[i].dispose();\r\n                this._objectPool.length = 0;\r\n            }\r\n        }\r\n\r\n        private internalCreateObject(item: PackageItem): void {\r\n            this._itemList.length = 0;\r\n            this._objectPool.length = 0;\r\n\r\n            var di: DisplayListItem = { pi: item, type: item.objectType };\r\n            di.childCount = this.collectComponentChildren(item);\r\n            this._itemList.push(di);\r\n\r\n            this._index = 0;\r\n            GTimers.inst.add(1, 0, this.run, this);\r\n        }\r\n\r\n        private collectComponentChildren(item: PackageItem): number {\r\n            var buffer: ByteBuffer = item.rawData;\r\n            buffer.seek(0, 2);\r\n\r\n            var di: DisplayListItem;\r\n            var pi: PackageItem;\r\n            var i: number;\r\n            var dataLen: number;\r\n            var curPos: number;\r\n            var pkg: UIPackage;\r\n\r\n            var dcnt: number = buffer.readShort();\r\n            for (i = 0; i < dcnt; i++) {\r\n                dataLen = buffer.readShort();\r\n                curPos = buffer.position;\r\n\r\n                buffer.seek(curPos, 0);\r\n\r\n                var type: number = buffer.readByte();\r\n                var src: string = buffer.readS();\r\n                var pkgId: string = buffer.readS();\r\n\r\n                buffer.position = curPos;\r\n\r\n                if (src != null) {\r\n                    if (pkgId != null)\r\n                        pkg = UIPackage.getById(pkgId);\r\n                    else\r\n                        pkg = item.owner;\r\n\r\n                    pi = pkg != null ? pkg.getItemById(src) : null;\r\n                    di = { pi: pi, type: type };\r\n\r\n                    if (pi != null && pi.type == PackageItemType.Component)\r\n                        di.childCount = this.collectComponentChildren(pi);\r\n                }\r\n                else {\r\n                    di = { type: type };\r\n                    if (type == ObjectType.List) //list\r\n                        di.listItemCount = this.collectListChildren(buffer);\r\n                }\r\n\r\n                this._itemList.push(di);\r\n                buffer.position = curPos + dataLen;\r\n            }\r\n\r\n            return dcnt;\r\n        }\r\n\r\n        private collectListChildren(buffer: ByteBuffer): number {\r\n            buffer.seek(buffer.position, 8);\r\n\r\n            var listItemCount: number = 0;\r\n            var i: number;\r\n            var nextPos: number;\r\n            var url: string;\r\n            var pi: PackageItem;\r\n            var di: DisplayListItem;\r\n            var defaultItem: string = buffer.readS();\r\n            var itemCount: number = buffer.readShort();\r\n\r\n            for (i = 0; i < itemCount; i++) {\r\n                nextPos = buffer.readShort();\r\n                nextPos += buffer.position;\r\n\r\n                url = buffer.readS();\r\n                if (url == null)\r\n                    url = defaultItem;\r\n                if (url) {\r\n                    pi = UIPackage.getItemByURL(url);\r\n                    if (pi) {\r\n                        di = { pi: pi, type: pi.objectType };\r\n                        if (pi.type == PackageItemType.Component)\r\n                            di.childCount = this.collectComponentChildren(pi);\r\n\r\n                        this._itemList.push(di);\r\n                        listItemCount++;\r\n                    }\r\n                }\r\n                buffer.position = nextPos;\r\n            }\r\n\r\n            return listItemCount;\r\n        }\r\n\r\n        private run(): void {\r\n            var obj: GObject;\r\n            var di: DisplayListItem;\r\n            var poolStart: number;\r\n            var k: number;\r\n            var t: number = egret.getTimer();\r\n            var frameTime: number = UIConfig.frameTimeForAsyncUIConstruction;\r\n            var totalItems: number = this._itemList.length;\r\n\r\n            while (this._index < totalItems) {\r\n                di = this._itemList[this._index];\r\n                if (di.pi) {\r\n                    obj = UIObjectFactory.newObject(di.pi);\r\n                    this._objectPool.push(obj);\r\n\r\n                    UIPackage._constructing++;\r\n                    if (di.pi.type == PackageItemType.Component) {\r\n                        poolStart = this._objectPool.length - di.childCount - 1;\r\n\r\n                        (<GComponent>obj).constructFromResource2(this._objectPool, poolStart);\r\n\r\n                        this._objectPool.splice(poolStart, di.childCount);\r\n                    }\r\n                    else {\r\n                        obj.constructFromResource();\r\n                    }\r\n                    UIPackage._constructing--;\r\n                }\r\n                else {\r\n                    obj = UIObjectFactory.newObject(di.type);\r\n                    this._objectPool.push(obj);\r\n\r\n                    if (di.type == ObjectType.List && di.listItemCount > 0) {\r\n                        poolStart = this._objectPool.length - di.listItemCount - 1;\r\n\r\n                        for (k = 0; k < di.listItemCount; k++) //把他们都放到pool里，这样GList在创建时就不需要创建对象了\r\n                            (<GList>obj).itemPool.returnObject(this._objectPool[k + poolStart]);\r\n\r\n                        this._objectPool.splice(poolStart, di.listItemCount);\r\n                    }\r\n                }\r\n\r\n                this._index++;\r\n                if ((this._index % 5 == 0) && egret.getTimer() - t >= frameTime)\r\n                    return;\r\n            }\r\n\r\n            GTimers.inst.remove(this.run, this);\r\n            var result: GObject = this._objectPool[0];\r\n            this._itemList.length = 0;\r\n            this._objectPool.length = 0;\r\n\r\n            if (this.callback != null)\r\n                this.callback.call(this.callbackObj, result);\r\n        }\r\n    }\r\n\r\n    interface DisplayListItem {\r\n        type: ObjectType;\r\n        pi?: PackageItem;\r\n        childCount?: number;\r\n        listItemCount?: number;\r\n    }\r\n}\r\n"
  },
  {
    "path": "source/src/Controller.ts",
    "content": "\nmodule fgui {\n    var _nextPageId: number = 0;\n\n    export class Controller extends egret.EventDispatcher {\n        private _selectedIndex: number;\n        private _previousIndex: number;\n        private _pageIds: Array<string>;\n        private _pageNames: Array<string>;\n        private _actions?: Array<ControllerAction>;\n\n        public name: string;\n        public parent: GComponent;\n        public autoRadioGroupDepth?: boolean;\n        public changing: boolean;\n\n        public constructor() {\n            super();\n            this._pageIds = [];\n            this._pageNames = [];\n            this._selectedIndex = -1;\n            this._previousIndex = -1;\n        }\n\n        public dispose(): void {\n\n        }\n\n        public get selectedIndex(): number {\n            return this._selectedIndex;\n        }\n\n        public set selectedIndex(value: number) {\n            if (this._selectedIndex != value) {\n                if (value > this._pageIds.length - 1)\n                    throw \"index out of bounds: \" + value;\n\n                this.changing = true;\n                this._previousIndex = this._selectedIndex;\n                this._selectedIndex = value;\n                this.parent.applyController(this);\n\n                this.dispatchEvent(new StateChangeEvent(StateChangeEvent.CHANGED));\n\n                this.changing = false;\n            }\n        }\n\n        //功能和设置selectedIndex一样，但不会触发事件\n        public setSelectedIndex(value: number): void {\n            if (this._selectedIndex != value) {\n                if (value > this._pageIds.length - 1)\n                    throw \"index out of bounds: \" + value;\n\n                this.changing = true;\n                this._previousIndex = this._selectedIndex;\n                this._selectedIndex = value;\n                this.parent.applyController(this);\n                this.changing = false;\n            }\n        }\n\n        public get previsousIndex(): number {\n            return this._previousIndex;\n        }\n\n        public get selectedPage(): string {\n            if (this._selectedIndex == -1)\n                return null;\n            else\n                return this._pageNames[this._selectedIndex];\n        }\n\n        public set selectedPage(val: string) {\n            var i: number = this._pageNames.indexOf(val);\n            if (i == -1)\n                i = 0;\n            this.selectedIndex = i;\n        }\n\n        //功能和设置selectedPage一样，但不会触发事件\n        public setSelectedPage(value: string): void {\n            var i: number = this._pageNames.indexOf(value);\n            if (i == -1)\n                i = 0;\n            this.setSelectedIndex(i);\n        }\n\n        public get previousPage(): string {\n            if (this._previousIndex == -1)\n                return null;\n            else\n                return this._pageNames[this._previousIndex];\n        }\n\n        public get pageCount(): number {\n            return this._pageIds.length;\n        }\n\n        public getPageName(index: number): string {\n            return this._pageNames[index];\n        }\n\n        public addPage(name?: string): void {\n            this.addPageAt(name || \"\", this._pageIds.length);\n        }\n\n        public addPageAt(name: string, index: number): void {\n            var nid: string = \"\" + (_nextPageId++);\n            if (index == this._pageIds.length) {\n                this._pageIds.push(nid);\n                this._pageNames.push(name);\n            }\n            else {\n                this._pageIds.splice(index, 0, nid);\n                this._pageNames.splice(index, 0, name);\n            }\n        }\n\n        public removePage(name: string): void {\n            var i: number = this._pageNames.indexOf(name);\n            if (i != -1) {\n                this._pageIds.splice(i, 1);\n                this._pageNames.splice(i, 1);\n                if (this._selectedIndex >= this._pageIds.length)\n                    this.selectedIndex = this._selectedIndex - 1;\n                else\n                    this.parent.applyController(this);\n            }\n        }\n\n        public removePageAt(index: number = 0): void {\n            this._pageIds.splice(index, 1);\n            this._pageNames.splice(index, 1);\n            if (this._selectedIndex >= this._pageIds.length)\n                this.selectedIndex = this._selectedIndex - 1;\n            else\n                this.parent.applyController(this);\n        }\n\n        public clearPages(): void {\n            this._pageIds.length = 0;\n            this._pageNames.length = 0;\n            if (this._selectedIndex != -1)\n                this.selectedIndex = -1;\n            else\n                this.parent.applyController(this);\n        }\n\n        public hasPage(aName: string): boolean {\n            return this._pageNames.indexOf(aName) != -1;\n        }\n\n        public getPageIndexById(aId: string): number {\n            return this._pageIds.indexOf(aId);\n        }\n\n        public getPageIdByName(aName: string): string {\n            var i: number = this._pageNames.indexOf(aName);\n            if (i != -1)\n                return this._pageIds[i];\n            else\n                return null;\n        }\n\n        public getPageNameById(aId: string): string {\n            var i: number = this._pageIds.indexOf(aId);\n            if (i != -1)\n                return this._pageNames[i];\n            else\n                return null;\n        }\n\n        public getPageId(index: number = 0): string {\n            return this._pageIds[index];\n        }\n\n        public get selectedPageId(): string {\n            if (this._selectedIndex == -1)\n                return null;\n            else\n                return this._pageIds[this._selectedIndex];\n        }\n\n        public set selectedPageId(val: string) {\n            var i: number = this._pageIds.indexOf(val);\n            this.selectedIndex = i;\n        }\n\n        public set oppositePageId(val: string) {\n            var i: number = this._pageIds.indexOf(val);\n            if (i > 0)\n                this.selectedIndex = 0;\n            else if (this._pageIds.length > 1)\n                this.selectedIndex = 1;\n        }\n\n        public get previousPageId(): string {\n            if (this._previousIndex == -1)\n                return null;\n            else\n                return this._pageIds[this._previousIndex];\n        }\n\n        public runActions(): void {\n            if (this._actions) {\n                var cnt: number = this._actions.length;\n                for (var i: number = 0; i < cnt; i++)\n                    this._actions[i].run(this, this.previousPageId, this.selectedPageId);\n            }\n        }\n\n        public setup(buffer: ByteBuffer): void {\n            var beginPos: number = buffer.position;\n            buffer.seek(beginPos, 0);\n\n            this.name = buffer.readS();\n            if (buffer.readBool())\n                this.autoRadioGroupDepth = true;\n\n            buffer.seek(beginPos, 1);\n\n            var i: number;\n            var nextPos: number;\n            var cnt: number = buffer.readShort();\n\n            for (i = 0; i < cnt; i++) {\n                this._pageIds.push(buffer.readS());\n                this._pageNames.push(buffer.readS());\n            }\n\n            var homePageIndex: number = 0;\n            if (buffer.version >= 2) {\n                var homePageType: number = buffer.readByte();\n                switch (homePageType) {\n                    case 1:\n                        homePageIndex = buffer.readShort();\n                        break;\n\n                    case 2:\n                        homePageIndex = this._pageNames.indexOf(UIPackage.branch);\n                        if (homePageIndex == -1)\n                            homePageIndex = 0;\n                        break;\n\n                    case 3:\n                        homePageIndex = this._pageNames.indexOf(UIPackage.getVar(buffer.readS()));\n                        if (homePageIndex == -1)\n                            homePageIndex = 0;\n                        break;\n                }\n            }\n\n            buffer.seek(beginPos, 2);\n\n            cnt = buffer.readShort();\n            if (cnt > 0) {\n                if (!this._actions)\n                    this._actions = new Array<ControllerAction>();\n\n                for (i = 0; i < cnt; i++) {\n                    nextPos = buffer.readShort();\n                    nextPos += buffer.position;\n\n                    var action: ControllerAction = ControllerAction.createAction(buffer.readByte());\n                    action.setup(buffer);\n                    this._actions.push(action);\n\n                    buffer.position = nextPos;\n                }\n            }\n\n            if (this.parent && this._pageIds.length > 0)\n                this._selectedIndex = homePageIndex;\n            else\n                this._selectedIndex = -1;\n        }\n    }\n}"
  },
  {
    "path": "source/src/DragDropManager.ts",
    "content": "module fgui {\r\n    export class DragDropManager {\r\n\r\n        private _agent: GLoader;\r\n        private _sourceData: any;\r\n\r\n        private static _inst: DragDropManager;\r\n        public static get inst(): DragDropManager {\r\n            if (DragDropManager._inst == null)\r\n                DragDropManager._inst = new DragDropManager();\r\n            return DragDropManager._inst;\r\n        }\r\n\r\n        public constructor() {\r\n            this._agent = new GLoader();\r\n            this._agent.draggable = true;\r\n            this._agent.touchable = false;//important\r\n            this._agent.setSize(100, 100);\r\n            this._agent.setPivot(0.5, 0.5, true);\r\n            this._agent.align = AlignType.Center;\r\n            this._agent.verticalAlign = VertAlignType.Middle;\r\n            this._agent.sortingOrder = 1000000;\r\n            this._agent.addEventListener(DragEvent.DRAG_END, this.__dragEnd, this);\r\n        }\r\n\r\n        public get dragAgent(): GObject {\r\n            return this._agent;\r\n        }\r\n\r\n        public get dragging(): boolean {\r\n            return this._agent.parent != null;\r\n        }\r\n\r\n        public startDrag(source: GObject, icon: string, sourceData?: any, touchPointID?: number): void {\r\n            if (this._agent.parent)\r\n                return;\r\n\r\n            this._sourceData = sourceData;\r\n            this._agent.url = icon;\r\n            GRoot.inst.addChild(this._agent);\r\n            var pt: egret.Point = GRoot.inst.globalToLocal(GRoot.mouseX, GRoot.mouseY);\r\n            this._agent.setXY(pt.x, pt.y);\r\n            this._agent.startDrag(touchPointID);\r\n        }\r\n\r\n        public cancel(): void {\r\n            if (this._agent.parent) {\r\n                this._agent.stopDrag();\r\n                GRoot.inst.removeChild(this._agent);\r\n                this._sourceData = null;\r\n            }\r\n        }\r\n\r\n        private __dragEnd(evt: DragEvent): void {\r\n            if (this._agent.parent == null) //cancelled\r\n                return;\r\n\r\n            GRoot.inst.removeChild(this._agent);\r\n\r\n            var sourceData: any = this._sourceData;\r\n            this._sourceData = null;\r\n\r\n            var obj: GObject = GRoot.inst.getObjectUnderPoint(evt.stageX, evt.stageY);\r\n            while (obj) {\r\n                if (obj.hasEventListener(DropEvent.DROP)) {\r\n                    var dropEvt: DropEvent = new DropEvent(DropEvent.DROP, sourceData);\r\n                    obj.requestFocus();\r\n                    obj.dispatchEvent(dropEvt);\r\n                    return;\r\n                }\r\n\r\n                obj = obj.parent;\r\n            }\r\n        }\r\n    }\r\n}\r\n"
  },
  {
    "path": "source/src/FieldTypes.ts",
    "content": "module fgui {\n    export enum ButtonMode {\n        Common,\n        Check,\n        Radio\n    }\n    export enum AutoSizeType {\n        None,\n        Both,\n        Height\n    }\n    export enum AlignType {\n        Left,\n        Center,\n        Right\n    }\n    export enum VertAlignType {\n        Top,\n        Middle,\n        Bottom\n    }\n    export enum LoaderFillType {\n        None,\n        Scale,\n        ScaleMatchHeight,\n        ScaleMatchWidth,\n        ScaleFree,\n        ScaleNoBorder\n    }\n    export enum ListLayoutType {\n        SingleColumn,\n        SingleRow,\n        FlowHorizontal,\n        FlowVertical,\n        Pagination\n    }\n    export enum ListSelectionMode {\n        Single,\n        Multiple,\n        Multiple_SingleClick,\n        None\n    }\n    export enum OverflowType {\n        Visible,\n        Hidden,\n        Scroll\n    }\n    export enum PackageItemType {\n        Image,\n        MovieClip,\n        Sound,\n        Component,\n        Atlas,\n        Font,\n        Swf,\n        Misc,\n        Unknown,\n        Spine,\n        DragonBones\n    };\n    export enum ObjectType {\n        Image,\n        MovieClip,\n        Swf,\n        Graph,\n        Loader,\n        Group,\n        Text,\n        RichText,\n        InputText,\n        Component,\n        List,\n        Label,\n        Button,\n        ComboBox,\n        ProgressBar,\n        Slider,\n        ScrollBar,\n        Tree,\n        Loader3D\n    }\n    export enum ProgressTitleType {\n        Percent,\n        ValueAndMax,\n        Value,\n        Max\n    }\n    export enum ScrollBarDisplayType {\n        Default,\n        Visible,\n        Auto,\n        Hidden\n    };\n    export enum ScrollType {\n        Horizontal,\n        Vertical,\n        Both\n    };\n    export enum FlipType {\n        None,\n        Horizontal,\n        Vertical,\n        Both\n    }\n    export enum ChildrenRenderOrder {\n        Ascent,\n        Descent,\n        Arch\n    }\n    export enum GroupLayoutType {\n        None,\n        Horizontal,\n        Vertical\n    }\n    export enum PopupDirection {\n        Auto,\n        Up,\n        Down\n    }\n    export enum RelationType {\n        Left_Left = 0,\n        Left_Center = 1,\n        Left_Right = 2,\n        Center_Center = 3,\n        Right_Left = 4,\n        Right_Center = 5,\n        Right_Right = 6,\n\n        Top_Top = 7,\n        Top_Middle = 8,\n        Top_Bottom = 9,\n        Middle_Middle = 10,\n        Bottom_Top = 11,\n        Bottom_Middle = 12,\n        Bottom_Bottom = 13,\n\n        Width = 14,\n        Height = 15,\n\n        LeftExt_Left = 16,\n        LeftExt_Right = 17,\n        RightExt_Left = 18,\n        RightExt_Right = 19,\n        TopExt_Top = 20,\n        TopExt_Bottom = 21,\n        BottomExt_Top = 22,\n        BottomExt_Bottom = 23,\n\n        Size = 24\n    }\n    export enum FillMethod {\n        None,\n        Horizontal,\n        Vertical,\n        Radial90,\n        Radial180,\n        Radial360,\n    }\n\n    export enum FillOrigin {\n        Top,\n        Bottom,\n        Left,\n        Right,\n\n        TopLeft = 0,\n        TopRight = 1,\n        BottomLeft = 2,\n        BottomRight = 3\n    }\n\n    export enum FillOrigin90 {\n        TopLeft,\n        TopRight,\n        BottomLeft,\n        BottomRight\n    }\n\n    export enum ObjectPropID {\n        Text,\n        Icon,\n        Color,\n        OutlineColor,\n        Playing,\n        Frame,\n        DeltaTime,\n        TimeScale,\n        FontSize,\n        Selected\n    }\n} "
  },
  {
    "path": "source/src/GButton.ts",
    "content": "\n/// <reference path=\"GComponent.ts\" />\n\nmodule fgui {\n\n    export class GButton extends GComponent {\n        protected _titleObject: GObject;\n        protected _iconObject: GObject;\n\n        private _mode: ButtonMode;\n        private _selected: boolean;\n        private _title: string;\n        private _selectedTitle: string;\n        private _icon: string;\n        private _selectedIcon: string;\n        private _sound: string;\n        private _soundVolumeScale: number;\n        private _buttonController: Controller;\n        private _relatedController?: Controller;\n        private _relatedPageId: string;\n        private _changeStateOnClick: boolean;\n        private _linkedPopup?: GObject;\n        private _downEffect: number;\n        private _downEffectValue: number;\n        private _downScaled?: boolean;\n\n        private _down: boolean;\n        private _over: boolean;\n\n        public static UP: string = \"up\";\n        public static DOWN: string = \"down\";\n        public static OVER: string = \"over\";\n        public static SELECTED_OVER: string = \"selectedOver\";\n        public static DISABLED: string = \"disabled\";\n        public static SELECTED_DISABLED: string = \"selectedDisabled\";\n\n        public constructor() {\n            super();\n\n            this._mode = ButtonMode.Common;\n            this._title = \"\";\n            this._icon = \"\";\n            this._sound = UIConfig.buttonSound;\n            this._soundVolumeScale = UIConfig.buttonSoundVolumeScale;\n            this._changeStateOnClick = true;\n            this._downEffect = 0;\n            this._downEffectValue = 0.8;\n        }\n\n        public get icon(): string {\n            return this._icon;\n        }\n\n        public set icon(value: string) {\n            this._icon = value;\n            value = (this._selected && this._selectedIcon) ? this._selectedIcon : this._icon;\n            if (this._iconObject)\n                this._iconObject.icon = value;\n            this.updateGear(7);\n        }\n\n        public get selectedIcon(): string {\n            return this._selectedIcon;\n        }\n\n        public set selectedIcon(value: string) {\n            this._selectedIcon = value;\n            value = (this._selected && this._selectedIcon) ? this._selectedIcon : this._icon;\n            if (this._iconObject)\n                this._iconObject.icon = value;\n        }\n\n        public get title(): string {\n            return this._title;\n        }\n\n        public set title(value: string) {\n            this._title = value;\n            if (this._titleObject)\n                this._titleObject.text = (this._selected && this._selectedTitle) ? this._selectedTitle : this._title;\n            this.updateGear(6);\n        }\n\n        public get text(): string {\n            return this.title;\n        }\n\n        public set text(value: string) {\n            this.title = value;\n        }\n\n        public get selectedTitle(): string {\n            return this._selectedTitle;\n        }\n\n        public set selectedTitle(value: string) {\n            this._selectedTitle = value;\n            if (this._titleObject)\n                this._titleObject.text = (this._selected && this._selectedTitle) ? this._selectedTitle : this._title;\n        }\n\n        public get titleColor(): number {\n            var tf: GTextField = this.getTextField();\n            if (tf)\n                return tf.color;\n            else\n                return 0;\n        }\n\n        public set titleColor(value: number) {\n            var tf: GTextField = this.getTextField();\n            if (tf)\n                tf.color = value;\n        }\n\n        public get titleFontSize(): number {\n            var tf: GTextField = this.getTextField();\n            if (tf)\n                return tf.fontSize;\n            else\n                return 0;\n        }\n\n        public set titleFontSize(value: number) {\n            var tf: GTextField = this.getTextField();\n            if (tf)\n                tf.fontSize = value;\n        }\n        public get sound(): string {\n            return this._sound;\n        }\n\n        public set sound(val: string) {\n            this._sound = val;\n        }\n\n        public get soundVolumeScale(): number {\n            return this._soundVolumeScale;\n        }\n\n        public set soundVolumeScale(value: number) {\n            this._soundVolumeScale = value;\n        }\n\n        public set selected(val: boolean) {\n            if (this._mode == ButtonMode.Common)\n                return;\n\n            if (this._selected != val) {\n                this._selected = val;\n                if (this.grayed && this._buttonController && this._buttonController.hasPage(GButton.DISABLED)) {\n                    if (this._selected)\n                        this.setState(GButton.SELECTED_DISABLED);\n                    else\n                        this.setState(GButton.DISABLED);\n                }\n                else {\n                    if (this._selected)\n                        this.setState(this._over ? GButton.SELECTED_OVER : GButton.DOWN);\n                    else\n                        this.setState(this._over ? GButton.OVER : GButton.UP);\n                }\n                if (this._selectedTitle && this._titleObject)\n                    this._titleObject.text = this._selected ? this._selectedTitle : this._title;\n                if (this._selectedIcon) {\n                    var str: string = this._selected ? this._selectedIcon : this._icon;\n                    if (this._iconObject)\n                        this._iconObject.icon = str;\n                }\n                if (this._relatedController\n                    && this._parent\n                    && !this._parent._buildingDisplayList) {\n                    if (this._selected) {\n                        this._relatedController.selectedPageId = this._relatedPageId;\n                        if (this._relatedController.autoRadioGroupDepth)\n                            this._parent.adjustRadioGroupDepth(this, this._relatedController);\n                    }\n                    else if (this._mode == ButtonMode.Check && this._relatedController.selectedPageId == this._relatedPageId)\n                        this._relatedController.oppositePageId = this._relatedPageId;\n                }\n            }\n        }\n\n        public get selected(): boolean {\n            return this._selected;\n        }\n\n        public get mode(): ButtonMode {\n            return this._mode;\n        }\n\n        public set mode(value: ButtonMode) {\n            if (this._mode != value) {\n                if (value == ButtonMode.Common)\n                    this.selected = false;\n                this._mode = value;\n            }\n        }\n\n        public get relatedController(): Controller {\n            return this._relatedController;\n        }\n\n        public set relatedController(val: Controller) {\n            this._relatedController = val;\n        }\n\n        public get relatedPageId(): string {\n            return this._relatedPageId;\n        }\n\n        public set relatedPageId(val: string) {\n            this._relatedPageId = val;\n        }\n\n        public get changeStateOnClick(): boolean {\n            return this._changeStateOnClick;\n        }\n\n        public set changeStateOnClick(value: boolean) {\n            this._changeStateOnClick = value;\n        }\n\n        public get linkedPopup(): GObject {\n            return this._linkedPopup;\n        }\n\n        public set linkedPopup(value: GObject) {\n            this._linkedPopup = value;\n        }\n\n        public getTextField(): GTextField {\n            if (this._titleObject instanceof GTextField)\n                return this._titleObject;\n            else if ((this._titleObject instanceof GLabel) || (this._titleObject instanceof GButton))\n                return this._titleObject.getTextField();\n            else\n                return null;\n        }\n\n        public addStateListener(listener: Function, thisObj: any): void {\n            this.addEventListener(StateChangeEvent.CHANGED, listener, thisObj);\n        }\n\n        public removeStateListener(listener: Function, thisObj: any): void {\n            this.removeEventListener(StateChangeEvent.CHANGED, listener, thisObj);\n        }\n\n        public fireClick(downEffect?: boolean): void {\n            if (downEffect && this._mode == ButtonMode.Common) {\n                this.setState(GButton.OVER);\n                GTimers.inst.add(100, 1, function () { this.setState(GButton.DOWN); }, this);\n                GTimers.inst.add(200, 1, function () { this.setState(GButton.UP); }, this);\n            }\n            this.__click(null);\n        }\n\n        protected setState(val: string): void {\n            if (this._buttonController)\n                this._buttonController.selectedPage = val;\n\n            if (this._downEffect == 1) {\n                var cnt: number = this.numChildren;\n                if (val == GButton.DOWN || val == GButton.SELECTED_OVER || val == GButton.SELECTED_DISABLED) {\n                    var r: number = this._downEffectValue * 255;\n                    var color: number = (r << 16) + (r << 8) + r;\n                    for (var i: number = 0; i < cnt; i++) {\n                        var obj: GObject = this.getChildAt(i);\n                        if (obj[\"color\"] != undefined && !(obj instanceof GTextField))\n                            (<any>obj).color = color;\n                    }\n                }\n                else {\n                    for (var i: number = 0; i < cnt; i++) {\n                        var obj: GObject = this.getChildAt(i);\n                        if (obj[\"color\"] != undefined && !(obj instanceof GTextField))\n                            (<any>obj).color = 0xFFFFFF;\n                    }\n                }\n            }\n            else if (this._downEffect == 2) {\n                if (val == GButton.DOWN || val == GButton.SELECTED_OVER || val == GButton.SELECTED_DISABLED) {\n                    if (!this._downScaled) {\n                        this._downScaled = true;\n                        //复制缩放前的变换矩阵,解决缩放后的 container 计算hitTest.\n                        this._rootContainer.cacheHitArea(true);\n                        this.setScale(this.scaleX * this._downEffectValue, this.scaleY * this._downEffectValue);\n                    }\n                }\n                else {\n                    if (this._downScaled) {\n                        this._downScaled = false;\n                        this._rootContainer.cacheHitArea(false);\n                        this.setScale(this.scaleX / this._downEffectValue, this.scaleY / this._downEffectValue);\n                    }\n                }\n            }\n        }\n\n        public handleControllerChanged(c: Controller): void {\n            super.handleControllerChanged(c);\n\n            if (this._relatedController == c)\n                this.selected = this._relatedPageId == c.selectedPageId;\n        }\n\n        protected handleGrayedChanged(): void {\n            if (this._buttonController && this._buttonController.hasPage(GButton.DISABLED)) {\n                if (this.grayed) {\n                    if (this._selected && this._buttonController.hasPage(GButton.SELECTED_DISABLED))\n                        this.setState(GButton.SELECTED_DISABLED);\n                    else\n                        this.setState(GButton.DISABLED);\n                }\n                else if (this._selected)\n                    this.setState(GButton.DOWN);\n                else\n                    this.setState(GButton.UP);\n            }\n            else\n                super.handleGrayedChanged();\n        }\n\n        public getProp(index: number): any {\n            switch (index) {\n                case ObjectPropID.Color:\n                    return this.titleColor;\n                case ObjectPropID.OutlineColor:\n                    {\n                        var tf: GTextField = this.getTextField();\n                        if (tf)\n                            return tf.strokeColor;\n                        else\n                            return 0;\n                    }\n                case ObjectPropID.FontSize:\n                    return this.titleFontSize;\n                case ObjectPropID.Selected:\n                    return this.selected;\n                default:\n                    return super.getProp(index);\n            }\n        }\n\n        public setProp(index: number, value: any): void {\n            switch (index) {\n                case ObjectPropID.Color:\n                    this.titleColor = value;\n                    break;\n                case ObjectPropID.OutlineColor:\n                    {\n                        var tf: GTextField = this.getTextField();\n                        if (tf)\n                            tf.strokeColor = value;\n                    }\n                    break;\n                case ObjectPropID.FontSize:\n                    this.titleFontSize = value;\n                    break;\n                case ObjectPropID.Selected:\n                    this.selected = value;\n                    break;\n                default:\n                    super.setProp(index, value);\n                    break;\n            }\n        }\n\n        protected constructExtension(buffer: ByteBuffer): void {\n            buffer.seek(0, 6);\n\n            this._mode = buffer.readByte();\n            var str: string = buffer.readS();\n            if (str)\n                this._sound = str;\n            this._soundVolumeScale = buffer.readFloat();\n            this._downEffect = buffer.readByte();\n            this._downEffectValue = buffer.readFloat();\n            if (this._downEffect == 2)\n                this.setPivot(0.5, 0.5, this.pivotAsAnchor);\n\n            this._buttonController = this.getController(\"button\");\n            this._titleObject = this.getChild(\"title\");\n            this._iconObject = this.getChild(\"icon\");\n            if (this._titleObject)\n                this._title = this._titleObject.text;\n            if (this._iconObject)\n                this._icon = this._iconObject.icon;\n\n            if (this._mode == ButtonMode.Common)\n                this.setState(GButton.UP);\n\n            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__mousedown, this);\n            this.addEventListener(egret.TouchEvent.TOUCH_TAP, this.__click, this);\n        }\n\n        public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_afterAdd(buffer, beginPos);\n\n            if (!buffer.seek(beginPos, 6))\n                return;\n\n            if (buffer.readByte() != this.packageItem.objectType)\n                return;\n\n            var str: string;\n            var iv: number;\n\n            str = buffer.readS();\n            if (str != null)\n                this.title = str;\n            str = buffer.readS();\n            if (str != null)\n                this.selectedTitle = str;\n            str = buffer.readS();\n            if (str != null)\n                this.icon = str;\n            str = buffer.readS();\n            if (str != null)\n                this.selectedIcon = str;\n            if (buffer.readBool())\n                this.titleColor = buffer.readColor();\n            iv = buffer.readInt();\n            if (iv != 0)\n                this.titleFontSize = iv;\n            iv = buffer.readShort();\n            if (iv >= 0)\n                this._relatedController = this.parent.getControllerAt(iv);\n            this._relatedPageId = buffer.readS();\n\n            str = buffer.readS();\n            if (str != null)\n                this._sound = str;\n            if (buffer.readBool())\n                this._soundVolumeScale = buffer.readFloat();\n\n            this.selected = buffer.readBool();\n        }\n\n        // private __rollover(evt: egret.TouchEvent): void {\n        //     if (!this._buttonController || !this._buttonController.hasPage(GButton.OVER))\n        //         return;\n\n        //     this._over = true;\n        //     if (this._down)\n        //         return;\n\n        //     this.setState(this._selected ? GButton.SELECTED_OVER : GButton.OVER);\n        // }\n\n        // private __rollout(evt: egret.TouchEvent): void {\n        //     if (!this._buttonController || !this._buttonController.hasPage(GButton.OVER))\n        //         return;\n\n        //     this._over = false;\n        //     if (this._down)\n        //         return;\n\n        //     this.setState(this._selected ? GButton.DOWN : GButton.UP);\n        // }\n\n        private __mousedown(evt: egret.TouchEvent): void {\n            this._down = true;\n            GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__mouseup, this);\n\n            if (this._mode == ButtonMode.Common) {\n                if (this.grayed && this._buttonController && this._buttonController.hasPage(GButton.DISABLED))\n                    this.setState(GButton.SELECTED_DISABLED);\n                else\n                    this.setState(GButton.DOWN);\n            }\n\n            if (this._linkedPopup) {\n                if (this._linkedPopup instanceof Window)\n                    this._linkedPopup.toggleStatus();\n                else\n                    this.root.togglePopup(this._linkedPopup, this);\n            }\n        }\n\n        private __mouseup(evt: egret.TouchEvent): void {\n            if (this._down) {\n                GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_END, this.__mouseup, this);\n                this._down = false;\n\n                if (!this.displayObject)\n                    return;\n\n                if (this._mode == ButtonMode.Common) {\n                    if (this.grayed && this._buttonController && this._buttonController.hasPage(GButton.DISABLED))\n                        this.setState(GButton.DISABLED);\n                    else if (this._over)\n                        this.setState(GButton.OVER);\n                    else\n                        this.setState(GButton.UP);\n                }\n            }\n        }\n\n        private __click(evt: egret.TouchEvent): void {\n            if (this._sound) {\n                var pi: PackageItem = UIPackage.getItemByURL(this._sound);\n                if (pi) {\n                    var sound: egret.Sound = <egret.Sound>pi.owner.getItemAsset(pi);\n                    if (sound)\n                        GRoot.inst.playOneShotSound(sound, this._soundVolumeScale);\n                }\n            }\n\n            if (this._mode == ButtonMode.Check) {\n                if (this._changeStateOnClick) {\n                    this.selected = !this._selected;\n                    this.dispatchEvent(new StateChangeEvent(StateChangeEvent.CHANGED));\n                }\n            }\n            else if (this._mode == ButtonMode.Radio) {\n                if (this._changeStateOnClick && !this._selected) {\n                    this.selected = true;\n                    this.dispatchEvent(new StateChangeEvent(StateChangeEvent.CHANGED));\n                }\n            }\n            else {\n                if (this._relatedController)\n                    this._relatedController.selectedPageId = this._relatedPageId;\n            }\n        }\n    }\n}"
  },
  {
    "path": "source/src/GComboBox.ts",
    "content": "\nmodule fgui {\n\n    export class GComboBox extends GComponent {\n        public dropdown: GComponent;\n\n        protected _titleObject: GObject;\n        protected _iconObject: GObject;\n        protected _list: GList;\n\n        private _items: Array<string>;\n        private _values: Array<string>;\n        private _icons?: Array<string>;\n\n        private _visibleItemCount: number = 0;\n        private _itemsUpdated: boolean;\n        private _selectedIndex: number = 0;\n        private _buttonController: Controller;\n        private _popupDirection: number = PopupDirection.Auto;\n        private _selectionController?: Controller;\n\n        private _over: boolean;\n        private _down: boolean;\n\n        public constructor() {\n            super();\n            this._visibleItemCount = UIConfig.defaultComboBoxVisibleItemCount;\n            this._itemsUpdated = true;\n            this._selectedIndex = -1;\n            this._items = [];\n            this._values = [];\n        }\n\n        public get text(): string {\n            if (this._titleObject)\n                return this._titleObject.text;\n            else\n                return null;\n        }\n\n        public set text(value: string) {\n            if (this._titleObject)\n                this._titleObject.text = value;\n            this.updateGear(6);\n        }\n\n        public get icon(): string {\n            if (this._iconObject)\n                return this._iconObject.icon;\n            else\n                return null;\n        }\n\n        public set icon(value: string) {\n            if (this._iconObject)\n                this._iconObject.icon = value;\n            this.updateGear(7);\n        }\n\n        public get titleColor(): number {\n            var tf: GTextField = this.getTextField();\n            if (tf)\n                return tf.color;\n            else\n                return 0;\n        }\n\n        public set titleColor(value: number) {\n            var tf: GTextField = this.getTextField();\n            if (tf)\n                tf.color = value;\n        }\n\n        public get titleFontSize(): number {\n            var tf: GTextField = this.getTextField();\n            if (tf)\n                return tf.fontSize;\n            else\n                return 0;\n        }\n\n        public set titleFontSize(value: number) {\n            var tf: GTextField = this.getTextField();\n            if (tf)\n                tf.fontSize = value;\n        }\n\n        public get visibleItemCount(): number {\n            return this._visibleItemCount;\n        }\n\n        public set visibleItemCount(value: number) {\n            this._visibleItemCount = value;\n        }\n\n        public get popupDirection(): PopupDirection {\n            return this._popupDirection;\n        }\n\n        public set popupDirection(value: PopupDirection) {\n            this._popupDirection = value;\n        }\n\n        public get items(): Array<string> {\n            return this._items;\n        }\n\n        public set items(value: Array<string>) {\n            if (!value)\n                this._items.length = 0;\n            else\n                this._items = value.concat();\n            if (this._items.length > 0) {\n                if (this._selectedIndex >= this._items.length)\n                    this._selectedIndex = this._items.length - 1;\n                else if (this._selectedIndex == -1)\n                    this._selectedIndex = 0;\n\n                this.text = this._items[this._selectedIndex];\n                if (this._icons && this._selectedIndex < this._icons.length)\n                    this.icon = this._icons[this._selectedIndex];\n            }\n            else {\n                this.text = \"\";\n                if (this._icons)\n                    this.icon = null;\n                this._selectedIndex = -1;\n            }\n            this._itemsUpdated = true;\n        }\n\n        public get icons(): Array<string> {\n            return this._icons;\n        }\n\n        public set icons(value: Array<string>) {\n            this._icons = value;\n            if (this._icons && this._selectedIndex != -1 && this._selectedIndex < this._icons.length)\n                this.icon = this._icons[this._selectedIndex];\n        }\n\n        public get values(): Array<string> {\n            return this._values;\n        }\n\n        public set values(value: Array<string>) {\n            if (!value)\n                this._values.length = 0;\n            else\n                this._values = value.concat();\n        }\n\n        public get selectedIndex(): number {\n            return this._selectedIndex;\n        }\n\n        public set selectedIndex(val: number) {\n            if (this._selectedIndex == val)\n                return;\n\n            this._selectedIndex = val;\n            if (this._selectedIndex >= 0 && this._selectedIndex < this._items.length) {\n                this.text = this._items[this._selectedIndex];\n                if (this._icons && this._selectedIndex < this._icons.length)\n                    this.icon = this._icons[this._selectedIndex];\n            }\n            else {\n                this.text = \"\";\n                if (this._icons)\n                    this.icon = null;\n            }\n\n            this.updateSelectionController();\n        }\n\n        public get value(): string {\n            return this._values[this._selectedIndex];\n        }\n\n        public set value(val: string) {\n            var index: number = this._values.indexOf(val);\n            if (index == -1 && val == null)\n                index = this._values.indexOf(\"\");\n            this.selectedIndex = index;\n        }\n\n        public get selectionController(): Controller {\n            return this._selectionController;\n        }\n\n        public set selectionController(value: Controller) {\n            this._selectionController = value;\n        }\n\n        public getTextField(): GTextField {\n            if (this._titleObject instanceof GTextField)\n                return this._titleObject;\n            else if ((this._titleObject instanceof GLabel) || (this._titleObject instanceof GButton))\n                return this._titleObject.getTextField();\n            else\n                return null;\n        }\n\n        protected setState(val: string): void {\n            if (this._buttonController)\n                this._buttonController.selectedPage = val;\n        }\n\n        public getProp(index: number): any {\n            switch (index) {\n                case ObjectPropID.Color:\n                    return this.titleColor;\n                case ObjectPropID.OutlineColor:\n                    {\n                        var tf: GTextField = this.getTextField();\n                        if (tf)\n                            return tf.strokeColor;\n                        else\n                            return 0;\n                    }\n                case ObjectPropID.FontSize:\n                    {\n                        tf = this.getTextField();\n                        if (tf)\n                            return tf.fontSize;\n                        else\n                            return 0;\n                    }\n                default:\n                    return super.getProp(index);\n            }\n        }\n\n        public setProp(index: number, value: any): void {\n            switch (index) {\n                case ObjectPropID.Color:\n                    this.titleColor = value;\n                    break;\n                case ObjectPropID.OutlineColor:\n                    {\n                        var tf: GTextField = this.getTextField();\n                        if (tf)\n                            tf.strokeColor = value;\n                    }\n                    break;\n                case ObjectPropID.FontSize:\n                    {\n                        tf = this.getTextField();\n                        if (tf)\n                            tf.fontSize = value;\n                    }\n                    break;\n                default:\n                    super.setProp(index, value);\n                    break;\n            }\n        }\n\n        protected constructExtension(buffer: ByteBuffer): void {\n            var str: string;\n\n            this._buttonController = this.getController(\"button\");\n            this._titleObject = this.getChild(\"title\");\n            this._iconObject = this.getChild(\"icon\");\n\n            str = buffer.readS();\n            if (str) {\n                this.dropdown = <GComponent><any>(UIPackage.createObjectFromURL(str));\n                if (!this.dropdown) {\n                    console.error(\"下拉框必须为元件\");\n                    return;\n                }\n                this.dropdown.name = \"this.dropdown\";\n                this._list = this.dropdown.getChild(\"list\").asList;\n                if (this._list == null) {\n                    console.error(this.resourceURL + \": 下拉框的弹出元件里必须包含名为list的列表\");\n                    return;\n                }\n                this._list.addEventListener(ItemEvent.CLICK, this.__clickItem, this);\n\n                this._list.addRelation(this.dropdown, RelationType.Width);\n                this._list.removeRelation(this.dropdown, RelationType.Height);\n\n                this.dropdown.addRelation(this._list, RelationType.Height);\n                this.dropdown.removeRelation(this._list, RelationType.Width);\n\n                this.dropdown.displayObject.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.__popupWinClosed, this);\n            }\n\n            /*not support\n            if (!GRoot.touchScreen) {\n                this.displayObject.addEventListener(egret.TouchEvent.TOUCH_ROLL_OVER, this.__rollover, this);\n                this.displayObject.addEventListener(egret.TouchEvent.TOUCH_ROLL_OUT, this.__rollout, this);\n            }*/\n\n            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__mousedown, this);\n        }\n\n        public handleControllerChanged(c: Controller): void {\n            super.handleControllerChanged(c);\n\n            if (this._selectionController == c)\n                this.selectedIndex = c.selectedIndex;\n        }\n\n        private updateSelectionController(): void {\n            if (this._selectionController && !this._selectionController.changing\n                && this._selectedIndex < this._selectionController.pageCount) {\n                var c: Controller = this._selectionController;\n                this._selectionController = null;\n                c.selectedIndex = this._selectedIndex;\n                this._selectionController = c;\n            }\n        }\n\n        public dispose(): void {\n            if (this.dropdown) {\n                this.dropdown.dispose();\n                this.dropdown = null;\n            }\n\n            super.dispose();\n        }\n\n        public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_afterAdd(buffer, beginPos);\n\n            if (!buffer.seek(beginPos, 6))\n                return;\n\n            if (buffer.readByte() != this.packageItem.objectType)\n                return;\n\n            var i: number;\n            var iv: number;\n            var nextPos: number;\n            var str: string;\n            var itemCount: number = buffer.readShort();\n            for (i = 0; i < itemCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n\n                this._items[i] = buffer.readS();\n                this._values[i] = buffer.readS();\n                str = buffer.readS();\n                if (str != null) {\n                    if (this._icons == null)\n                        this._icons = new Array<string>();\n                    this._icons[i] = str;\n                }\n\n                buffer.position = nextPos;\n            }\n\n            str = buffer.readS();\n            if (str != null) {\n                this.text = str;\n                this._selectedIndex = this._items.indexOf(str);\n            }\n            else if (this._items.length > 0) {\n                this._selectedIndex = 0;\n                this.text = this._items[0];\n            }\n            else\n                this._selectedIndex = -1;\n\n            str = buffer.readS();\n            if (str != null)\n                this.icon = str;\n\n            if (buffer.readBool())\n                this.titleColor = buffer.readColor();\n            iv = buffer.readInt();\n            if (iv > 0)\n                this._visibleItemCount = iv;\n            this._popupDirection = buffer.readByte();\n\n            iv = buffer.readShort();\n            if (iv >= 0)\n                this._selectionController = this.parent.getControllerAt(iv);\n        }\n\n        protected showDropdown(): void {\n            if (this._itemsUpdated) {\n                this._itemsUpdated = false;\n\n                this._list.removeChildrenToPool();\n                var cnt: number = this._items.length;\n                for (var i: number = 0; i < cnt; i++) {\n                    var item: GObject = this._list.addItemFromPool();\n                    item.name = i < this._values.length ? this._values[i] : \"\";\n                    item.text = this._items[i];\n                    item.icon = (this._icons && i < this._icons.length) ? this._icons[i] : null;\n                }\n                this._list.resizeToFit(this._visibleItemCount);\n            }\n            this._list.selectedIndex = -1;\n            this.dropdown.width = this.width;\n            this._list.ensureBoundsCorrect();\n\n            this.root.togglePopup(this.dropdown, this, this._popupDirection);\n            if (this.dropdown.parent)\n                this.setState(GButton.DOWN);\n        }\n\n        private __popupWinClosed(evt: egret.Event): void {\n            if (this._over)\n                this.setState(GButton.OVER);\n            else\n                this.setState(GButton.UP);\n        }\n\n        private __clickItem(evt: ItemEvent): void {\n            GTimers.inst.add(100, 1, this.__clickItem2, this, this._list.getChildIndex(evt.itemObject))\n        }\n\n        private __clickItem2(index: number): void {\n            if (this.dropdown.parent instanceof GRoot)\n                this.dropdown.parent.hidePopup();\n\n            this._selectedIndex = -1;\n            this.selectedIndex = index;\n            this.dispatchEvent(new StateChangeEvent(StateChangeEvent.CHANGED));\n        }\n\n        // private __rollover(evt: egret.TouchEvent): void {\n        //     this._over = true;\n        //     if (this._down || this.dropdown && this.dropdown.parent)\n        //         return;\n\n        //     this.setState(GButton.OVER);\n        // }\n\n        // private __rollout(evt: egret.TouchEvent): void {\n        //     this._over = false;\n        //     if (this._down || this.dropdown && this.dropdown.parent)\n        //         return;\n\n        //     this.setState(GButton.UP);\n        // }\n\n        private __mousedown(evt: egret.TouchEvent): void {\n            if ((evt.target instanceof egret.TextField) && evt.target.type == egret.TextFieldType.INPUT)\n                return;\n\n            this._down = true;\n            GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__mouseup, this);\n\n            if (this.dropdown)\n                this.showDropdown();\n        }\n\n        private __mouseup(evt: egret.TouchEvent): void {\n            if (this._down) {\n                this._down = false;\n                GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_END, this.__mouseup, this);\n\n                if (this.dropdown && !this.dropdown.parent) {\n                    if (this._over)\n                        this.setState(GButton.OVER);\n                    else\n                        this.setState(GButton.UP);\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "source/src/GComponent.ts",
    "content": "/// <reference path=\"GObject.ts\" />\n\nmodule fgui {\n\n    export class GComponent extends GObject {\n        private _sortingChildCount: number = 0;\n        private _applyingController?: Controller;\n\n        protected _margin: Margin;\n        protected _trackBounds: boolean;\n        protected _boundsChanged: boolean;\n        protected _childrenRenderOrder: ChildrenRenderOrder = ChildrenRenderOrder.Ascent;\n        protected _apexIndex: number = 0;\n\n        public _buildingDisplayList: boolean;\n        public _children: Array<GObject>;\n        public _controllers: Array<Controller>;\n        public _transitions: Array<Transition>;\n        public _rootContainer: UIContainer;\n        public _container: egret.DisplayObjectContainer;\n        public _scrollPane?: ScrollPane;\n        public _alignOffset: egret.Point;\n\n        public constructor() {\n            super();\n            this._children = new Array<GObject>();\n            this._controllers = new Array<Controller>();\n            this._transitions = new Array<Transition>();\n            this._margin = new Margin();\n            this._alignOffset = new egret.Point();\n        }\n\n        protected createDisplayObject(): void {\n            this._rootContainer = new UIContainer();\n            this.setDisplayObject(this._rootContainer);\n            this._container = this._rootContainer;\n        }\n\n        public dispose(): void {\n            var i: number;\n            var cnt: number;\n\n            cnt = this._transitions.length;\n            for (i = 0; i < cnt; ++i) {\n                var trans: Transition = this._transitions[i];\n                trans.dispose();\n            }\n\n            cnt = this._controllers.length;\n            for (i = 0; i < cnt; ++i) {\n                var cc: Controller = this._controllers[i];\n                cc.dispose();\n            }\n\n            if (this._scrollPane)\n                this._scrollPane.dispose();\n\n            cnt = this._children.length;\n            for (i = cnt - 1; i >= 0; --i) {\n                var obj: GObject = this._children[i];\n                obj.parent = null;//avoid removeFromParent call\n                obj.dispose();\n            }\n\n            this._boundsChanged = false;\n            super.dispose();\n        }\n\n        public get displayListContainer(): egret.DisplayObjectContainer {\n            return this._container;\n        }\n\n        public addChild(child: GObject): GObject {\n            this.addChildAt(child, this._children.length);\n            return child;\n        }\n\n        public addChildAt(child: GObject, index: number = 0): GObject {\n            if (!child)\n                throw \"child is null\";\n\n            var numChildren: number = this._children.length;\n\n            if (index >= 0 && index <= numChildren) {\n                if (child.parent == this) {\n                    this.setChildIndex(child, index);\n                }\n                else {\n                    child.removeFromParent();\n                    child.parent = this;\n\n                    var cnt: number = this._children.length;\n                    if (child.sortingOrder != 0) {\n                        this._sortingChildCount++;\n                        index = this.getInsertPosForSortingChild(child);\n                    }\n                    else if (this._sortingChildCount > 0) {\n                        if (index > (cnt - this._sortingChildCount))\n                            index = cnt - this._sortingChildCount;\n                    }\n\n                    if (index == cnt)\n                        this._children.push(child);\n                    else\n                        this._children.splice(index, 0, child);\n\n                    this.childStateChanged(child);\n                    this.setBoundsChangedFlag();\n                }\n\n                return child;\n            }\n            else {\n                throw \"Invalid child index\";\n            }\n        }\n\n        private getInsertPosForSortingChild(target: GObject): number {\n            var cnt: number = this._children.length;\n            var i: number = 0;\n            for (i = 0; i < cnt; i++) {\n                var child: GObject = this._children[i];\n                if (child == target)\n                    continue;\n\n                if (target.sortingOrder < child.sortingOrder)\n                    break;\n            }\n            return i;\n        }\n\n        public removeChild(child: GObject, dispose?: boolean): GObject {\n            var childIndex: number = this._children.indexOf(child);\n            if (childIndex != -1) {\n                this.removeChildAt(childIndex, dispose);\n            }\n            return child;\n        }\n\n        public removeChildAt(index: number, dispose?: boolean): GObject {\n            if (index >= 0 && index < this.numChildren) {\n                var child: GObject = this._children[index];\n                child.parent = null;\n\n                if (child.sortingOrder != 0)\n                    this._sortingChildCount--;\n\n                this._children.splice(index, 1);\n                child.group = null;\n                if (child.inContainer) {\n                    this._container.removeChild(child.displayObject);\n                    if (this._childrenRenderOrder == ChildrenRenderOrder.Arch)\n                        GTimers.inst.callLater(this.buildNativeDisplayList, this);\n                }\n\n                if (dispose)\n                    child.dispose();\n\n                this.setBoundsChangedFlag();\n\n                return child;\n            }\n            else {\n                throw \"Invalid child index\";\n            }\n        }\n\n        public removeChildren(beginIndex?: number, endIndex?: number, dispose?: boolean): void {\n            if (beginIndex == undefined) beginIndex = 0;\n            if (endIndex == undefined) endIndex = -1;\n\n            if (endIndex < 0 || endIndex >= this.numChildren)\n                endIndex = this.numChildren - 1;\n\n            for (var i: number = beginIndex; i <= endIndex; ++i)\n                this.removeChildAt(beginIndex, dispose);\n        }\n\n        public getChildAt(index: number): GObject {\n            if (index >= 0 && index < this.numChildren)\n                return this._children[index];\n            else\n                throw \"Invalid child index\";\n        }\n\n        public getChild(name: string): GObject {\n            var cnt: number = this._children.length;\n            for (var i: number = 0; i < cnt; ++i) {\n                if (this._children[i].name == name)\n                    return this._children[i];\n            }\n\n            return null;\n        }\n\n        public getChildByPath(path: String): GObject {\n            var arr: string[] = path.split(\".\");\n            var cnt: number = arr.length;\n            var gcom: GComponent = this;\n            var obj: GObject;\n            for (var i: number = 0; i < cnt; ++i) {\n                obj = gcom.getChild(arr[i]);\n                if (!obj)\n                    break;\n\n                if (i != cnt - 1) {\n                    if (!(obj instanceof GComponent)) {\n                        obj = null;\n                        break;\n                    }\n                    else\n                        gcom = obj;\n                }\n            }\n\n            return obj;\n        }\n\n        public getVisibleChild(name: string): GObject {\n            var cnt: number = this._children.length;\n            for (var i: number = 0; i < cnt; ++i) {\n                var child: GObject = this._children[i];\n                if (child.internalVisible && child.internalVisible && child.name == name)\n                    return child;\n            }\n\n            return null;\n        }\n\n        public getChildInGroup(name: string, group: GGroup): GObject {\n            var cnt: number = this._children.length;\n            for (var i: number = 0; i < cnt; ++i) {\n                var child: GObject = this._children[i];\n                if (child.group == group && child.name == name)\n                    return child;\n            }\n\n            return null;\n        }\n\n        public getChildById(id: string): GObject {\n            var cnt: number = this._children.length;\n            for (var i: number = 0; i < cnt; ++i) {\n                if (this._children[i]._id == id)\n                    return this._children[i];\n            }\n\n            return null;\n        }\n\n        public getChildIndex(child: GObject): number {\n            return this._children.indexOf(child);\n        }\n\n        public setChildIndex(child: GObject, index: number): void {\n            var oldIndex: number = this._children.indexOf(child);\n            if (oldIndex == -1)\n                throw \"Not a child of this container\";\n\n            if (child.sortingOrder != 0) //no effect\n                return;\n\n            var cnt: number = this._children.length;\n            if (this._sortingChildCount > 0) {\n                if (index > (cnt - this._sortingChildCount - 1))\n                    index = cnt - this._sortingChildCount - 1;\n            }\n\n            this._setChildIndex(child, oldIndex, index);\n        }\n\n        public setChildIndexBefore(child: GObject, index: number): number {\n            var oldIndex: number = this._children.indexOf(child);\n            if (oldIndex == -1)\n                throw \"Not a child of this container\";\n\n            if (child.sortingOrder != 0) //no effect\n                return oldIndex;\n\n            var cnt: number = this._children.length;\n            if (this._sortingChildCount > 0) {\n                if (index > (cnt - this._sortingChildCount - 1))\n                    index = cnt - this._sortingChildCount - 1;\n            }\n\n            if (oldIndex < index)\n                return this._setChildIndex(child, oldIndex, index - 1);\n            else\n                return this._setChildIndex(child, oldIndex, index);\n        }\n\n        private _setChildIndex(child: GObject, oldIndex: number, index: number): number {\n            var cnt: number = this._children.length;\n            if (index > cnt)\n                index = cnt;\n\n            if (oldIndex == index)\n                return oldIndex;\n\n            this._children.splice(oldIndex, 1);\n            this._children.splice(index, 0, child);\n\n            if (child.inContainer) {\n                var displayIndex: number = 0;\n                var g: GObject;\n                var i: number;\n\n                if (this._childrenRenderOrder == ChildrenRenderOrder.Ascent) {\n                    for (i = 0; i < index; i++) {\n                        g = this._children[i];\n                        if (g.inContainer)\n                            displayIndex++;\n                    }\n                    if (displayIndex == this._container.numChildren)\n                        displayIndex--;\n                    this._container.setChildIndex(child.displayObject, displayIndex);\n                }\n                else if (this._childrenRenderOrder == ChildrenRenderOrder.Descent) {\n                    for (i = cnt - 1; i > index; i--) {\n                        g = this._children[i];\n                        if (g.inContainer)\n                            displayIndex++;\n                    }\n                    if (displayIndex == this._container.numChildren)\n                        displayIndex--;\n                    this._container.setChildIndex(child.displayObject, displayIndex);\n                }\n                else {\n                    GTimers.inst.callLater(this.buildNativeDisplayList, this);\n                }\n\n                this.setBoundsChangedFlag();\n            }\n\n            return index;\n        }\n\n        public swapChildren(child1: GObject, child2: GObject): void {\n            var index1: number = this._children.indexOf(child1);\n            var index2: number = this._children.indexOf(child2);\n            if (index1 == -1 || index2 == -1)\n                throw \"Not a child of this container\";\n            this.swapChildrenAt(index1, index2);\n        }\n\n        public swapChildrenAt(index1: number, index2: number): void {\n            var child1: GObject = this._children[index1];\n            var child2: GObject = this._children[index2];\n\n            this.setChildIndex(child1, index2);\n            this.setChildIndex(child2, index1);\n        }\n\n        public get numChildren(): number {\n            return this._children.length;\n        }\n\n        public isAncestorOf(child: GObject): boolean {\n            if (!child)\n                return false;\n\n            var p: GComponent = child.parent;\n            while (p) {\n                if (p == this)\n                    return true;\n\n                p = p.parent;\n            }\n            return false;\n        }\n\n        public addController(controller: Controller): void {\n            this._controllers.push(controller);\n            controller.parent = this;\n            this.applyController(controller);\n        }\n\n        public getControllerAt(index: number): Controller {\n            return this._controllers[index];\n        }\n\n        public getController(name: string): Controller {\n            var cnt: number = this._controllers.length;\n            for (var i: number = 0; i < cnt; ++i) {\n                var c: Controller = this._controllers[i];\n                if (c.name == name)\n                    return c;\n            }\n\n            return null;\n        }\n\n        public removeController(c: Controller): void {\n            var index: number = this._controllers.indexOf(c);\n            if (index == -1)\n                throw \"controller not exists\";\n\n            c.parent = null;\n            this._controllers.splice(index, 1);\n\n            var length: number = this._children.length;\n            for (var i: number = 0; i < length; i++) {\n                var child: GObject = this._children[i];\n                child.handleControllerChanged(c);\n            }\n        }\n\n        public get controllers(): Array<Controller> {\n            return this._controllers;\n        }\n\n        public childStateChanged(child: GObject): void {\n            if (this._buildingDisplayList)\n                return;\n\n            var cnt: number = this._children.length;\n            var g: GObject;\n            var i: number;\n\n            if (child instanceof GGroup) {\n                for (i = 0; i < cnt; i++) {\n                    g = this._children[i];\n                    if (g.group == child)\n                        this.childStateChanged(g);\n                }\n                return;\n            }\n\n            if (!child.displayObject)\n                return;\n\n            if (child.internalVisible) {\n                if (!child.displayObject.parent) {\n                    var index: number = 0;\n                    if (this._childrenRenderOrder == ChildrenRenderOrder.Ascent) {\n                        for (i = 0; i < cnt; i++) {\n                            g = this._children[i];\n                            if (g == child)\n                                break;\n\n                            if (g.displayObject && g.displayObject.parent)\n                                index++;\n                        }\n                        this._container.addChildAt(child.displayObject, index);\n                    }\n                    else if (this._childrenRenderOrder == ChildrenRenderOrder.Descent) {\n                        for (i = cnt - 1; i >= 0; i--) {\n                            g = this._children[i];\n                            if (g == child)\n                                break;\n\n                            if (g.displayObject && g.displayObject.parent)\n                                index++;\n                        }\n                        this._container.addChildAt(child.displayObject, index);\n                    }\n                    else {\n                        this._container.addChild(child.displayObject);\n\n                        GTimers.inst.callLater(this.buildNativeDisplayList, this);\n                    }\n                }\n            }\n            else {\n                if (child.displayObject.parent)\n                    this._container.removeChild(child.displayObject);\n            }\n        }\n\n        private buildNativeDisplayList(): void {\n            var cnt: number = this._children.length;\n            if (cnt == 0)\n                return;\n\n            var i: number;\n            var child: GObject;\n            switch (this._childrenRenderOrder) {\n                case ChildrenRenderOrder.Ascent:\n                    {\n                        for (i = 0; i < cnt; i++) {\n                            child = this._children[i];\n                            if (child.displayObject && child.internalVisible)\n                                this._container.addChild(child.displayObject);\n                        }\n                    }\n                    break;\n                case ChildrenRenderOrder.Descent:\n                    {\n                        for (i = cnt - 1; i >= 0; i--) {\n                            child = this._children[i];\n                            if (child.displayObject && child.internalVisible)\n                                this._container.addChild(child.displayObject);\n                        }\n                    }\n                    break;\n\n                case ChildrenRenderOrder.Arch:\n                    {\n                        var apex: number = ToolSet.clamp(this._apexIndex, 0, cnt);\n                        for (i = 0; i < apex; i++) {\n                            child = this._children[i];\n                            if (child.displayObject && child.internalVisible)\n                                this._container.addChild(child.displayObject);\n                        }\n                        for (i = cnt - 1; i >= apex; i--) {\n                            child = this._children[i];\n                            if (child.displayObject && child.internalVisible)\n                                this._container.addChild(child.displayObject);\n                        }\n                    }\n                    break;\n            }\n        }\n\n        public applyController(c: Controller): void {\n            this._applyingController = c;\n            var child: GObject;\n            var length: number = this._children.length;\n            for (var i: number = 0; i < length; i++) {\n                child = this._children[i];\n                child.handleControllerChanged(c);\n            }\n            this._applyingController = null;\n\n            c.runActions();\n        }\n\n        public applyAllControllers(): void {\n            var cnt: number = this._controllers.length;\n            for (var i: number = 0; i < cnt; ++i) {\n                this.applyController(this._controllers[i]);\n            }\n        }\n\n        public adjustRadioGroupDepth(obj: GObject, c: Controller): void {\n            var cnt: number = this._children.length;\n            var i: number;\n            var child: GObject;\n            var myIndex: number = -1, maxIndex: number = -1;\n            for (i = 0; i < cnt; i++) {\n                child = this._children[i];\n                if (child == obj) {\n                    myIndex = i;\n                }\n                else if ((child instanceof GButton) && child.relatedController == c) {\n                    if (i > maxIndex)\n                        maxIndex = i;\n                }\n            }\n            if (myIndex < maxIndex) {\n                if (this._applyingController)\n                    this._children[maxIndex].handleControllerChanged(this._applyingController);\n                this.swapChildrenAt(myIndex, maxIndex);\n            }\n        }\n\n        public getTransitionAt(index: number): Transition {\n            return this._transitions[index];\n        }\n\n        public getTransition(transName: string): Transition {\n            var cnt: number = this._transitions.length;\n            for (var i: number = 0; i < cnt; ++i) {\n                var trans: Transition = this._transitions[i];\n                if (trans.name == transName)\n                    return trans;\n            }\n\n            return null;\n        }\n\n        public isChildInView(child: GObject): boolean {\n            if (this._rootContainer.scrollRect) {\n                return child.x + child.width >= 0 && child.x <= this.width\n                    && child.y + child.height >= 0 && child.y <= this.height;\n            }\n            else if (this._scrollPane) {\n                return this._scrollPane.isChildInView(child);\n            }\n            else\n                return true;\n        }\n\n        public getFirstChildInView(): number {\n            var cnt: number = this._children.length;\n            for (var i: number = 0; i < cnt; ++i) {\n                var child: GObject = this._children[i];\n                if (this.isChildInView(child))\n                    return i;\n            }\n            return -1;\n        }\n\n        public get scrollPane(): ScrollPane {\n            return this._scrollPane;\n        }\n\n        public get opaque(): boolean {\n            return this._rootContainer.opaque;\n        }\n\n        public set opaque(value: boolean) {\n            this._rootContainer.opaque = value;\n        }\n\n        public get margin(): Margin {\n            return this._margin;\n        }\n\n        public set margin(value: Margin) {\n            this._margin.copy(value);\n            if (this._rootContainer.scrollRect) {\n                this._container.x = this._margin.left + this._alignOffset.x;\n                this._container.y = this._margin.top + this._alignOffset.y;\n            }\n            this.handleSizeChanged();\n        }\n\n        public get childrenRenderOrder(): ChildrenRenderOrder {\n            return this._childrenRenderOrder;\n        }\n\n        public set childrenRenderOrder(value: ChildrenRenderOrder) {\n            if (this._childrenRenderOrder != value) {\n                this._childrenRenderOrder = value;\n                this.buildNativeDisplayList();\n            }\n        }\n\n        public get apexIndex(): number {\n            return this._apexIndex;\n        }\n\n        public set apexIndex(value: number) {\n            if (this._apexIndex != value) {\n                this._apexIndex = value;\n\n                if (this._childrenRenderOrder == ChildrenRenderOrder.Arch)\n                    this.buildNativeDisplayList();\n            }\n        }\n\n        public reversedMask: boolean;\n        public get mask(): egret.DisplayObject | egret.Rectangle {\n            return this._rootContainer.mask;\n        }\n\n        public set mask(value: egret.DisplayObject | egret.Rectangle) {\n            this._rootContainer.mask = value;\n            if (this.reversedMask) {\n                this._rootContainer.cacheAsBitmap = true;\n                (this.mask as egret.DisplayObject).blendMode = egret.BlendMode.ERASE;\n                this._rootContainer.mask = null;\n            }\n        }\n\n        public get baseUserData(): string {\n            var buffer: ByteBuffer = this.packageItem.rawData;\n            buffer.seek(0, 4);\n            return buffer.readS();\n        }\n\n        protected updateScrollRect() {\n            var rect: egret.Rectangle = this._rootContainer.scrollRect;\n            if (rect == null)\n                rect = new egret.Rectangle();\n\n            var w: number = this.width - this._margin.right;\n            var h: number = this.height - this._margin.bottom;\n            rect.setTo(0, 0, w, h);\n            this._rootContainer.scrollRect = rect;\n        }\n\n        protected setupScroll(buffer: ByteBuffer): void {\n            if (this._rootContainer == this._container) {\n                this._container = new egret.DisplayObjectContainer();\n                this._rootContainer.addChild(this._container);\n            }\n            this._scrollPane = new ScrollPane(this);\n            this._scrollPane.setup(buffer);\n            this.setBoundsChangedFlag();\n        }\n\n        protected setupOverflow(overflow: OverflowType): void {\n            if (overflow == OverflowType.Hidden) {\n                if (this._rootContainer == this._container) {\n                    this._container = new egret.DisplayObjectContainer();\n                    this._rootContainer.addChild(this._container);\n                }\n                this.updateScrollRect();\n                this._container.x = this._margin.left;\n                this._container.y = this._margin.top;\n            }\n            else if (this._margin.left != 0 || this._margin.top != 0) {\n                if (this._rootContainer == this._container) {\n                    this._container = new egret.DisplayObjectContainer();\n                    this._rootContainer.addChild(this._container);\n                }\n                this._container.x = this._margin.left;\n                this._container.y = this._margin.top;\n            }\n\n            this.setBoundsChangedFlag();\n        }\n\n        protected handleSizeChanged(): void {\n            super.handleSizeChanged();\n\n            if (this._scrollPane)\n                this._scrollPane.onOwnerSizeChanged();\n            else if (this._rootContainer.scrollRect)\n                this.updateScrollRect();\n\n            if (this._rootContainer.hitArea instanceof PixelHitTest) {\n                var hitTest: PixelHitTest = <PixelHitTest>(this._rootContainer.hitArea);\n                if (this.sourceWidth != 0)\n                    hitTest.scaleX = this._width / this.sourceWidth;\n                if (this.sourceHeight != 0)\n                    hitTest.scaleY = this._height / this.sourceHeight;\n            }\n        }\n\n        protected handleGrayedChanged(): void {\n            var c: Controller = this.getController(\"grayed\");\n            if (c) {\n                c.selectedIndex = this.grayed ? 1 : 0;\n                return;\n            }\n\n            var v: boolean = this.grayed;\n            var cnt: number = this._children.length;\n            for (var i: number = 0; i < cnt; ++i) {\n                this._children[i].grayed = v;\n            }\n        }\n\n        public handleControllerChanged(c: Controller): void {\n            super.handleControllerChanged(c);\n\n            if (this._scrollPane)\n                this._scrollPane.handleControllerChanged(c);\n        }\n\n        public setBoundsChangedFlag(): void {\n            if (!this._scrollPane && !this._trackBounds)\n                return;\n\n            if (!this._boundsChanged) {\n                this._boundsChanged = true;\n\n                egret.callLater(this.__render, this);\n            }\n        }\n\n        private __render(): void {\n            if (this._boundsChanged) {\n                var len: number = this._children.length;\n                if (len > 0) {\n                    for (var i: number = 0; i < len; i++) {\n                        var child: GObject = this._children[i];\n                        child.ensureSizeCorrect();\n                    }\n                }\n\n                this.updateBounds();\n            }\n        }\n\n        public ensureBoundsCorrect(): void {\n            var len: number = this._children.length;\n            if (len > 0) {\n                for (var i: number = 0; i < len; i++) {\n                    var child: GObject = this._children[i];\n                    child.ensureSizeCorrect();\n                }\n            }\n\n            if (this._boundsChanged)\n                this.updateBounds();\n        }\n\n        protected updateBounds(): void {\n            var ax: number = 0, ay: number = 0, aw: number = 0, ah: number = 0;\n            var len: number = this._children.length;\n            if (len > 0) {\n                ax = Number.POSITIVE_INFINITY, ay = Number.POSITIVE_INFINITY;\n                var ar: number = Number.NEGATIVE_INFINITY, ab: number = Number.NEGATIVE_INFINITY;\n                var tmp: number = 0;\n                var i: number = 0;\n\n                for (var i: number = 0; i < len; i++) {\n                    var child: GObject = this._children[i];\n                    tmp = child.x;\n                    if (tmp < ax)\n                        ax = tmp;\n                    tmp = child.y;\n                    if (tmp < ay)\n                        ay = tmp;\n                    tmp = child.x + child.actualWidth;\n                    if (tmp > ar)\n                        ar = tmp;\n                    tmp = child.y + child.actualHeight;\n                    if (tmp > ab)\n                        ab = tmp;\n                }\n                aw = ar - ax;\n                ah = ab - ay;\n            }\n\n            this.setBounds(ax, ay, aw, ah);\n        }\n\n        public setBounds(ax: number, ay: number, aw: number, ah: number = 0): void {\n            this._boundsChanged = false;\n\n            if (this._scrollPane)\n                this._scrollPane.setContentSize(Math.round(ax + aw), Math.round(ay + ah));\n        }\n\n        public get viewWidth(): number {\n            if (this._scrollPane)\n                return this._scrollPane.viewWidth;\n            else\n                return this.width - this._margin.left - this._margin.right;\n        }\n\n        public set viewWidth(value: number) {\n            if (this._scrollPane)\n                this._scrollPane.viewWidth = value;\n            else\n                this.width = value + this._margin.left + this._margin.right;\n        }\n\n        public get viewHeight(): number {\n            if (this._scrollPane)\n                return this._scrollPane.viewHeight;\n            else\n                return this.height - this._margin.top - this._margin.bottom;\n        }\n\n        public set viewHeight(value: number) {\n            if (this._scrollPane)\n                this._scrollPane.viewHeight = value;\n            else\n                this.height = value + this._margin.top + this._margin.bottom;\n        }\n\n        public getSnappingPosition(xValue: number, yValue: number, resultPoint?: egret.Point): egret.Point {\n            if (!resultPoint)\n                resultPoint = new egret.Point();\n\n            var cnt: number = this._children.length;\n            if (cnt == 0) {\n                resultPoint.x = 0;\n                resultPoint.y = 0;\n                return resultPoint;\n            }\n\n            this.ensureBoundsCorrect();\n\n            var obj: GObject = null;\n            var prev: GObject = null;\n            var i: number = 0;\n            if (yValue != 0) {\n                for (; i < cnt; i++) {\n                    obj = this._children[i];\n                    if (yValue < obj.y) {\n                        if (i == 0) {\n                            yValue = 0;\n                            break;\n                        }\n                        else {\n                            prev = this._children[i - 1];\n                            if (yValue < prev.y + prev.actualHeight / 2) //top half part\n                                yValue = prev.y;\n                            else //bottom half part\n                                yValue = obj.y;\n                            break;\n                        }\n                    }\n                }\n\n                if (i == cnt)\n                    yValue = obj.y;\n            }\n\n            if (xValue != 0) {\n                if (i > 0)\n                    i--;\n                for (; i < cnt; i++) {\n                    obj = this._children[i];\n                    if (xValue < obj.x) {\n                        if (i == 0) {\n                            xValue = 0;\n                            break;\n                        }\n                        else {\n                            prev = this._children[i - 1];\n                            if (xValue < prev.x + prev.actualWidth / 2) //top half part\n                                xValue = prev.x;\n                            else //bottom half part\n                                xValue = obj.x;\n                            break;\n                        }\n                    }\n                }\n\n                if (i == cnt)\n                    xValue = obj.x;\n            }\n\n            resultPoint.x = xValue;\n            resultPoint.y = yValue;\n            return resultPoint;\n        }\n\n        public childSortingOrderChanged(child: GObject, oldValue: number, newValue: number = 0): void {\n            if (newValue == 0) {\n                this._sortingChildCount--;\n                this.setChildIndex(child, this._children.length);\n            }\n            else {\n                if (oldValue == 0)\n                    this._sortingChildCount++;\n\n                var oldIndex: number = this._children.indexOf(child);\n                var index: number = this.getInsertPosForSortingChild(child);\n                if (oldIndex < index)\n                    this._setChildIndex(child, oldIndex, index - 1);\n                else\n                    this._setChildIndex(child, oldIndex, index);\n            }\n        }\n\n        public constructFromResource(): void {\n            this.constructFromResource2(null, 0);\n        }\n\n        public constructFromResource2(objectPool: Array<GObject>, poolIndex: number): void {\n            var contentItem: PackageItem = this.packageItem.getBranch();\n\n            if (!contentItem.decoded) {\n                contentItem.decoded = true;\n                TranslationHelper.translateComponent(contentItem);\n            }\n\n            var i: number;\n            var dataLen: number;\n            var curPos: number;\n            var nextPos: number;\n            var f1: number;\n            var f2: number;\n            var i1: number;\n            var i2: number;\n\n            var buffer: ByteBuffer = contentItem.rawData;\n            buffer.seek(0, 0);\n\n            this._underConstruct = true;\n\n            this.sourceWidth = buffer.readInt();\n            this.sourceHeight = buffer.readInt();\n            this.initWidth = this.sourceWidth;\n            this.initHeight = this.sourceHeight;\n\n            this.setSize(this.sourceWidth, this.sourceHeight);\n\n            if (buffer.readBool()) {\n                this.minWidth = buffer.readInt();\n                this.maxWidth = buffer.readInt();\n                this.minHeight = buffer.readInt();\n                this.maxHeight = buffer.readInt();\n            }\n\n            if (buffer.readBool()) {\n                f1 = buffer.readFloat();\n                f2 = buffer.readFloat();\n                this.internalSetPivot(f1, f2, buffer.readBool());\n            }\n\n            if (buffer.readBool()) {\n                this._margin.top = buffer.readInt();\n                this._margin.bottom = buffer.readInt();\n                this._margin.left = buffer.readInt();\n                this._margin.right = buffer.readInt();\n            }\n\n            var overflow: number = buffer.readByte();\n            if (overflow == OverflowType.Scroll) {\n                var savedPos: number = buffer.position;\n                buffer.seek(0, 7);\n                this.setupScroll(buffer);\n                buffer.position = savedPos;\n            }\n            else\n                this.setupOverflow(overflow);\n\n            if (buffer.readBool())\n                buffer.skip(8);\n\n            this._buildingDisplayList = true;\n\n            buffer.seek(0, 1);\n\n            var controllerCount: number = buffer.readShort();\n            for (i = 0; i < controllerCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n\n                var controller: Controller = new Controller();\n                this._controllers.push(controller);\n                controller.parent = this;\n                controller.setup(buffer);\n\n                buffer.position = nextPos;\n            }\n\n            buffer.seek(0, 2);\n\n            var child: GObject;\n            var childCount: number = buffer.readShort();\n            for (i = 0; i < childCount; i++) {\n                dataLen = buffer.readShort();\n                curPos = buffer.position;\n\n                if (objectPool)\n                    child = objectPool[poolIndex + i];\n                else {\n                    buffer.seek(curPos, 0);\n\n                    var type: ObjectType = buffer.readByte();\n                    var src: string = buffer.readS();\n                    var pkgId: string = buffer.readS();\n\n                    var pi: PackageItem = null;\n                    if (src != null) {\n                        var pkg: UIPackage;\n                        if (pkgId != null)\n                            pkg = UIPackage.getById(pkgId);\n                        else\n                            pkg = contentItem.owner;\n\n                        pi = pkg ? pkg.getItemById(src) : null;\n                    }\n\n                    if (pi) {\n                        child = UIObjectFactory.newObject(pi);\n                        child.constructFromResource();\n                    }\n                    else\n                        child = UIObjectFactory.newObject(type);\n                }\n\n                child._underConstruct = true;\n                child.setup_beforeAdd(buffer, curPos);\n                child.parent = this;\n                this._children.push(child);\n\n                buffer.position = curPos + dataLen;\n            }\n\n            buffer.seek(0, 3);\n            this.relations.setup(buffer, true);\n\n            buffer.seek(0, 2);\n            buffer.skip(2);\n\n            for (i = 0; i < childCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n\n                buffer.seek(buffer.position, 3);\n                this._children[i].relations.setup(buffer, false);\n\n                buffer.position = nextPos;\n            }\n\n            buffer.seek(0, 2);\n            buffer.skip(2);\n\n            for (i = 0; i < childCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n\n                child = this._children[i];\n                child.setup_afterAdd(buffer, buffer.position);\n                child._underConstruct = false;\n\n                buffer.position = nextPos;\n            }\n\n            buffer.seek(0, 4);\n\n            buffer.skip(2); //customData\n            this.opaque = buffer.readBool();\n            var maskId: number = buffer.readShort();\n            if (maskId != -1) {\n                this.reversedMask = buffer.readBool(); //reversedMask\n                this.mask = this.getChildAt(maskId).displayObject;\n                \n            }\n            var hitTestId: string = buffer.readS();\n            i1 = buffer.readInt();\n            i2 = buffer.readInt();\n            if (hitTestId != null) {\n                pi = contentItem.owner.getItemById(hitTestId);\n                if (pi && pi.pixelHitTestData)\n                    this._rootContainer.hitArea = new PixelHitTest(pi.pixelHitTestData, i1, i2);\n            }\n            else if (i1 != 0 && i2 != -1) {\n                this._rootContainer.hitArea = this.getChildAt(i2).displayObject;\n            }\n\n            buffer.seek(0, 5);\n\n            var transitionCount: number = buffer.readShort();\n            for (i = 0; i < transitionCount; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n\n                var trans: Transition = new Transition(this);\n                trans.setup(buffer);\n                this._transitions.push(trans);\n\n                buffer.position = nextPos;\n            }\n\n            if (this._transitions.length > 0) {\n                this.displayObject.addEventListener(egret.Event.ADDED_TO_STAGE, this.___added, this);\n                this.displayObject.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.___removed, this);\n            }\n\n            this.applyAllControllers();\n\n            this._buildingDisplayList = false;\n            this._underConstruct = false;\n\n            this.buildNativeDisplayList();\n            this.setBoundsChangedFlag();\n\n            if (contentItem.objectType != ObjectType.Component)\n                this.constructExtension(buffer);\n\n            this.onConstruct();\n        }\n\n        protected onConstruct(): void {\n            this.constructFromXML(null);\n        }\n\n        protected constructExtension(buffer: ByteBuffer): void {\n        }\n\n        protected constructFromXML(xml: any): void {\n        }\n\n        public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_afterAdd(buffer, beginPos);\n\n            buffer.seek(beginPos, 4);\n\n            var pageController: number = buffer.readShort();\n            if (pageController != -1 && this._scrollPane)\n                this._scrollPane.pageController = this._parent.getControllerAt(pageController);\n\n            var cnt: number = buffer.readShort();\n            for (var i: number = 0; i < cnt; i++) {\n                var cc: Controller = this.getController(buffer.readS());\n                var pageId: string = buffer.readS();\n                if (cc)\n                    cc.selectedPageId = pageId;\n            }\n\n            if (buffer.version >= 2) {\n                cnt = buffer.readShort();\n                for (i = 0; i < cnt; i++) {\n                    var target: string = buffer.readS();\n                    var propertyId: number = buffer.readShort();\n                    var value: String = buffer.readS();\n                    var obj: GObject = this.getChildByPath(target);\n                    if (obj)\n                        obj.setProp(propertyId, value);\n                }\n            }\n        }\n\n        private ___added(evt: egret.Event): void {\n            var cnt: number = this._transitions.length;\n            for (var i: number = 0; i < cnt; ++i) {\n                this._transitions[i].onOwnerAddedToStage();\n            }\n        }\n\n        private ___removed(evt: egret.Event): void {\n            var cnt: number = this._transitions.length;\n            for (var i: number = 0; i < cnt; ++i) {\n                this._transitions[i].onOwnerRemovedFromStage();\n            }\n        }\n    }\n}"
  },
  {
    "path": "source/src/GGraph.ts",
    "content": "\nmodule fgui {\n\n    export class GGraph extends GObject {\n        private _graphics: egret.Graphics;\n\n        private _type: number = 0;\n        private _lineSize: number = 0;\n        private _lineColor: number = 0;\n        private _lineAlpha: number;\n        private _fillColor: number = 0;\n        private _fillAlpha: number;\n        private _cornerRadius?: Array<number>;\n        private _sides?: number;\n        private _startAngle?: number;\n        private _polygonPoints?: any[];\n        private _distances?: number[];\n\n        public constructor() {\n            super();\n\n            this._lineSize = 1;\n            this._lineAlpha = 1;\n            this._fillAlpha = 1;\n            this._fillColor = 0xFFFFFF;\n        }\n\n        public get graphics(): egret.Graphics {\n            return this._graphics;\n        }\n\n        public drawRect(lineSize: number, lineColor: number, lineAlpha: number,\n            fillColor: number, fillAlpha: number, corner?: Array<number>): void {\n            this._type = 1;\n            this._lineSize = lineSize;\n            this._lineColor = lineColor;\n            this._lineAlpha = lineAlpha;\n            this._fillColor = fillColor;\n            this._fillAlpha = fillAlpha;\n            this._cornerRadius = corner;\n            this.updateGraph();\n        }\n\n        public drawEllipse(lineSize: number, lineColor: number, lineAlpha: number,\n            fillColor: number, fillAlpha: number): void {\n            this._type = 2;\n            this._lineSize = lineSize;\n            this._lineColor = lineColor;\n            this._lineAlpha = lineAlpha;\n            this._fillColor = fillColor;\n            this._fillAlpha = fillAlpha;\n            this._cornerRadius = null;\n            this.updateGraph();\n        }\n\n        public drawRegularPolygon(lineSize: number, lineColor: number, lineAlpha: number,\n            fillColor: number, fillAlpha: number, sides: number, startAngle?: number, distances?: number[]): void {\n            this._type = 4;\n            this._lineSize = lineSize;\n            this._lineColor = lineColor;\n            this._lineAlpha = lineAlpha;\n            this._fillColor = fillColor;\n            this._fillAlpha = fillAlpha;\n            this._sides = sides;\n            this._startAngle = startAngle || 0;\n            this._distances = distances;\n            this.updateGraph();\n        }\n\n        public drawPolygon(lineSize: number, lineColor: number, lineAlpha: number, fillColor: number, fillAlpha: number, points: number[]): void {\n            this._type = 3;\n            this._lineSize = lineSize;\n            this._lineColor = lineColor;\n            this._lineAlpha = lineAlpha;\n            this._fillColor = fillColor;\n            this._fillAlpha = fillAlpha;\n            this._polygonPoints = points;\n            this.updateGraph();\n        }\n\n        public get distances(): number[] {\n            return this._distances;\n        }\n\n        public set distances(value: number[]) {\n            this._distances = value;\n            if (this._type == 3)\n                this.updateGraph();\n        }\n\n        public clearGraphics(): void {\n            if (this._graphics) {\n                this._type = 0;\n                this._graphics.clear();\n            }\n        }\n\n        public get color(): number {\n            return this._fillColor;\n        }\n\n        public set color(value: number) {\n            this._fillColor = value;\n            if (this._type != 0)\n                this.updateGraph();\n        }\n\n        private updateGraph(): void {\n            let ctx = this.graphics;\n\n            ctx.clear();\n\n            var w: number = this.width;\n            var h: number = this.height;\n            if (w == 0 || h == 0)\n                return;\n\n            if (this._lineSize == 0)\n                ctx.lineStyle(0, 0, 0);\n            else\n                ctx.lineStyle(this._lineSize, this._lineColor, this._lineAlpha);\n            ctx.beginFill(this._fillColor, this._fillAlpha);\n            if (this._type == 1) {\n                if (this._cornerRadius) {\n                    if (this._cornerRadius.length == 1)\n                        ctx.drawRoundRect(0, 0, w, h, this._cornerRadius[0] * 2, this._cornerRadius[0] * 2);\n                    else\n                        ctx.drawRoundRect(0, 0, w, h, this._cornerRadius[0] * 2, this._cornerRadius[1] * 2);\n                }\n                else\n                    ctx.drawRect(0, 0, w, h);\n            }\n            else if (this._type == 2)\n                ctx.drawEllipse(0, 0, w, h);\n            else if (this._type == 3) {\n                ToolSet.fillPath(ctx, this._polygonPoints, 0, 0);\n            }\n            else if (this._type == 4) {\n                if (!this._polygonPoints)\n                    this._polygonPoints = [];\n                var radius: number = Math.min(this._width, this._height) / 2;\n                this._polygonPoints.length = 0;\n                var angle: number = this._startAngle * Math.PI / 180;\n                var deltaAngle: number = 2 * Math.PI / this._sides;\n                var dist: number;\n                for (var i: number = 0; i < this._sides; i++) {\n                    if (this._distances) {\n                        dist = this._distances[i];\n                        if (isNaN(dist))\n                            dist = 1;\n                    }\n                    else\n                        dist = 1;\n\n                    var xv: number = radius + radius * dist * Math.cos(angle);\n                    var yv: number = radius + radius * dist * Math.sin(angle);\n                    this._polygonPoints.push(xv, yv);\n\n                    angle += deltaAngle;\n                }\n\n                ToolSet.fillPath(ctx, this._polygonPoints, 0, 0);\n            }\n            ctx.endFill();\n        }\n\n        public replaceMe(target: GObject): void {\n            if (!this._parent)\n                throw \"parent not set\";\n\n            target.name = this.name;\n            target.alpha = this.alpha;\n            target.rotation = this.rotation;\n            target.visible = this.visible;\n            target.touchable = this.touchable;\n            target.grayed = this.grayed;\n            target.setXY(this.x, this.y);\n            target.setSize(this.width, this.height);\n\n            var index: number = this._parent.getChildIndex(this);\n            this._parent.addChildAt(target, index);\n            target.relations.copyFrom(this.relations);\n\n            this._parent.removeChild(this, true);\n        }\n\n        public addBeforeMe(target: GObject): void {\n            if (this._parent == null)\n                throw \"parent not set\";\n\n            var index: number = this._parent.getChildIndex(this);\n            this._parent.addChildAt(target, index);\n        }\n\n        public addAfterMe(target: GObject): void {\n            if (this._parent == null)\n                throw \"parent not set\";\n\n            var index: number = this._parent.getChildIndex(this);\n            index++;\n            this._parent.addChildAt(target, index);\n        }\n\n        public setNativeObject(obj: egret.DisplayObject): void {\n            var sprite: egret.Sprite = new egret.Sprite();\n            this.setDisplayObject(sprite);\n            if (this._parent)\n                this._parent.childStateChanged(this);\n            this.handleXYChanged();\n            sprite.alpha = this.alpha;\n            sprite.rotation = this.rotation;\n            sprite.visible = this.visible;\n            sprite.touchEnabled = this.touchable;\n            sprite.touchChildren = this.touchable;\n            sprite.addChild(obj);\n        }\n\n        protected createDisplayObject(): void {\n            let sprite: egret.Sprite = new egret.Sprite();\n            sprite.touchEnabled = true;\n            this._graphics = sprite.graphics;\n            this.setDisplayObject(sprite);\n        }\n\n        public getProp(index: number): any {\n            if (index == ObjectPropID.Color)\n                return this.color;\n            else\n                return super.getProp(index);\n        }\n\n        public setProp(index: number, value: any): void {\n            if (index == ObjectPropID.Color)\n                this.color = value;\n            else\n                super.setProp(index, value);\n        }\n\n        protected handleSizeChanged(): void {\n            super.handleSizeChanged();\n\n            if (this._type != 0)\n                this.updateGraph();\n        }\n\n        public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_beforeAdd(buffer, beginPos);\n\n            buffer.seek(beginPos, 5);\n\n            this._type = buffer.readByte();\n            if (this._type != 0) {\n                var i: number;\n                var cnt: number;\n\n                this._lineSize = buffer.readInt();\n                var c: number = buffer.readColor(true);\n                this._lineColor = c & 0xFFFFFF;\n                this._lineAlpha = ((c >> 24) & 0xFF) / 0xFF;\n                c = buffer.readColor(true);\n                this._fillColor = c & 0xFFFFFF;\n                this._fillAlpha = ((c >> 24) & 0xFF) / 0xFF;\n                if (buffer.readBool()) {\n                    this._cornerRadius = new Array<number>(4);\n                    for (i = 0; i < 4; i++)\n                        this._cornerRadius[i] = buffer.readFloat();\n                }\n\n                if (this._type == 3) {\n                    cnt = buffer.readShort();\n                    this._polygonPoints = [];\n                    this._polygonPoints.length = cnt;\n                    for (i = 0; i < cnt; i++)\n                        this._polygonPoints[i] = buffer.readFloat();\n                }\n                else if (this._type == 4) {\n                    this._sides = buffer.readShort();\n                    this._startAngle = buffer.readFloat();\n                    cnt = buffer.readShort();\n                    if (cnt > 0) {\n                        this._distances = [];\n                        for (i = 0; i < cnt; i++)\n                            this._distances[i] = buffer.readFloat();\n                    }\n                }\n\n                this.updateGraph();\n            }\n        }\n    }\n}"
  },
  {
    "path": "source/src/GGroup.ts",
    "content": "namespace fgui {\n    export class GGroup extends GObject {\n        private _layout: number = 0;\n        private _lineGap: number = 0;\n        private _columnGap: number = 0;\n        private _excludeInvisibles?: boolean;\n        private _autoSizeDisabled?: boolean;\n        private _mainGridIndex: number = -1;\n        private _mainGridMinSize: number = 50;\n\n        private _boundsChanged: boolean;\n        private _percentReady: boolean;\n        private _mainChildIndex: number = -1;\n        private _totalSize: number = 0;\n        private _numChildren: number = 0;\n\n        public _updating: number = 0;\n\n        constructor() {\n            super();\n        }\n\n        public dispose(): void {\n            this._boundsChanged = false;\n\n            super.dispose();\n        }\n\n        public get layout(): number {\n            return this._layout;\n        }\n\n        public set layout(value: number) {\n            if (this._layout != value) {\n                this._layout = value;\n                this.setBoundsChangedFlag();\n            }\n        }\n\n        public get lineGap(): number {\n            return this._lineGap;\n        }\n\n        public set lineGap(value: number) {\n            if (this._lineGap != value) {\n                this._lineGap = value;\n                this.setBoundsChangedFlag(true);\n            }\n        }\n\n        public get columnGap(): number {\n            return this._columnGap;\n        }\n\n        public set columnGap(value: number) {\n            if (this._columnGap != value) {\n                this._columnGap = value;\n                this.setBoundsChangedFlag(true);\n            }\n        }\n\n        public get excludeInvisibles(): boolean {\n            return this._excludeInvisibles;\n        }\n\n        public set excludeInvisibles(value: boolean) {\n            if (this._excludeInvisibles != value) {\n                this._excludeInvisibles = value;\n                this.setBoundsChangedFlag();\n            }\n        }\n\n        public get autoSizeDisabled(): boolean {\n            return this._autoSizeDisabled;\n        }\n\n        public set autoSizeDisabled(value: boolean) {\n            this._autoSizeDisabled = value;\n        }\n\n        public get mainGridMinSize(): number {\n            return this._mainGridMinSize;\n        }\n\n        public set mainGridMinSize(value: number) {\n            if (this._mainGridMinSize != value) {\n                this._mainGridMinSize = value;\n                this.setBoundsChangedFlag();\n            }\n        }\n\n        public get mainGridIndex(): number {\n            return this._mainGridIndex;\n        }\n\n        public set mainGridIndex(value: number) {\n            if (this._mainGridIndex != value) {\n                this._mainGridIndex = value;\n                this.setBoundsChangedFlag();\n            }\n        }\n\n        public setBoundsChangedFlag(positionChangedOnly?: boolean): void {\n            if (this._updating == 0 && this._parent) {\n                if (!positionChangedOnly)\n                    this._percentReady = false;\n\n                if (!this._boundsChanged) {\n                    this._boundsChanged = true;\n                    if (this._layout != GroupLayoutType.None)\n                        GTimers.inst.callLater(this.ensureBoundsCorrect, this);\n                }\n            }\n        }\n\n        public ensureSizeCorrect(): void {\n            if (this._parent == null || !this._boundsChanged || this._layout == 0)\n                return;\n\n            this._boundsChanged = false;\n            if (this._autoSizeDisabled)\n                this.resizeChildren(0, 0);\n            else {\n                this.handleLayout();\n                this.updateBounds();\n            }\n        }\n\n        public ensureBoundsCorrect(): void {\n            if (this._parent == null || !this._boundsChanged)\n                return;\n\n            this._boundsChanged = false;\n            if (this._layout == 0)\n                this.updateBounds();\n            else {\n                if (this._autoSizeDisabled)\n                    this.resizeChildren(0, 0);\n                else {\n                    this.handleLayout();\n                    this.updateBounds();\n                }\n            }\n        }\n\n        private updateBounds(): void {\n            GTimers.inst.remove(this.ensureBoundsCorrect, this);\n\n            var cnt: number = this._parent.numChildren;\n            var i: number;\n            var child: GObject;\n            var ax: number = Number.POSITIVE_INFINITY, ay: number = Number.POSITIVE_INFINITY;\n            var ar: number = Number.NEGATIVE_INFINITY, ab: number = Number.NEGATIVE_INFINITY;\n            var tmp: number;\n            var empty: boolean = true;\n            for (i = 0; i < cnt; i++) {\n                child = this._parent.getChildAt(i);\n                if (child.group != this || this._excludeInvisibles && !child.internalVisible3)\n                    continue;\n\n                tmp = child.xMin;\n                if (tmp < ax)\n                    ax = tmp;\n                tmp = child.yMin;\n                if (tmp < ay)\n                    ay = tmp;\n                tmp = child.xMin + child.width;\n                if (tmp > ar)\n                    ar = tmp;\n                tmp = child.yMin + child.height;\n                if (tmp > ab)\n                    ab = tmp;\n                empty = false;\n            }\n\n            var w: number = 0, h: number = 0;\n            if (!empty) {\n                this._updating |= 1;\n                this.setXY(ax, ay);\n                this._updating &= 2;\n\n                w = ar - ax;\n                h = ab - ay;\n            }\n\n            if ((this._updating & 2) == 0) {\n                this._updating |= 2;\n                this.setSize(w, h);\n                this._updating &= 1;\n            }\n            else {\n                this._updating &= 1;\n                this.resizeChildren(this._width - w, this._height - h);\n            }\n        }\n\n        private handleLayout(): void {\n            this._updating |= 1;\n\n            var child: GObject;\n            var i: number;\n            var cnt: number;\n\n            if (this._layout == GroupLayoutType.Horizontal) {\n                var curX: number = this.x;\n                cnt = this._parent.numChildren;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n                    if (this._excludeInvisibles && !child.internalVisible3)\n                        continue;\n\n                    child.xMin = curX;\n                    if (child.width != 0)\n                        curX += child.width + this._columnGap;\n                }\n            }\n            else if (this._layout == GroupLayoutType.Vertical) {\n                var curY: number = this.y;\n                cnt = this._parent.numChildren;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n                    if (this._excludeInvisibles && !child.internalVisible3)\n                        continue;\n\n                    child.yMin = curY;\n                    if (child.height != 0)\n                        curY += child.height + this._lineGap;\n                }\n            }\n\n            this._updating &= 2;\n        }\n\n        public moveChildren(dx: number, dy: number): void {\n            if ((this._updating & 1) != 0 || this._parent == null)\n                return;\n\n            this._updating |= 1;\n\n            var cnt: number = this._parent.numChildren;\n            var i: number\n            var child: GObject;\n            for (i = 0; i < cnt; i++) {\n                child = this._parent.getChildAt(i);\n                if (child.group == this) {\n                    child.setXY(child.x + dx, child.y + dy);\n                }\n            }\n\n            this._updating &= 2;\n        }\n\n        public resizeChildren(dw: number, dh: number): void {\n            if (this._layout == GroupLayoutType.None || (this._updating & 2) != 0 || this._parent == null)\n                return;\n\n            this._updating |= 2;\n\n            if (this._boundsChanged) {\n                this._boundsChanged = false;\n                if (!this._autoSizeDisabled) {\n                    this.updateBounds();\n                    return;\n                }\n            }\n\n            var cnt: number = this._parent.numChildren;\n            var i: number;\n            var child: GObject;\n\n            if (!this._percentReady) {\n                this._percentReady = true;\n                this._numChildren = 0;\n                this._totalSize = 0;\n                this._mainChildIndex = -1;\n\n                var j: number = 0;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n\n                    if (!this._excludeInvisibles || child.internalVisible3) {\n                        if (j == this._mainGridIndex)\n                            this._mainChildIndex = i;\n\n                        this._numChildren++;\n\n                        if (this._layout == 1)\n                            this._totalSize += child.width;\n                        else\n                            this._totalSize += child.height;\n                    }\n\n                    j++;\n                }\n\n                if (this._mainChildIndex != -1) {\n                    if (this._layout == 1) {\n                        child = this._parent.getChildAt(this._mainChildIndex);\n                        this._totalSize += this._mainGridMinSize - child.width;\n                        child._sizePercentInGroup = this._mainGridMinSize / this._totalSize;\n                    }\n                    else {\n                        child = this._parent.getChildAt(this._mainChildIndex);\n                        this._totalSize += this._mainGridMinSize - child.height;\n                        child._sizePercentInGroup = this._mainGridMinSize / this._totalSize;\n                    }\n                }\n\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n\n                    if (i == this._mainChildIndex)\n                        continue;\n\n                    if (this._totalSize > 0)\n                        child._sizePercentInGroup = (this._layout == 1 ? child.width : child.height) / this._totalSize;\n                    else\n                        child._sizePercentInGroup = 0;\n                }\n            }\n\n            var remainSize: number = 0;\n            var remainPercent: number = 1;\n            var priorHandled: boolean = false;\n\n            if (this._layout == 1) {\n                remainSize = this.width - (this._numChildren - 1) * this._columnGap;\n                if (this._mainChildIndex != -1 && remainSize >= this._totalSize) {\n                    child = this._parent.getChildAt(this._mainChildIndex);\n                    child.setSize(remainSize - (this._totalSize - this._mainGridMinSize), child._rawHeight + dh, true);\n                    remainSize -= child.width;\n                    remainPercent -= child._sizePercentInGroup;\n                    priorHandled = true;\n                }\n\n                var curX: number = this.x;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n\n                    if (this._excludeInvisibles && !child.internalVisible3) {\n                        child.setSize(child._rawWidth, child._rawHeight + dh, true);\n                        continue;\n                    }\n\n                    if (!priorHandled || i != this._mainChildIndex) {\n                        child.setSize(Math.round(child._sizePercentInGroup / remainPercent * remainSize), child._rawHeight + dh, true);\n                        remainPercent -= child._sizePercentInGroup;\n                        remainSize -= child.width;\n                    }\n\n                    child.xMin = curX;\n                    if (child.width != 0)\n                        curX += child.width + this._columnGap;\n                }\n            }\n            else {\n                remainSize = this.height - (this._numChildren - 1) * this._lineGap;\n                if (this._mainChildIndex != -1 && remainSize >= this._totalSize) {\n                    child = this._parent.getChildAt(this._mainChildIndex);\n                    child.setSize(child._rawWidth + dw, remainSize - (this._totalSize - this._mainGridMinSize), true);\n                    remainSize -= child.height;\n                    remainPercent -= child._sizePercentInGroup;\n                    priorHandled = true;\n                }\n\n                var curY: number = this.y;\n                for (i = 0; i < cnt; i++) {\n                    child = this._parent.getChildAt(i);\n                    if (child.group != this)\n                        continue;\n\n                    if (this._excludeInvisibles && !child.internalVisible3) {\n                        child.setSize(child._rawWidth + dw, child._rawHeight, true);\n                        continue;\n                    }\n\n                    if (!priorHandled || i != this._mainChildIndex) {\n                        child.setSize(child._rawWidth + dw, Math.round(child._sizePercentInGroup / remainPercent * remainSize), true);\n                        remainPercent -= child._sizePercentInGroup;\n                        remainSize -= child.height;\n                    }\n\n                    child.yMin = curY;\n                    if (child.height != 0)\n                        curY += child.height + this._lineGap;\n                }\n            }\n\n            this._updating &= 1;\n        }\n\n        public handleAlphaChanged(): void {\n            if (this._underConstruct)\n                return;\n\n            var cnt: number = this._parent.numChildren;\n            for (var i: number = 0; i < cnt; i++) {\n                var child: GObject = this._parent.getChildAt(i);\n                if (child.group == this)\n                    child.alpha = this.alpha;\n            }\n        }\n\n        public handleVisibleChanged(): void {\n            if (!this._parent)\n                return;\n\n            var cnt: number = this._parent.numChildren;\n            for (var i: number = 0; i < cnt; i++) {\n                var child: GObject = this._parent.getChildAt(i);\n                if (child.group == this)\n                    child.handleVisibleChanged();\n            }\n        }\n\n        public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_beforeAdd(buffer, beginPos);\n\n            buffer.seek(beginPos, 5);\n\n            this._layout = buffer.readByte();\n            this._lineGap = buffer.readInt();\n            this._columnGap = buffer.readInt();\n            if (buffer.version >= 2) {\n                this._excludeInvisibles = buffer.readBool();\n                this._autoSizeDisabled = buffer.readBool();\n                this._mainGridIndex = buffer.readInt();\n            }\n        }\n\n        public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_afterAdd(buffer, beginPos);\n\n            if (!this.visible)\n                this.handleVisibleChanged();\n        }\n    }\n}"
  },
  {
    "path": "source/src/GImage.ts",
    "content": "\nmodule fgui {\n\n    export class GImage extends GObject {\n        private _content: Image;\n        private _flip: FlipType;\n\n        public constructor() {\n            super();\n            this._flip = FlipType.None;\n        }\n\n        public get color(): number {\n            return this._content.color;\n        }\n\n        public set color(value: number) {\n            if (this._content.color != value) {\n                this._content.color = value;\n                this.updateGear(4);\n            }\n        }\n\n        public get flip(): FlipType {\n            return this._flip;\n        }\n\n        public set flip(value: FlipType) {\n            if (this._flip != value) {\n                this._flip = value;\n\n                var sx: number = 1, sy: number = 1;\n                if (this._flip == FlipType.Horizontal || this._flip == FlipType.Both)\n                    sx = -1;\n                if (this._flip == FlipType.Vertical || this._flip == FlipType.Both)\n                    sy = -1;\n\n                this._content.scaleX = sx;\n                this._content.scaleY = sy;\n                this.handleXYChanged();\n            }\n        }\n\n        public get fillMethod(): number {\n            return this._content.fillMethod;\n        }\n\n        public set fillMethod(value: number) {\n            this._content.fillMethod = value;\n        }\n\n        public get fillOrigin(): number {\n            return this._content.fillOrigin;\n        }\n\n        public set fillOrigin(value: number) {\n            this._content.fillOrigin = value;\n        }\n\n        public get fillClockwise(): boolean {\n            return this._content.fillClockwise;\n        }\n\n        public set fillClockwise(value: boolean) {\n            this._content.fillClockwise = value;\n        }\n\n        public get fillAmount(): number {\n            return this._content.fillAmount;\n        }\n\n        public set fillAmount(value: number) {\n            this._content.fillAmount = value;\n        }\n\n        public get texture(): egret.Texture {\n            return this._content.texture;\n        }\n\n        public set texture(value: egret.Texture) {\n            if (value) {\n                this.sourceWidth = value.textureWidth;\n                this.sourceHeight = value.textureHeight;\n            }\n            else {\n                this.sourceWidth = 0;\n                this.sourceHeight = 0;\n            }\n            this.initWidth = this.sourceWidth;\n            this.initHeight = this.sourceHeight;\n            this._content.scale9Grid = null;\n            this._content.fillMode = egret.BitmapFillMode.SCALE;\n            this._content.texture = value;\n        }\n\n        protected createDisplayObject(): void {\n            this._content = new Image();\n            this._content.touchEnabled = false;\n            this.setDisplayObject(this._content);\n        }\n\n        public constructFromResource(): void {\n            var contentItem: PackageItem = this.packageItem.getBranch();\n            this.sourceWidth = contentItem.width;\n            this.sourceHeight = contentItem.height;\n            this.initWidth = this.sourceWidth;\n            this.initHeight = this.sourceHeight;\n            this.setSize(this.sourceWidth, this.sourceHeight);\n\n            contentItem = contentItem.getHighResolution();\n            contentItem.load();\n\n            this._content.scale9Grid = contentItem.scale9Grid;\n            this._content.smoothing = contentItem.smoothing;\n            if (contentItem.scaleByTile)\n                this._content.fillMode = egret.BitmapFillMode.REPEAT;\n\n            this.setSize(this.sourceWidth, this.sourceHeight);\n\n            this._content.texture = <egret.Texture>contentItem.asset;\n        }\n\n        protected handleXYChanged(): void {\n            super.handleXYChanged();\n\n            if (this._flip != FlipType.None) {\n                if (this._content.scaleX == -1)\n                    this._content.x += this.width;\n                if (this._content.scaleY == -1)\n                    this._content.y += this.height;\n            }\n        }\n\n        public getProp(index: number): any {\n            if (index == ObjectPropID.Color)\n                return this.color;\n            else\n                return super.getProp(index);\n        }\n\n        public setProp(index: number, value: any): void {\n            if (index == ObjectPropID.Color)\n                this.color = value;\n            else\n                super.setProp(index, value);\n        }\n\n        public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_beforeAdd(buffer, beginPos);\n\n            buffer.seek(beginPos, 5);\n\n            if (buffer.readBool())\n                this.color = buffer.readColor();\n            this.flip = buffer.readByte();\n            this._content.fillMethod = buffer.readByte();\n            if (this._content.fillMethod != 0) {\n                this._content.fillOrigin = buffer.readByte();\n                this._content.fillClockwise = buffer.readBool();\n                this._content.fillAmount = buffer.readFloat();\n            }\n        }\n    }\n}\n"
  },
  {
    "path": "source/src/GLabel.ts",
    "content": "\nmodule fgui {\n\n    export class GLabel extends GComponent {\n        protected _titleObject: GObject;\n        protected _iconObject: GObject;\n\n        public constructor() {\n            super();\n        }\n\n        public get icon(): string {\n            if (this._iconObject)\n                return this._iconObject.icon;\n        }\n\n        public set icon(value: string) {\n            if (this._iconObject)\n                this._iconObject.icon = value;\n            this.updateGear(7);\n        }\n\n        public get title(): string {\n            if (this._titleObject)\n                return this._titleObject.text;\n            else\n                return null;\n        }\n\n        public set title(value: string) {\n            if (this._titleObject)\n                this._titleObject.text = value;\n            this.updateGear(6);\n        }\n\n        public get text(): string {\n            return this.title;\n        }\n\n        public set text(value: string) {\n            this.title = value;\n        }\n\n        public get titleColor(): number {\n            var tf: GTextField = this.getTextField();\n            if (tf)\n                return tf.color;\n            else\n                return 0;\n        }\n\n        public set titleColor(value: number) {\n            var tf: GTextField = this.getTextField();\n            if (tf)\n                tf.color = value;\n            this.updateGear(4);\n        }\n\n        public get titleFontSize(): number {\n            var tf: GTextField = this.getTextField();\n            if (tf)\n                return tf.fontSize;\n            else\n                return 0;\n        }\n\n        public set titleFontSize(value: number) {\n            var tf: GTextField = this.getTextField();\n            if (tf)\n                tf.fontSize = value;\n        }\n\n        public set editable(val: boolean) {\n            if (this._titleObject)\n                this._titleObject.asTextInput.editable = val;\n        }\n\n        public get editable(): boolean {\n            if (this._titleObject && (this._titleObject instanceof GTextInput))\n                return this._titleObject.asTextInput.editable;\n            else\n                return false;\n        }\n\n        public getTextField(): GTextField {\n            if (this._titleObject instanceof GTextField)\n                return this._titleObject;\n            else if ((this._titleObject instanceof GLabel) || (this._titleObject instanceof GButton))\n                return this._titleObject.getTextField();\n            else\n                return null;\n        }\n\n        public getProp(index: number): any {\n            switch (index) {\n                case ObjectPropID.Color:\n                    return this.titleColor;\n                case ObjectPropID.OutlineColor:\n                    {\n                        var tf: GTextField = this.getTextField();\n                        if (tf)\n                            return tf.strokeColor;\n                        else\n                            return 0;\n                    }\n                case ObjectPropID.FontSize:\n                    return this.titleFontSize;\n                default:\n                    return super.getProp(index);\n            }\n        }\n\n        public setProp(index: number, value: any): void {\n            switch (index) {\n                case ObjectPropID.Color:\n                    this.titleColor = value;\n                    break;\n                case ObjectPropID.OutlineColor:\n                    {\n                        var tf: GTextField = this.getTextField();\n                        if (tf)\n                            tf.strokeColor = value;\n                    }\n                    break;\n                case ObjectPropID.FontSize:\n                    this.titleFontSize = value;\n                    break;\n                default:\n                    super.setProp(index, value);\n                    break;\n            }\n        }\n\n        protected constructExtension(buffer: ByteBuffer): void {\n            this._titleObject = this.getChild(\"title\");\n            this._iconObject = this.getChild(\"icon\");\n        }\n\n        public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_afterAdd(buffer, beginPos);\n\n            if (!buffer.seek(beginPos, 6))\n                return;\n\n            if (buffer.readByte() != this.packageItem.objectType)\n                return;\n\n            var str: string;\n            str = buffer.readS();\n            if (str != null)\n                this.title = str;\n            str = buffer.readS();\n            if (str != null)\n                this.icon = str;\n            if (buffer.readBool())\n                this.titleColor = buffer.readColor();\n            var iv: number = buffer.readInt();\n            if (iv != 0)\n                this.titleFontSize = iv;\n\n            if (buffer.readBool()) {\n                var input: GTextField = this.getTextField();\n                if (input instanceof GTextInput) {\n                    str = buffer.readS();\n                    if (str != null)\n                        input.promptText = str;\n\n                    str = buffer.readS();\n                    if (str != null)\n                        input.restrict = str;\n\n                    iv = buffer.readInt();\n                    if (iv != 0)\n                        input.maxLength = iv;\n                    iv = buffer.readInt();\n                    if (iv != 0) {\n                        //keyboardType\n                    }\n                    if (buffer.readBool())\n                        input.password = true;\n                }\n                else\n                    buffer.skip(13);\n            }\n        }\n    }\n}"
  },
  {
    "path": "source/src/GList.ts",
    "content": "\nmodule fgui {\n\n    export class GList extends GComponent {\n        public itemRenderer: (index: number, item: GObject) => void;\n        public itemProvider: (index: number) => string;\n        public callbackThisObj: any;\n\n        public scrollItemToViewOnClick: boolean = true;\n        public foldInvisibleItems: boolean = false;\n\n        private _layout: ListLayoutType;\n        private _lineCount: number = 0;\n        private _columnCount: number = 0;\n        private _lineGap: number = 0;\n        private _columnGap: number = 0;\n        private _defaultItem: string;\n        private _autoResizeItem: boolean;\n        private _selectionMode: ListSelectionMode;\n        private _align: AlignType;\n        private _verticalAlign: VertAlignType;\n        private _selectionController?: Controller;\n\n        private _lastSelectedIndex: number = 0;\n        private _pool: GObjectPool;\n\n        //Virtual List support\n        private _virtual?: boolean;\n        private _loop?: boolean;\n        private _numItems: number = 0;\n        private _realNumItems: number = 0;\n        private _firstIndex: number = 0; //the top left index\n        private _curLineItemCount: number = 0; //item count in one line\n        private _curLineItemCount2: number = 0; //只用在页面模式，表示垂直方向的项目数\n        private _itemSize?: egret.Point;\n        private _virtualListChanged: number = 0; //1-content changed, 2-size changed\n        private _virtualItems?: Array<ItemInfo>;\n        private _eventLocked?: boolean;\n        private itemInfoVer: number = 0; //用来标志item是否在本次处理中已经被重用了\n\n        public constructor() {\n            super();\n\n            this._trackBounds = true;\n            this._pool = new GObjectPool();\n            this._layout = ListLayoutType.SingleColumn;\n            this._autoResizeItem = true;\n            this._lastSelectedIndex = -1;\n            this._selectionMode = ListSelectionMode.Single;\n            this.opaque = true;\n            this._align = AlignType.Left;\n            this._verticalAlign = VertAlignType.Top;\n\n            this._container = new egret.DisplayObjectContainer();\n            this._rootContainer.addChild(this._container);\n        }\n\n        public dispose(): void {\n            this._pool.clear();\n            super.dispose();\n        }\n\n        public get layout(): ListLayoutType {\n            return this._layout;\n        }\n\n        public set layout(value: ListLayoutType) {\n            if (this._layout != value) {\n                this._layout = value;\n                this.setBoundsChangedFlag();\n                if (this._virtual)\n                    this.setVirtualListChangedFlag(true);\n            }\n        }\n\n        public get lineCount(): number {\n            return this._lineCount;\n        }\n\n        public set lineCount(value: number) {\n            if (this._lineCount != value) {\n                this._lineCount = value;\n                this.setBoundsChangedFlag();\n                if (this._virtual)\n                    this.setVirtualListChangedFlag(true);\n            }\n        }\n\n        public get columnCount(): number {\n            return this._columnCount;\n        }\n\n        public set columnCount(value: number) {\n            if (this._columnCount != value) {\n                this._columnCount = value;\n                this.setBoundsChangedFlag();\n                if (this._virtual)\n                    this.setVirtualListChangedFlag(true);\n            }\n        }\n\n        public get lineGap(): number {\n            return this._lineGap;\n        }\n\n        public set lineGap(value: number) {\n            if (this._lineGap != value) {\n                this._lineGap = value;\n                this.setBoundsChangedFlag();\n                if (this._virtual)\n                    this.setVirtualListChangedFlag(true);\n            }\n        }\n\n        public get columnGap(): number {\n            return this._columnGap;\n        }\n\n        public set columnGap(value: number) {\n            if (this._columnGap != value) {\n                this._columnGap = value;\n                this.setBoundsChangedFlag();\n                if (this._virtual)\n                    this.setVirtualListChangedFlag(true);\n            }\n        }\n\n        public get align(): AlignType {\n            return this._align;\n        }\n\n        public set align(value: AlignType) {\n            if (this._align != value) {\n                this._align = value;\n                this.setBoundsChangedFlag();\n                if (this._virtual)\n                    this.setVirtualListChangedFlag(true);\n            }\n        }\n\n        public get verticalAlign(): VertAlignType {\n            return this._verticalAlign;\n        }\n\n        public set verticalAlign(value: VertAlignType) {\n            if (this._verticalAlign != value) {\n                this._verticalAlign = value;\n                this.setBoundsChangedFlag();\n                if (this._virtual)\n                    this.setVirtualListChangedFlag(true);\n            }\n        }\n\n        public get virtualItemSize(): egret.Point {\n            return this._itemSize;\n        }\n\n        public set virtualItemSize(value: egret.Point) {\n            if (this._virtual) {\n                if (!this._itemSize)\n                    this._itemSize = new egret.Point();\n                this._itemSize.copyFrom(value);\n                this.setVirtualListChangedFlag(true);\n            }\n        }\n\n        public get defaultItem(): string {\n            return this._defaultItem;\n        }\n\n        public set defaultItem(val: string) {\n            this._defaultItem = val;\n        }\n\n        public get autoResizeItem(): boolean {\n            return this._autoResizeItem;\n        }\n\n        public set autoResizeItem(value: boolean) {\n            if (this._autoResizeItem != value) {\n                this._autoResizeItem = value;\n                this.setBoundsChangedFlag();\n                if (this._virtual)\n                    this.setVirtualListChangedFlag(true);\n            }\n        }\n\n        public get selectionMode(): ListSelectionMode {\n            return this._selectionMode;\n        }\n\n        public set selectionMode(value: ListSelectionMode) {\n            this._selectionMode = value;\n        }\n\n        public get selectionController(): Controller {\n            return this._selectionController;\n        }\n\n        public set selectionController(value: Controller) {\n            this._selectionController = value;\n        }\n\n        public get itemPool(): GObjectPool {\n            return this._pool;\n        }\n\n        public getFromPool(url?: string): GObject {\n            if (!url)\n                url = this._defaultItem;\n\n            var obj: GObject = this._pool.getObject(url);\n            if (obj)\n                obj.visible = true;\n            return obj;\n        }\n\n        public returnToPool(obj: GObject): void {\n            obj.displayObject.cacheAsBitmap = false;\n            this._pool.returnObject(obj);\n        }\n\n        public addChildAt(child: GObject, index: number): GObject {\n            super.addChildAt(child, index);\n\n            if (child instanceof GButton) {\n                child.selected = false;\n                child.changeStateOnClick = false;\n            }\n            child.addEventListener(egret.TouchEvent.TOUCH_TAP, this.__clickItem, this);\n\n            return child;\n        }\n\n        public addItem(url?: string): GObject {\n            if (!url)\n                url = this._defaultItem;\n\n            return this.addChild(UIPackage.createObjectFromURL(url));\n        }\n\n        public addItemFromPool(url?: string): GObject {\n            return this.addChild(this.getFromPool(url));\n        }\n\n        public removeChildAt(index: number, dispose?: boolean): GObject {\n            var child: GObject = super.removeChildAt(index, dispose);\n            child.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.__clickItem, this);\n\n            return child;\n        }\n\n        public removeChildToPoolAt(index: number): void {\n            var child: GObject = super.removeChildAt(index);\n            this.returnToPool(child);\n        }\n\n        public removeChildToPool(child: GObject): void {\n            super.removeChild(child);\n            this.returnToPool(child);\n        }\n\n        public removeChildrenToPool(beginIndex?: number, endIndex?: number): void {\n            if (beginIndex == undefined) beginIndex = 0;\n            if (endIndex == undefined) endIndex = -1;\n            if (endIndex < 0 || endIndex >= this._children.length)\n                endIndex = this._children.length - 1;\n\n            for (var i: number = beginIndex; i <= endIndex; ++i)\n                this.removeChildToPoolAt(beginIndex);\n        }\n\n        public get selectedIndex(): number {\n            var i: number;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii: ItemInfo = this._virtualItems[i];\n                    if ((ii.obj instanceof GButton) && ii.obj.selected\n                        || ii.obj == null && ii.selected) {\n                        if (this._loop)\n                            return i % this._numItems;\n                        else\n                            return i;\n                    }\n                }\n            }\n            else {\n                var cnt: number = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj: GObject = this._children[i];\n                    if ((obj instanceof GButton) && obj.selected)\n                        return i;\n                }\n            }\n\n            return -1;\n        }\n\n        public set selectedIndex(value: number) {\n            if (value >= 0 && value < this.numItems) {\n                if (this._selectionMode != ListSelectionMode.Single)\n                    this.clearSelection();\n                this.addSelection(value);\n            }\n            else\n                this.clearSelection();\n        }\n\n        public getSelection(result?: number[]): number[] {\n            if (!result)\n                result = new Array<number>();\n            var i: number;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii: ItemInfo = this._virtualItems[i];\n                    if ((ii.obj instanceof GButton) && ii.obj.selected\n                        || ii.obj == null && ii.selected) {\n                        var j: number = i;\n                        if (this._loop) {\n                            j = i % this._numItems;\n                            if (result.indexOf(j) != -1)\n                                continue;\n                        }\n                        result.push(j);\n                    }\n                }\n            }\n            else {\n                var cnt: number = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj: GObject = this._children[i];\n                    if ((obj instanceof GButton) && obj.selected)\n                        result.push(i);\n                }\n            }\n            return result;\n        }\n\n        public addSelection(index: number, scrollItToView?: boolean): void {\n            if (this._selectionMode == ListSelectionMode.None)\n                return;\n\n            this.checkVirtualList();\n\n            if (this._selectionMode == ListSelectionMode.Single)\n                this.clearSelection();\n\n            if (scrollItToView)\n                this.scrollToView(index);\n\n            this._lastSelectedIndex = index;\n            var obj: GObject;\n            if (this._virtual) {\n                var ii: ItemInfo = this._virtualItems[index];\n                if (ii.obj)\n                    obj = ii.obj;\n                ii.selected = true;\n            }\n            else\n                obj = this.getChildAt(index);\n\n            if ((obj instanceof GButton) && !obj.selected) {\n                obj.selected = true;\n                this.updateSelectionController(index);\n            }\n        }\n\n        public removeSelection(index: number): void {\n            if (this._selectionMode == ListSelectionMode.None)\n                return;\n\n            var obj: GObject;\n            if (this._virtual) {\n                var ii: ItemInfo = this._virtualItems[index];\n                if (ii.obj)\n                    obj = ii.obj;\n                ii.selected = false;\n            }\n            else\n                obj = this.getChildAt(index);\n\n            if (obj instanceof GButton)\n                obj.selected = false;\n        }\n\n        public clearSelection(): void {\n            var i: number;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii: ItemInfo = this._virtualItems[i];\n                    if (ii.obj instanceof GButton)\n                        ii.obj.selected = false;\n                    ii.selected = false;\n                }\n            }\n            else {\n                var cnt: number = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj: GObject = this._children[i];\n                    if (obj instanceof GButton)\n                        obj.selected = false;\n                }\n            }\n        }\n\n        private clearSelectionExcept(g: GObject): void {\n            var i: number;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii: ItemInfo = this._virtualItems[i];\n                    if (ii.obj != g) {\n                        if ((ii.obj instanceof GButton))\n                            ii.obj.selected = false;\n                        ii.selected = false;\n                    }\n                }\n            }\n            else {\n                var cnt: number = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj: GObject = this._children[i];\n                    if ((obj instanceof GButton) && obj != g)\n                        obj.selected = false;\n                }\n            }\n        }\n\n        public selectAll(): void {\n            this.checkVirtualList();\n\n            var last: number = -1;\n            var i: number;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii: ItemInfo = this._virtualItems[i];\n                    if ((ii.obj instanceof GButton) && !ii.obj.selected) {\n                        ii.obj.selected = true;\n                        last = i;\n                    }\n                    ii.selected = true;\n                }\n            }\n            else {\n                var cnt: number = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj: GObject = this._children[i];\n                    if ((obj instanceof GButton) && !obj.selected) {\n                        obj.selected = true;\n                        last = i;\n                    }\n                }\n            }\n\n            if (last != -1)\n                this.updateSelectionController(last);\n        }\n\n        public selectNone(): void {\n            this.clearSelection();\n        }\n\n        public selectReverse(): void {\n            this.checkVirtualList();\n\n            var last: number = -1;\n            var i: number;\n            if (this._virtual) {\n                for (i = 0; i < this._realNumItems; i++) {\n                    var ii: ItemInfo = this._virtualItems[i];\n                    if (ii.obj instanceof GButton) {\n                        ii.obj.selected = !ii.obj.selected;\n                        if (ii.obj.selected)\n                            last = i;\n                    }\n                    ii.selected = !ii.selected;\n                }\n            }\n            else {\n                var cnt: number = this._children.length;\n                for (i = 0; i < cnt; i++) {\n                    var obj: GObject = this._children[i];\n                    if (obj instanceof GButton) {\n                        obj.selected = !obj.selected;\n                        if (obj.selected)\n                            last = i;\n                    }\n                }\n            }\n\n            if (last != -1)\n                this.updateSelectionController(last);\n        }\n\n        public handleArrowKey(dir: number): void {\n            var index: number = this.selectedIndex;\n            if (index == -1)\n                return;\n\n            switch (dir) {\n                case 1://up\n                    if (this._layout == ListLayoutType.SingleColumn || this._layout == ListLayoutType.FlowVertical) {\n                        index--;\n                        if (index >= 0) {\n                            this.clearSelection();\n                            this.addSelection(index, true);\n                        }\n                    }\n                    else if (this._layout == ListLayoutType.FlowHorizontal || this._layout == ListLayoutType.Pagination) {\n                        var current: GObject = this._children[index];\n                        var k: number = 0;\n                        for (var i: number = index - 1; i >= 0; i--) {\n                            var obj: GObject = this._children[i];\n                            if (obj.y != current.y) {\n                                current = obj;\n                                break;\n                            }\n                            k++;\n                        }\n                        for (; i >= 0; i--) {\n                            obj = this._children[i];\n                            if (obj.y != current.y) {\n                                this.clearSelection();\n                                this.addSelection(i + k + 1, true);\n                                break;\n                            }\n                        }\n                    }\n                    break;\n\n                case 3://right\n                    if (this._layout == ListLayoutType.SingleRow || this._layout == ListLayoutType.FlowHorizontal || this._layout == ListLayoutType.Pagination) {\n                        index++;\n                        if (index < this._children.length) {\n                            this.clearSelection();\n                            this.addSelection(index, true);\n                        }\n                    }\n                    else if (this._layout == ListLayoutType.FlowVertical) {\n                        current = this._children[index];\n                        k = 0;\n                        var cnt: number = this._children.length;\n                        for (i = index + 1; i < cnt; i++) {\n                            obj = this._children[i];\n                            if (obj.x != current.x) {\n                                current = obj;\n                                break;\n                            }\n                            k++;\n                        }\n                        for (; i < cnt; i++) {\n                            obj = this._children[i];\n                            if (obj.x != current.x) {\n                                this.clearSelection();\n                                this.addSelection(i - k - 1, true);\n                                break;\n                            }\n                        }\n                    }\n                    break;\n\n                case 5://down\n                    if (this._layout == ListLayoutType.SingleColumn || this._layout == ListLayoutType.FlowVertical) {\n                        index++;\n                        if (index < this._children.length) {\n                            this.clearSelection();\n                            this.addSelection(index, true);\n                        }\n                    }\n                    else if (this._layout == ListLayoutType.FlowHorizontal || this._layout == ListLayoutType.Pagination) {\n                        current = this._children[index];\n                        k = 0;\n                        cnt = this._children.length;\n                        for (i = index + 1; i < cnt; i++) {\n                            obj = this._children[i];\n                            if (obj.y != current.y) {\n                                current = obj;\n                                break;\n                            }\n                            k++;\n                        }\n                        for (; i < cnt; i++) {\n                            obj = this._children[i];\n                            if (obj.y != current.y) {\n                                this.clearSelection();\n                                this.addSelection(i - k - 1, true);\n                                break;\n                            }\n                        }\n                    }\n                    break;\n\n                case 7://left\n                    if (this._layout == ListLayoutType.SingleRow || this._layout == ListLayoutType.FlowHorizontal || this._layout == ListLayoutType.Pagination) {\n                        index--;\n                        if (index >= 0) {\n                            this.clearSelection();\n                            this.addSelection(index, true);\n                        }\n                    }\n                    else if (this._layout == ListLayoutType.FlowVertical) {\n                        current = this._children[index];\n                        k = 0;\n                        for (i = index - 1; i >= 0; i--) {\n                            obj = this._children[i];\n                            if (obj.x != current.x) {\n                                current = obj;\n                                break;\n                            }\n                            k++;\n                        }\n                        for (; i >= 0; i--) {\n                            obj = this._children[i];\n                            if (obj.x != current.x) {\n                                this.clearSelection();\n                                this.addSelection(i + k + 1, true);\n                                break;\n                            }\n                        }\n                    }\n                    break;\n            }\n        }\n\n        private __clickItem(evt: egret.TouchEvent): void {\n            if (this._scrollPane && this._scrollPane.isDragged)\n                return;\n\n            var item: GObject = <GObject>(evt.currentTarget);\n            this.setSelectionOnEvent(item);\n\n            if (this._scrollPane && this.scrollItemToViewOnClick)\n                this._scrollPane.scrollToView(item, true);\n\n            var ie: ItemEvent = new ItemEvent(ItemEvent.CLICK, item);\n            ie.stageX = evt.stageX;\n            ie.stageY = evt.stageY;\n            this.dispatchItemEvent(ie);\n        }\n\n        protected dispatchItemEvent(evt: ItemEvent): void {\n            this.dispatchEvent(evt);\n        }\n\n        private setSelectionOnEvent(item: GObject): void {\n            if (!(item instanceof GButton) || this._selectionMode == ListSelectionMode.None)\n                return;\n\n            var dontChangeLastIndex: boolean = false;\n            var index: number = this.childIndexToItemIndex(this.getChildIndex(item));\n\n            if (this._selectionMode == ListSelectionMode.Single) {\n                if (!item.selected) {\n                    this.clearSelectionExcept(item);\n                    item.selected = true;\n                }\n            }\n            else {\n                if (GRoot.shiftKeyDown) {\n                    if (!item.selected) {\n                        if (this._lastSelectedIndex != -1) {\n                            var min: number = Math.min(this._lastSelectedIndex, index);\n                            var max: number = Math.max(this._lastSelectedIndex, index);\n                            max = Math.min(max, this.numItems - 1);\n                            var i: number;\n                            if (this._virtual) {\n                                for (i = min; i <= max; i++) {\n                                    var ii: ItemInfo = this._virtualItems[i];\n                                    if (ii.obj instanceof GButton)\n                                        ii.obj.selected = true;\n                                    ii.selected = true;\n                                }\n                            }\n                            else {\n                                for (i = min; i <= max; i++) {\n                                    var obj: GObject = this.getChildAt(i);\n                                    if (obj instanceof GButton)\n                                        obj.selected = true;\n                                }\n                            }\n\n                            dontChangeLastIndex = true;\n                        }\n                        else {\n                            item.selected = true;\n                        }\n                    }\n                }\n                else if (GRoot.ctrlKeyDown || this._selectionMode == ListSelectionMode.Multiple_SingleClick) {\n                    item.selected = !item.selected;\n                }\n                else {\n                    if (!item.selected) {\n                        this.clearSelectionExcept(item);\n                        item.selected = true;\n                    }\n                    else\n                        this.clearSelectionExcept(item);\n                }\n            }\n\n            if (!dontChangeLastIndex)\n                this._lastSelectedIndex = index;\n\n            if (item.selected)\n                this.updateSelectionController(index);\n        }\n\n        public resizeToFit(itemCount: number = Number.POSITIVE_INFINITY, minSize: number = 0): void {\n            this.ensureBoundsCorrect();\n\n            var curCount: number = this.numItems;\n            if (itemCount > curCount)\n                itemCount = curCount;\n\n            if (this._virtual) {\n                var lineCount: number = Math.ceil(itemCount / this._curLineItemCount);\n                if (this._layout == ListLayoutType.SingleColumn || this._layout == ListLayoutType.FlowHorizontal)\n                    this.viewHeight = lineCount * this._itemSize.y + Math.max(0, lineCount - 1) * this._lineGap;\n                else\n                    this.viewWidth = lineCount * this._itemSize.x + Math.max(0, lineCount - 1) * this._columnGap;\n            }\n            else if (itemCount == 0) {\n                if (this._layout == ListLayoutType.SingleColumn || this._layout == ListLayoutType.FlowHorizontal)\n                    this.viewHeight = minSize;\n                else\n                    this.viewWidth = minSize;\n            }\n            else {\n                var i: number = itemCount - 1;\n                var obj: GObject;\n                while (i >= 0) {\n                    obj = this.getChildAt(i);\n                    if (!this.foldInvisibleItems || obj.visible)\n                        break;\n                    i--;\n                }\n                if (i < 0) {\n                    if (this._layout == ListLayoutType.SingleColumn || this._layout == ListLayoutType.FlowHorizontal)\n                        this.viewHeight = minSize;\n                    else\n                        this.viewWidth = minSize;\n                }\n                else {\n                    var size: number = 0;\n                    if (this._layout == ListLayoutType.SingleColumn || this._layout == ListLayoutType.FlowHorizontal) {\n                        size = obj.y + obj.height;\n                        if (size < minSize)\n                            size = minSize;\n                        this.viewHeight = size;\n                    }\n                    else {\n                        size = obj.x + obj.width;\n                        if (size < minSize)\n                            size = minSize;\n                        this.viewWidth = size;\n                    }\n                }\n            }\n        }\n\n        public getMaxItemWidth(): number {\n            var cnt: number = this._children.length;\n            var max: number = 0;\n            for (var i: number = 0; i < cnt; i++) {\n                var child: GObject = this.getChildAt(i);\n                if (child.width > max)\n                    max = child.width;\n            }\n            return max;\n        }\n\n        protected handleSizeChanged(): void {\n            super.handleSizeChanged();\n\n            this.setBoundsChangedFlag();\n            if (this._virtual)\n                this.setVirtualListChangedFlag(true);\n        }\n\n        public handleControllerChanged(c: Controller): void {\n            super.handleControllerChanged(c);\n\n            if (this._selectionController == c)\n                this.selectedIndex = c.selectedIndex;\n        }\n\n        private updateSelectionController(index: number): void {\n            if (this._selectionController && !this._selectionController.changing\n                && index < this._selectionController.pageCount) {\n                var c: Controller = this._selectionController;\n                this._selectionController = null;\n                c.selectedIndex = index;\n                this._selectionController = c;\n            }\n        }\n\n        public getSnappingPosition(xValue: number, yValue: number, result?: egret.Point): egret.Point {\n            if (this._virtual) {\n                if (!result)\n                    result = new egret.Point();\n\n                var saved: number;\n                var index: number;\n                if (this._layout == ListLayoutType.SingleColumn || this._layout == ListLayoutType.FlowHorizontal) {\n                    saved = yValue;\n                    s_n = yValue;\n                    index = this.getIndexOnPos1(false);\n                    yValue = s_n;\n                    if (index < this._virtualItems.length && saved - yValue > this._virtualItems[index].height / 2 && index < this._realNumItems)\n                        yValue += this._virtualItems[index].height + this._lineGap;\n                }\n                else if (this._layout == ListLayoutType.SingleRow || this._layout == ListLayoutType.FlowVertical) {\n                    saved = xValue;\n                    s_n = xValue;\n                    index = this.getIndexOnPos2(false);\n                    xValue = s_n;\n                    if (index < this._virtualItems.length && saved - xValue > this._virtualItems[index].width / 2 && index < this._realNumItems)\n                        xValue += this._virtualItems[index].width + this._columnGap;\n                }\n                else {\n                    saved = xValue;\n                    s_n = xValue;\n                    index = this.getIndexOnPos3(false);\n                    xValue = s_n;\n                    if (index < this._virtualItems.length && saved - xValue > this._virtualItems[index].width / 2 && index < this._realNumItems)\n                        xValue += this._virtualItems[index].width + this._columnGap;\n                }\n\n                result.x = xValue;\n                result.y = yValue;\n                return result;\n            }\n            else {\n                return super.getSnappingPosition(xValue, yValue, result);\n            }\n        }\n\n        public scrollToView(index: number, ani?: boolean, setFirst?: boolean): void {\n            if (this._virtual) {\n                if (this._numItems == 0)\n                    return;\n\n                this.checkVirtualList();\n\n                if (index >= this._virtualItems.length)\n                    throw \"Invalid child index: \" + index + \">\" + this._virtualItems.length;\n\n                if (this._loop)\n                    index = Math.floor(this._firstIndex / this._numItems) * this._numItems + index;\n\n                var rect: egret.Rectangle;\n                var ii: ItemInfo = this._virtualItems[index];\n                var pos: number = 0;\n                var i: number;\n                if (this._layout == ListLayoutType.SingleColumn || this._layout == ListLayoutType.FlowHorizontal) {\n                    for (i = this._curLineItemCount - 1; i < index; i += this._curLineItemCount)\n                        pos += this._virtualItems[i].height + this._lineGap;\n                    rect = new egret.Rectangle(0, pos, this._itemSize.x, ii.height);\n                }\n                else if (this._layout == ListLayoutType.SingleRow || this._layout == ListLayoutType.FlowVertical) {\n                    for (i = this._curLineItemCount - 1; i < index; i += this._curLineItemCount)\n                        pos += this._virtualItems[i].width + this._columnGap;\n                    rect = new egret.Rectangle(pos, 0, ii.width, this._itemSize.y);\n                }\n                else {\n                    var page: number = index / (this._curLineItemCount * this._curLineItemCount2);\n                    rect = new egret.Rectangle(page * this.viewWidth + (index % this._curLineItemCount) * (ii.width + this._columnGap),\n                        (index / this._curLineItemCount) % this._curLineItemCount2 * (ii.height + this._lineGap),\n                        ii.width, ii.height);\n                }\n\n                if (this._scrollPane)\n                    this._scrollPane.scrollToView(rect, ani, setFirst);\n            }\n            else {\n                var obj: GObject = this.getChildAt(index);\n                if (obj) {\n                    if (this._scrollPane)\n                        this._scrollPane.scrollToView(obj, ani, setFirst);\n                    else if (this.parent && this.parent.scrollPane)\n                        this.parent.scrollPane.scrollToView(obj, ani, setFirst);\n                }\n            }\n        }\n\n        public getFirstChildInView(): number {\n            return this.childIndexToItemIndex(super.getFirstChildInView());\n        }\n\n        public childIndexToItemIndex(index: number): number {\n            if (!this._virtual)\n                return index;\n\n            if (this._layout == ListLayoutType.Pagination) {\n                for (var i: number = this._firstIndex; i < this._realNumItems; i++) {\n                    if (this._virtualItems[i].obj) {\n                        index--;\n                        if (index < 0)\n                            return i;\n                    }\n                }\n\n                return index;\n            }\n            else {\n                index += this._firstIndex;\n                if (this._loop && this._numItems > 0)\n                    index = index % this._numItems;\n\n                return index;\n            }\n        }\n\n        public itemIndexToChildIndex(index: number): number {\n            if (!this._virtual)\n                return index;\n\n            if (this._layout == ListLayoutType.Pagination) {\n                return this.getChildIndex(this._virtualItems[index].obj);\n            }\n            else {\n                if (this._loop && this._numItems > 0) {\n                    var j: number = this._firstIndex % this._numItems;\n                    if (index >= j)\n                        index = index - j;\n                    else\n                        index = this._numItems - j + index;\n                }\n                else\n                    index -= this._firstIndex;\n\n                return index;\n            }\n        }\n\n        public setVirtual(): void {\n            this._setVirtual(false);\n        }\n\n        public setVirtualAndLoop(): void {\n            this._setVirtual(true);\n        }\n\n        private _setVirtual(loop: boolean): void {\n            if (!this._virtual) {\n                if (this._scrollPane == null)\n                    throw \"Virtual list must be scrollable!\";\n\n                if (loop) {\n                    if (this._layout == ListLayoutType.FlowHorizontal || this._layout == ListLayoutType.FlowVertical)\n                        throw \"Loop list is not supported for FlowHorizontal or FlowVertical layout!\";\n\n                    this._scrollPane.bouncebackEffect = false;\n                }\n\n                this._virtual = true;\n                this._loop = loop;\n                this._virtualItems = new Array<ItemInfo>();\n                this.removeChildrenToPool();\n\n                if (this._itemSize == null) {\n                    this._itemSize = new egret.Point();\n                    var obj: GObject = this.getFromPool(null);\n                    if (obj == null) {\n                        throw \"Virtual List must have a default list item resource.\";\n                    }\n                    else {\n                        this._itemSize.x = obj.width;\n                        this._itemSize.y = obj.height;\n                    }\n                    this.returnToPool(obj);\n                }\n\n                if (this._layout == ListLayoutType.SingleColumn || this._layout == ListLayoutType.FlowHorizontal) {\n                    this._scrollPane.scrollStep = this._itemSize.y;\n                    if (this._loop)\n                        this._scrollPane._loop = 2;\n                }\n                else {\n                    this._scrollPane.scrollStep = this._itemSize.x;\n                    if (this._loop)\n                        this._scrollPane._loop = 1;\n                }\n\n                this._scrollPane.addEventListener(ScrollPane.SCROLL, this.__scrolled, this);\n                this.setVirtualListChangedFlag(true);\n            }\n        }\n\n        public get numItems(): number {\n            if (this._virtual)\n                return this._numItems;\n            else\n                return this._children.length;\n        }\n\n        public set numItems(value: number) {\n            if (this._virtual) {\n                if (this.itemRenderer == null)\n                    throw \"Set itemRenderer first!\";\n\n                this._numItems = value;\n                if (this._loop)\n                    this._realNumItems = this._numItems * 6;//设置6倍数量，用于循环滚动\n                else\n                    this._realNumItems = this._numItems;\n\n                //_virtualItems的设计是只增不减的\n                var oldCount: number = this._virtualItems.length;\n                if (this._realNumItems > oldCount) {\n                    for (i = oldCount; i < this._realNumItems; i++) {\n                        var ii: ItemInfo = {\n                            width: this._itemSize.x,\n                            height: this._itemSize.y,\n                            updateFlag: 0\n                        };\n\n                        this._virtualItems.push(ii);\n                    }\n                }\n                else {\n                    for (i = this._realNumItems; i < oldCount; i++)\n                        this._virtualItems[i].selected = false;\n                }\n\n                if (this._virtualListChanged != 0)\n                    GTimers.inst.remove(this._refreshVirtualList, this);\n\n                //立即刷新\n                this._refreshVirtualList();\n            }\n            else {\n                var cnt: number = this._children.length;\n                if (value > cnt) {\n                    for (var i: number = cnt; i < value; i++) {\n                        if (this.itemProvider == null)\n                            this.addItemFromPool();\n                        else\n                            this.addItemFromPool(this.itemProvider.call(this.callbackThisObj, i));\n                    }\n                }\n                else {\n                    this.removeChildrenToPool(value, cnt);\n                }\n                if (this.itemRenderer != null) {\n                    for (i = 0; i < value; i++)\n                        this.itemRenderer.call(this.callbackThisObj, i, this.getChildAt(i));\n                }\n            }\n        }\n\n        public refreshVirtualList(): void {\n            this.setVirtualListChangedFlag(false);\n        }\n\n        private checkVirtualList(): void {\n            if (this._virtualListChanged != 0) {\n                this._refreshVirtualList();\n                GTimers.inst.remove(this._refreshVirtualList, this);\n            }\n        }\n\n        private setVirtualListChangedFlag(layoutChanged?: boolean): void {\n            if (layoutChanged)\n                this._virtualListChanged = 2;\n            else if (this._virtualListChanged == 0)\n                this._virtualListChanged = 1;\n\n            GTimers.inst.callLater(this._refreshVirtualList, this);\n        }\n\n        private _refreshVirtualList(): void {\n            var layoutChanged: boolean = this._virtualListChanged == 2;\n            this._virtualListChanged = 0;\n            this._eventLocked = true;\n\n            if (layoutChanged) {\n                if (this._layout == ListLayoutType.SingleColumn || this._layout == ListLayoutType.SingleRow)\n                    this._curLineItemCount = 1;\n                else if (this._layout == ListLayoutType.FlowHorizontal) {\n                    if (this._columnCount > 0)\n                        this._curLineItemCount = this._columnCount;\n                    else {\n                        this._curLineItemCount = Math.floor((this._scrollPane.viewWidth + this._columnGap) / (this._itemSize.x + this._columnGap));\n                        if (this._curLineItemCount <= 0)\n                            this._curLineItemCount = 1;\n                    }\n                }\n                else if (this._layout == ListLayoutType.FlowVertical) {\n                    if (this._lineCount > 0)\n                        this._curLineItemCount = this._lineCount;\n                    else {\n                        this._curLineItemCount = Math.floor((this._scrollPane.viewHeight + this._lineGap) / (this._itemSize.y + this._lineGap));\n                        if (this._curLineItemCount <= 0)\n                            this._curLineItemCount = 1;\n                    }\n                }\n                else //pagination\n                {\n                    if (this._columnCount > 0)\n                        this._curLineItemCount = this._columnCount;\n                    else {\n                        this._curLineItemCount = Math.floor((this._scrollPane.viewWidth + this._columnGap) / (this._itemSize.x + this._columnGap));\n                        if (this._curLineItemCount <= 0)\n                            this._curLineItemCount = 1;\n                    }\n\n                    if (this._lineCount > 0)\n                        this._curLineItemCount2 = this._lineCount;\n                    else {\n                        this._curLineItemCount2 = Math.floor((this._scrollPane.viewHeight + this._lineGap) / (this._itemSize.y + this._lineGap));\n                        if (this._curLineItemCount2 <= 0)\n                            this._curLineItemCount2 = 1;\n                    }\n                }\n            }\n\n            var ch: number = 0, cw: number = 0;\n            if (this._realNumItems > 0) {\n                var i: number;\n                var len: number = Math.ceil(this._realNumItems / this._curLineItemCount) * this._curLineItemCount;\n                var len2: number = Math.min(this._curLineItemCount, this._realNumItems);\n                if (this._layout == ListLayoutType.SingleColumn || this._layout == ListLayoutType.FlowHorizontal) {\n                    for (i = 0; i < len; i += this._curLineItemCount)\n                        ch += this._virtualItems[i].height + this._lineGap;\n                    if (ch > 0)\n                        ch -= this._lineGap;\n\n                    if (this._autoResizeItem)\n                        cw = this._scrollPane.viewWidth;\n                    else {\n                        for (i = 0; i < len2; i++)\n                            cw += this._virtualItems[i].width + this._columnGap;\n                        if (cw > 0)\n                            cw -= this._columnGap;\n                    }\n                }\n                else if (this._layout == ListLayoutType.SingleRow || this._layout == ListLayoutType.FlowVertical) {\n                    for (i = 0; i < len; i += this._curLineItemCount)\n                        cw += this._virtualItems[i].width + this._columnGap;\n                    if (cw > 0)\n                        cw -= this._columnGap;\n\n                    if (this._autoResizeItem)\n                        ch = this._scrollPane.viewHeight;\n                    else {\n                        for (i = 0; i < len2; i++)\n                            ch += this._virtualItems[i].height + this._lineGap;\n                        if (ch > 0)\n                            ch -= this._lineGap;\n                    }\n                }\n                else {\n                    var pageCount: number = Math.ceil(len / (this._curLineItemCount * this._curLineItemCount2));\n                    cw = pageCount * this.viewWidth;\n                    ch = this.viewHeight;\n                }\n            }\n\n            this.handleAlign(cw, ch);\n            this._scrollPane.setContentSize(cw, ch);\n\n            this._eventLocked = false;\n\n            this.handleScroll(true);\n        }\n\n        private __scrolled(evt: Event): void {\n            this.handleScroll(false);\n        }\n\n        private getIndexOnPos1(forceUpdate: boolean): number {\n            if (this._realNumItems < this._curLineItemCount) {\n                s_n = 0;\n                return 0;\n            }\n\n            var i: number;\n            var pos2: number;\n            var pos3: number;\n\n            if (this.numChildren > 0 && !forceUpdate) {\n                pos2 = this.getChildAt(0).y;\n                if (pos2 > s_n) {\n                    for (i = this._firstIndex - this._curLineItemCount; i >= 0; i -= this._curLineItemCount) {\n                        pos2 -= (this._virtualItems[i].height + this._lineGap);\n                        if (pos2 <= s_n) {\n                            s_n = pos2;\n                            return i;\n                        }\n                    }\n\n                    s_n = 0;\n                    return 0;\n                }\n                else {\n                    for (i = this._firstIndex; i < this._realNumItems; i += this._curLineItemCount) {\n                        pos3 = pos2 + this._virtualItems[i].height + this._lineGap;\n                        if (pos3 > s_n) {\n                            s_n = pos2;\n                            return i;\n                        }\n                        pos2 = pos3;\n                    }\n\n                    s_n = pos2;\n                    return this._realNumItems - this._curLineItemCount;\n                }\n            }\n            else {\n                pos2 = 0;\n                for (i = 0; i < this._realNumItems; i += this._curLineItemCount) {\n                    pos3 = pos2 + this._virtualItems[i].height + this._lineGap;\n                    if (pos3 > s_n) {\n                        s_n = pos2;\n                        return i;\n                    }\n                    pos2 = pos3;\n                }\n\n                s_n = pos2;\n                return this._realNumItems - this._curLineItemCount;\n            }\n        }\n\n        private getIndexOnPos2(forceUpdate: boolean): number {\n            if (this._realNumItems < this._curLineItemCount) {\n                s_n = 0;\n                return 0;\n            }\n\n            var i: number;\n            var pos2: number;\n            var pos3: number;\n\n            if (this.numChildren > 0 && !forceUpdate) {\n                pos2 = this.getChildAt(0).x;\n                if (pos2 > s_n) {\n                    for (i = this._firstIndex - this._curLineItemCount; i >= 0; i -= this._curLineItemCount) {\n                        pos2 -= (this._virtualItems[i].width + this._columnGap);\n                        if (pos2 <= s_n) {\n                            s_n = pos2;\n                            return i;\n                        }\n                    }\n\n                    s_n = 0;\n                    return 0;\n                }\n                else {\n                    for (i = this._firstIndex; i < this._realNumItems; i += this._curLineItemCount) {\n                        pos3 = pos2 + this._virtualItems[i].width + this._columnGap;\n                        if (pos3 > s_n) {\n                            s_n = pos2;\n                            return i;\n                        }\n                        pos2 = pos3;\n                    }\n\n                    s_n = pos2;\n                    return this._realNumItems - this._curLineItemCount;\n                }\n            }\n            else {\n                pos2 = 0;\n                for (i = 0; i < this._realNumItems; i += this._curLineItemCount) {\n                    pos3 = pos2 + this._virtualItems[i].width + this._columnGap;\n                    if (pos3 > s_n) {\n                        s_n = pos2;\n                        return i;\n                    }\n                    pos2 = pos3;\n                }\n\n                s_n = pos2;\n                return this._realNumItems - this._curLineItemCount;\n            }\n        }\n\n        private getIndexOnPos3(forceUpdate: boolean): number {\n            if (this._realNumItems < this._curLineItemCount) {\n                s_n = 0;\n                return 0;\n            }\n\n            var viewWidth: number = this.viewWidth;\n            var page: number = Math.floor(s_n / viewWidth);\n            var startIndex: number = page * (this._curLineItemCount * this._curLineItemCount2);\n            var pos2: number = page * viewWidth;\n            var i: number;\n            var pos3: number;\n            for (i = 0; i < this._curLineItemCount; i++) {\n                pos3 = pos2 + this._virtualItems[startIndex + i].width + this._columnGap;\n                if (pos3 > s_n) {\n                    s_n = pos2;\n                    return startIndex + i;\n                }\n                pos2 = pos3;\n            }\n\n            s_n = pos2;\n            return startIndex + this._curLineItemCount - 1;\n        }\n\n        private handleScroll(forceUpdate: boolean): void {\n            if (this._eventLocked)\n                return;\n\n            if (this._layout == ListLayoutType.SingleColumn || this._layout == ListLayoutType.FlowHorizontal) {\n                var enterCounter: number = 0;\n                while (this.handleScroll1(forceUpdate)) {\n                    enterCounter++;\n                    forceUpdate = false;\n                    if (enterCounter > 20) {\n                        console.log(\"FairyGUI: list will never be filled as the item renderer function always returns a different size.\");\n                        break;\n                    }\n                }\n                this.handleArchOrder1();\n            }\n            else if (this._layout == ListLayoutType.SingleRow || this._layout == ListLayoutType.FlowVertical) {\n                enterCounter = 0;\n                while (this.handleScroll2(forceUpdate)) {\n                    enterCounter++;\n                    forceUpdate = false;\n                    if (enterCounter > 20) {\n                        console.log(\"FairyGUI: list will never be filled as the item renderer function always returns a different size.\");\n                        break;\n                    }\n                }\n                this.handleArchOrder2();\n            }\n            else {\n                this.handleScroll3(forceUpdate);\n            }\n\n            this._boundsChanged = false;\n        }\n\n        private handleScroll1(forceUpdate: boolean): boolean {\n            var pos: number = this._scrollPane.scrollingPosY;\n            var max: number = pos + this._scrollPane.viewHeight;\n            var end: boolean = max == this._scrollPane.contentHeight;//这个标志表示当前需要滚动到最末，无论内容变化大小\n\n            //寻找当前位置的第一条项目\n            s_n = pos;\n            var newFirstIndex: number = this.getIndexOnPos1(forceUpdate);\n            pos = s_n;\n            if (newFirstIndex == this._firstIndex && !forceUpdate) {\n                return false;\n            }\n\n            var oldFirstIndex: number = this._firstIndex;\n            this._firstIndex = newFirstIndex;\n            var curIndex: number = newFirstIndex;\n            var forward: boolean = oldFirstIndex > newFirstIndex;\n            var childCount: number = this.numChildren;\n            var lastIndex: number = oldFirstIndex + childCount - 1;\n            var reuseIndex: number = forward ? lastIndex : oldFirstIndex;\n            var curX: number = 0, curY: number = pos;\n            var needRender: boolean;\n            var deltaSize: number = 0;\n            var firstItemDeltaSize: number = 0;\n            var url: string = this.defaultItem;\n            var ii: ItemInfo, ii2: ItemInfo;\n            var i: number, j: number;\n            var partSize: number = (this._scrollPane.viewWidth - this._columnGap * (this._curLineItemCount - 1)) / this._curLineItemCount;\n\n            this.itemInfoVer++;\n\n            while (curIndex < this._realNumItems && (end || curY < max)) {\n                ii = this._virtualItems[curIndex];\n\n                if (ii.obj == null || forceUpdate) {\n                    if (this.itemProvider != null) {\n                        url = this.itemProvider.call(this.callbackThisObj, curIndex % this._numItems);\n                        if (url == null)\n                            url = this._defaultItem;\n                        url = UIPackage.normalizeURL(url);\n                    }\n\n                    if (ii.obj && ii.obj.resourceURL != url) {\n                        if (ii.obj instanceof GButton)\n                            ii.selected = ii.obj.selected;\n                        this.removeChildToPool(ii.obj);\n                        ii.obj = null;\n                    }\n                }\n\n                if (ii.obj == null) {\n                    //搜索最适合的重用item，保证每次刷新需要新建或者重新render的item最少\n                    if (forward) {\n                        for (j = reuseIndex; j >= oldFirstIndex; j--) {\n                            ii2 = this._virtualItems[j];\n                            if (ii2.obj && ii2.updateFlag != this.itemInfoVer && ii2.obj.resourceURL == url) {\n                                if (ii2.obj instanceof GButton)\n                                    ii2.selected = ii2.obj.selected;\n                                ii.obj = ii2.obj;\n                                ii2.obj = null;\n                                if (j == reuseIndex)\n                                    reuseIndex--;\n                                break;\n                            }\n                        }\n                    }\n                    else {\n                        for (j = reuseIndex; j <= lastIndex; j++) {\n                            ii2 = this._virtualItems[j];\n                            if (ii2.obj && ii2.updateFlag != this.itemInfoVer && ii2.obj.resourceURL == url) {\n                                if (ii2.obj instanceof GButton)\n                                    ii2.selected = ii2.obj.selected;\n                                ii.obj = ii2.obj;\n                                ii2.obj = null;\n                                if (j == reuseIndex)\n                                    reuseIndex++;\n                                break;\n                            }\n                        }\n                    }\n\n                    if (ii.obj) {\n                        this.setChildIndex(ii.obj, forward ? curIndex - newFirstIndex : this.numChildren);\n                    }\n                    else {\n                        ii.obj = this._pool.getObject(url);\n                        if (forward)\n                            this.addChildAt(ii.obj, curIndex - newFirstIndex);\n                        else\n                            this.addChild(ii.obj);\n                    }\n                    if (ii.obj instanceof GButton)\n                        ii.obj.selected = ii.selected;\n\n                    needRender = true;\n                }\n                else\n                    needRender = forceUpdate;\n\n                if (needRender) {\n                    if (this._autoResizeItem && (this._layout == ListLayoutType.SingleColumn || this._columnCount > 0))\n                        ii.obj.setSize(partSize, ii.obj.height, true);\n\n                    this.itemRenderer.call(this.callbackThisObj, curIndex % this._numItems, ii.obj);\n                    if (curIndex % this._curLineItemCount == 0) {\n                        deltaSize += Math.ceil(ii.obj.height) - ii.height;\n                        if (curIndex == newFirstIndex && oldFirstIndex > newFirstIndex) {\n                            //当内容向下滚动时，如果新出现的项目大小发生变化，需要做一个位置补偿，才不会导致滚动跳动\n                            firstItemDeltaSize = Math.ceil(ii.obj.height) - ii.height;\n                        }\n                    }\n                    ii.width = Math.ceil(ii.obj.width);\n                    ii.height = Math.ceil(ii.obj.height);\n                }\n\n                ii.updateFlag = this.itemInfoVer;\n                ii.obj.setXY(curX, curY);\n                if (curIndex == newFirstIndex) //要显示多一条才不会穿帮\n                    max += ii.height;\n\n                curX += ii.width + this._columnGap;\n\n                if (curIndex % this._curLineItemCount == this._curLineItemCount - 1) {\n                    curX = 0;\n                    curY += ii.height + this._lineGap;\n                }\n                curIndex++;\n            }\n\n            for (i = 0; i < childCount; i++) {\n                ii = this._virtualItems[oldFirstIndex + i];\n                if (ii.updateFlag != this.itemInfoVer && ii.obj) {\n                    if (ii.obj instanceof GButton)\n                        ii.selected = ii.obj.selected;\n                    this.removeChildToPool(ii.obj);\n                    ii.obj = null;\n                }\n            }\n\n            childCount = this._children.length;\n            for (i = 0; i < childCount; i++) {\n                let obj: GObject = this._virtualItems[newFirstIndex + i].obj;\n                if (this._children[i] != obj)\n                    this.setChildIndex(obj, i);\n            }\n\n            if (deltaSize != 0 || firstItemDeltaSize != 0)\n                this._scrollPane.changeContentSizeOnScrolling(0, deltaSize, 0, firstItemDeltaSize);\n\n            if (curIndex > 0 && this.numChildren > 0 && this._container.y <= 0 && this.getChildAt(0).y > -this._container.y)//最后一页没填满！\n                return true;\n            else\n                return false;\n        }\n\n        private handleScroll2(forceUpdate: boolean): boolean {\n            var pos: number = this._scrollPane.scrollingPosX;\n            var max: number = pos + this._scrollPane.viewWidth;\n            var end: boolean = pos == this._scrollPane.contentWidth;//这个标志表示当前需要滚动到最末，无论内容变化大小\n\n            //寻找当前位置的第一条项目\n            s_n = pos;\n            var newFirstIndex: number = this.getIndexOnPos2(forceUpdate);\n            pos = s_n;\n            if (newFirstIndex == this._firstIndex && !forceUpdate) {\n                return false;\n            }\n\n            var oldFirstIndex: number = this._firstIndex;\n            this._firstIndex = newFirstIndex;\n            var curIndex: number = newFirstIndex;\n            var forward: boolean = oldFirstIndex > newFirstIndex;\n            var childCount: number = this.numChildren;\n            var lastIndex: number = oldFirstIndex + childCount - 1;\n            var reuseIndex: number = forward ? lastIndex : oldFirstIndex;\n            var curX: number = pos, curY: number = 0;\n            var needRender: boolean;\n            var deltaSize: number = 0;\n            var firstItemDeltaSize: number = 0;\n            var url: string = this.defaultItem;\n            var ii: ItemInfo, ii2: ItemInfo;\n            var i: number, j: number;\n            var partSize: number = (this._scrollPane.viewHeight - this._lineGap * (this._curLineItemCount - 1)) / this._curLineItemCount;\n\n            this.itemInfoVer++;\n\n            while (curIndex < this._realNumItems && (end || curX < max)) {\n                ii = this._virtualItems[curIndex];\n\n                if (ii.obj == null || forceUpdate) {\n                    if (this.itemProvider != null) {\n                        url = this.itemProvider.call(this.callbackThisObj, curIndex % this._numItems);\n                        if (url == null)\n                            url = this._defaultItem;\n                        url = UIPackage.normalizeURL(url);\n                    }\n\n                    if (ii.obj && ii.obj.resourceURL != url) {\n                        if (ii.obj instanceof GButton)\n                            ii.selected = ii.obj.selected;\n                        this.removeChildToPool(ii.obj);\n                        ii.obj = null;\n                    }\n                }\n\n                if (ii.obj == null) {\n                    if (forward) {\n                        for (j = reuseIndex; j >= oldFirstIndex; j--) {\n                            ii2 = this._virtualItems[j];\n                            if (ii2.obj && ii2.updateFlag != this.itemInfoVer && ii2.obj.resourceURL == url) {\n                                if (ii2.obj instanceof GButton)\n                                    ii2.selected = ii2.obj.selected;\n                                ii.obj = ii2.obj;\n                                ii2.obj = null;\n                                if (j == reuseIndex)\n                                    reuseIndex--;\n                                break;\n                            }\n                        }\n                    }\n                    else {\n                        for (j = reuseIndex; j <= lastIndex; j++) {\n                            ii2 = this._virtualItems[j];\n                            if (ii2.obj && ii2.updateFlag != this.itemInfoVer && ii2.obj.resourceURL == url) {\n                                if (ii2.obj instanceof GButton)\n                                    ii2.selected = ii2.obj.selected;\n                                ii.obj = ii2.obj;\n                                ii2.obj = null;\n                                if (j == reuseIndex)\n                                    reuseIndex++;\n                                break;\n                            }\n                        }\n                    }\n\n                    if (ii.obj) {\n                        this.setChildIndex(ii.obj, forward ? curIndex - newFirstIndex : this.numChildren);\n                    }\n                    else {\n                        ii.obj = this._pool.getObject(url);\n                        if (forward)\n                            this.addChildAt(ii.obj, curIndex - newFirstIndex);\n                        else\n                            this.addChild(ii.obj);\n                    }\n                    if (ii.obj instanceof GButton)\n                        ii.obj.selected = ii.selected;\n\n                    needRender = true;\n                }\n                else\n                    needRender = forceUpdate;\n\n                if (needRender) {\n                    if (this._autoResizeItem && (this._layout == ListLayoutType.SingleRow || this._lineCount > 0))\n                        ii.obj.setSize(ii.obj.width, partSize, true);\n\n\n                    this.itemRenderer.call(this.callbackThisObj, curIndex % this._numItems, ii.obj);\n                    if (curIndex % this._curLineItemCount == 0) {\n                        deltaSize += Math.ceil(ii.obj.width) - ii.width;\n                        if (curIndex == newFirstIndex && oldFirstIndex > newFirstIndex) {\n                            //当内容向下滚动时，如果新出现的一个项目大小发生变化，需要做一个位置补偿，才不会导致滚动跳动\n                            firstItemDeltaSize = Math.ceil(ii.obj.width) - ii.width;\n                        }\n                    }\n                    ii.width = Math.ceil(ii.obj.width);\n                    ii.height = Math.ceil(ii.obj.height);\n                }\n\n                ii.updateFlag = this.itemInfoVer;\n                ii.obj.setXY(curX, curY);\n                if (curIndex == newFirstIndex) //要显示多一条才不会穿帮\n                    max += ii.width;\n\n                curY += ii.height + this._lineGap;\n\n                if (curIndex % this._curLineItemCount == this._curLineItemCount - 1) {\n                    curY = 0;\n                    curX += ii.width + this._columnGap;\n                }\n                curIndex++;\n            }\n\n            for (i = 0; i < childCount; i++) {\n                ii = this._virtualItems[oldFirstIndex + i];\n                if (ii.updateFlag != this.itemInfoVer && ii.obj) {\n                    if (ii.obj instanceof GButton)\n                        ii.selected = ii.obj.selected;\n                    this.removeChildToPool(ii.obj);\n                    ii.obj = null;\n                }\n            }\n\n            childCount = this._children.length;\n            for (i = 0; i < childCount; i++) {\n                let obj: GObject = this._virtualItems[newFirstIndex + i].obj;\n                if (this._children[i] != obj)\n                    this.setChildIndex(obj, i);\n            }\n\n            if (deltaSize != 0 || firstItemDeltaSize != 0)\n                this._scrollPane.changeContentSizeOnScrolling(deltaSize, 0, firstItemDeltaSize, 0);\n\n            if (curIndex > 0 && this.numChildren > 0 && this._container.x <= 0 && this.getChildAt(0).x > - this._container.x)//最后一页没填满！\n                return true;\n            else\n                return false;\n        }\n\n        private handleScroll3(forceUpdate: boolean): void {\n            var pos: number = this._scrollPane.scrollingPosX;\n\n            //寻找当前位置的第一条项目\n            s_n = pos;\n            var newFirstIndex: number = this.getIndexOnPos3(forceUpdate);\n            pos = s_n;\n            if (newFirstIndex == this._firstIndex && !forceUpdate)\n                return;\n\n            var oldFirstIndex: number = this._firstIndex;\n            this._firstIndex = newFirstIndex;\n\n            //分页模式不支持不等高，所以渲染满一页就好了\n\n            var reuseIndex: number = oldFirstIndex;\n            var virtualItemCount: number = this._virtualItems.length;\n            var pageSize: number = this._curLineItemCount * this._curLineItemCount2;\n            var startCol: number = newFirstIndex % this._curLineItemCount;\n            var viewWidth: number = this.viewWidth;\n            var page: number = Math.floor(newFirstIndex / pageSize);\n            var startIndex: number = page * pageSize;\n            var lastIndex: number = startIndex + pageSize * 2; //测试两页\n            var needRender: boolean;\n            var i: number;\n            var ii: ItemInfo, ii2: ItemInfo;\n            var col: number;\n            var url: string = this._defaultItem;\n            var partWidth: number = (this._scrollPane.viewWidth - this._columnGap * (this._curLineItemCount - 1)) / this._curLineItemCount;\n            var partHeight: number = (this._scrollPane.viewHeight - this._lineGap * (this._curLineItemCount2 - 1)) / this._curLineItemCount2;\n\n            this.itemInfoVer++;\n\n            //先标记这次要用到的项目\n            for (i = startIndex; i < lastIndex; i++) {\n                if (i >= this._realNumItems)\n                    continue;\n\n                col = i % this._curLineItemCount;\n                if (i - startIndex < pageSize) {\n                    if (col < startCol)\n                        continue;\n                }\n                else {\n                    if (col > startCol)\n                        continue;\n                }\n\n                ii = this._virtualItems[i];\n                ii.updateFlag = this.itemInfoVer;\n            }\n\n            var lastObj: GObject;\n            var insertIndex: number = 0;\n            for (i = startIndex; i < lastIndex; i++) {\n                if (i >= this._realNumItems)\n                    continue;\n\n                ii = this._virtualItems[i];\n                if (ii.updateFlag != this.itemInfoVer)\n                    continue;\n\n                if (ii.obj == null) {\n                    //寻找看有没有可重用的\n                    while (reuseIndex < virtualItemCount) {\n                        ii2 = this._virtualItems[reuseIndex];\n                        if (ii2.obj && ii2.updateFlag != this.itemInfoVer) {\n                            if (ii2.obj instanceof GButton)\n                                ii2.selected = ii2.obj.selected;\n                            ii.obj = ii2.obj;\n                            ii2.obj = null;\n                            break;\n                        }\n                        reuseIndex++;\n                    }\n\n                    if (insertIndex == -1)\n                        insertIndex = this.getChildIndex(lastObj) + 1;\n\n                    if (ii.obj == null) {\n                        if (this.itemProvider != null) {\n                            url = this.itemProvider.call(this.callbackThisObj, i % this._numItems);\n                            if (url == null)\n                                url = this._defaultItem;\n                            url = UIPackage.normalizeURL(url);\n                        }\n\n                        ii.obj = this._pool.getObject(url);\n                        this.addChildAt(ii.obj, insertIndex);\n                    }\n                    else {\n                        insertIndex = this.setChildIndexBefore(ii.obj, insertIndex);\n                    }\n                    insertIndex++;\n\n                    if (ii.obj instanceof GButton)\n                        ii.obj.selected = ii.selected;\n\n                    needRender = true;\n                }\n                else {\n                    needRender = forceUpdate;\n                    insertIndex = -1;\n                    lastObj = ii.obj;\n                }\n\n                if (needRender) {\n                    if (this._autoResizeItem) {\n                        if (this._curLineItemCount == this._columnCount && this._curLineItemCount2 == this._lineCount)\n                            ii.obj.setSize(partWidth, partHeight, true);\n                        else if (this._curLineItemCount == this._columnCount)\n                            ii.obj.setSize(partWidth, ii.obj.height, true);\n                        else if (this._curLineItemCount2 == this._lineCount)\n                            ii.obj.setSize(ii.obj.width, partHeight, true);\n                    }\n\n                    this.itemRenderer.call(this.callbackThisObj, i % this._numItems, ii.obj);\n                    ii.width = Math.ceil(ii.obj.width);\n                    ii.height = Math.ceil(ii.obj.height);\n                }\n            }\n\n            //排列item\n            var borderX: number = (startIndex / pageSize) * viewWidth;\n            var xx: number = borderX;\n            var yy: number = 0;\n            var lineHeight: number = 0;\n            for (i = startIndex; i < lastIndex; i++) {\n                if (i >= this._realNumItems)\n                    continue;\n\n                ii = this._virtualItems[i];\n                if (ii.updateFlag == this.itemInfoVer)\n                    ii.obj.setXY(xx, yy);\n\n                if (ii.height > lineHeight)\n                    lineHeight = ii.height;\n                if (i % this._curLineItemCount == this._curLineItemCount - 1) {\n                    xx = borderX;\n                    yy += lineHeight + this._lineGap;\n                    lineHeight = 0;\n\n                    if (i == startIndex + pageSize - 1) {\n                        borderX += viewWidth;\n                        xx = borderX;\n                        yy = 0;\n                    }\n                }\n                else\n                    xx += ii.width + this._columnGap;\n            }\n\n            //释放未使用的\n            for (i = reuseIndex; i < virtualItemCount; i++) {\n                ii = this._virtualItems[i];\n                if (ii.updateFlag != this.itemInfoVer && ii.obj) {\n                    if (ii.obj instanceof GButton)\n                        ii.selected = ii.obj.selected;\n                    this.removeChildToPool(ii.obj);\n                    ii.obj = null;\n                }\n            }\n        }\n\n        private handleArchOrder1(): void {\n            if (this._childrenRenderOrder == ChildrenRenderOrder.Arch) {\n                var mid: number = this._scrollPane.posY + this.viewHeight / 2;\n                var minDist: number = Number.POSITIVE_INFINITY;\n                var dist: number = 0;\n                var apexIndex: number = 0;\n                var cnt: number = this.numChildren;\n                for (var i: number = 0; i < cnt; i++) {\n                    var obj: GObject = this.getChildAt(i);\n                    if (!this.foldInvisibleItems || obj.visible) {\n                        dist = Math.abs(mid - obj.y - obj.height / 2);\n                        if (dist < minDist) {\n                            minDist = dist;\n                            apexIndex = i;\n                        }\n                    }\n                }\n                this.apexIndex = apexIndex;\n            }\n        }\n\n        private handleArchOrder2(): void {\n            if (this._childrenRenderOrder == ChildrenRenderOrder.Arch) {\n                var mid: number = this._scrollPane.posX + this.viewWidth / 2;\n                var minDist: number = Number.POSITIVE_INFINITY;\n                var dist: number = 0;\n                var apexIndex: number = 0;\n                var cnt: number = this.numChildren;\n                for (var i: number = 0; i < cnt; i++) {\n                    var obj: GObject = this.getChildAt(i);\n                    if (!this.foldInvisibleItems || obj.visible) {\n                        dist = Math.abs(mid - obj.x - obj.width / 2);\n                        if (dist < minDist) {\n                            minDist = dist;\n                            apexIndex = i;\n                        }\n                    }\n                }\n                this.apexIndex = apexIndex;\n            }\n        }\n\n        private handleAlign(contentWidth: number, contentHeight: number): void {\n            var newOffsetX: number = 0;\n            var newOffsetY: number = 0;\n\n            if (contentHeight < this.viewHeight) {\n                if (this._verticalAlign == VertAlignType.Middle)\n                    newOffsetY = Math.floor((this.viewHeight - contentHeight) / 2);\n                else if (this._verticalAlign == VertAlignType.Bottom)\n                    newOffsetY = this.viewHeight - contentHeight;\n            }\n\n            if (contentWidth < this.viewWidth) {\n                if (this._align == AlignType.Center)\n                    newOffsetX = Math.floor((this.viewWidth - contentWidth) / 2);\n                else if (this._align == AlignType.Right)\n                    newOffsetX = this.viewWidth - contentWidth;\n            }\n\n\n            if (newOffsetX != this._alignOffset.x || newOffsetY != this._alignOffset.y) {\n                this._alignOffset.setTo(newOffsetX, newOffsetY);\n                if (this._scrollPane)\n                    this._scrollPane.adjustMaskContainer();\n                else {\n                    this._container.x = this._margin.left + this._alignOffset.x;\n                    this._container.y = this._margin.top + this._alignOffset.y;\n                }\n            }\n        }\n\n        protected updateBounds(): void {\n            if (this._virtual)\n                return;\n\n            var i: number;\n            var child: GObject;\n            var curX: number = 0;\n            var curY: number = 0;\n            var maxWidth: number = 0;\n            var maxHeight: number = 0;\n            var cw: number = 0, ch: number = 0;\n            var j: number = 0;\n            var page: number = 0;\n            var k: number = 0;\n            var cnt: number = this._children.length;\n            var viewWidth: number = this.viewWidth;\n            var viewHeight: number = this.viewHeight;\n            var lineSize: number = 0;\n            var lineStart: number = 0;\n            var ratio: number = 0;\n\n            if (this._layout == ListLayoutType.SingleColumn) {\n                for (i = 0; i < cnt; i++) {\n                    child = this.getChildAt(i);\n                    if (this.foldInvisibleItems && !child.visible)\n                        continue;\n\n                    if (curY != 0)\n                        curY += this._lineGap;\n                    child.y = curY;\n                    if (this._autoResizeItem)\n                        child.setSize(viewWidth, child.height, true);\n                    curY += Math.ceil(child.height);\n                    if (child.width > maxWidth)\n                        maxWidth = child.width;\n                }\n                ch = curY;\n\n                if (ch <= viewHeight && this._autoResizeItem && this._scrollPane && this._scrollPane._displayInDemand && this._scrollPane.vtScrollBar) {\n                    viewWidth += this._scrollPane.vtScrollBar.width;\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n\n                        child.setSize(viewWidth, child.height, true);\n                        if (child.width > maxWidth)\n                            maxWidth = child.width;\n                    }\n                }\n\n                cw = Math.ceil(maxWidth);\n            }\n            else if (this._layout == ListLayoutType.SingleRow) {\n                for (i = 0; i < cnt; i++) {\n                    child = this.getChildAt(i);\n                    if (this.foldInvisibleItems && !child.visible)\n                        continue;\n\n                    if (curX != 0)\n                        curX += this._columnGap;\n                    child.x = curX;\n                    if (this._autoResizeItem)\n                        child.setSize(child.width, viewHeight, true);\n                    curX += Math.ceil(child.width);\n                    if (child.height > maxHeight)\n                        maxHeight = child.height;\n                }\n                cw = curX;\n\n                if (cw <= viewWidth && this._autoResizeItem && this._scrollPane && this._scrollPane._displayInDemand && this._scrollPane.hzScrollBar) {\n                    viewHeight += this._scrollPane.hzScrollBar.height;\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n\n                        child.setSize(child.width, viewHeight, true);\n                        if (child.height > maxHeight)\n                            maxHeight = child.height;\n                    }\n                }\n\n                ch = Math.ceil(maxHeight);\n            }\n            else if (this._layout == ListLayoutType.FlowHorizontal) {\n                if (this._autoResizeItem && this._columnCount > 0) {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n\n                        lineSize += child.sourceWidth;\n                        j++;\n                        if (j == this._columnCount || i == cnt - 1) {\n                            ratio = (viewWidth - lineSize - (j - 1) * this._columnGap) / lineSize;\n                            curX = 0;\n                            for (j = lineStart; j <= i; j++) {\n                                child = this.getChildAt(j);\n                                if (this.foldInvisibleItems && !child.visible)\n                                    continue;\n\n                                child.setXY(curX, curY);\n\n                                if (j < i) {\n                                    child.setSize(child.sourceWidth + Math.round(child.sourceWidth * ratio), child.height, true);\n                                    curX += Math.ceil(child.width) + this._columnGap;\n                                }\n                                else {\n                                    child.setSize(viewWidth - curX, child.height, true);\n                                }\n                                if (child.height > maxHeight)\n                                    maxHeight = child.height;\n                            }\n                            //new line\n                            curY += Math.ceil(maxHeight) + this._lineGap;\n                            maxHeight = 0;\n                            j = 0;\n                            lineStart = i + 1;\n                            lineSize = 0;\n                        }\n                    }\n                    ch = curY + Math.ceil(maxHeight);\n                    cw = viewWidth;\n                }\n                else {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n\n                        if (curX != 0)\n                            curX += this._columnGap;\n\n                        if (this._columnCount != 0 && j >= this._columnCount\n                            || this._columnCount == 0 && curX + child.width > viewWidth && maxHeight != 0) {\n                            //new line\n                            curX = 0;\n                            curY += Math.ceil(maxHeight) + this._lineGap;\n                            maxHeight = 0;\n                            j = 0;\n                        }\n                        child.setXY(curX, curY);\n                        curX += Math.ceil(child.width);\n                        if (curX > maxWidth)\n                            maxWidth = curX;\n                        if (child.height > maxHeight)\n                            maxHeight = child.height;\n                        j++;\n                    }\n                    ch = curY + Math.ceil(maxHeight);\n                    cw = Math.ceil(maxWidth);\n                }\n            }\n            else if (this._layout == ListLayoutType.FlowVertical) {\n                if (this._autoResizeItem && this._lineCount > 0) {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n\n                        lineSize += child.sourceHeight;\n                        j++;\n                        if (j == this._lineCount || i == cnt - 1) {\n                            ratio = (viewHeight - lineSize - (j - 1) * this._lineGap) / lineSize;\n                            curY = 0;\n                            for (j = lineStart; j <= i; j++) {\n                                child = this.getChildAt(j);\n                                if (this.foldInvisibleItems && !child.visible)\n                                    continue;\n\n                                child.setXY(curX, curY);\n\n                                if (j < i) {\n                                    child.setSize(child.width, child.sourceHeight + Math.round(child.sourceHeight * ratio), true);\n                                    curY += Math.ceil(child.height) + this._lineGap;\n                                }\n                                else {\n                                    child.setSize(child.width, viewHeight - curY, true);\n                                }\n                                if (child.width > maxWidth)\n                                    maxWidth = child.width;\n                            }\n                            //new line\n                            curX += Math.ceil(maxWidth) + this._columnGap;\n                            maxWidth = 0;\n                            j = 0;\n                            lineStart = i + 1;\n                            lineSize = 0;\n                        }\n                    }\n                    cw = curX + Math.ceil(maxWidth);\n                    ch = viewHeight;\n                }\n                else {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n\n                        if (curY != 0)\n                            curY += this._lineGap;\n\n                        if (this._lineCount != 0 && j >= this._lineCount\n                            || this._lineCount == 0 && curY + child.height > viewHeight && maxWidth != 0) {\n                            curY = 0;\n                            curX += Math.ceil(maxWidth) + this._columnGap;\n                            maxWidth = 0;\n                            j = 0;\n                        }\n                        child.setXY(curX, curY);\n                        curY += Math.ceil(child.height);\n                        if (curY > maxHeight)\n                            maxHeight = curY;\n                        if (child.width > maxWidth)\n                            maxWidth = child.width;\n                        j++;\n                    }\n                    cw = curX + Math.ceil(maxWidth);\n                    ch = Math.ceil(maxHeight);\n                }\n            }\n            else //pagination\n            {\n                var eachHeight: number;\n                if (this._autoResizeItem && this._lineCount > 0)\n                    eachHeight = Math.floor((viewHeight - (this._lineCount - 1) * this._lineGap) / this._lineCount);\n\n                if (this._autoResizeItem && this._columnCount > 0) {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n\n\n                        if (j == 0 && (this._lineCount != 0 && k >= this._lineCount\n                            || this._lineCount == 0 && curY + (this._lineCount > 0 ? eachHeight : child.height) > viewHeight)) {\n                            //new page\n                            page++;\n                            curY = 0;\n                            k = 0;\n                        }\n\n                        lineSize += child.sourceWidth;\n                        j++;\n                        if (j == this._columnCount || i == cnt - 1) {\n                            ratio = (viewWidth - lineSize - (j - 1) * this._columnGap) / lineSize;\n                            curX = 0;\n                            for (j = lineStart; j <= i; j++) {\n                                child = this.getChildAt(j);\n                                if (this.foldInvisibleItems && !child.visible)\n                                    continue;\n\n                                child.setXY(page * viewWidth + curX, curY);\n\n                                if (j < i) {\n                                    child.setSize(child.sourceWidth + Math.round(child.sourceWidth * ratio),\n                                        this._lineCount > 0 ? eachHeight : child.height, true);\n                                    curX += Math.ceil(child.width) + this._columnGap;\n                                }\n                                else {\n                                    child.setSize(viewWidth - curX, this._lineCount > 0 ? eachHeight : child.height, true);\n                                }\n                                if (child.height > maxHeight)\n                                    maxHeight = child.height;\n                            }\n                            //new line\n                            curY += Math.ceil(maxHeight) + this._lineGap;\n                            maxHeight = 0;\n                            j = 0;\n                            lineStart = i + 1;\n                            lineSize = 0;\n\n                            k++;\n                        }\n                    }\n                }\n                else {\n                    for (i = 0; i < cnt; i++) {\n                        child = this.getChildAt(i);\n                        if (this.foldInvisibleItems && !child.visible)\n                            continue;\n\n                        if (curX != 0)\n                            curX += this._columnGap;\n\n                        if (this._autoResizeItem && this._lineCount > 0)\n                            child.setSize(child.width, eachHeight, true);\n\n                        if (this._columnCount != 0 && j >= this._columnCount\n                            || this._columnCount == 0 && curX + child.width > viewWidth && maxHeight != 0) {\n                            //new line\n                            curX = 0;\n                            curY += Math.ceil(maxHeight) + this._lineGap;\n                            maxHeight = 0;\n                            j = 0;\n                            k++;\n\n                            if (this._lineCount != 0 && k >= this._lineCount\n                                || this._lineCount == 0 && curY + child.height > viewHeight && maxWidth != 0)//new page\n                            {\n                                page++;\n                                curY = 0;\n                                k = 0;\n                            }\n                        }\n                        child.setXY(page * viewWidth + curX, curY);\n                        curX += Math.ceil(child.width);\n                        if (curX > maxWidth)\n                            maxWidth = curX;\n                        if (child.height > maxHeight)\n                            maxHeight = child.height;\n                        j++;\n                    }\n                }\n                ch = page > 0 ? viewHeight : curY + Math.ceil(maxHeight);\n                cw = (page + 1) * viewWidth;\n            }\n\n            this.handleAlign(cw, ch);\n            this.setBounds(0, 0, cw, ch);\n        }\n\n        public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_beforeAdd(buffer, beginPos);\n\n            buffer.seek(beginPos, 5);\n\n            this._layout = buffer.readByte();\n            this._selectionMode = buffer.readByte();\n            this._align = buffer.readByte();\n            this._verticalAlign = buffer.readByte();\n            this._lineGap = buffer.readShort();\n            this._columnGap = buffer.readShort();\n            this._lineCount = buffer.readShort();\n            this._columnCount = buffer.readShort();\n            this._autoResizeItem = buffer.readBool();\n            this._childrenRenderOrder = buffer.readByte();\n            this._apexIndex = buffer.readShort();\n\n            if (buffer.readBool()) {\n                this._margin.top = buffer.readInt();\n                this._margin.bottom = buffer.readInt();\n                this._margin.left = buffer.readInt();\n                this._margin.right = buffer.readInt();\n            }\n\n            var overflow: number = buffer.readByte();\n            if (overflow == OverflowType.Scroll) {\n                var savedPos: number = buffer.position;\n                buffer.seek(beginPos, 7);\n                this.setupScroll(buffer);\n                buffer.position = savedPos;\n            }\n            else\n                this.setupOverflow(overflow);\n\n            if (buffer.readBool())\n                buffer.skip(8);\n\n            if (buffer.version >= 2) {\n                this.scrollItemToViewOnClick = buffer.readBool();\n                this.foldInvisibleItems = buffer.readBool();\n            }\n\n            buffer.seek(beginPos, 8);\n\n            this._defaultItem = buffer.readS();\n            this.readItems(buffer);\n        }\n\n        protected readItems(buffer: ByteBuffer): void {\n            var cnt: number;\n            var i: number;\n            var nextPos: number;\n            var str: string;\n\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n\n                str = buffer.readS();\n                if (str == null) {\n                    str = this.defaultItem;\n                    if (!str) {\n                        buffer.position = nextPos;\n                        continue;\n                    }\n                }\n\n                var obj: GObject = this.getFromPool(str);\n                if (obj != null) {\n                    this.addChild(obj);\n                    this.setupItem(buffer, obj);\n                }\n\n                buffer.position = nextPos;\n            }\n        }\n\n        protected setupItem(buffer: ByteBuffer, obj: GObject): void {\n            var str: string;\n\n            str = buffer.readS();\n            if (str != null)\n                obj.text = str;\n            str = buffer.readS();\n            if (str != null && (obj instanceof GButton))\n                obj.selectedTitle = str;\n            str = buffer.readS();\n            if (str != null)\n                obj.icon = str;\n            str = buffer.readS();\n            if (str != null && (obj instanceof GButton))\n                obj.selectedIcon = str;\n            str = buffer.readS();\n            if (str != null)\n                obj.name = str;\n\n            var cnt: number;\n            var i: number;\n\n            if (obj instanceof GComponent) {\n                cnt = buffer.readShort();\n                for (i = 0; i < cnt; i++) {\n                    var cc: Controller = obj.getController(buffer.readS());\n                    str = buffer.readS();\n                    if (cc)\n                        cc.selectedPageId = str;\n                }\n\n                if (buffer.version >= 2) {\n                    cnt = buffer.readShort();\n                    for (i = 0; i < cnt; i++) {\n                        var target: string = buffer.readS();\n                        var propertyId: number = buffer.readShort();\n                        var value: String = buffer.readS();\n                        var obj2: GObject = obj.getChildByPath(target);\n                        if (obj2)\n                            obj2.setProp(propertyId, value);\n                    }\n                }\n            }\n        }\n\n        public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_afterAdd(buffer, beginPos);\n\n            buffer.seek(beginPos, 6);\n\n            var i: number = buffer.readShort();\n            if (i != -1)\n                this._selectionController = this.parent.getControllerAt(i);\n        }\n    }\n\n    interface ItemInfo {\n        width: number;\n        height: number;\n        obj?: GObject;\n        updateFlag: number;\n        selected?: boolean;\n    }\n\n    var s_n: number = 0;\n}"
  },
  {
    "path": "source/src/GLoader.ts",
    "content": "/// <reference path=\"GObjectPool.ts\" />\n\nmodule fgui {\n\n    export class GLoader extends GObject {\n        private _url: string;\n        private _align: AlignType;\n        private _verticalAlign: VertAlignType;\n        private _autoSize: boolean;\n        private _fill: LoaderFillType;\n        private _shrinkOnly: boolean;\n        private _showErrorSign: boolean;\n        private _contentItem: PackageItem;\n        private _container: UIContainer;\n        private _content: MovieClip;\n        private _errorSign?: GObject;\n        private _content2?: GComponent;\n        private _updatingLayout: boolean;\n\n        private static _errorSignPool: GObjectPool = new GObjectPool();\n\n        public constructor() {\n            super();\n\n            this._url = \"\";\n            this._fill = LoaderFillType.None;\n            this._align = AlignType.Left;\n            this._verticalAlign = VertAlignType.Top;\n            this._showErrorSign = true;\n        }\n\n        protected createDisplayObject(): void {\n            this._container = new UIContainer();\n            this._container.opaque = true;\n            this.setDisplayObject(this._container);\n\n            this._content = new MovieClip();\n            this._container.addChild(this._content);\n        }\n\n        public dispose(): void {\n            if (!this._contentItem) {\n                var texture: egret.Texture = this._content.texture;\n                if (texture)\n                    this.freeExternal(texture);\n            }\n            if (this._content2)\n                this._content2.dispose();\n            super.dispose();\n        }\n\n        public get url(): string {\n            return this._url;\n        }\n\n        public set url(value: string) {\n            if (this._url == value)\n                return;\n\n            //清除旧的url加载的资源\n            this.clearContent();\n\n            this._url = value;\n            this.loadContent();\n            this.updateGear(7);\n        }\n\n        public get icon(): string {\n            return this._url;\n        }\n\n        public set icon(value: string) {\n            this.url = value;\n        }\n\n        public get align(): AlignType {\n            return this._align;\n        }\n\n        public set align(value: AlignType) {\n            if (this._align != value) {\n                this._align = value;\n                this.updateLayout();\n            }\n        }\n\n        public get verticalAlign(): VertAlignType {\n            return this._verticalAlign;\n        }\n\n        public set verticalAlign(value: VertAlignType) {\n            if (this._verticalAlign != value) {\n                this._verticalAlign = value;\n                this.updateLayout();\n            }\n        }\n\n        public get fill(): LoaderFillType {\n            return this._fill;\n        }\n\n        public set fill(value: LoaderFillType) {\n            if (this._fill != value) {\n                this._fill = value;\n                this.updateLayout();\n            }\n        }\n\n        public get shrinkOnly(): boolean {\n            return this._shrinkOnly;\n        }\n\n        public set shrinkOnly(value: boolean) {\n            if (this._shrinkOnly != value) {\n                this._shrinkOnly = value;\n                this.updateLayout();\n            }\n        }\n\n        public get autoSize(): boolean {\n            return this._autoSize;\n        }\n\n        public set autoSize(value: boolean) {\n            if (this._autoSize != value) {\n                this._autoSize = value;\n                this.updateLayout();\n            }\n        }\n\n        public get playing(): boolean {\n            return this._content.playing;\n        }\n\n        public set playing(value: boolean) {\n            if (this._content.playing != value) {\n                this._content.playing = value;\n                this.updateGear(5);\n            }\n        }\n\n        public get frame(): number {\n            return this._content.frame;\n        }\n\n        public set frame(value: number) {\n            if (this._content.frame != value) {\n                this._content.frame = value;\n                this.updateGear(5);\n            }\n        }\n\n        public get color(): number {\n            return this._content.color;\n        }\n\n        public set color(value: number) {\n            if (this._content.color != value) {\n                this._content.color = value;\n                this.updateGear(4);\n            }\n        }\n\n        public get showErrorSign(): boolean {\n            return this._showErrorSign;\n        }\n\n        public set showErrorSign(value: boolean) {\n            this._showErrorSign = value;\n        }\n\n        public get content(): MovieClip {\n            return this._content;\n        }\n\n        public get component(): GComponent {\n            return this._content2;\n        }\n\n        public get texture(): egret.Texture {\n            return this._content.texture;\n        }\n\n        public set texture(value: egret.Texture) {\n            this.url = null;\n            this._content.frames = null;\n\n            this._content.texture = value;\n\n            if (value) {\n                this.sourceWidth = value.textureWidth;\n                this.sourceHeight = value.textureHeight;\n            }\n            else {\n                this.sourceWidth = this.sourceHeight = 0;\n            }\n\n            this.updateLayout();\n        }\n\n        public get fillMethod(): number {\n            return this._content.fillMethod;\n        }\n\n        public set fillMethod(value: number) {\n            this._content.fillMethod = value;\n        }\n\n        public get fillOrigin(): number {\n            return this._content.fillOrigin;\n        }\n\n        public set fillOrigin(value: number) {\n            this._content.fillOrigin = value;\n        }\n\n        public get fillClockwise(): boolean {\n            return this._content.fillClockwise;\n        }\n\n        public set fillClockwise(value: boolean) {\n            this._content.fillClockwise = value;\n        }\n\n        public get fillAmount(): number {\n            return this._content.fillAmount;\n        }\n\n        public set fillAmount(value: number) {\n            this._content.fillAmount = value;\n        }\n\n        protected loadContent(): void {\n            //this.clearContent();\n\n            if (!this._url)\n                return;\n\n            if (ToolSet.startsWith(this._url, \"ui://\"))\n                this.loadFromPackage(this._url);\n            else\n                this.loadExternal();\n        }\n\n        protected loadFromPackage(itemURL: string) {\n            this._contentItem = UIPackage.getItemByURL(itemURL);\n            if (this._contentItem) {\n                this._contentItem = this._contentItem.getBranch();\n                this.sourceWidth = this._contentItem.width;\n                this.sourceHeight = this._contentItem.height;\n                this._contentItem = this._contentItem.getHighResolution();\n                this._contentItem.load();\n\n                if (this._autoSize)\n                    this.setSize(this.sourceWidth, this.sourceHeight);\n\n                if (this._contentItem.type == PackageItemType.Image) {\n                    if (this._contentItem.asset == null) {\n                        this.setErrorState();\n                    }\n                    else {\n                        this._content.texture = <egret.Texture>this._contentItem.asset;\n                        this._content.scale9Grid = this._contentItem.scale9Grid;\n                        if (this._contentItem.scaleByTile)\n                            this._content.fillMode = egret.BitmapFillMode.REPEAT;\n                        else\n                            this._content.fillMode = egret.BitmapFillMode.SCALE;\n                        this.updateLayout();\n                    }\n                }\n                else if (this._contentItem.type == PackageItemType.MovieClip) {\n                    this._content.interval = this._contentItem.interval;\n                    this._content.swing = this._contentItem.swing;\n                    this._content.repeatDelay = this._contentItem.repeatDelay;\n                    this._content.frames = this._contentItem.frames;\n                    this.updateLayout();\n                }\n                else if (this._contentItem.type == PackageItemType.Component) {\n                    var obj: GObject = UIPackage.createObjectFromURL(itemURL);\n                    if (!obj)\n                        this.setErrorState();\n                    else if (!(obj instanceof GComponent)) {\n                        obj.dispose();\n                        this.setErrorState();\n                    }\n                    else {\n                        this._content2 = obj.asCom;\n                        this._container.addChild(this._content2.displayObject);\n                        this.updateLayout();\n                    }\n                }\n                else\n                    this.setErrorState();\n            }\n            else\n                this.setErrorState();\n        }\n\n        protected loadExternal(): void {\n            RES.getResByUrl(this._url, this.__getResCompleted, this);\n        }\n\n        protected freeExternal(texture: egret.Texture): void {\n        }\n\n        protected onExternalLoadSuccess(texture: egret.Texture): void {\n            this._content.texture = texture;\n            this._content.scale9Grid = null;\n            this._content.fillMode = egret.BitmapFillMode.SCALE;\n            this.sourceWidth = texture.textureWidth;\n            this.sourceHeight = texture.textureHeight;\n            this.updateLayout();\n        }\n\n        protected onExternalLoadFailed(): void {\n            this.setErrorState();\n        }\n\n        private __getResCompleted(res: any, key: string): void {\n            if (res instanceof egret.Texture)\n                this.onExternalLoadSuccess(<egret.Texture>res);\n            else\n                this.onExternalLoadFailed();\n        }\n\n        private setErrorState(): void {\n            if (!this._showErrorSign)\n                return;\n\n            if (this._errorSign == null) {\n                if (UIConfig.loaderErrorSign != null) {\n                    this._errorSign = GLoader._errorSignPool.getObject(UIConfig.loaderErrorSign);\n                }\n            }\n\n            if (this._errorSign) {\n                this._errorSign.setSize(this.width, this.height);\n                this._container.addChild(this._errorSign.displayObject);\n            }\n        }\n\n        private clearErrorState(): void {\n            if (this._errorSign) {\n                this._container.removeChild(this._errorSign.displayObject);\n                GLoader._errorSignPool.returnObject(this._errorSign);\n                this._errorSign = null;\n            }\n        }\n\n        private updateLayout(): void {\n            if (!this._content2 && !this._content) {\n                if (this._autoSize) {\n                    this._updatingLayout = true;\n                    this.setSize(50, 30);\n                    this._updatingLayout = false;\n                }\n                return;\n            }\n\n            let cw = this.sourceWidth;\n            let ch = this.sourceHeight;\n\n            if (this._autoSize) {\n                this._updatingLayout = true;\n                if (cw == 0)\n                    cw = 50;\n                if (ch == 0)\n                    ch = 30;\n                this.setSize(cw, ch);\n                this._updatingLayout = false;\n\n                if (cw == this._width && ch == this._height) {\n                    if (this._content2) {\n                        this._content2.setXY(0, 0);\n                        this._content2.setScale(1, 1);\n                    }\n                    else {\n                        this._content.x = 0;\n                        this._content.y = 0;\n                        this._content.width = cw;\n                        this._content.height = ch;\n                    }\n                    return;\n                }\n            }\n\n            var sx: number = 1, sy: number = 1;\n            if (this._fill != LoaderFillType.None) {\n                sx = this.width / this.sourceWidth;\n                sy = this.height / this.sourceHeight;\n\n                if (sx != 1 || sy != 1) {\n                    if (this._fill == LoaderFillType.ScaleMatchHeight)\n                        sx = sy;\n                    else if (this._fill == LoaderFillType.ScaleMatchWidth)\n                        sy = sx;\n                    else if (this._fill == LoaderFillType.Scale) {\n                        if (sx > sy)\n                            sx = sy;\n                        else\n                            sy = sx;\n                    }\n                    else if (this._fill == LoaderFillType.ScaleNoBorder) {\n                        if (sx > sy)\n                            sy = sx;\n                        else\n                            sx = sy;\n                    }\n                    if (this._shrinkOnly) {\n                        if (sx > 1)\n                            sx = 1;\n                        if (sy > 1)\n                            sy = 1;\n                    }\n                    cw = this.sourceWidth * sx;\n                    ch = this.sourceHeight * sy;\n                }\n            }\n\n            if (this._content2) {\n                this._content2.setScale(sx, sy);\n            }\n            else {\n                this._content.width = cw;\n                this._content.height = ch;\n            }\n\n            var nx: number, ny: number;\n            if (this._align == AlignType.Center)\n                nx = Math.floor((this.width - cw) / 2);\n            else if (this._align == AlignType.Right)\n                nx = this.width - cw;\n            else\n                nx = 0;\n            if (this._verticalAlign == VertAlignType.Middle)\n                ny = Math.floor((this.height - ch) / 2);\n            else if (this._verticalAlign == VertAlignType.Bottom)\n                ny = this.height - ch;\n            else\n                ny = 0;\n\n            if (this._content2)\n                this._content2.setXY(nx, ny);\n            else {\n                this._content.x = nx;\n                this._content.y = ny;\n            }\n        }\n\n        private clearContent(): void {\n            this.clearErrorState();\n\n            if (!this._contentItem && this._content.texture) {\n                this.freeExternal(this._content.texture);\n            }\n            this._content.texture = null;\n            this._content.frames = null;\n\n            if (this._content2) {\n                this._container.removeChild(this._content2.displayObject);\n                this._content2.dispose();\n                this._content2 = null;\n            }\n            this._contentItem = null;\n        }\n\n        protected handleSizeChanged(): void {\n            super.handleSizeChanged();\n\n            if (!this._updatingLayout)\n                this.updateLayout();\n        }\n\n        public getProp(index: number): any {\n            switch (index) {\n                case ObjectPropID.Color:\n                    return this.color;\n                case ObjectPropID.Playing:\n                    return this.playing;\n                case ObjectPropID.Frame:\n                    return this.frame;\n                case ObjectPropID.TimeScale:\n                    return this._content.timeScale;\n                default:\n                    return super.getProp(index);\n            }\n        }\n\n        public setProp(index: number, value: any): void {\n            switch (index) {\n                case ObjectPropID.Color:\n                    this.color = value;\n                    break;\n                case ObjectPropID.Playing:\n                    this.playing = value;\n                    break;\n                case ObjectPropID.Frame:\n                    this.frame = value;\n                    break;\n                case ObjectPropID.TimeScale:\n                    this._content.timeScale = value;\n                    break;\n                case ObjectPropID.DeltaTime:\n                    this._content.advance(value);\n                    break;\n                default:\n                    super.setProp(index, value);\n                    break;\n            }\n        }\n\n        public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_beforeAdd(buffer, beginPos);\n\n            buffer.seek(beginPos, 5);\n\n            this._url = buffer.readS();\n            this._align = buffer.readByte();\n            this._verticalAlign = buffer.readByte();\n            this._fill = buffer.readByte();\n            this._shrinkOnly = buffer.readBool();\n            this._autoSize = buffer.readBool();\n            this._showErrorSign = buffer.readBool();\n            this._content.playing = buffer.readBool();\n            this._content.frame = buffer.readInt();\n\n            if (buffer.readBool())\n                this.color = buffer.readColor();\n\n            this._content.fillMethod = buffer.readByte();\n            if (this._content.fillMethod != 0) {\n                this._content.fillOrigin = buffer.readByte();\n                this._content.fillClockwise = buffer.readBool();\n                this._content.fillAmount = buffer.readFloat();\n            }\n\n            if (this._url)\n                this.loadContent();\n        }\n    }\n}"
  },
  {
    "path": "source/src/GLoader3D.ts",
    "content": "namespace fgui {\n    export class GLoader3D extends GObject {\n        private _url: string;\n        private _align: AlignType;\n        private _verticalAlign: VertAlignType;\n        private _autoSize: boolean;\n        private _fill: LoaderFillType;\n        private _shrinkOnly: boolean;\n        private _playing: boolean;\n        private _frame: number = 0;\n        private _loop: boolean;\n        private _animationName: string;\n        private _skinName: string;\n        private _color: number;\n        private _contentItem: PackageItem;\n        private _container: egret.DisplayObjectContainer;\n        private _content: egret.DisplayObject;\n        private _updatingLayout: boolean;\n\n        public constructor() {\n            super();\n\n            this._playing = true;\n            this._url = \"\";\n            this._fill = LoaderFillType.None;\n            this._align = AlignType.Left;\n            this._verticalAlign = VertAlignType.Top;\n            this._color = 0xFFFFFF;\n        }\n\n        protected createDisplayObject(): void {\n            let d = new UIContainer();\n            d.opaque = true;\n            this.setDisplayObject(d);\n            this._container = new egret.DisplayObjectContainer();\n            d.addChild(this._container);\n        }\n\n        public dispose(): void {\n            //防止龙骨内存泄漏(创建的骨架代理不再使用时，需要显式释放)\n            this.clearContent();\n            super.dispose();\n        }\n\n        public get url(): string {\n            return this._url;\n        }\n\n        public set url(value: string) {\n            if (this._url == value)\n                return;\n\n            this._url = value;\n            this.loadContent();\n            this.updateGear(7);\n        }\n\n        public get icon(): string {\n            return this._url;\n        }\n\n        public set icon(value: string) {\n            this.url = value;\n        }\n\n        public get align(): AlignType {\n            return this._align;\n        }\n\n        public set align(value: AlignType) {\n            if (this._align != value) {\n                this._align = value;\n                this.updateLayout();\n            }\n        }\n\n        public get verticalAlign(): VertAlignType {\n            return this._verticalAlign;\n        }\n\n        public set verticalAlign(value: VertAlignType) {\n            if (this._verticalAlign != value) {\n                this._verticalAlign = value;\n                this.updateLayout();\n            }\n        }\n\n        public get fill(): LoaderFillType {\n            return this._fill;\n        }\n\n        public set fill(value: LoaderFillType) {\n            if (this._fill != value) {\n                this._fill = value;\n                this.updateLayout();\n            }\n        }\n\n        public get shrinkOnly(): boolean {\n            return this._shrinkOnly;\n        }\n\n        public set shrinkOnly(value: boolean) {\n            if (this._shrinkOnly != value) {\n                this._shrinkOnly = value;\n                this.updateLayout();\n            }\n        }\n\n        public get autoSize(): boolean {\n            return this._autoSize;\n        }\n\n        public set autoSize(value: boolean) {\n            if (this._autoSize != value) {\n                this._autoSize = value;\n                this.updateLayout();\n            }\n        }\n\n        public get playing(): boolean {\n            return this._playing;\n        }\n\n        public set playing(value: boolean) {\n            if (this._playing != value) {\n                this._playing = value;\n                this.updateGear(5);\n\n                this.onChange();\n            }\n        }\n\n        public get frame(): number {\n            return this._frame;\n        }\n\n        public set frame(value: number) {\n            if (this._frame != value) {\n                this._frame = value;\n                this.updateGear(5);\n\n                this.onChange();\n            }\n        }\n\n        public get animationName(): string {\n            return this._animationName;\n        }\n\n        public set animationName(value: string) {\n            if (this._animationName != value) {\n                this._animationName = value;\n                this.onChange();\n            }\n        }\n\n        public get skinName(): string {\n            return this._skinName;\n        }\n\n        public set skinName(value: string) {\n            if (this._skinName != value) {\n                this._skinName = value;\n                this.onChange();\n            }\n        }\n\n        public get loop(): boolean {\n            return this._loop;\n        }\n\n        public set loop(value: boolean) {\n            if (this._loop != value) {\n                this._loop = value;\n                this.onChange();\n            }\n        }\n\n        public get color(): number {\n            return this._color;\n        }\n\n        public set color(value: number) {\n            if (this._color != value) {\n                this._color = value;\n                this.updateGear(4);\n\n                if (this._content)\n                    this._content.tint = value;\n            }\n        }\n\n        public get content(): egret.DisplayObject {\n            return <dragonBones.EgretArmatureDisplay>this._content;\n        }\n\n        protected loadContent(): void {\n            this.clearContent();\n\n            if (!this._url)\n                return;\n\n            if (ToolSet.startsWith(this._url, \"ui://\"))\n                this.loadFromPackage(this._url);\n            else\n                this.loadExternal();\n        }\n\n        protected loadFromPackage(itemURL: string) {\n            this._contentItem = UIPackage.getItemByURL(itemURL);\n            if (this._contentItem) {\n                this._contentItem = this._contentItem.getBranch();\n                this.sourceWidth = this._contentItem.width;\n                this.sourceHeight = this._contentItem.height;\n                this._contentItem = this._contentItem.getHighResolution();\n\n                if (this._autoSize)\n                    this.setSize(this.sourceWidth, this.sourceHeight);\n\n                if (this._contentItem.type == PackageItemType.Spine || this._contentItem.type == PackageItemType.DragonBones)\n                    this._contentItem.owner.getItemAssetAsync(this._contentItem, this.onLoaded.bind(this));\n            }\n        }\n\n        private onLoaded(err: Error, item: PackageItem): void {\n            if (this._contentItem != item)\n                return;\n\n            if (err)\n                console.warn(err);\n\n            if (!this._contentItem.asset)\n                return;\n\n            if (this._contentItem.type == PackageItemType.DragonBones) {\n                let asset = this._contentItem.asset;\n                this.setDragonBones(this._contentItem.armatureName,\n                    asset.data.name,\n                    this._skinName,\n                    asset.atlasData.name,\n                    this._contentItem.skeletonAnchor);\n            }\n        }\n\n        public setDragonBones(armatureName: string, dragonBonesName?: string, skinName?: string, textureAtlasName?: string, anchor?: egret.Point): void {\n            this.url = null;\n\n            let egretFactory: dragonBones.EgretFactory = dragonBones.EgretFactory.factory;\n            this._content = egretFactory.buildArmatureDisplay(armatureName, dragonBonesName, skinName, textureAtlasName);\n            this._container.addChild(this._content);\n            this._content.x = anchor.x;\n            this._content.y = anchor.y;\n            this._content.tint = this._color;\n\n            this.onChangeDragonBones();\n\n            this.updateLayout();\n        }\n\n        private onChange(): void {\n            this.onChangeDragonBones();\n        }\n\n        private onChangeDragonBones(): void {\n            if (!(this._content instanceof dragonBones.EgretArmatureDisplay))\n                return;\n\n            if (this._animationName) {\n                if (this._playing)\n                    this._content.animation.play(this._animationName, this._loop ? 0 : 1);\n                else\n                    this._content.animation.gotoAndStopByFrame(this._animationName, this._frame);\n            }\n            else\n                this._content.animation.reset();\n        }\n\n        protected loadExternal(): void {\n        }\n\n        private updateLayout(): void {\n            let cw = this.sourceWidth;\n            let ch = this.sourceHeight;\n\n            if (this._autoSize) {\n                this._updatingLayout = true;\n                if (cw == 0)\n                    cw = 50;\n                if (ch == 0)\n                    ch = 30;\n\n                this.setSize(cw, ch);\n                this._updatingLayout = false;\n\n                if (cw == this._width && ch == this._height) {\n                    this._container.scaleX = this._container.scaleY = 1;\n                    this._container.x = this._container.y = 0;\n\n                    return;\n                }\n            }\n\n            var sx: number = 1, sy: number = 1;\n            if (this._fill != LoaderFillType.None) {\n                sx = this.width / this.sourceWidth;\n                sy = this.height / this.sourceHeight;\n\n                if (sx != 1 || sy != 1) {\n                    if (this._fill == LoaderFillType.ScaleMatchHeight)\n                        sx = sy;\n                    else if (this._fill == LoaderFillType.ScaleMatchWidth)\n                        sy = sx;\n                    else if (this._fill == LoaderFillType.Scale) {\n                        if (sx > sy)\n                            sx = sy;\n                        else\n                            sy = sx;\n                    }\n                    else if (this._fill == LoaderFillType.ScaleNoBorder) {\n                        if (sx > sy)\n                            sy = sx;\n                        else\n                            sx = sy;\n                    }\n                    if (this._shrinkOnly) {\n                        if (sx > 1)\n                            sx = 1;\n                        if (sy > 1)\n                            sy = 1;\n                    }\n                    cw = this.sourceWidth * sx;\n                    ch = this.sourceHeight * sy;\n                }\n            }\n\n            this._container.scaleX = sx;\n            this._container.scaleY = sy;\n\n            var nx: number, ny: number;\n            if (this._align == AlignType.Center)\n                nx = Math.floor((this.width - cw) / 2);\n            else if (this._align == AlignType.Right)\n                nx = this.width - cw;\n            else\n                nx = 0;\n            if (this._verticalAlign == VertAlignType.Middle)\n                ny = Math.floor((this.height - ch) / 2);\n            else if (this._verticalAlign == VertAlignType.Bottom)\n                ny = this.height - ch;\n            else\n                ny = 0;\n\n            this._container.x = nx;\n            this._container.y = ny;\n        }\n\n        private clearContent(): void {\n            this._contentItem = null;\n            if (this._content) {\n                this._container.removeChild(this._content);\n                if ('dispose' in this._content)\n                    (<any>this._content).dispose();\n                this._content = null;\n            }\n        }\n\n        protected handleSizeChanged(): void {\n            super.handleSizeChanged();\n\n            if (!this._updatingLayout)\n                this.updateLayout();\n        }\n\n        protected handleGrayedChanged(): void {\n        }\n\n        public getProp(index: number): any {\n            switch (index) {\n                case ObjectPropID.Color:\n                    return this.color;\n                case ObjectPropID.Playing:\n                    return this.playing;\n                case ObjectPropID.Frame:\n                    return this.frame;\n                case ObjectPropID.TimeScale:\n                    return 1;\n                default:\n                    return super.getProp(index);\n            }\n        }\n\n        public setProp(index: number, value: any): void {\n            switch (index) {\n                case ObjectPropID.Color:\n                    this.color = value;\n                    break;\n                case ObjectPropID.Playing:\n                    this.playing = value;\n                    break;\n                case ObjectPropID.Frame:\n                    this.frame = value;\n                    break;\n                case ObjectPropID.TimeScale:\n                    break;\n                case ObjectPropID.DeltaTime:\n                    break;\n                default:\n                    super.setProp(index, value);\n                    break;\n            }\n        }\n\n        public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_beforeAdd(buffer, beginPos);\n\n            buffer.seek(beginPos, 5);\n\n            this._url = buffer.readS();\n            this._align = buffer.readByte();\n            this._verticalAlign = buffer.readByte();\n            this._fill = buffer.readByte();\n            this._shrinkOnly = buffer.readBool();\n            this._autoSize = buffer.readBool();\n            this._animationName = buffer.readS();\n            this._skinName = buffer.readS();\n            this._playing = buffer.readBool();\n            this._frame = buffer.readInt();\n            this._loop = buffer.readBool();\n\n            if (buffer.readBool())\n                this.color = buffer.readColor();\n\n            if (this._url)\n                this.loadContent();\n        }\n    }\n}"
  },
  {
    "path": "source/src/GMovieClip.ts",
    "content": "\nmodule fgui {\n\n    export class GMovieClip extends GObject {\n        private _content: MovieClip;\n\n        public constructor() {\n            super();\n        }\n\n        public get color(): number {\n            return this._content.color;\n        }\n\n        public set color(value: number) {\n            if (this._content.color != value) {\n                this._content.color = value;\n                this.updateGear(4);\n            }\n        }\n\n        protected createDisplayObject(): void {\n            this._content = new MovieClip();\n            this._content.touchEnabled = false;\n            this.setDisplayObject(this._content);\n        }\n\n        public get playing(): boolean {\n            return this._content.playing;\n        }\n\n        public set playing(value: boolean) {\n            if (this._content.playing != value) {\n                this._content.playing = value;\n                this.updateGear(5);\n            }\n        }\n\n        public get frame(): number {\n            return this._content.frame;\n        }\n\n        public set frame(value: number) {\n            if (this._content.frame != value) {\n                this._content.frame = value;\n                this.updateGear(5);\n            }\n        }\n\n        public get timeScale(): number {\n            return this._content.timeScale;\n        }\n\n        public set timeScale(value: number) {\n            this._content.timeScale = value;\n        }\n\n        public rewind(): void {\n            this._content.rewind();\n        }\n\n        public syncStatus(anotherMc: GMovieClip): void {\n            this._content.syncStatus(anotherMc._content);\n        }\n\n        public advance(timeInMiniseconds: number): void {\n            this._content.advance(timeInMiniseconds);\n        }\n\n        //从start帧开始，播放到end帧（-1表示结尾），重复times次（0表示无限循环），循环结束后，停止在endAt帧（-1表示参数end）\n        public setPlaySettings(start?: number, end?: number, times?: number, endAt?: number, endCallback?: Function, callbackObj?: any): void {\n            this._content.setPlaySettings(start, end, times, endAt, endCallback, callbackObj);\n        }\n\n        public getProp(index: number): any {\n            switch (index) {\n                case ObjectPropID.Color:\n                    return this.color;\n                case ObjectPropID.Playing:\n                    return this.playing;\n                case ObjectPropID.Frame:\n                    return this.frame;\n                case ObjectPropID.TimeScale:\n                    return this.timeScale;\n                default:\n                    return super.getProp(index);\n            }\n        }\n\n        public setProp(index: number, value: any): void {\n            switch (index) {\n                case ObjectPropID.Color:\n                    this.color = value;\n                    break;\n                case ObjectPropID.Playing:\n                    this.playing = value;\n                    break;\n                case ObjectPropID.Frame:\n                    this.frame = value;\n                    break;\n                case ObjectPropID.TimeScale:\n                    this.timeScale = value;\n                    break;\n                case ObjectPropID.DeltaTime:\n                    this.advance(value);\n                    break;\n                default:\n                    super.setProp(index, value);\n                    break;\n            }\n        }\n\n        public constructFromResource(): void {\n            var contentItem: PackageItem = this.packageItem.getBranch();\n            this.sourceWidth = contentItem.width;\n            this.sourceHeight = contentItem.height;\n            this.initWidth = this.sourceWidth;\n            this.initHeight = this.sourceHeight;\n\n            this.setSize(this.sourceWidth, this.sourceHeight);\n\n            contentItem = contentItem.getHighResolution();\n            contentItem.load();\n\n            this._content.interval = contentItem.interval;\n            this._content.swing = contentItem.swing;\n            this._content.repeatDelay = contentItem.repeatDelay;\n            this._content.frames = contentItem.frames;\n            this._content.smoothing = contentItem.smoothing;\n        }\n\n        public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_beforeAdd(buffer, beginPos);\n\n            buffer.seek(beginPos, 5);\n\n            if (buffer.readBool())\n                this.color = buffer.readColor();\n            buffer.readByte(); //flip\n            this._content.frame = buffer.readInt();\n            this._content.playing = buffer.readBool();\n        }\n    }\n}"
  },
  {
    "path": "source/src/GObject.ts",
    "content": "\nmodule fgui {\n\n    export class GObject extends egret.EventDispatcher {\n        public data: any;\n        public packageItem: PackageItem;\n        public static draggingObject: GObject;\n\n        private _x: number = 0;\n        private _y: number = 0;\n        private _alpha: number = 1;\n        private _rotation: number = 0;\n        private _visible: boolean = true;\n        private _touchable: boolean = true;\n        private _grayed: boolean;\n        private _draggable: boolean;\n        private _scaleX: number = 1;\n        private _scaleY: number = 1;\n        private _skewX: number = 0;\n        private _skewY: number = 0;\n        private _pivotX: number = 0;\n        private _pivotY: number = 0;\n        private _pivotAsAnchor: boolean;\n        private _pivotOffsetX: number = 0;\n        private _pivotOffsetY: number = 0;\n        private _sortingOrder: number = 0;\n        private _internalVisible: boolean = true;\n        private _handlingController?: boolean;\n        private _tooltips?: string;\n        private _pixelSnapping?: boolean;\n        private _disposed?: boolean = false;\n        private _dragTesting?: boolean;\n        private _dragStartPos?: egret.Point;\n\n        private _relations: Relations;\n        private _group?: GGroup;\n        private _gears: GearBase[];\n        private _displayObject: egret.DisplayObject;\n        private _dragBounds?: egret.Rectangle;\n\n        public sourceWidth: number = 0;\n        public sourceHeight: number = 0;\n        public initWidth: number = 0;\n        public initHeight: number = 0;\n        public minWidth: number = 0;\n        public minHeight: number = 0;\n        public maxWidth: number = 0;\n        public maxHeight: number = 0;\n\n        public _parent: GComponent;\n        public _width: number = 0;\n        public _height: number = 0;\n        public _rawWidth: number = 0;\n        public _rawHeight: number = 0;\n        public _id: string;\n        public _name: string;\n        public _underConstruct: boolean;\n        public _gearLocked?: boolean;\n        public _sizePercentInGroup: number = 0;\n        public _treeNode?: GTreeNode;\n\n        public static XY_CHANGED: string = \"__xyChanged\";\n        public static SIZE_CHANGED: string = \"__sizeChanged\";\n        public static SIZE_DELAY_CHANGE: string = \"__sizeDelayChange\";\n        public static GEAR_STOP: string = \"gearStop\";\n\n        public constructor() {\n            super();\n\n            this._id = \"\" + _gInstanceCounter++;\n            this._name = \"\";\n\n            this.createDisplayObject();\n\n            this._relations = new Relations(this);\n            this._gears = new Array<GearBase>(10);\n        }\n\n        public get id(): string {\n            return this._id;\n        }\n\n        public get name(): string {\n            return this._name;\n        }\n\n        public set name(value: string) {\n            this._name = value;\n        }\n\n        public get x(): number {\n            return this._x;\n        }\n\n        public set x(value: number) {\n            this.setXY(value, this._y);\n        }\n\n        public get y(): number {\n            return this._y;\n        }\n\n        public set y(value: number) {\n            this.setXY(this._x, value);\n        }\n\n        public setXY(xv: number, yv: number): void {\n            if (this._x != xv || this._y != yv) {\n                var dx: number = xv - this._x;\n                var dy: number = yv - this._y;\n                this._x = xv;\n                this._y = yv;\n\n                this.handleXYChanged();\n                if (this instanceof GGroup)\n                    this.moveChildren(dx, dy);\n\n                this.updateGear(1);\n\n                if (this._parent && !(this._parent instanceof GList)) {\n                    this._parent.setBoundsChangedFlag();\n                    if (this._group)\n                        this._group.setBoundsChangedFlag(true);\n                    this.dispatchEventWith(GObject.XY_CHANGED);\n                }\n\n                if (GObject.draggingObject == this && !sUpdateInDragging)\n                    this.localToGlobalRect(0, 0, this._width, this._height, sGlobalRect);\n            }\n        }\n\n        public get xMin(): number {\n            return this._pivotAsAnchor ? (this._x - this._width * this._pivotX) : this._x;\n        }\n\n        public set xMin(value: number) {\n            if (this._pivotAsAnchor)\n                this.setXY(value + this._width * this._pivotX, this._y);\n            else\n                this.setXY(value, this._y);\n        }\n\n        public get yMin(): number {\n            return this._pivotAsAnchor ? (this._y - this._height * this._pivotY) : this._y;\n        }\n\n        public set yMin(value: number) {\n            if (this._pivotAsAnchor)\n                this.setXY(this._x, value + this._height * this._pivotY);\n            else\n                this.setXY(this._x, value);\n        }\n\n        public get pixelSnapping(): boolean {\n            return this._pixelSnapping;\n        }\n\n        public set pixelSnapping(value: boolean) {\n            if (this._pixelSnapping != value) {\n                this._pixelSnapping = value;\n                this.handleXYChanged();\n            }\n        }\n\n        public center(restraint?: boolean): void {\n            var r: GComponent;\n            if (this._parent)\n                r = this.parent;\n            else\n                r = this.root;\n\n            this.setXY((r.width - this._width) / 2, (r.height - this._height) / 2);\n            if (restraint) {\n                this.addRelation(r, RelationType.Center_Center);\n                this.addRelation(r, RelationType.Middle_Middle);\n            }\n        }\n\n        public get width(): number {\n            this.ensureSizeCorrect();\n            if (this._relations.sizeDirty)\n                this._relations.ensureRelationsSizeCorrect();\n            return this._width;\n        }\n\n        public set width(value: number) {\n            this.setSize(value, this._rawHeight);\n        }\n\n        public get height(): number {\n            this.ensureSizeCorrect();\n            if (this._relations.sizeDirty)\n                this._relations.ensureRelationsSizeCorrect();\n            return this._height;\n        }\n\n        public set height(value: number) {\n            this.setSize(this._rawWidth, value);\n        }\n\n        public setSize(wv: number, hv: number, ignorePivot?: boolean): void {\n            if (this._rawWidth != wv || this._rawHeight != hv) {\n                this._rawWidth = wv;\n                this._rawHeight = hv;\n                if (wv < this.minWidth)\n                    wv = this.minWidth;\n                if (hv < this.minHeight)\n                    hv = this.minHeight;\n                if (this.maxWidth > 0 && wv > this.maxWidth)\n                    wv = this.maxWidth;\n                if (this.maxHeight > 0 && hv > this.maxHeight)\n                    hv = this.maxHeight;\n                var dWidth: number = wv - this._width;\n                var dHeight: number = hv - this._height;\n                this._width = wv;\n                this._height = hv;\n\n                this.handleSizeChanged();\n                if (this._pivotX != 0 || this._pivotY != 0) {\n                    if (!this._pivotAsAnchor) {\n                        if (!ignorePivot)\n                            this.setXY(this.x - this._pivotX * dWidth, this.y - this._pivotY * dHeight);\n                        this.updatePivotOffset();\n                    }\n                    else {\n                        this.applyPivot();\n                    }\n                }\n\n                if (this instanceof GGroup)\n                    this.resizeChildren(dWidth, dHeight);\n\n                this.updateGear(2);\n\n                if (this._parent) {\n                    this._relations.onOwnerSizeChanged(dWidth, dHeight, this._pivotAsAnchor || !ignorePivot);\n                    this._parent.setBoundsChangedFlag();\n                    if (this._group)\n                        this._group.setBoundsChangedFlag();\n                }\n\n                this.dispatchEventWith(GObject.SIZE_CHANGED);\n            }\n        }\n\n        public makeFullScreen(): void {\n            this.setSize(GRoot.inst.width, GRoot.inst.height);\n        }\n\n        public ensureSizeCorrect(): void {\n        }\n\n        public get actualWidth(): number {\n            return this.width * Math.abs(this._scaleX);\n        }\n\n        public get actualHeight(): number {\n            return this.height * Math.abs(this._scaleY);\n        }\n\n        public get scaleX(): number {\n            return this._scaleX;\n        }\n\n        public set scaleX(value: number) {\n            this.setScale(value, this._scaleY);\n        }\n\n        public get scaleY(): number {\n            return this._scaleY;\n        }\n\n        public set scaleY(value: number) {\n            this.setScale(this._scaleX, value);\n        }\n\n        public setScale(sx: number, sy: number) {\n            if (this._scaleX != sx || this._scaleY != sy) {\n                this._scaleX = sx;\n                this._scaleY = sy;\n                this.handleScaleChanged();\n                this.applyPivot();\n\n                this.updateGear(2);\n            }\n        }\n\n        public get skewX(): number {\n            return this._skewX;\n        }\n\n        public set skewX(value: number) {\n            this.setSkew(value, this._skewY);\n        }\n\n        public get skewY(): number {\n            return this._skewY;\n        }\n\n        public set skewY(value: number) {\n            this.setSkew(this._skewX, value);\n        }\n\n        public setSkew(xv: number, yv: number) {\n            if (this._skewX != xv || this._skewY != yv) {\n                this._skewX = xv;\n                this._skewY = yv;\n                if (this._displayObject) {\n                    this._displayObject.skewX = xv;\n                    this._displayObject.skewY = yv;\n                }\n                this.applyPivot();\n            }\n        }\n\n        public get pivotX(): number {\n            return this._pivotX;\n        }\n\n        public set pivotX(value: number) {\n            this.setPivot(value, this._pivotY);\n        }\n\n        public get pivotY(): number {\n            return this._pivotY;\n        }\n\n        public set pivotY(value: number) {\n            this.setPivot(this._pivotX, value);\n        }\n\n        public setPivot(xv: number, yv: number, asAnchor?: boolean): void {\n            if (this._pivotX != xv || this._pivotY != yv || this._pivotAsAnchor != asAnchor) {\n                this._pivotX = xv;\n                this._pivotY = yv;\n                this._pivotAsAnchor = asAnchor;\n                this.updatePivotOffset();\n                this.handleXYChanged();\n            }\n        }\n\n        public get pivotAsAnchor(): boolean {\n            return this._pivotAsAnchor;\n        }\n\n        protected internalSetPivot(xv: number, yv: number, asAnchor: boolean): void {\n            this._pivotX = xv;\n            this._pivotY = yv;\n            this._pivotAsAnchor = asAnchor;\n            if (asAnchor)\n                this.handleXYChanged();\n        }\n\n        private updatePivotOffset(): void {\n            if (this._displayObject) {\n                if (this._pivotX != 0 || this._pivotY != 0) {\n                    var px: number = this._pivotX * this._width;\n                    var py: number = this._pivotY * this._height;\n                    var pt: egret.Point = this._displayObject.matrix.transformPoint(px, py, sHelperPoint);\n                    this._pivotOffsetX = this._pivotX * this._width - (pt.x - this._displayObject.x);\n                    this._pivotOffsetY = this._pivotY * this._height - (pt.y - this._displayObject.y);\n                }\n                else {\n                    this._pivotOffsetX = 0;\n                    this._pivotOffsetY = 0;\n                }\n            }\n        }\n\n        private applyPivot(): void {\n            if (this._pivotX != 0 || this._pivotY != 0) {\n                this.updatePivotOffset();\n                this.handleXYChanged();\n            }\n        }\n\n        public get touchable(): boolean {\n            return this._touchable;\n        }\n\n        public set touchable(value: boolean) {\n            if (this._touchable != value) {\n                this._touchable = value;\n                this.updateGear(3);\n\n                if ((this instanceof GImage) || (this instanceof GMovieClip)\n                    || (this instanceof GTextField) && !(this instanceof GTextInput) && !(this instanceof GRichTextField))\n                    //Touch is not supported by GImage/GMovieClip/GTextField\n                    return;\n\n                if (this._displayObject) {\n                    this._displayObject.touchEnabled = this._touchable;\n                    if (this._displayObject instanceof egret.DisplayObjectContainer)\n                        this._displayObject.touchChildren = this._touchable;\n                }\n            }\n        }\n\n        public get grayed(): boolean {\n            return this._grayed;\n        }\n\n        public set grayed(value: boolean) {\n            if (this._grayed != value) {\n                this._grayed = value;\n                this.handleGrayedChanged();\n                this.updateGear(3);\n            }\n        }\n\n        public get enabled(): boolean {\n            return !this._grayed && this._touchable;\n        }\n\n        public set enabled(value: boolean) {\n            this.grayed = !value;\n            this.touchable = value;\n        }\n\n        public get rotation(): number {\n            return this._rotation;\n        }\n\n        public set rotation(value: number) {\n            if (this._rotation != value) {\n                this._rotation = value;\n                if (this._displayObject)\n                    this._displayObject.rotation = this.normalizeRotation;\n\n                this.applyPivot();\n\n                this.updateGear(3);\n            }\n        }\n\n        public get normalizeRotation(): number {\n            var rot: number = this._rotation % 360;\n            if (rot > 180)\n                rot -= 360;\n            else if (rot < -180)\n                rot += 360;\n            return rot;\n        }\n\n        public get alpha(): number {\n            return this._alpha;\n        }\n\n        public set alpha(value: number) {\n            if (this._alpha != value) {\n                this._alpha = value;\n                this.handleAlphaChanged();\n                this.updateGear(3);\n            }\n        }\n\n        public get visible(): boolean {\n            return this._visible;\n        }\n\n        public set visible(value: boolean) {\n            if (this._visible != value) {\n                this._visible = value;\n                this.handleVisibleChanged();\n                if (this._parent)\n                    this._parent.setBoundsChangedFlag();\n                if (this._group && this._group.excludeInvisibles)\n                    this._group.setBoundsChangedFlag();\n            }\n        }\n\n        public get internalVisible(): boolean {\n            return this._internalVisible && (!this._group || this._group.internalVisible);\n        }\n\n        public get internalVisible2(): boolean {\n            return this._visible && (!this._group || this._group.internalVisible2);\n        }\n\n        public get internalVisible3(): boolean {\n            return this._visible && this._internalVisible;\n        }\n\n        public get sortingOrder(): number {\n            return this._sortingOrder;\n        }\n\n        public set sortingOrder(value: number) {\n            if (value < 0)\n                value = 0;\n            if (this._sortingOrder != value) {\n                var old: number = this._sortingOrder;\n                this._sortingOrder = value;\n                if (this._parent)\n                    this._parent.childSortingOrderChanged(this, old, this._sortingOrder);\n            }\n        }\n\n        public get focused(): boolean {\n            return this.root.focus == this;\n        }\n\n        public requestFocus(): void {\n            this.root.focus = this;\n        }\n\n        public get tooltips(): string {\n            return this._tooltips;\n        }\n\n        public set tooltips(value: string) {\n            this._tooltips = value;\n        }\n\n        public get blendMode(): string {\n            return this._displayObject.blendMode;\n        }\n\n        public set blendMode(value: string) {\n            this._displayObject.blendMode = value;\n        }\n\n        public get filters(): egret.Filter[] {\n            return this._displayObject.filters;\n        }\n\n        public set filters(value: egret.Filter[]) {\n            this._displayObject.filters = value;\n        }\n\n        public get inContainer(): boolean {\n            return this._displayObject != null && this._displayObject.parent != null;\n        }\n\n        public get onStage(): boolean {\n            return this._displayObject != null && this._displayObject.stage != null;\n        }\n\n        public get resourceURL(): string {\n            if (this.packageItem)\n                return \"ui://\" + this.packageItem.owner.id + this.packageItem.id;\n            else\n                return null;\n        }\n\n        public set group(value: GGroup) {\n            if (this._group != value) {\n                if (this._group)\n                    this._group.setBoundsChangedFlag();\n                this._group = value;\n                if (this._group)\n                    this._group.setBoundsChangedFlag();\n            }\n        }\n\n        public get group(): GGroup {\n            return this._group;\n        }\n\n        public getGear(index: number): GearBase {\n            var gear: GearBase = this._gears[index];\n            if (gear == null)\n                this._gears[index] = gear = GearBase.create(this, index);\n            return gear;\n        }\n\n        protected updateGear(index: number): void {\n            if (this._underConstruct || this._gearLocked)\n                return;\n\n            var gear: GearBase = this._gears[index];\n            if (gear && gear.controller)\n                gear.updateState();\n        }\n\n        public checkGearController(index: number, c: Controller): boolean {\n            return this._gears[index] != null && this._gears[index].controller == c;\n        }\n\n        public updateGearFromRelations(index: number, dx: number, dy: number): void {\n            if (this._gears[index])\n                this._gears[index].updateFromRelations(dx, dy);\n        }\n\n        public addDisplayLock(): number {\n            var gearDisplay: GearDisplay = <GearDisplay>this._gears[0];\n            if (gearDisplay && gearDisplay.controller) {\n                var ret: number = gearDisplay.addLock();\n                this.checkGearDisplay();\n\n                return ret;\n            }\n            else\n                return 0;\n        }\n\n        public releaseDisplayLock(token: number): void {\n            var gearDisplay: GearDisplay = <GearDisplay>this._gears[0];\n            if (gearDisplay && gearDisplay.controller) {\n                gearDisplay.releaseLock(token);\n                this.checkGearDisplay();\n            }\n        }\n\n        private checkGearDisplay(): void {\n            if (this._handlingController)\n                return;\n\n            var connected: boolean = this._gears[0] == null || (<GearDisplay>this._gears[0]).connected;\n            if (this._gears[8])\n                connected = (<GearDisplay2>this._gears[8]).evaluate(connected);\n            if (connected != this._internalVisible) {\n                this._internalVisible = connected;\n                if (this._parent)\n                    this._parent.childStateChanged(this);\n                if (this._group && this._group.excludeInvisibles)\n                    this._group.setBoundsChangedFlag();\n            }\n        }\n\n        public get gearXY(): GearXY {\n            return <GearXY>this.getGear(1);\n        }\n\n        public get gearSize(): GearSize {\n            return <GearSize>this.getGear(2);\n        }\n\n        public get gearLook(): GearLook {\n            return <GearLook>this.getGear(3);\n        }\n\n        public get relations(): Relations {\n            return this._relations;\n        }\n\n        public addRelation(target: GObject, relationType: number, usePercent?: boolean): void {\n            this._relations.add(target, relationType, usePercent);\n        }\n\n        public removeRelation(target: GObject, relationType?: number): void {\n            this._relations.remove(target, relationType || 0);\n        }\n\n        public get displayObject(): egret.DisplayObject {\n            return this._displayObject;\n        }\n\n        protected setDisplayObject(value: egret.DisplayObject): void {\n            if (this._displayObject != value) {\n                if (this._displayObject)\n                    delete this._displayObject[\"$owner\"];\n                this._displayObject = value;\n                this._displayObject[\"$owner\"] = this;\n            }\n        }\n\n        public get parent(): GComponent {\n            return this._parent;\n        }\n\n        public set parent(val: GComponent) {\n            this._parent = val;\n        }\n\n        public removeFromParent(): void {\n            if (this._parent)\n                this._parent.removeChild(this);\n        }\n\n        public get root(): GRoot {\n            if (this instanceof GRoot)\n                return this;\n\n            var p: GObject = this._parent;\n            while (p) {\n                if (p instanceof GRoot)\n                    return p;\n                p = p.parent;\n            }\n            return GRoot.inst;\n        }\n\n        public get asCom(): GComponent {\n            return <GComponent><any>this;\n        }\n\n        public get asButton(): GButton {\n            return <GButton><any>this;\n        }\n\n        public get asLabel(): GLabel {\n            return <GLabel><any>this;\n        }\n\n        public get asProgress(): GProgressBar {\n            return <GProgressBar><any>this;\n        }\n\n        public get asTextField(): GTextField {\n            return <GTextField><any>this;\n        }\n\n        public get asRichTextField(): GRichTextField {\n            return <GRichTextField><any>this;\n        }\n\n        public get asTextInput(): GTextInput {\n            return <GTextInput><any>this;\n        }\n\n        public get asLoader(): GLoader {\n            return <GLoader><any>this;\n        }\n\n        public get asList(): GList {\n            return <GList><any>this;\n        }\n\n        public get asTree(): GTree {\n            return <GTree><any>this;\n        }\n\n        public get asGraph(): GGraph {\n            return <GGraph><any>this;\n        }\n\n        public get asGroup(): GGroup {\n            return <GGroup><any>this;\n        }\n\n        public get asSlider(): GSlider {\n            return <GSlider><any>this;\n        }\n\n        public get asComboBox(): GComboBox {\n            return <GComboBox><any>this;\n        }\n\n        public get asImage(): GImage {\n            return <GImage><any>this;\n        }\n\n        public get asMovieClip(): GMovieClip {\n            return <GMovieClip><any>this;\n        }\n\n        public static cast(obj: egret.DisplayObject): GObject {\n            return <GObject><any>obj[\"$owner\"];\n        }\n\n        public get text(): string {\n            return null;\n        }\n\n        public set text(value: string) {\n        }\n\n        public get icon(): string {\n            return null;\n        }\n\n        public set icon(value: string) {\n        }\n\n        public get isDisposed(): boolean {\n            return this._disposed;\n        }\n\n        public get treeNode(): GTreeNode {\n            return this._treeNode;\n        }\n\n        public dispose(): void {\n            if (this._disposed)\n                return;\n\n            this._disposed = true;\n            this.removeFromParent();\n            this._relations.dispose();\n            this._displayObject = null;\n            for (var i: number = 0; i < 10; i++) {\n                var gear: GearBase = this._gears[i];\n                if (gear)\n                    gear.dispose();\n            }\n        }\n\n        public addClickListener(listener: Function, thisObj?: any): void {\n            this.addEventListener(egret.TouchEvent.TOUCH_TAP, listener, thisObj);\n        }\n\n        public removeClickListener(listener: Function, thisObj?: any): void {\n            this.removeEventListener(egret.TouchEvent.TOUCH_TAP, listener, thisObj);\n        }\n\n        public hasClickListener(): boolean {\n            return this.hasEventListener(egret.TouchEvent.TOUCH_TAP);\n        }\n\n        public addEventListener(type: string, listener: Function, thisObject?: any): void {\n            super.addEventListener(type, listener, thisObject);\n\n            if (this._displayObject) {\n                this._displayObject.addEventListener(type, this._reDispatch, this);\n            }\n        }\n\n        public removeEventListener(type: string, listener: Function, thisObject?: any): void {\n            super.removeEventListener(type, listener, thisObject);\n\n            if (this._displayObject && !this.hasEventListener(type)) {\n                this._displayObject.removeEventListener(type, this._reDispatch, this);\n            }\n        }\n\n        private _reDispatch(evt: egret.Event): void {\n            this.dispatchEvent(evt);\n        }\n\n        public get draggable(): boolean {\n            return this._draggable;\n        }\n\n        public set draggable(value: boolean) {\n            if (this._draggable != value) {\n                this._draggable = value;\n                this.initDrag();\n            }\n        }\n\n        public get dragBounds(): egret.Rectangle {\n            return this._dragBounds;\n        }\n\n        public set dragBounds(value: egret.Rectangle) {\n            this._dragBounds = value;\n        }\n\n        public startDrag(touchPointID?: number, stageX?: number, stageY?: number): void {\n            if (this._displayObject.stage == null)\n                return;\n\n            this.dragBegin(touchPointID, stageX, stageY);\n        }\n\n        public stopDrag(): void {\n            this.dragEnd();\n        }\n\n        public get dragging(): boolean {\n            return GObject.draggingObject == this;\n        }\n\n        public localToGlobal(ax?: number, ay?: number, result?: egret.Point): egret.Point {\n            ax = ax || 0;\n            ay = ay || 0;\n\n            if (this._pivotAsAnchor) {\n                ax += this._pivotX * this._width;\n                ay += this._pivotY * this._height;\n            }\n\n            return this._displayObject.localToGlobal(ax, ay, result);\n        }\n\n        public globalToLocal(ax?: number, ay?: number, result?: egret.Point): egret.Point {\n            ax = ax || 0;\n            ay = ay || 0;\n            var pt: egret.Point = this._displayObject.globalToLocal(ax, ay, result);\n            if (this._pivotAsAnchor) {\n                pt.x -= this._pivotX * this._width;\n                pt.y -= this._pivotY * this._height;\n            }\n            return pt;\n        }\n\n        public localToRoot(ax?: number, ay?: number, result?: egret.Point): egret.Point {\n            ax = ax || 0;\n            ay = ay || 0;\n            var pt: egret.Point = this._displayObject.localToGlobal(ax, ay, result);\n            pt.x /= GRoot.contentScaleFactor;\n            pt.y /= GRoot.contentScaleFactor;\n            return pt;\n        }\n\n        public rootToLocal(ax?: number, ay?: number, resultPoint?: egret.Point): egret.Point {\n            ax = ax || 0;\n            ay = ay || 0;\n            ax *= GRoot.contentScaleFactor;\n            ay *= GRoot.contentScaleFactor;\n            return this._displayObject.globalToLocal(ax, ay, resultPoint);\n        }\n\n        public localToGlobalRect(ax?: number, ay?: number, aw?: number, ah?: number, result?: egret.Rectangle): egret.Rectangle {\n            ax = ax || 0;\n            ay = ay || 0;\n            aw = aw || 0;\n            ah = ah || 0;\n            result = result || new egret.Rectangle();\n            var pt: egret.Point = this.localToGlobal(ax, ay);\n            result.x = pt.x;\n            result.y = pt.y;\n            pt = this.localToGlobal(ax + aw, ay + ah);\n            result.right = pt.x;\n            result.bottom = pt.y;\n            return result;\n        }\n\n        public globalToLocalRect(ax?: number, ay?: number, aw?: number, ah?: number, result?: egret.Rectangle): egret.Rectangle {\n            ax = ax || 0;\n            ay = ay || 0;\n            aw = aw || 0;\n            ah = ah || 0;\n            result = result || new egret.Rectangle();\n            var pt: egret.Point = this.globalToLocal(ax, ay);\n            result.x = pt.x;\n            result.y = pt.y;\n            pt = this.globalToLocal(ax + aw, ay + ah);\n            result.right = pt.x;\n            result.bottom = pt.y;\n            return result;\n        }\n\n        public handleControllerChanged(c: Controller): void {\n            this._handlingController = true;\n            for (var i: number = 0; i < 10; i++) {\n                var gear: GearBase = this._gears[i];\n                if (gear && gear.controller == c)\n                    gear.apply();\n            }\n            this._handlingController = false;\n\n            this.checkGearDisplay();\n        }\n\n        protected createDisplayObject(): void {\n        }\n\n        protected switchDisplayObject(newObj: egret.DisplayObject): void {\n            if (newObj == this._displayObject)\n                return;\n\n            var old: egret.DisplayObject = this._displayObject;\n            if (this._displayObject && this._displayObject.parent) {\n                var i: number = this._displayObject.parent.getChildIndex(this._displayObject);\n                this._displayObject.parent.addChildAt(newObj, i);\n                this._displayObject.parent.removeChild(this._displayObject);\n            }\n            this._displayObject = newObj;\n            this._displayObject.x = old.x;\n            this._displayObject.y = old.y;\n            this._displayObject.rotation = old.rotation;\n            this._displayObject.alpha = old.alpha;\n            this._displayObject.visible = old.visible;\n            this._displayObject.touchEnabled = old.touchEnabled;\n            this._displayObject.scaleX = old.scaleX;\n            this._displayObject.scaleY = old.scaleY;\n            ToolSet.setColorFilter(this._displayObject, this._grayed);\n\n            if (this._displayObject instanceof egret.DisplayObjectContainer)\n                this._displayObject.touchChildren = this._touchable;\n        }\n\n        protected handleXYChanged(): void {\n            if (this._displayObject) {\n                var xv: number = this._x;\n                var yv: number = this._y;\n                if (this._pivotAsAnchor) {\n                    xv -= this._pivotX * this._width;\n                    yv -= this._pivotY * this._height;\n                }\n                if (this._pixelSnapping) {\n                    xv = Math.round(xv);\n                    yv = Math.round(yv);\n                }\n                this._displayObject.x = xv + this._pivotOffsetX;\n                this._displayObject.y = yv + this._pivotOffsetY;\n            }\n        }\n\n        protected handleSizeChanged(): void {\n            if (this._displayObject) {\n                this._displayObject.width = this._width;\n                this._displayObject.height = this._height;\n            }\n        }\n\n        protected handleScaleChanged(): void {\n            if (this._displayObject) {\n                this._displayObject.scaleX = this._scaleX;\n                this._displayObject.scaleY = this._scaleY;\n            }\n        }\n\n        protected handleGrayedChanged(): void {\n            if (this._displayObject) {\n                ToolSet.setColorFilter(this._displayObject, this._grayed);\n            }\n        }\n\n        protected handleAlphaChanged(): void {\n            if (this._displayObject)\n                this._displayObject.alpha = this._alpha;\n        }\n\n        public handleVisibleChanged(): void {\n            if (this._displayObject)\n                this._displayObject.visible = this.internalVisible2;\n            if (this instanceof GGroup)\n                this.handleVisibleChanged();\n        }\n\n        public getProp(index: number): any {\n            switch (index) {\n                case ObjectPropID.Text:\n                    return this.text;\n                case ObjectPropID.Icon:\n                    return this.icon;\n                case ObjectPropID.Color:\n                    return NaN;\n                case ObjectPropID.OutlineColor:\n                    return NaN;\n                case ObjectPropID.Playing:\n                    return false;\n                case ObjectPropID.Frame:\n                    return 0;\n                case ObjectPropID.DeltaTime:\n                    return 0;\n                case ObjectPropID.TimeScale:\n                    return 1;\n                case ObjectPropID.FontSize:\n                    return 0;\n                case ObjectPropID.Selected:\n                    return false;\n                default:\n                    return undefined;\n            }\n        }\n\n        public setProp(index: number, value: any): void {\n            switch (index) {\n                case ObjectPropID.Text:\n                    this.text = value;\n                    break;\n\n                case ObjectPropID.Icon:\n                    this.icon = value;\n                    break;\n            }\n        }\n\n        public constructFromResource(): void {\n        }\n\n        public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {\n            buffer.seek(beginPos, 0);\n            buffer.skip(5);\n\n            var f1: number;\n            var f2: number;\n\n            this._id = buffer.readS();\n            this._name = buffer.readS();\n            f1 = buffer.readInt();\n            f2 = buffer.readInt();\n            this.setXY(f1, f2);\n\n            if (buffer.readBool()) {\n                this.initWidth = buffer.readInt();\n                this.initHeight = buffer.readInt();\n                this.setSize(this.initWidth, this.initHeight, true);\n            }\n\n            if (buffer.readBool()) {\n                this.minWidth = buffer.readInt();\n                this.maxWidth = buffer.readInt();\n                this.minHeight = buffer.readInt();\n                this.maxHeight = buffer.readInt();\n            }\n\n            if (buffer.readBool()) {\n                f1 = buffer.readFloat();\n                f2 = buffer.readFloat();\n                this.setScale(f1, f2);\n            }\n\n            if (buffer.readBool()) {\n                f1 = buffer.readFloat();\n                f2 = buffer.readFloat();\n                this.setSkew(f1, f2);\n            }\n\n            if (buffer.readBool()) {\n                f1 = buffer.readFloat();\n                f2 = buffer.readFloat();\n                this.setPivot(f1, f2, buffer.readBool());\n            }\n\n            f1 = buffer.readFloat();\n            if (f1 != 1)\n                this.alpha = f1;\n\n            f1 = buffer.readFloat();\n            if (f1 != 0)\n                this.rotation = f1;\n\n            if (!buffer.readBool())\n                this.visible = false;\n            if (!buffer.readBool())\n                this.touchable = false;\n            if (buffer.readBool())\n                this.grayed = true;\n            var bm: number = buffer.readByte();\n            if (bm == 2)\n                this.blendMode = egret.BlendMode.ADD;\n            else if (bm == 5)\n                this.blendMode = egret.BlendMode.ERASE;\n\n            var filter: number = buffer.readByte();\n            if (filter == 1 && this._displayObject)\n                ToolSet.setColorFilter(this._displayObject,\n                    [buffer.readFloat(), buffer.readFloat(), buffer.readFloat(), buffer.readFloat()]);\n\n            var str: string = buffer.readS();\n            if (str != null)\n                this.data = str;\n        }\n\n        public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {\n            buffer.seek(beginPos, 1);\n\n            var str: string = buffer.readS();\n            if (str != null)\n                this.tooltips = str;\n\n            var groupId: number = buffer.readShort();\n            if (groupId >= 0)\n                this.group = <GGroup>this.parent.getChildAt(groupId);\n\n            buffer.seek(beginPos, 2);\n\n            var cnt: number = buffer.readShort();\n            for (var i: number = 0; i < cnt; i++) {\n                var nextPos: number = buffer.readShort();\n                nextPos += buffer.position;\n\n                var gear: GearBase = this.getGear(buffer.readByte());\n                gear.setup(buffer);\n\n                buffer.position = nextPos;\n            }\n        }\n\n        //drag support\n        //-------------------------------------------------------------------\n\n        private initDrag(): void {\n            if (this._draggable)\n                this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__begin, this);\n            else\n                this.removeEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__begin, this);\n        }\n\n        private dragBegin(touchPointID?: number, stageX?: number, stageY?: number): void {\n            if (GObject.draggingObject) {\n                let tmp: GObject = GObject.draggingObject;\n                tmp.stopDrag();\n                GObject.draggingObject = null;\n\n                var dragEvent: DragEvent = new DragEvent(DragEvent.DRAG_END);\n                dragEvent.stageX = stageX || GRoot.mouseX;\n                dragEvent.stageY = stageY || GRoot.mouseY;\n                dragEvent.touchPointID = touchPointID || 0;\n                tmp.dispatchEvent(dragEvent);\n            }\n\n            sGlobalDragStart.x = stageX || GRoot.mouseX;\n            sGlobalDragStart.y = stageY || GRoot.mouseY;\n\n            this.localToGlobalRect(0, 0, this._width, this._height, sGlobalRect);\n            this._dragTesting = true;\n            GObject.draggingObject = this;\n\n            GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__moving, this);\n            GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__end, this);\n        }\n\n        private dragEnd(): void {\n            if (GObject.draggingObject == this) {\n                this.reset();\n                this._dragTesting = false;\n                GObject.draggingObject = null;\n            }\n        }\n\n        private reset(): void {\n            GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__moving, this);\n            GRoot.inst.nativeStage.removeEventListener(egret.TouchEvent.TOUCH_END, this.__end, this);\n        }\n\n        private __begin(evt: egret.TouchEvent): void {\n            if (this._dragStartPos == null)\n                this._dragStartPos = new egret.Point();\n            this._dragStartPos.x = evt.stageX;\n            this._dragStartPos.y = evt.stageY;\n            this._dragTesting = true;\n\n            GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__moving, this);\n            GRoot.inst.nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__end, this);\n        }\n\n        private __moving(evt: egret.TouchEvent): void {\n            if (GObject.draggingObject != this && this._draggable && this._dragTesting) {\n                var sensitivity: number = UIConfig.touchDragSensitivity;\n                if (this._dragStartPos\n                    && Math.abs(this._dragStartPos.x - evt.stageX) < sensitivity\n                    && Math.abs(this._dragStartPos.y - evt.stageY) < sensitivity)\n                    return;\n\n                this._dragTesting = false;\n\n                var dragEvent: DragEvent = new DragEvent(DragEvent.DRAG_START);\n                dragEvent.stageX = evt.stageX;\n                dragEvent.stageY = evt.stageY;\n                dragEvent.touchPointID = evt.touchPointID;\n                this.dispatchEvent(dragEvent);\n\n                if (!dragEvent.isDefaultPrevented())\n                    this.dragBegin(evt.touchPointID, evt.stageX, evt.stageY);\n            }\n\n            if (GObject.draggingObject == this) {\n                var xx: number = evt.stageX - sGlobalDragStart.x + sGlobalRect.x;\n                var yy: number = evt.stageY - sGlobalDragStart.y + sGlobalRect.y;\n\n                if (this._dragBounds) {\n                    var rect: egret.Rectangle = GRoot.inst.localToGlobalRect(this._dragBounds.x, this._dragBounds.y,\n                        this._dragBounds.width, this._dragBounds.height, sDragHelperRect);\n                    if (xx < rect.x)\n                        xx = rect.x;\n                    else if (xx + sGlobalRect.width > rect.right) {\n                        xx = rect.right - sGlobalRect.width;\n                        if (xx < rect.x)\n                            xx = rect.x;\n                    }\n\n                    if (yy < rect.y)\n                        yy = rect.y;\n                    else if (yy + sGlobalRect.height > rect.bottom) {\n                        yy = rect.bottom - sGlobalRect.height;\n                        if (yy < rect.y)\n                            yy = rect.y;\n                    }\n                }\n\n                sUpdateInDragging = true;\n                var pt: egret.Point = this.parent.globalToLocal(xx, yy, sHelperPoint);\n                this.setXY(Math.round(pt.x), Math.round(pt.y));\n                sUpdateInDragging = false;\n\n                var dragEvent: DragEvent = new DragEvent(DragEvent.DRAG_MOVING);\n                dragEvent.stageX = evt.stageX;\n                dragEvent.stageY = evt.stageY;\n                dragEvent.touchPointID = evt.touchPointID;\n                this.dispatchEvent(dragEvent);\n            }\n        }\n\n        private __end(evt: egret.TouchEvent): void {\n            if (GObject.draggingObject == this) {\n                GObject.draggingObject = null;\n                this.reset();\n\n                var dragEvent: DragEvent = new DragEvent(DragEvent.DRAG_END);\n                dragEvent.stageX = evt.stageX;\n                dragEvent.stageY = evt.stageY;\n                dragEvent.touchPointID = evt.touchPointID;\n                this.dispatchEvent(dragEvent);\n            }\n            else if (this._dragTesting) {\n                this._dragTesting = false;\n                this.reset();\n            }\n        }\n        //-------------------------------------------------------------------\n    }\n\n    var _gInstanceCounter: number = 0;\n    var sGlobalDragStart: egret.Point = new egret.Point();\n    var sGlobalRect: egret.Rectangle = new egret.Rectangle();\n    var sHelperPoint: egret.Point = new egret.Point();\n    var sDragHelperRect: egret.Rectangle = new egret.Rectangle();\n    var sUpdateInDragging: boolean;\n}"
  },
  {
    "path": "source/src/GObjectPool.ts",
    "content": "\r\nmodule fgui {\r\n\r\n    export class GObjectPool {\r\n        private _pool: { [index: string]: Array<GObject> };\r\n        private _count: number = 0;\r\n\r\n        public constructor() {\r\n            this._pool = {};\r\n        }\r\n\r\n        public clear(): void {\r\n            for (var i1 in this._pool) {\r\n                var arr: Array<GObject> = this._pool[i1];\r\n                var cnt: number = arr.length;\r\n                for (var i: number = 0; i < cnt; i++)\r\n                    arr[i].dispose();\r\n            }\r\n            this._pool = {};\r\n            this._count = 0;\r\n        }\r\n\r\n        public get count(): number {\r\n            return this._count;\r\n        }\r\n\r\n        public getObject(url: string): GObject {\r\n            url = UIPackage.normalizeURL(url);\r\n            if (url == null)\r\n                return null;\r\n\r\n            var arr: Array<GObject> = this._pool[url];\r\n            if (arr && arr.length) {\r\n                this._count--;\r\n                return arr.shift();\r\n            }\r\n\r\n            var child: GObject = UIPackage.createObjectFromURL(url);\r\n            return child;\r\n        }\r\n\r\n        public returnObject(obj: GObject): void {\r\n            var url: string = obj.resourceURL;\r\n            if (!url)\r\n                return;\r\n\r\n            var arr: Array<GObject> = this._pool[url];\r\n            if (arr == null) {\r\n                arr = new Array<GObject>();\r\n                this._pool[url] = arr;\r\n            }\r\n\r\n            this._count++;\r\n            arr.push(obj);\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "source/src/GProgressBar.ts",
    "content": "\nmodule fgui {\n\n    export class GProgressBar extends GComponent {\n        private _min: number = 0;\n        private _max: number = 0;\n        private _value: number = 0;\n        private _titleType: ProgressTitleType;\n        private _reverse: boolean;\n\n        private _titleObject: GObject;\n        private _aniObject: GObject;\n        private _barObjectH: GObject;\n        private _barObjectV: GObject;\n        private _barMaxWidth: number = 0;\n        private _barMaxHeight: number = 0;\n        private _barMaxWidthDelta: number = 0;\n        private _barMaxHeightDelta: number = 0;\n        private _barStartX: number = 0;\n        private _barStartY: number = 0;\n\n        public constructor() {\n            super();\n\n            this._titleType = ProgressTitleType.Percent;\n            this._value = 50;\n            this._max = 100;\n        }\n\n        public get titleType(): ProgressTitleType {\n            return this._titleType;\n        }\n\n        public set titleType(value: ProgressTitleType) {\n            if (this._titleType != value) {\n                this._titleType = value;\n                this.update(this._value);\n            }\n        }\n\n        public get min(): number {\n            return this._min;\n        }\n\n        public set min(value: number) {\n            if (this._min != value) {\n                this._min = value;\n                this.update(this._value);\n            }\n        }\n\n        public get max(): number {\n            return this._max;\n        }\n\n        public set max(value: number) {\n            if (this._max != value) {\n                this._max = value;\n                this.update(this._value);\n            }\n        }\n\n        public get value(): number {\n            return this._value;\n        }\n\n        public set value(value: number) {\n            if (this._value != value) {\n                GTween.kill(this, false, this.update);\n\n                this._value = value;\n                this.update(value);\n            }\n        }\n\n        public tweenValue(value: number, duration: number): GTweener {\n            var oldValule: number;\n\n            var tweener: GTweener = GTween.getTween(this, this.update);\n            if (tweener) {\n                oldValule = tweener.value.x;\n                tweener.kill();\n            }\n            else\n                oldValule = this._value;\n\n            this._value = value;\n            return GTween.to(oldValule, this._value, duration).setTarget(this, this.update).setEase(EaseType.Linear);\n        }\n\n        public update(newValue: number): void {\n            var percent: number = ToolSet.clamp01((newValue - this._min) / (this._max - this._min));\n            if (this._titleObject) {\n                switch (this._titleType) {\n                    case ProgressTitleType.Percent:\n                        this._titleObject.text = Math.floor(percent * 100) + \"%\";\n                        break;\n\n                    case ProgressTitleType.ValueAndMax:\n                        this._titleObject.text = Math.floor(newValue) + \"/\" + Math.floor(this._max);\n                        break;\n\n                    case ProgressTitleType.Value:\n                        this._titleObject.text = \"\" + Math.floor(newValue);\n                        break;\n\n                    case ProgressTitleType.Max:\n                        this._titleObject.text = \"\" + Math.floor(this._max);\n                        break;\n                }\n            }\n\n            var fullWidth: number = this.width - this._barMaxWidthDelta;\n            var fullHeight: number = this.height - this._barMaxHeightDelta;\n            if (!this._reverse) {\n                if (this._barObjectH) {\n                    if (!this.setFillAmount(this._barObjectH, percent))\n                        this._barObjectH.width = Math.round(fullWidth * percent);\n                }\n                if (this._barObjectV) {\n                    if (!this.setFillAmount(this._barObjectV, percent))\n                        this._barObjectV.height = Math.round(fullHeight * percent);\n                }\n            }\n            else {\n                if (this._barObjectH) {\n                    if (!this.setFillAmount(this._barObjectH, 1 - percent)) {\n                        this._barObjectH.width = Math.round(fullWidth * percent);\n                        this._barObjectH.x = this._barStartX + (fullWidth - this._barObjectH.width);\n                    }\n\n                }\n                if (this._barObjectV) {\n                    if (!this.setFillAmount(this._barObjectV, 1 - percent)) {\n                        this._barObjectV.height = Math.round(fullHeight * percent);\n                        this._barObjectV.y = this._barStartY + (fullHeight - this._barObjectV.height);\n                    }\n                }\n            }\n            if (this._aniObject)\n                this._aniObject.setProp(ObjectPropID.Frame, Math.floor(percent * 100));\n        }\n\n        private setFillAmount(bar: GObject, percent: number): boolean {\n            if (((bar instanceof GImage) || (bar instanceof GLoader)) && bar.fillMethod != FillMethod.None) {\n                bar.fillAmount = percent;\n                return true;\n            }\n            else\n                return false;\n        }\n\n        protected constructExtension(buffer: ByteBuffer): void {\n            buffer.seek(0, 6);\n\n            this._titleType = buffer.readByte();\n            this._reverse = buffer.readBool();\n\n            this._titleObject = this.getChild(\"title\");\n            this._barObjectH = this.getChild(\"bar\");\n            this._barObjectV = this.getChild(\"bar_v\");\n            this._aniObject = this.getChild(\"ani\");\n\n            if (this._barObjectH) {\n                this._barMaxWidth = this._barObjectH.width;\n                this._barMaxWidthDelta = this.width - this._barMaxWidth;\n                this._barStartX = this._barObjectH.x;\n            }\n            if (this._barObjectV) {\n                this._barMaxHeight = this._barObjectV.height;\n                this._barMaxHeightDelta = this.height - this._barMaxHeight;\n                this._barStartY = this._barObjectV.y;\n            }\n        }\n\n        protected handleSizeChanged(): void {\n            super.handleSizeChanged();\n\n            if (this._barObjectH)\n                this._barMaxWidth = this.width - this._barMaxWidthDelta;\n            if (this._barObjectV)\n                this._barMaxHeight = this.height - this._barMaxHeightDelta;\n            if (!this._underConstruct)\n                this.update(this._value);\n        }\n\n        public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_afterAdd(buffer, beginPos);\n\n            if (!buffer.seek(beginPos, 6)) {\n                this.update(this._value);\n                return;\n            }\n\n            if (buffer.readByte() != this.packageItem.objectType) {\n                this.update(this._value);\n                return;\n            }\n\n            this._value = buffer.readInt();\n            this._max = buffer.readInt();\n            if (buffer.version >= 2)\n                this._min = buffer.readInt();\n\n            this.update(this._value);\n        }\n    }\n}"
  },
  {
    "path": "source/src/GRichTextField.ts",
    "content": "/// <reference path=\"GTextField.ts\" />\n\nmodule fgui {\n\n    export class GRichTextField extends GTextField {\n\n        public constructor() {\n            super();\n\n            this._textField.touchEnabled = true;\n        }\n\n        protected updateTextFieldText(): void {\n            var text2: string = this._text;\n            if (this._templateVars)\n                text2 = this.parseTemplate(text2);\n            let arr;\n            if (this._ubbEnabled)\n                arr = GTextField._htmlParser.parser(UBBParser.inst.parse(text2));\n            else\n                arr = GTextField._htmlParser.parser(text2);\n            if (this._underline) {\n                for (var i = 0; i < arr.length; i++) {\n                    let element = arr[i];\n                    if (element.style)\n                        element.style.underline = true;\n                    else\n                        element.style = <egret.ITextStyle>{ underline: true };\n                }\n            }\n            this._textField.textFlow = arr;\n        }\n    }\n}"
  },
  {
    "path": "source/src/GRoot.ts",
    "content": "\nmodule fgui {\n\n    export class GRoot extends GComponent {\n        public static contentScaleLevel: number = 0;\n\n        private _nativeStage: egret.Stage;\n        private _modalLayer: GGraph;\n        private _popupStack: Array<GObject>;\n        private _justClosedPopups: Array<GObject>;\n        private _modalWaitPane: GObject;\n        private _tooltipWin: GObject;\n        private _defaultTooltipWin: GObject;\n        private _volumeScale: number;\n\n        private static _inst: GRoot;\n\n        public static touchScreen: boolean;\n        public static contentScaleFactor: number = 1;\n        public static touchDown: boolean;\n        public static ctrlKeyDown: boolean;\n        public static shiftKeyDown: boolean;\n        public static mouseX: number;\n        public static mouseY: number;\n\n        public static get inst(): GRoot {\n            if (GRoot._inst == null)\n                new GRoot();\n            return GRoot._inst;\n        }\n\n        public constructor() {\n            super();\n            if (GRoot._inst == null)\n                GRoot._inst = this;\n\n            this.opaque = false;\n            this._volumeScale = 1;\n            this._popupStack = new Array<GObject>();\n            this._justClosedPopups = new Array<GObject>();\n            this.displayObject.addEventListener(egret.Event.ADDED_TO_STAGE, this.__addedToStage, this);\n        }\n\n        public get nativeStage(): egret.Stage {\n            return this._nativeStage;\n        }\n\n        public showWindow(win: Window): void {\n            this.addChild(win);\n            win.requestFocus();\n\n            if (win.x > this.width)\n                win.x = this.width - win.width;\n            else if (win.x + win.width < 0)\n                win.x = 0;\n\n            if (win.y > this.height)\n                win.y = this.height - win.height;\n            else if (win.y + win.height < 0)\n                win.y = 0;\n\n            this.adjustModalLayer();\n        }\n\n        public hideWindow(win: Window): void {\n            win.hide();\n        }\n\n        public hideWindowImmediately(win: Window): void {\n            if (win.parent == this)\n                this.removeChild(win);\n\n            this.adjustModalLayer();\n        }\n\n        public bringToFront(win: Window): void {\n            var cnt: number = this.numChildren;\n            var i: number;\n            if (this._modalLayer.parent != null && !win.modal)\n                i = this.getChildIndex(this._modalLayer) - 1;\n            else\n                i = cnt - 1;\n\n            for (; i >= 0; i--) {\n                var g: GObject = this.getChildAt(i);\n                if (g == win)\n                    return;\n                if (g instanceof Window)\n                    break;\n            }\n\n            if (i >= 0)\n                this.setChildIndex(win, i);\n        }\n\n        public showModalWait(msg?: string): void {\n            if (UIConfig.globalModalWaiting != null) {\n                if (this._modalWaitPane == null)\n                    this._modalWaitPane = UIPackage.createObjectFromURL(UIConfig.globalModalWaiting);\n                this._modalWaitPane.setSize(this.width, this.height);\n                this._modalWaitPane.addRelation(this, RelationType.Size);\n\n                this.addChild(this._modalWaitPane);\n                this._modalWaitPane.text = msg;\n            }\n        }\n\n        public closeModalWait(): void {\n            if (this._modalWaitPane != null && this._modalWaitPane.parent != null)\n                this.removeChild(this._modalWaitPane);\n        }\n\n        public closeAllExceptModals(): void {\n            var arr: Array<GObject> = this._children.slice();\n            var cnt: number = arr.length;\n            for (var i: number = 0; i < cnt; i++) {\n                var g: GObject = arr[i];\n                if ((g instanceof Window) && !g.modal)\n                    g.hide();\n            }\n        }\n\n        public closeAllWindows(): void {\n            var arr: Array<GObject> = this._children.slice();\n            var cnt: number = arr.length;\n            for (var i: number = 0; i < cnt; i++) {\n                var g: GObject = arr[i];\n                if (g instanceof Window)\n                    g.hide();\n            }\n        }\n\n        public getTopWindow(): Window {\n            var cnt: number = this.numChildren;\n            for (var i: number = cnt - 1; i >= 0; i--) {\n                var g: GObject = this.getChildAt(i);\n                if (g instanceof Window) {\n                    return g;\n                }\n            }\n\n            return null;\n        }\n\n        public get modalLayer(): GGraph {\n            return this._modalLayer;\n        }\n\n        public get hasModalWindow(): boolean {\n            return this._modalLayer.parent != null;\n        }\n\n        public get modalWaiting(): boolean {\n            return this._modalWaitPane && this._modalWaitPane.inContainer;\n        }\n\n        public showPopup(popup: GObject, target?: GObject, dir?: PopupDirection | boolean): void {\n            if (this._popupStack.length > 0) {\n                var k: number = this._popupStack.indexOf(popup);\n                if (k != -1) {\n                    for (var i: number = this._popupStack.length - 1; i >= k; i--)\n                        this.removeChild(this._popupStack.pop());\n                }\n            }\n            this._popupStack.push(popup);\n\n            if (target) {\n                var p: GObject = target;\n                while (p) {\n                    if (p.parent == this) {\n                        if (popup.sortingOrder < p.sortingOrder) {\n                            popup.sortingOrder = p.sortingOrder;\n                        }\n                        break;\n                    }\n                    p = p.parent;\n                }\n            }\n\n            this.addChild(popup);\n            this.adjustModalLayer();\n\n            var pos: egret.Point;\n            var sizeW: number = 0, sizeH: number = 0;\n            if (target) {\n                pos = target.localToRoot();\n                sizeW = target.width;\n                sizeH = target.height;\n            }\n            else {\n                pos = this.globalToLocal(GRoot.mouseX, GRoot.mouseY);\n            }\n            var xx: number, yy: number;\n            xx = pos.x;\n            if (xx + popup.width > this.width)\n                xx = xx + sizeW - popup.width;\n            yy = pos.y + sizeH;\n            if (((dir === undefined || dir === PopupDirection.Auto) && pos.y + popup.height > this.height)\n                || dir === false || dir === PopupDirection.Up) {\n                yy = pos.y - popup.height - 1;\n                if (yy < 0) {\n                    yy = 0;\n                    xx += sizeW / 2;\n                }\n            }\n\n            popup.x = xx;\n            popup.y = yy;\n        }\n\n        public togglePopup(popup: GObject, target?: GObject, dir?: PopupDirection | boolean): void {\n            if (this._justClosedPopups.indexOf(popup) != -1)\n                return;\n\n            this.showPopup(popup, target, dir);\n        }\n\n        public hidePopup(popup?: GObject): void {\n            if (popup) {\n                var k: number = this._popupStack.indexOf(popup);\n                if (k != -1) {\n                    for (var i: number = this._popupStack.length - 1; i >= k; i--)\n                        this.closePopup(this._popupStack.pop());\n                }\n            }\n            else {\n                var cnt: number = this._popupStack.length;\n                for (i = cnt - 1; i >= 0; i--)\n                    this.closePopup(this._popupStack[i]);\n                this._popupStack.length = 0;\n            }\n        }\n\n        public get hasAnyPopup(): boolean {\n            return this._popupStack.length != 0;\n        }\n\n        private closePopup(target: GObject): void {\n            if (target.parent) {\n                if (target instanceof Window)\n                    target.hide();\n                else\n                    this.removeChild(target);\n            }\n        }\n\n        public showTooltips(msg: string): void {\n            if (this._defaultTooltipWin == null) {\n                var resourceURL: string = UIConfig.tooltipsWin;\n                if (!resourceURL) {\n                    console.error(\"UIConfig.tooltipsWin not defined\");\n                    return;\n                }\n\n                this._defaultTooltipWin = UIPackage.createObjectFromURL(resourceURL);\n            }\n\n            this._defaultTooltipWin.text = msg;\n            this.showTooltipsWin(this._defaultTooltipWin);\n        }\n\n        public showTooltipsWin(tooltipWin: GObject, position?: egret.Point): void {\n            this.hideTooltips();\n\n            this._tooltipWin = tooltipWin;\n\n            var xx: number = 0;\n            var yy: number = 0;\n            if (!position) {\n                xx = GRoot.mouseX + 10;\n                yy = GRoot.mouseY + 20;\n            }\n            else {\n                xx = position.x;\n                yy = position.y;\n            }\n            var pt: egret.Point = this.globalToLocal(xx, yy);\n            xx = pt.x;\n            yy = pt.y;\n\n            if (xx + this._tooltipWin.width > this.width) {\n                xx = xx - this._tooltipWin.width - 1;\n                if (xx < 0)\n                    xx = 10;\n            }\n            if (yy + this._tooltipWin.height > this.height) {\n                yy = yy - this._tooltipWin.height - 1;\n                if (xx - this._tooltipWin.width - 1 > 0)\n                    xx = xx - this._tooltipWin.width - 1;\n                if (yy < 0)\n                    yy = 10;\n            }\n\n            this._tooltipWin.x = xx;\n            this._tooltipWin.y = yy;\n            this.addChild(this._tooltipWin);\n        }\n\n        public hideTooltips(): void {\n            if (this._tooltipWin) {\n                if (this._tooltipWin.parent)\n                    this.removeChild(this._tooltipWin);\n                this._tooltipWin = null;\n            }\n        }\n\n        public getObjectUnderPoint(globalX: number, globalY: number): GObject {\n            var ret: egret.DisplayObject = this._nativeStage.$hitTest(globalX, globalY);\n            if (ret)\n                return ToolSet.displayObjectToGObject(ret);\n            else\n                return null;\n        }\n\n        public get focus(): GObject {\n            return null;\n        }\n\n        public set focus(value: GObject) {\n        }\n\n        private setFocus(value: GObject) {\n        }\n\n        public get volumeScale(): number {\n            return this._volumeScale;\n        }\n\n        public set volumeScale(value: number) {\n            this._volumeScale = value;\n        }\n\n        public playOneShotSound(sound: egret.Sound, volumeScale?: number) {\n            volumeScale = volumeScale || 1;\n            var vs: number = this._volumeScale * volumeScale;\n            var channel: egret.SoundChannel = sound.play(0, 1);\n            channel.volume = vs;\n        }\n\n        private adjustModalLayer(): void {\n            var cnt: number = this.numChildren;\n\n            if (this._modalWaitPane && this._modalWaitPane.parent)\n                this.setChildIndex(this._modalWaitPane, cnt - 1);\n\n            for (var i: number = cnt - 1; i >= 0; i--) {\n                var g: GObject = this.getChildAt(i);\n                if ((g instanceof Window) && g.modal) {\n                    if (this._modalLayer.parent == null)\n                        this.addChildAt(this._modalLayer, i);\n                    else\n                        this.setChildIndexBefore(this._modalLayer, i);\n                    return;\n                }\n            }\n\n            if (this._modalLayer.parent)\n                this.removeChild(this._modalLayer);\n        }\n\n        private __addedToStage(evt: egret.Event): void {\n            this.displayObject.removeEventListener(egret.Event.ADDED_TO_STAGE, this.__addedToStage, this);\n\n            this._nativeStage = this.displayObject.stage;\n\n            this._nativeStage.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__stageMouseDownCapture, this, true);\n            this._nativeStage.addEventListener(egret.TouchEvent.TOUCH_END, this.__stageMouseUpCapture, this, true);\n            this._nativeStage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__stageMouseMoveCapture, this, true);\n\n            this._modalLayer = new GGraph();\n            this._modalLayer.setSize(this.width, this.height);\n            this._modalLayer.drawRect(0, 0, 0, UIConfig.modalLayerColor, UIConfig.modalLayerAlpha);\n            this._modalLayer.addRelation(this, RelationType.Size);\n\n            this.displayObject.stage.addEventListener(egret.Event.RESIZE, this.__winResize, this);\n\n            this.__winResize(null);\n        }\n\n        private __stageMouseDownCapture(evt: egret.TouchEvent): void {\n            //GRoot.ctrlKeyDown = evt.ctrlKey;\n            //GRoot.shiftKeyDown = evt.shiftKey;\n            GRoot.mouseX = evt.stageX;\n            GRoot.mouseY = evt.stageY;\n            GRoot.touchDown = true;\n\n            if (this._tooltipWin)\n                this.hideTooltips();\n\n            this._justClosedPopups.length = 0;\n            if (this._popupStack.length > 0) {\n                let mc = <egret.DisplayObject>(evt.target);\n                while (mc != this.displayObject.stage && mc) {\n                    if (mc[\"$owner\"]) {\n                        var pindex: number = this._popupStack.indexOf(<GObject>mc[\"$owner\"]);\n                        if (pindex != -1) {\n                            for (var i: number = this._popupStack.length - 1; i > pindex; i--) {\n                                var popup: GObject = this._popupStack.pop();\n                                this.closePopup(popup);\n                                this._justClosedPopups.push(popup);\n                            }\n                            return;\n                        }\n                    }\n                    mc = mc.parent;\n                }\n\n                var cnt: number = this._popupStack.length;\n                for (i = cnt - 1; i >= 0; i--) {\n                    popup = this._popupStack[i];\n                    this.closePopup(popup);\n                    this._justClosedPopups.push(popup);\n                }\n                this._popupStack.length = 0;\n            }\n        }\n\n        private __stageMouseMoveCapture(evt: egret.TouchEvent): void {\n            //GRoot.ctrlKeyDown = evt.ctrlKey;\n            //GRoot.shiftKeyDown = evt.shiftKey;\n            GRoot.mouseX = evt.stageX;\n            GRoot.mouseY = evt.stageY;\n        }\n\n        private __stageMouseUpCapture(evt: egret.TouchEvent): void {\n            GRoot.touchDown = false;\n        }\n\n        private __winResize(evt: egret.Event): void {\n            this.setSize(this._nativeStage.stageWidth, this._nativeStage.stageHeight);\n\n            //console.info(\"screen size=\" + w + \"x\" + h + \"/\" + this.width + \"x\" + this.height);\n        }\n\n        private updateContentScaleLevel(): void {\n            var ss: number = 1;// Math.max(cc.view.getScaleX(), cc.view.getScaleY());\n            if (ss >= 3.5)\n                GRoot.contentScaleLevel = 3; //x4\n            else if (ss >= 2.5)\n                GRoot.contentScaleLevel = 2; //x3\n            else if (ss >= 1.5)\n                GRoot.contentScaleLevel = 1; //x2\n            else\n                GRoot.contentScaleLevel = 0;\n        }\n    }\n}"
  },
  {
    "path": "source/src/GScrollBar.ts",
    "content": "\nmodule fgui {\n\n    export class GScrollBar extends GComponent {\n        private _grip: GObject;\n        private _arrowButton1: GObject;\n        private _arrowButton2: GObject;\n        private _bar: GObject;\n        private _target: ScrollPane;\n\n        private _vertical: boolean;\n        private _scrollPerc: number;\n        private _fixedGripSize: boolean;\n\n        private _dragOffset: egret.Point;\n        private _gripDragging: boolean;\n\n        public constructor() {\n            super();\n            this._dragOffset = new egret.Point();\n            this._scrollPerc = 0;\n        }\n\n        public setScrollPane(target: ScrollPane, vertical: boolean): void {\n            this._target = target;\n            this._vertical = vertical;\n        }\n\n        public setDisplayPerc(value: number) {\n            if (this._vertical) {\n                if (!this._fixedGripSize)\n                    this._grip.height = Math.floor(value * this._bar.height);\n                this._grip.y = this._bar.y + (this._bar.height - this._grip.height) * this._scrollPerc;\n\n            }\n            else {\n                if (!this._fixedGripSize)\n                    this._grip.width = Math.floor(value * this._bar.width);\n                this._grip.x = this._bar.x + (this._bar.width - this._grip.width) * this._scrollPerc;\n            }\n            this._grip.visible = value != 0 && value != 1;\n        }\n\n        public setScrollPerc(val: number) {\n            this._scrollPerc = val;\n            if (this._vertical)\n                this._grip.y = this._bar.y + (this._bar.height - this._grip.height) * this._scrollPerc;\n            else\n                this._grip.x = this._bar.x + (this._bar.width - this._grip.width) * this._scrollPerc;\n        }\n\n        public get minSize(): number {\n            if (this._vertical)\n                return (this._arrowButton1 ? this._arrowButton1.height : 0) + (this._arrowButton2 ? this._arrowButton2.height : 0);\n            else\n                return (this._arrowButton1 ? this._arrowButton1.width : 0) + (this._arrowButton2 ? this._arrowButton2.width : 0);\n        }\n\n        public get gripDragging(): boolean {\n            return this._gripDragging;\n        }\n\n        protected constructExtension(buffer: ByteBuffer): void {\n            buffer.seek(0, 6);\n\n            this._fixedGripSize = buffer.readBool();\n\n            this._grip = this.getChild(\"grip\");\n            if (!this._grip) {\n                console.error(\"需要定义grip\");\n                return;\n            }\n\n            this._bar = this.getChild(\"bar\");\n            if (!this._bar) {\n                console.error(\"需要定义bar\");\n                return;\n            }\n\n            this._arrowButton1 = this.getChild(\"arrow1\");\n            this._arrowButton2 = this.getChild(\"arrow2\");\n\n            this._grip.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__gripMouseDown, this);\n\n            if (this._arrowButton1)\n                this._arrowButton1.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__arrowButton1Click, this);\n            if (this._arrowButton2)\n                this._arrowButton2.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__arrowButton2Click, this);\n\n            this.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__barMouseDown, this);\n        }\n\n        private __gripMouseDown(evt: egret.TouchEvent): void {\n            this._gripDragging = true;\n            this._target.updateScrollBarVisible();\n\n            evt.stopPropagation();\n\n            this.globalToLocal(evt.stageX, evt.stageY, this._dragOffset);\n            this._dragOffset.x -= this._grip.x;\n            this._dragOffset.y -= this._grip.y;\n\n            this._grip.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__gripMouseMove, this);\n            this._grip.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.__gripMouseUp, this);\n        }\n\n        private __gripMouseMove(evt: egret.TouchEvent): void {\n            if (!this.onStage)\n                return;\n\n            var pt: egret.Point = this.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            if (this._vertical) {\n                var curY: number = pt.y - this._dragOffset.y;\n                this._target.setPercY((curY - this._bar.y) / (this._bar.height - this._grip.height), false);\n            }\n            else {\n                var curX: number = pt.x - this._dragOffset.x;\n                this._target.setPercX((curX - this._bar.x) / (this._bar.width - this._grip.width), false);\n            }\n        }\n\n        private __gripMouseUp(evt: egret.TouchEvent): void {\n            var st: egret.Stage = evt.currentTarget;\n            st.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__gripMouseMove, this);\n            st.removeEventListener(egret.TouchEvent.TOUCH_END, this.__gripMouseUp, this);\n\n            if (this.onStage)\n                return;\n\n            this._gripDragging = false;\n            this._target.updateScrollBarVisible();\n        }\n\n        private __arrowButton1Click(evt: egret.TouchEvent): void {\n            evt.stopPropagation();\n\n            if (this._vertical)\n                this._target.scrollUp();\n            else\n                this._target.scrollLeft();\n        }\n\n        private __arrowButton2Click(evt: egret.TouchEvent): void {\n            evt.stopPropagation();\n\n            if (this._vertical)\n                this._target.scrollDown();\n            else\n                this._target.scrollRight();\n        }\n\n        private __barMouseDown(evt: egret.TouchEvent): void {\n            var pt: egret.Point = this._grip.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            if (this._vertical) {\n                if (pt.y < 0)\n                    this._target.scrollUp(4);\n                else\n                    this._target.scrollDown(4);\n            }\n            else {\n                if (pt.x < 0)\n                    this._target.scrollLeft(4);\n                else\n                    this._target.scrollRight(4);\n            }\n        }\n    }\n\n    var s_vec2: egret.Point = new egret.Point();\n}"
  },
  {
    "path": "source/src/GSlider.ts",
    "content": "\nmodule fgui {\n\n    export class GSlider extends GComponent {\n        private _min: number = 0;\n        private _max: number = 0;\n        private _value: number = 0;\n        private _titleType: ProgressTitleType;\n        private _reverse: boolean;\n        private _wholeNumbers: boolean;\n\n        private _titleObject: GTextField;\n        private _barObjectH: GObject;\n        private _barObjectV: GObject;\n        private _barMaxWidth: number = 0;\n        private _barMaxHeight: number = 0;\n        private _barMaxWidthDelta: number = 0;\n        private _barMaxHeightDelta: number = 0;\n        private _gripObject: GObject;\n        private _clickPos: egret.Point;\n        private _clickPercent: number = 0;\n        private _barStartX: number = 0;\n        private _barStartY: number = 0;\n\n        public changeOnClick: boolean = true;\n        public canDrag: boolean = true;\n\n        public constructor() {\n            super();\n\n            this._titleType = ProgressTitleType.Percent;\n            this._value = 50;\n            this._max = 100;\n            this._clickPos = new egret.Point();\n        }\n\n        public get titleType(): ProgressTitleType {\n            return this._titleType;\n        }\n\n        public set titleType(value: ProgressTitleType) {\n            this._titleType = value;\n        }\n\n        public get wholeNumbers(): boolean {\n            return this._wholeNumbers;\n        }\n\n        public set wholeNumbers(value: boolean) {\n            if (this._wholeNumbers != value) {\n                this._wholeNumbers = value;\n                this.update();\n            }\n        }\n\n        public get min(): number {\n            return this._min;\n        }\n\n        public set min(value: number) {\n            if (this._min != value) {\n                this._min = value;\n                this.update();\n            }\n        }\n\n        public get max(): number {\n            return this._max;\n        }\n\n        public set max(value: number) {\n            if (this._max != value) {\n                this._max = value;\n                this.update();\n            }\n        }\n\n        public get value(): number {\n            return this._value;\n        }\n\n        public set value(value: number) {\n            if (this._value != value) {\n                this._value = value;\n                this.update();\n            }\n        }\n\n        public update(): void {\n            this.updateWithPercent((this._value - this._min) / (this._max - this._min));\n        }\n\n        private updateWithPercent(percent: number, manual?: boolean): void {\n            percent = ToolSet.clamp01(percent);\n            if (manual) {\n                var newValue: number = ToolSet.clamp(this._min + (this._max - this._min) * percent, this._min, this._max);\n                if (this._wholeNumbers) {\n                    newValue = Math.round(newValue);\n                    percent = ToolSet.clamp01((newValue - this._min) / (this._max - this._min));\n                }\n\n                if (newValue != this._value) {\n                    this._value = newValue;\n                    this.dispatchEvent(new StateChangeEvent(StateChangeEvent.CHANGED));\n                }\n            }\n\n            if (this._titleObject) {\n                switch (this._titleType) {\n                    case ProgressTitleType.Percent:\n                        this._titleObject.text = Math.floor(percent * 100) + \"%\";\n                        break;\n\n                    case ProgressTitleType.ValueAndMax:\n                        this._titleObject.text = this._value + \"/\" + this._max;\n                        break;\n\n                    case ProgressTitleType.Value:\n                        this._titleObject.text = \"\" + this._value;\n                        break;\n\n                    case ProgressTitleType.Max:\n                        this._titleObject.text = \"\" + this._max;\n                        break;\n                }\n            }\n\n            var fullWidth: number = this.width - this._barMaxWidthDelta;\n            var fullHeight: number = this.height - this._barMaxHeightDelta;\n            if (!this._reverse) {\n                if (this._barObjectH)\n                    this._barObjectH.width = Math.round(fullWidth * percent);\n                if (this._barObjectV)\n                    this._barObjectV.height = Math.round(fullHeight * percent);\n            }\n            else {\n                if (this._barObjectH) {\n                    this._barObjectH.width = Math.round(fullWidth * percent);\n                    this._barObjectH.x = this._barStartX + (fullWidth - this._barObjectH.width);\n                }\n                if (this._barObjectV) {\n                    this._barObjectV.height = Math.round(fullHeight * percent);\n                    this._barObjectV.y = this._barStartY + (fullHeight - this._barObjectV.height);\n                }\n            }\n        }\n\n        protected constructExtension(buffer: ByteBuffer): void {\n            buffer.seek(0, 6);\n\n            this._titleType = buffer.readByte();\n            this._reverse = buffer.readBool();\n            if (buffer.version >= 2) {\n                this._wholeNumbers = buffer.readBool();\n                this.changeOnClick = buffer.readBool();\n            }\n\n            this._titleObject = <GTextField><any>(this.getChild(\"title\"));\n            this._barObjectH = this.getChild(\"bar\");\n            this._barObjectV = this.getChild(\"bar_v\");\n            this._gripObject = this.getChild(\"grip\");\n\n            if (this._barObjectH) {\n                this._barMaxWidth = this._barObjectH.width;\n                this._barMaxWidthDelta = this.width - this._barMaxWidth;\n                this._barStartX = this._barObjectH.x;\n            }\n            if (this._barObjectV) {\n                this._barMaxHeight = this._barObjectV.height;\n                this._barMaxHeightDelta = this.height - this._barMaxHeight;\n                this._barStartY = this._barObjectV.y;\n            }\n            if (this._gripObject) {\n                this._gripObject.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__gripMouseDown, this);\n            }\n\n            this.displayObject.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__barMouseDown, this);\n        }\n\n        protected handleSizeChanged(): void {\n            super.handleSizeChanged();\n\n            if (this._barObjectH)\n                this._barMaxWidth = this.width - this._barMaxWidthDelta;\n            if (this._barObjectV)\n                this._barMaxHeight = this.height - this._barMaxHeightDelta;\n            if (!this._underConstruct)\n                this.update();\n        }\n\n        public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_afterAdd(buffer, beginPos);\n\n            if (!buffer.seek(beginPos, 6)) {\n                this.update();\n                return;\n            }\n\n            if (buffer.readByte() != this.packageItem.objectType) {\n                this.update();\n                return;\n            }\n\n            this._value = buffer.readInt();\n            this._max = buffer.readInt();\n            if (buffer.version >= 2)\n                this._min = buffer.readInt();\n\n            this.update();\n        }\n\n        private __gripMouseDown(evt: egret.TouchEvent): void {\n            this.canDrag = true;\n            evt.stopPropagation();\n\n            this._clickPos = this.globalToLocal(evt.stageX, evt.stageY);\n            this._clickPercent = ToolSet.clamp01((this._value - this._min) / (this._max - this._min));\n\n            this._gripObject.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__gripMouseMove, this);\n            this._gripObject.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.__gripMouseUp, this);\n        }\n\n        private __gripMouseMove(evt: egret.TouchEvent): void {\n            if (!this.canDrag) {\n                return;\n            }\n\n            var pt: egret.Point = this.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            var deltaX: number = pt.x - this._clickPos.x;\n            var deltaY: number = pt.y - this._clickPos.y;\n            if (this._reverse) {\n                deltaX = -deltaX;\n                deltaY = -deltaY;\n            }\n\n            var percent: number;\n            if (this._barObjectH)\n                percent = this._clickPercent + deltaX / this._barMaxWidth;\n            else\n                percent = this._clickPercent + deltaY / this._barMaxHeight;\n            this.updateWithPercent(percent, true);\n        }\n\n        private __gripMouseUp(evt: egret.TouchEvent): void {\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__gripMouseMove, this);\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_END, this.__gripMouseUp, this);\n        }\n\n        private __barMouseDown(evt: egret.TouchEvent): void {\n            if (!this.changeOnClick)\n                return;\n\n            var pt: egret.Point = this._gripObject.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n            var percent: number = ToolSet.clamp01((this._value - this._min) / (this._max - this._min));\n            var delta: number;\n            if (this._barObjectH)\n                delta = pt.x / this._barMaxWidth;\n            if (this._barObjectV)\n                delta = pt.y / this._barMaxHeight;\n            if (this._reverse)\n                percent -= delta;\n            else\n                percent += delta;\n            this.updateWithPercent(percent, true);\n        }\n    }\n\n    var s_vec2: egret.Point = new egret.Point();\n}"
  },
  {
    "path": "source/src/GTextField.ts",
    "content": "\nmodule fgui {\n\n    export class GTextField extends GObject {\n        protected _textField: egret.TextField;\n        protected _bitmapContainer?: egret.DisplayObjectContainer;\n        protected _font: string;\n        protected _fontSize: number = 0;\n        protected _align: AlignType;\n        protected _verticalAlign: VertAlignType;\n        protected _color: number;\n        protected _leading: number = 0;\n        protected _letterSpacing: number = 0;\n        protected _underline: boolean;\n        protected _text: string;\n        protected _ubbEnabled: boolean;\n        protected _templateVars?: { [index: string]: string };\n\n        protected _autoSize: AutoSizeType;\n        protected _widthAutoSize: boolean;\n        protected _heightAutoSize: boolean;\n\n        protected _updatingSize: boolean;\n        protected _sizeDirty: boolean;\n        protected _textWidth: number = 0;\n        protected _textHeight: number = 0;\n        protected _requireRender: boolean;\n\n        protected _bitmapFont?: BitmapFont;\n        protected _lines?: Array<LineInfo>;\n        protected _bitmapPool?: Array<egret.Bitmap>;\n\n        protected static _htmlParser: egret.HtmlTextParser = new egret.HtmlTextParser();\n\n        public constructor() {\n            super();\n\n            this._fontSize = 12;\n            this._align = AlignType.Left;\n            this._verticalAlign = VertAlignType.Top;\n            this._text = \"\";\n            this._leading = 3;\n            this._color = 0;\n\n            this._autoSize = AutoSizeType.Both;\n            this._widthAutoSize = true;\n            this._heightAutoSize = true;\n        }\n\n        protected createDisplayObject(): void {\n            this._textField = new egret.TextField();\n            this._textField.touchEnabled = false;\n            this.setDisplayObject(this._textField);\n        }\n\n        private switchBitmapMode(val: boolean): void {\n            if (val && this.displayObject == this._textField) {\n                if (this._bitmapContainer == null)\n                    this._bitmapContainer = new egret.Sprite();\n                this.switchDisplayObject(this._bitmapContainer);\n            }\n            else if (!val && this.displayObject == this._bitmapContainer)\n                this.switchDisplayObject(this._textField);\n        }\n\n        public dispose(): void {\n            super.dispose();\n\n            this._bitmapFont = null;\n            this._requireRender = false;\n        }\n\n        public set text(value: string) {\n            this._text = value;\n            if (this._text == null)\n                this._text = \"\";\n            this.updateGear(6);\n\n            if (this.parent && this.parent._underConstruct)\n                this.renderNow();\n            else\n                this.render();\n        }\n\n        protected updateTextFieldText(): void {\n            var text2: string = this._text;\n            if (this._templateVars)\n                text2 = this.parseTemplate(text2);\n            if (this._ubbEnabled) {\n                let arr = GTextField._htmlParser.parser(UBBParser.inst.parse(ToolSet.encodeHTML(text2)));\n                if (this._underline) {\n                    for (var i = 0; i < arr.length; i++) {\n                        let element = arr[i];\n                        if (element.style)\n                            element.style.underline = true;\n                        else\n                            element.style = <egret.ITextStyle>{ underline: true };\n                    }\n                }\n                this._textField.textFlow = arr;\n            }\n            else if (this._underline) {\n                let arr = new Array<egret.ITextElement>(1);\n                arr[0] = <egret.ITextElement>{ text: text2, style: <egret.ITextStyle>{ underline: true } };\n                this._textField.textFlow = arr;\n            }\n            else\n                this._textField.text = text2;\n        }\n\n        public get text(): string {\n            return this._text;\n        }\n\n        public get font(): string {\n            return this._font;\n        }\n\n        public set font(value: string) {\n            if (this._font != value) {\n                this._font = value;\n                this.updateTextFormat();\n            }\n        }\n\n        public get fontSize(): number {\n            return this._fontSize;\n        }\n\n        public set fontSize(value: number) {\n            if (value < 0)\n                return;\n\n            if (this._fontSize != value) {\n                this._fontSize = value;\n                this.updateTextFormat();\n            }\n        }\n\n        public get color(): number {\n            return this._color;\n        }\n\n        public set color(value: number) {\n            if (this._color != value) {\n                this._color = value;\n                this.updateGear(4);\n                this.updateTextFormat();\n            }\n        }\n\n        public get align(): AlignType {\n            return this._align;\n        }\n\n        public set align(value: AlignType) {\n            if (this._align != value) {\n                this._align = value;\n                this._textField.textAlign = this.getAlignTypeString(this._align);\n                if (this._bitmapFont && !this._underConstruct)\n                    this.render();\n            }\n        }\n\n        public get verticalAlign(): VertAlignType {\n            return this._verticalAlign;\n        }\n\n        public set verticalAlign(value: VertAlignType) {\n            if (this._verticalAlign != value) {\n                this._verticalAlign = value;\n                this._textField.verticalAlign = this.getVertAlignTypeString(this._verticalAlign);\n                if (this._bitmapFont && !this._underConstruct)\n                    this.render();\n            }\n        }\n\n        private getAlignTypeString(type: AlignType): string {\n            return type == AlignType.Left ? egret.HorizontalAlign.LEFT :\n                (type == AlignType.Center ? egret.HorizontalAlign.CENTER : egret.HorizontalAlign.RIGHT);\n        }\n\n        private getVertAlignTypeString(type: VertAlignType): string {\n            return type == VertAlignType.Top ? egret.VerticalAlign.TOP :\n                (type == VertAlignType.Middle ? egret.VerticalAlign.MIDDLE : egret.VerticalAlign.BOTTOM);\n        }\n\n        public get leading(): number {\n            return this._leading;\n        }\n\n        public set leading(value: number) {\n            if (this._leading != value) {\n                this._leading = value;\n                this.updateTextFormat();\n            }\n        }\n\n        public get letterSpacing(): number {\n            return this._letterSpacing;\n        }\n\n        public set letterSpacing(value: number) {\n            if (this._letterSpacing != value) {\n                this._letterSpacing = value;\n                this.updateTextFormat();\n            }\n        }\n\n        public get underline(): boolean {\n            return this._underline;\n        }\n\n        public set underline(value: boolean) {\n            this._underline = value;\n        }\n\n        public get bold(): boolean {\n            return this._textField.bold;\n        }\n\n        public set bold(value: boolean) {\n            this._textField.bold = value;\n        }\n\n        public get italic(): boolean {\n            return this._textField.italic;\n        }\n\n        public set italic(value: boolean) {\n            this._textField.italic = value;\n        }\n\n        public get singleLine(): boolean {\n            return !this._textField.multiline;\n        }\n\n        public set singleLine(value: boolean) {\n            value = !value;\n            if (this._textField.multiline != value) {\n                this._textField.multiline = value;\n                this.render();\n            }\n        }\n\n        public get stroke(): number {\n            return this._textField.stroke;\n        }\n\n        public set stroke(value: number) {\n            this._textField.stroke = value;\n        }\n\n        public get strokeColor(): number {\n            return this._textField.strokeColor;\n        }\n\n        public set strokeColor(value: number) {\n            this._textField.strokeColor = value;\n            this.updateGear(4);\n        }\n\n        public set ubbEnabled(value: boolean) {\n            if (this._ubbEnabled != value) {\n                this._ubbEnabled = value;\n                this.render();\n            }\n        }\n\n        public get ubbEnabled(): boolean {\n            return this._ubbEnabled;\n        }\n\n        public set autoSize(value: AutoSizeType) {\n            if (this._autoSize != value) {\n                this._autoSize = value;\n                this._widthAutoSize = value == AutoSizeType.Both;\n                this._heightAutoSize = value == AutoSizeType.Both || value == AutoSizeType.Height;\n                this.render();\n            }\n        }\n\n        public get autoSize(): AutoSizeType {\n            return this._autoSize;\n        }\n\n        public get textWidth(): number {\n            if (this._requireRender)\n                this.renderNow();\n            return this._textWidth;\n        }\n\n        public ensureSizeCorrect(): void {\n            if (this._sizeDirty && this._requireRender)\n                this.renderNow();\n        }\n\n        protected updateTextFormat(): void {\n            this._textField.size = this._fontSize;\n            this._bitmapFont = null;\n            if (ToolSet.startsWith(this._font, \"ui://\")) {\n                var pi: PackageItem = UIPackage.getItemByURL(this._font);\n                if (pi)\n                    this._bitmapFont = <BitmapFont>pi.owner.getItemAsset(pi);\n            }\n\n\n            if (this._bitmapFont == null) {\n                if (this._font)\n                    this._textField.fontFamily = this._font;\n                else\n                    this._textField.fontFamily = UIConfig.defaultFont;\n            }\n            if (this.grayed)\n                this._textField.textColor = 0xAAAAAA;\n            else\n                this._textField.textColor = this._color;\n            this._textField.lineSpacing = this._leading;\n            //this._textField.letterSpacing = this._letterSpacing;\n\n            if (!this._underConstruct)\n                this.render();\n        }\n\n        protected render(): void {\n            if (!this._requireRender) {\n                this._requireRender = true;\n                egret.callLater(this.__render, this);\n            }\n\n            if (!this._sizeDirty && (this._widthAutoSize || this._heightAutoSize)) {\n                this._sizeDirty = true;\n                this.dispatchEventWith(GObject.SIZE_DELAY_CHANGE);\n            }\n        }\n\n        private __render(): void {\n            if (this._requireRender)\n                this.renderNow();\n        }\n\n        protected renderNow(updateBounds: boolean = true): void {\n            this._requireRender = false;\n            this._sizeDirty = false;\n\n            if (this._bitmapFont) {\n                this.renderWithBitmapFont(updateBounds);\n                return;\n            }\n\n            this.switchBitmapMode(false);\n            this._textField.width = this._widthAutoSize ? (this.maxWidth <= 0 ? 10000 : this.maxWidth) : Math.ceil(this.width);\n            this.updateTextFieldText();\n            this._textWidth = Math.ceil(this._textField.textWidth);\n            if (this._textWidth > 0)\n                this._textWidth += 4;\n            this._textHeight = Math.ceil(this._textField.textHeight);\n            if (this._textHeight > 0)\n                this._textHeight += 4;\n\n            var w: number, h: number = 0;\n            if (this._widthAutoSize) {\n                w = this._textWidth;\n                this._textField.width = w;\n            }\n            else\n                w = this.width;\n\n            if (this._heightAutoSize) {\n                h = this._textHeight;\n                if (this._textField.height != this._textHeight)\n                    this._textField.height = this._textHeight;\n            }\n            else {\n                h = this.height;\n                if (this._textHeight > h)\n                    this._textHeight = h;\n            }\n\n            if (updateBounds) {\n                this._updatingSize = true;\n                this.setSize(w, h);\n                this._updatingSize = false;\n            }\n        }\n\n        private renderWithBitmapFont(updateBounds: boolean): void {\n            this.switchBitmapMode(true);\n\n            if (!this._bitmapPool)\n                this._bitmapPool = [];\n\n            var cnt: number = this._bitmapContainer.numChildren;\n            for (var i: number = 0; i < cnt; i++) {\n                var obj: egret.DisplayObject = this._bitmapContainer.getChildAt(i);\n                this._bitmapPool.push(<egret.Bitmap>obj);\n            }\n            this._bitmapContainer.removeChildren();\n\n            if (!this._lines)\n                this._lines = new Array<LineInfo>();\n            else\n                returnList(this._lines);\n\n            var letterSpacing: number = this._letterSpacing;\n            var lineSpacing: number = this._leading - 1;\n            var rectWidth: number = this.width - GUTTER_X * 2;\n            var lineWidth: number = 0, lineHeight: number = 0, lineTextHeight: number = 0;\n            var glyphWidth: number = 0, glyphHeight: number = 0;\n            var wordChars: number = 0, wordStart: number = 0, wordEnd: number = 0;\n            var lastLineHeight: number = 0;\n            var lineBuffer: string = \"\";\n            var lineY: number = GUTTER_Y;\n            var line: LineInfo;\n            var wordWrap: boolean = !this._widthAutoSize && this._textField.multiline;\n            var fontScale: number = this._bitmapFont.resizable ? this._fontSize / this._bitmapFont.size : 1;\n            var tint: boolean = this._bitmapFont.tint;\n            this._textWidth = 0;\n            this._textHeight = 0;\n\n            var text2: string = this._text;\n            if (this._templateVars)\n                text2 = this.parseTemplate(text2);\n            var textLength: number = text2.length;\n            for (var offset: number = 0; offset < textLength; ++offset) {\n                var ch: string = text2.charAt(offset);\n                var cc: number = ch.charCodeAt(0);\n\n                if (cc == 10) {\n                    lineBuffer += ch;\n                    line = borrow();\n                    line.width = lineWidth;\n                    if (lineTextHeight == 0) {\n                        if (lastLineHeight == 0)\n                            lastLineHeight = this._fontSize;\n                        if (lineHeight == 0)\n                            lineHeight = lastLineHeight;\n                        lineTextHeight = lineHeight;\n                    }\n                    line.height = lineHeight;\n                    lastLineHeight = lineHeight;\n                    line.textHeight = lineTextHeight;\n                    line.text = lineBuffer;\n                    line.y = lineY;\n                    lineY += (line.height + lineSpacing);\n                    if (line.width > this._textWidth)\n                        this._textWidth = line.width;\n                    this._lines.push(line);\n\n                    lineBuffer = \"\";\n                    lineWidth = 0;\n                    lineHeight = 0;\n                    lineTextHeight = 0;\n                    wordChars = 0;\n                    wordStart = 0;\n                    wordEnd = 0;\n                    continue;\n                }\n\n                if (cc >= 65 && cc <= 90 || cc >= 97 && cc <= 122) { //a-z,A-Z\n                    if (wordChars == 0)\n                        wordStart = lineWidth;\n                    wordChars++;\n                }\n                else {\n                    if (wordChars > 0)\n                        wordEnd = lineWidth;\n                    wordChars = 0;\n                }\n\n                if (cc == 32) {\n                    glyphWidth = Math.ceil(this._fontSize / 2);\n                    glyphHeight = this._fontSize;\n                }\n                else {\n                    var glyph: BMGlyph = this._bitmapFont.glyphs[ch];\n                    if (glyph) {\n                        glyphWidth = Math.ceil(glyph.advance * fontScale);\n                        glyphHeight = Math.ceil(glyph.lineHeight * fontScale);\n                    }\n                    else {\n                        glyphWidth = 0;\n                        glyphHeight = 0;\n                    }\n                }\n                if (glyphHeight > lineTextHeight)\n                    lineTextHeight = glyphHeight;\n\n                if (glyphHeight > lineHeight)\n                    lineHeight = glyphHeight;\n\n                if (lineWidth != 0)\n                    lineWidth += letterSpacing;\n                lineWidth += glyphWidth;\n\n                if (!wordWrap || lineWidth <= rectWidth) {\n                    lineBuffer += ch;\n                }\n                else {\n                    line = borrow();\n                    line.height = lineHeight;\n                    line.textHeight = lineTextHeight;\n\n                    if (lineBuffer.length == 0) {//the line cannt fit even a char\n                        line.text = ch;\n                    }\n                    else if (wordChars > 0 && wordEnd > 0) {//if word had broken, move it to new line\n                        lineBuffer += ch;\n                        var len: number = lineBuffer.length - wordChars;\n                        line.text = ToolSet.trimRight(lineBuffer.substr(0, len));\n                        line.width = wordEnd;\n                        lineBuffer = lineBuffer.substr(len);\n                        lineWidth -= wordStart;\n                    }\n                    else {\n                        line.text = lineBuffer;\n                        line.width = lineWidth - (glyphWidth + letterSpacing);\n                        lineBuffer = ch;\n                        lineWidth = glyphWidth;\n                        lineHeight = glyphHeight;\n                        lineTextHeight = glyphHeight;\n                    }\n                    line.y = lineY;\n                    lineY += (line.height + lineSpacing);\n                    if (line.width > this._textWidth)\n                        this._textWidth = line.width;\n\n                    wordChars = 0;\n                    wordStart = 0;\n                    wordEnd = 0;\n                    this._lines.push(line);\n                }\n            }\n\n            if (lineBuffer.length > 0) {\n                line = borrow();\n                line.width = lineWidth;\n                if (lineHeight == 0)\n                    lineHeight = lastLineHeight;\n                if (lineTextHeight == 0)\n                    lineTextHeight = lineHeight;\n                line.height = lineHeight;\n                line.textHeight = lineTextHeight;\n                line.text = lineBuffer;\n                line.y = lineY;\n                if (line.width > this._textWidth)\n                    this._textWidth = line.width;\n                this._lines.push(line);\n            }\n\n            if (this._textWidth > 0)\n                this._textWidth += GUTTER_X * 2;\n\n            var count: number = this._lines.length;\n            if (count == 0) {\n                this._textHeight = 0;\n            }\n            else {\n                line = this._lines[this._lines.length - 1];\n                this._textHeight = line.y + line.height + GUTTER_Y;\n            }\n\n            var w: number, h: number = 0;\n            if (this._widthAutoSize) {\n                if (this._textWidth == 0)\n                    w = 0;\n                else\n                    w = this._textWidth;\n            }\n            else\n                w = this.width;\n\n            if (this._heightAutoSize) {\n                if (this._textHeight == 0)\n                    h = 0;\n                else\n                    h = this._textHeight;\n            }\n            else\n                h = this.height;\n\n            if (updateBounds) {\n                this._updatingSize = true;\n                this.setSize(w, h);\n                this._updatingSize = false;\n            }\n\n            if (w == 0 || h == 0)\n                return;\n\n            var charX: number = GUTTER_X;\n            var lineIndent: number = 0;\n            var charIndent: number = 0;\n            rectWidth = this.width - GUTTER_X * 2;\n            var lineCount: number = this._lines.length;\n            for (var i: number = 0; i < lineCount; i++) {\n                line = this._lines[i];\n                charX = GUTTER_X;\n\n                if (this._align == AlignType.Center)\n                    lineIndent = (rectWidth - line.width) / 2;\n                else if (this._align == AlignType.Right)\n                    lineIndent = rectWidth - line.width;\n                else\n                    lineIndent = 0;\n                textLength = line.text.length;\n                for (var j: number = 0; j < textLength; j++) {\n                    ch = line.text.charAt(j);\n                    cc = ch.charCodeAt(0);\n\n                    if (cc == 10)\n                        continue;\n\n                    if (cc == 32) {\n                        charX += letterSpacing + Math.ceil(this._fontSize / 2);\n                        continue;\n                    }\n\n                    glyph = this._bitmapFont.glyphs[ch];\n                    if (glyph) {\n                        charIndent = (line.height + line.textHeight) / 2 - Math.ceil(glyph.lineHeight * fontScale);\n                        var bm: egret.Bitmap;\n                        if (this._bitmapPool.length)\n                            bm = this._bitmapPool.pop();\n                        else {\n                            bm = new egret.Bitmap();\n                            bm.smoothing = true;\n                        }\n                        bm.x = charX + lineIndent + Math.ceil(glyph.x * fontScale);\n                        bm.y = line.y + charIndent + Math.ceil(glyph.y * fontScale);\n                        bm[\"$backupY\"] = bm.y;\n                        bm.texture = glyph.texture;\n                        bm.scaleX = fontScale;\n                        bm.scaleY = fontScale;\n                        if (tint)\n                            bm.tint = this._color;\n                        else\n                            bm.tint = 0xFFFFFF;\n                        this._bitmapContainer.addChild(bm);\n\n                        charX += letterSpacing + Math.ceil(glyph.advance * fontScale);\n                    }\n                    else {\n                        charX += letterSpacing;\n                    }\n                }//text loop\n            }//line loop\n\n            this.doAlign();\n        }\n\n        protected handleSizeChanged(): void {\n            if (this._updatingSize)\n                return;\n\n            if (this._bitmapFont) {\n                if (!this._widthAutoSize)\n                    this.render();\n                else\n                    this.doAlign();\n            }\n            else {\n                if (this._underConstruct) {\n                    this._textField.width = this.width;\n                    this._textField.height = this.height;\n                }\n                else {\n                    if (!this._widthAutoSize) {\n                        if (!this._heightAutoSize) {\n                            this._textField.width = this.width;\n                            this._textField.height = this.height;\n                        }\n                        else\n                            this._textField.width = this.width;\n                    }\n                }\n            }\n        }\n\n        protected parseTemplate(template: string): string {\n            var pos1: number = 0, pos2: number, pos3: number;\n            var tag: string;\n            var value: string;\n            var result: string = \"\";\n            while ((pos2 = template.indexOf(\"{\", pos1)) != -1) {\n                if (pos2 > 0 && template.charCodeAt(pos2 - 1) == 92)//\\\n                {\n                    result += template.substring(pos1, pos2 - 1);\n                    result += \"{\";\n                    pos1 = pos2 + 1;\n                    continue;\n                }\n\n                result += template.substring(pos1, pos2);\n                pos1 = pos2;\n                pos2 = template.indexOf(\"}\", pos1);\n                if (pos2 == -1)\n                    break;\n\n                if (pos2 == pos1 + 1) {\n                    result += template.substr(pos1, 2);\n                    pos1 = pos2 + 1;\n                    continue;\n                }\n\n                tag = template.substring(pos1 + 1, pos2);\n                pos3 = tag.indexOf(\"=\");\n                if (pos3 != -1) {\n                    value = this._templateVars[tag.substring(0, pos3)];\n                    if (value == null)\n                        result += tag.substring(pos3 + 1);\n                    else\n                        result += value;\n                }\n                else {\n                    value = this._templateVars[tag];\n                    if (value != null)\n                        result += value;\n                }\n                pos1 = pos2 + 1;\n            }\n\n            if (pos1 < template.length)\n                result += template.substr(pos1);\n\n            return result;\n        }\n\n        public get templateVars(): { [index: string]: string } {\n            return this._templateVars;\n        }\n\n        public set templateVars(value: { [index: string]: string }) {\n            if (!this._templateVars && !value)\n                return;\n\n            this._templateVars = value;\n            this.flushVars();\n        }\n\n        public setVar(name: string, value: string): GTextField {\n            if (!this._templateVars)\n                this._templateVars = {};\n            this._templateVars[name] = value;\n\n            return this;\n        }\n\n        public flushVars(): void {\n            this.render();\n        }\n\n        protected handleGrayedChanged(): void {\n            super.handleGrayedChanged();\n            this.updateTextFormat();\n        }\n\n        private doAlign(): void {\n            var yOffset: number;\n            if (this._verticalAlign == VertAlignType.Top || this._textHeight == 0)\n                yOffset = GUTTER_Y;\n            else {\n                var dh: number = this.height - this._textHeight;\n                if (dh < 0)\n                    dh = 0;\n                if (this._verticalAlign == VertAlignType.Middle)\n                    yOffset = Math.floor(dh / 2);\n                else\n                    yOffset = Math.floor(dh);\n            }\n\n            var cnt: number = this._bitmapContainer.numChildren;\n            for (var i: number = 0; i < cnt; i++) {\n                var obj: egret.DisplayObject = this._bitmapContainer.getChildAt(i);\n                obj.y = obj[\"$backupY\"] + yOffset;\n            }\n        }\n\n        public getProp(index: number): any {\n            switch (index) {\n                case ObjectPropID.Color:\n                    return this.color;\n                case ObjectPropID.OutlineColor:\n                    return this.strokeColor;\n                case ObjectPropID.FontSize:\n                    return this.fontSize;\n                default:\n                    return super.getProp(index);\n            }\n        }\n\n        public setProp(index: number, value: any): void {\n            switch (index) {\n                case ObjectPropID.Color:\n                    this.color = value;\n                    break;\n                case ObjectPropID.OutlineColor:\n                    this.strokeColor = value;\n                    break;\n                case ObjectPropID.FontSize:\n                    this.fontSize = value;\n                    break;\n                default:\n                    super.setProp(index, value);\n                    break;\n            }\n        }\n\n        public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_beforeAdd(buffer, beginPos);\n\n            buffer.seek(beginPos, 5);\n\n            this._font = buffer.readS();\n            this._fontSize = buffer.readShort();\n            this._color = buffer.readColor();\n            this.align = buffer.readByte();\n            this.verticalAlign = buffer.readByte();\n            this._leading = buffer.readShort();\n            this._letterSpacing = buffer.readShort();\n            this._ubbEnabled = buffer.readBool();\n            this._autoSize = buffer.readByte();\n            this._widthAutoSize = this._autoSize == AutoSizeType.Both;\n            this._heightAutoSize = this._autoSize == AutoSizeType.Both || this._autoSize == AutoSizeType.Height;\n            this._underline = buffer.readBool();\n            this._textField.italic = buffer.readBool();\n            this._textField.bold = buffer.readBool();\n            this._textField.multiline = !buffer.readBool();\n            if (buffer.readBool()) {\n                this._textField.strokeColor = buffer.readColor();\n                this.stroke = buffer.readFloat() + 1;\n            }\n\n            if (buffer.readBool()) //shadow\n                buffer.skip(12);\n\n            if (buffer.readBool())\n                this._templateVars = {};\n        }\n\n        public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_afterAdd(buffer, beginPos);\n\n            this.updateTextFormat();\n\n            buffer.seek(beginPos, 6);\n\n            var str: string = buffer.readS();\n            if (str != null)\n                this.text = str;\n            this._sizeDirty = false;\n        }\n    }\n\n    export interface LineInfo {\n        width: number;\n        height: number;\n        textHeight: number;\n        text: string;\n        y: number;\n    }\n\n    var pool: Array<LineInfo> = [];\n\n    function borrow(): LineInfo {\n        if (pool.length) {\n            var ret: LineInfo = pool.pop();\n            ret.width = 0;\n            ret.height = 0;\n            ret.textHeight = 0;\n            ret.text = null;\n            ret.y = 0;\n            return ret;\n        }\n        else\n            return {\n                width: 0,\n                height: 0,\n                textHeight: 0,\n                text: null,\n                y: 0\n            };\n    }\n\n    function returnList(value: Array<LineInfo>): void {\n        var length: number = value.length;\n        for (var i: number = 0; i < length; i++) {\n            var li: LineInfo = value[i];\n            pool.push(li);\n        }\n        value.length = 0;\n    }\n\n    const GUTTER_X: number = 2;\n    const GUTTER_Y: number = 2;\n}"
  },
  {
    "path": "source/src/GTextInput.ts",
    "content": "\nmodule fgui {\n\n    export class GTextInput extends GTextField {\n        private _promptText: string;\n        private _password: boolean;\n\n        public constructor() {\n            super();\n\n            this._widthAutoSize = false;\n            this._heightAutoSize = false;\n\n            (<egret.DisplayObjectContainer>this.displayObject).touchChildren = true;\n            this._textField.type = egret.TextFieldType.INPUT;\n            this._textField.addEventListener(egret.Event.CHANGE, this.__textChanged, this);\n            this._textField.addEventListener(egret.FocusEvent.FOCUS_IN, this.__focusIn, this);\n            this._textField.addEventListener(egret.FocusEvent.FOCUS_OUT, this.__focusOut, this);\n        }\n\n        public dispose(): void {\n            super.dispose();\n        }\n\n        public set editable(val: boolean) {\n            if (val)\n                this._textField.type = egret.TextFieldType.INPUT;\n            else\n                this._textField.type = egret.TextFieldType.DYNAMIC;\n        }\n\n        public get editable(): boolean {\n            return this._textField.type == egret.TextFieldType.INPUT;\n        }\n\n        public set maxLength(val: number) {\n            this._textField.maxChars = val;\n        }\n\n        public get maxLength(): number {\n            return this._textField.maxChars;\n        }\n\n        public set promptText(val: string) {\n            this._promptText = val;\n            this.updateTextFieldText();\n        }\n\n        public get promptText(): string {\n            return this._promptText;\n        }\n\n        public set restrict(value: string) {\n            this._textField.restrict = value;\n        }\n\n        public get restrict(): string {\n            return this._textField.restrict;\n        }\n\n        public get password(): boolean {\n            return this._password;\n        }\n\n        public set password(val: boolean) {\n            if (this._password != val) {\n                this._password = val;\n                this._textField.displayAsPassword = this._password;\n                if (val)\n                    this._textField.inputType = egret.TextFieldInputType.PASSWORD;\n                else\n                    this._textField.inputType = egret.TextFieldInputType.TEXT;\n                this.render();\n            }\n        }\n\n        public get verticalAlign(): VertAlignType {\n            return this._verticalAlign;\n        }\n\n        public set verticalAlign(value: VertAlignType) {\n            if (this._verticalAlign != value) {\n                this._verticalAlign = value;\n                this.updateVertAlign();\n            }\n        }\n\n        private updateVertAlign(): void {\n            switch (this._verticalAlign) {\n                case VertAlignType.Top:\n                    this._textField.verticalAlign = egret.VerticalAlign.TOP;\n                    break;\n                case VertAlignType.Middle:\n                    this._textField.verticalAlign = egret.VerticalAlign.MIDDLE;\n                    break;\n\n                case VertAlignType.Bottom:\n                    this._textField.verticalAlign = egret.VerticalAlign.BOTTOM;\n                    break;\n            }\n        }\n\n        protected updateTextFieldText(): void {\n            if (!this._text && this._promptText) {\n                this._textField.displayAsPassword = false;\n                this._textField.textFlow = (new egret.HtmlTextParser).parser(UBBParser.inst.parse(this._promptText));\n            }\n            else {\n                this._textField.displayAsPassword = this._password;\n                if (this._ubbEnabled)\n                    this._textField.textFlow = (new egret.HtmlTextParser).parser(UBBParser.inst.parse(ToolSet.encodeHTML(this._text)));\n                else\n                    this._textField.text = this._text;\n            }\n        }\n\n        protected handleSizeChanged(): void {\n            if (!this._updatingSize) {\n                this._textField.width = Math.ceil(this.width);\n                this._textField.height = Math.ceil(this.height);\n            }\n        }\n\n        public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_beforeAdd(buffer, beginPos);\n\n            buffer.seek(beginPos, 4);\n\n            var str: string = buffer.readS();\n            if (str != null)\n                this._promptText = str;\n\n            str = buffer.readS();\n            if (str != null)\n                this._textField.restrict = str;\n\n            var iv: number = buffer.readInt();\n            if (iv != 0)\n                this._textField.maxChars = iv;\n            iv = buffer.readInt();\n            if (iv != 0) {//keyboardType\n            }\n            if (buffer.readBool())\n                this.password = true;\n\n            this.updateVertAlign();\n        }\n\n        public setup_afterAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_afterAdd(buffer, beginPos);\n\n            if (!this._text && this._promptText) {\n                this._textField.displayAsPassword = false;\n                this._textField.textFlow = (new egret.HtmlTextParser).parser(UBBParser.inst.parse(ToolSet.encodeHTML(this._promptText)));\n            }\n        }\n\n        private __textChanged(evt: egret.Event): void {\n            this._text = this._textField.text;\n        }\n\n        private __focusIn(evt: egret.Event): void {\n            if (!this._text && this._promptText) {\n                this._textField.displayAsPassword = this._password;\n                this._textField.text = \"\";\n            }\n        }\n\n        private __focusOut(evt: egret.Event): void {\n            this._text = this._textField.text;\n            if (!this._text && this._promptText) {\n                this._textField.displayAsPassword = false;\n                this._textField.textFlow = (new egret.HtmlTextParser).parser(UBBParser.inst.parse(ToolSet.encodeHTML(this._promptText)));\n            }\n        }\n    }\n}"
  },
  {
    "path": "source/src/GTree.ts",
    "content": "namespace fgui {\n    export class GTree extends GList {\n\n        public treeNodeRender: (node: GTreeNode, obj: GComponent) => void;\n        public treeNodeWillExpand: (node: GTreeNode, expanded: boolean) => void;\n\n        private _indent: number;\n        private _clickToExpand: number;\n        private _rootNode: GTreeNode;\n        private _expandedStatusInEvt: boolean;\n\n        constructor() {\n            super();\n\n            this._indent = 15;\n\n            this._rootNode = new GTreeNode(true);\n            this._rootNode._setTree(this);\n            this._rootNode.expanded = true;\n        }\n\n        public get rootNode(): GTreeNode {\n            return this._rootNode;\n        }\n\n        public get indent(): number {\n            return this._indent;\n        }\n\n        public set indent(value: number) {\n            this._indent = value;\n        }\n\n        public get clickToExpand(): number {\n            return this._clickToExpand;\n        }\n\n        public set clickToExpand(value: number) {\n            this._clickToExpand = value;\n        }\n\n        public getSelectedNode(): GTreeNode {\n            if (this.selectedIndex != -1)\n                return this.getChildAt(this.selectedIndex)._treeNode;\n            else\n                return null;\n        }\n\n        public getSelectedNodes(result?: Array<GTreeNode>): Array<GTreeNode> {\n            if (!result)\n                result = new Array<GTreeNode>();\n\n            s_list.length = 0;\n            super.getSelection(s_list);\n            var cnt: number = s_list.length;\n            var ret: Array<GTreeNode> = new Array<GTreeNode>();\n            for (var i: number = 0; i < cnt; i++) {\n                var node: GTreeNode = this.getChildAt(s_list[i])._treeNode;\n                ret.push(node);\n            }\n            return ret;\n        }\n\n        public selectNode(node: GTreeNode, scrollItToView?: boolean): void {\n            var parentNode: GTreeNode = node.parent;\n            while (parentNode && parentNode != this._rootNode) {\n                parentNode.expanded = true;\n                parentNode = parentNode.parent;\n            }\n\n            if (!node._cell)\n                return;\n\n            this.addSelection(this.getChildIndex(node._cell), scrollItToView);\n        }\n\n        public unselectNode(node: GTreeNode): void {\n            if (!node._cell)\n                return;\n\n            this.removeSelection(this.getChildIndex(node._cell));\n        }\n\n        public expandAll(folderNode?: GTreeNode): void {\n            if (!folderNode)\n                folderNode = this._rootNode;\n\n            folderNode.expanded = true;\n            var cnt: number = folderNode.numChildren;\n            for (var i: number = 0; i < cnt; i++) {\n                var node: GTreeNode = folderNode.getChildAt(i);\n                if (node.isFolder)\n                    this.expandAll(node);\n            }\n        }\n\n        public collapseAll(folderNode?: GTreeNode): void {\n            if (!folderNode)\n                folderNode = this._rootNode;\n\n            if (folderNode != this._rootNode)\n                folderNode.expanded = false;\n            var cnt: number = folderNode.numChildren;\n            for (var i: number = 0; i < cnt; i++) {\n                var node: GTreeNode = folderNode.getChildAt(i);\n                if (node.isFolder)\n                    this.collapseAll(node);\n            }\n        }\n\n        private createCell(node: GTreeNode): void {\n            var child: GObject = this.getFromPool(node._resURL ? node._resURL : this.defaultItem);\n            if (!(child instanceof GComponent))\n                throw new Error(\"cannot create tree node object.\");\n\n            child._treeNode = node;\n            node._cell = child;\n\n            var indentObj: GObject = child.getChild(\"indent\");\n            if (indentObj != null)\n                indentObj.width = (node.level - 1) * this._indent;\n\n            var cc: Controller;\n\n            cc = child.getController(\"expanded\");\n            if (cc) {\n                cc.addEventListener(StateChangeEvent.CHANGED, this.__expandedStateChanged, this);\n                cc.selectedIndex = node.expanded ? 1 : 0;\n            }\n\n            cc = child.getController(\"leaf\");\n            if (cc)\n                cc.selectedIndex = node.isFolder ? 0 : 1;\n\n            if (node.isFolder)\n                child.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__cellMouseDown, this);\n\n            if (this.treeNodeRender)\n                this.treeNodeRender.call(this.callbackThisObj, node, child);\n        }\n\n        public _afterInserted(node: GTreeNode): void {\n            if (!node._cell)\n                this.createCell(node);\n\n            var index: number = this.getInsertIndexForNode(node);\n            this.addChildAt(node._cell, index);\n            if (this.treeNodeRender)\n                this.treeNodeRender.call(this.callbackThisObj, node, node._cell);\n\n            if (node.isFolder && node.expanded)\n                this.checkChildren(node, index);\n        }\n\n        private getInsertIndexForNode(node: GTreeNode): number {\n            var prevNode: GTreeNode = node.getPrevSibling();\n            if (prevNode == null)\n                prevNode = node.parent;\n            var insertIndex: number = this.getChildIndex(prevNode._cell) + 1;\n            var myLevel: number = node.level;\n            var cnt: number = this.numChildren;\n            for (var i: number = insertIndex; i < cnt; i++) {\n                var testNode: GTreeNode = this.getChildAt(i)._treeNode;\n                if (testNode.level <= myLevel)\n                    break;\n\n                insertIndex++;\n            }\n\n            return insertIndex;\n        }\n\n        public _afterRemoved(node: GTreeNode): void {\n            this.removeNode(node);\n        }\n\n        public _afterExpanded(node: GTreeNode): void {\n            if (node == this._rootNode) {\n                this.checkChildren(this._rootNode, 0);\n                return;\n            }\n\n            if (this.treeNodeWillExpand != null)\n                this.treeNodeWillExpand.call(this.callbackThisObj, node, true);\n\n            if (node._cell == null)\n                return;\n\n            if (this.treeNodeRender)\n                this.treeNodeRender.call(this.callbackThisObj, node, node._cell);\n\n            var cc: Controller = node._cell.getController(\"expanded\");\n            if (cc)\n                cc.selectedIndex = 1;\n\n            if (node._cell.parent)\n                this.checkChildren(node, this.getChildIndex(node._cell));\n        }\n\n        public _afterCollapsed(node: GTreeNode): void {\n            if (node == this._rootNode) {\n                this.checkChildren(this._rootNode, 0);\n                return;\n            }\n\n            if (this.treeNodeWillExpand)\n                this.treeNodeWillExpand.call(this.callbackThisObj, node, false);\n\n            if (node._cell == null)\n                return;\n\n            if (this.treeNodeRender)\n                this.treeNodeRender.call(this.callbackThisObj, node, node._cell);\n\n            var cc: Controller = node._cell.getController(\"expanded\");\n            if (cc)\n                cc.selectedIndex = 0;\n\n            if (node._cell.parent)\n                this.hideFolderNode(node);\n        }\n\n        public _afterMoved(node: GTreeNode): void {\n            var startIndex: number = this.getChildIndex(node._cell);\n            var endIndex: number;\n            if (node.isFolder)\n                endIndex = this.getFolderEndIndex(startIndex, node.level);\n            else\n                endIndex = startIndex + 1;\n            var insertIndex: number = this.getInsertIndexForNode(node);\n            var i: number;\n            var cnt: number = endIndex - startIndex;\n            var obj: GObject;\n            if (insertIndex < startIndex) {\n                for (i = 0; i < cnt; i++) {\n                    obj = this.getChildAt(startIndex + i);\n                    this.setChildIndex(obj, insertIndex + i);\n                }\n            }\n            else {\n                for (i = 0; i < cnt; i++) {\n                    obj = this.getChildAt(startIndex);\n                    this.setChildIndex(obj, insertIndex);\n                }\n            }\n        }\n\n        private getFolderEndIndex(startIndex: number, level: number): number {\n            var cnt: number = this.numChildren;\n            for (var i: number = startIndex + 1; i < cnt; i++) {\n                var node: GTreeNode = this.getChildAt(i)._treeNode;\n                if (node.level <= level)\n                    return i;\n            }\n\n            return cnt;\n        }\n\n        private checkChildren(folderNode: GTreeNode, index: number): number {\n            var cnt: number = folderNode.numChildren;\n            for (var i: number = 0; i < cnt; i++) {\n                index++;\n                var node: GTreeNode = folderNode.getChildAt(i);\n                if (node._cell == null)\n                    this.createCell(node);\n\n                if (!node._cell.parent)\n                    this.addChildAt(node._cell, index);\n\n                if (node.isFolder && node.expanded)\n                    index = this.checkChildren(node, index);\n            }\n\n            return index;\n        }\n\n        private hideFolderNode(folderNode: GTreeNode): void {\n            var cnt: number = folderNode.numChildren;\n            for (var i: number = 0; i < cnt; i++) {\n                var node: GTreeNode = folderNode.getChildAt(i);\n                if (node._cell)\n                    this.removeChild(node._cell);\n                if (node.isFolder && node.expanded)\n                    this.hideFolderNode(node);\n            }\n        }\n\n        private removeNode(node: GTreeNode): void {\n            if (node._cell) {\n                if (node._cell.parent)\n                    this.removeChild(node._cell);\n                this.returnToPool(node._cell);\n                node._cell._treeNode = null;\n                node._cell = null;\n            }\n\n            if (node.isFolder) {\n                var cnt: number = node.numChildren;\n                for (var i: number = 0; i < cnt; i++) {\n                    var node2: GTreeNode = node.getChildAt(i);\n                    this.removeNode(node2);\n                }\n            }\n        }\n\n        private __cellMouseDown(evt: egret.Event): void {\n            var node: GTreeNode = evt.currentTarget._treeNode;\n            this._expandedStatusInEvt = node.expanded;\n        }\n\n        private __expandedStateChanged(evt: egret.Event): void {\n            var cc: Controller = evt.currentTarget;\n            var node: GTreeNode = cc.parent._treeNode;\n            node.expanded = cc.selectedIndex == 1;\n        }\n\n        protected dispatchItemEvent(evt: ItemEvent): void {\n            if (this._clickToExpand != 0) {\n                var node: GTreeNode = evt.itemObject._treeNode;\n                if (node && node.isFolder && this._expandedStatusInEvt == node.expanded) {\n                    if (this._clickToExpand == 2) {\n                        //if (evt.clickCount == 2)\n                        // node.expanded = !node.expanded;\n                    }\n                    else\n                        node.expanded = !node.expanded;\n                }\n            }\n\n            super.dispatchItemEvent(evt);\n        }\n\n        public setup_beforeAdd(buffer: ByteBuffer, beginPos: number): void {\n            super.setup_beforeAdd(buffer, beginPos);\n\n            buffer.seek(beginPos, 9);\n\n            this._indent = buffer.readInt();\n            this._clickToExpand = buffer.readByte();\n        }\n\n        protected readItems(buffer: ByteBuffer): void {\n            var cnt: number;\n            var i: number;\n            var nextPos: number;\n            var str: string;\n            var isFolder: boolean;\n            var lastNode: GTreeNode;\n            var level: number;\n            var prevLevel: number = 0;\n\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n\n                str = buffer.readS();\n                if (str == null) {\n                    str = this.defaultItem;\n                    if (!str) {\n                        buffer.position = nextPos;\n                        continue;\n                    }\n                }\n\n                isFolder = buffer.readBool();\n                level = buffer.readByte();\n\n                var node: GTreeNode = new GTreeNode(isFolder, str);\n                node.expanded = true;\n                if (i == 0)\n                    this._rootNode.addChild(node);\n                else {\n                    if (level > prevLevel)\n                        lastNode.addChild(node);\n                    else if (level < prevLevel) {\n                        for (var j: number = level; j <= prevLevel; j++)\n                            lastNode = lastNode.parent;\n                        lastNode.addChild(node);\n                    }\n                    else\n                        lastNode.parent.addChild(node);\n                }\n                lastNode = node;\n                prevLevel = level;\n\n                this.setupItem(buffer, node.cell);\n\n                buffer.position = nextPos;\n            }\n        }\n    }\n\n    var s_list: number[] = new Array<number>();\n}"
  },
  {
    "path": "source/src/GTreeNode.ts",
    "content": "namespace fgui {\n    export class GTreeNode {\n        public data: any;\n\n        private _parent: GTreeNode;\n        private _children: Array<GTreeNode>;\n        private _expanded: boolean;\n        private _level: number = 0;\n        private _tree: GTree;\n\n        public _cell: GComponent;\n        public _resURL?: string;\n\n        constructor(hasChild: boolean, resURL?: string) {\n            this._resURL = resURL;\n            if (hasChild)\n                this._children = new Array<GTreeNode>();\n        }\n\n        public set expanded(value: boolean) {\n            if (!this._children)\n                return;\n\n            if (this._expanded != value) {\n                this._expanded = value;\n                if (this._tree) {\n                    if (this._expanded)\n                        this._tree._afterExpanded(this);\n                    else\n                        this._tree._afterCollapsed(this);\n                }\n            }\n        }\n\n        public get expanded(): boolean {\n            return this._expanded;\n        }\n\n        public get isFolder(): boolean {\n            return this._children != null;\n        }\n\n        public get parent(): GTreeNode {\n            return this._parent;\n        }\n\n        public get text(): string {\n            if (this._cell)\n                return this._cell.text;\n            else\n                return null;\n        }\n\n        public set text(value: string) {\n            if (this._cell)\n                this._cell.text = value;\n        }\n\n        public get icon(): string {\n            if (this._cell)\n                return this._cell.icon;\n            else\n                return null;\n        }\n\n        public set icon(value: string) {\n            if (this._cell)\n                this._cell.icon = value;\n        }\n\n        public get cell(): GComponent {\n            return this._cell;\n        }\n\n        public get level(): number {\n            return this._level;\n        }\n\n        public _setLevel(value: number): void {\n            this._level = value;\n        }\n\n        public addChild(child: GTreeNode): GTreeNode {\n            this.addChildAt(child, this._children.length);\n            return child;\n        }\n\n        public addChildAt(child: GTreeNode, index: number): GTreeNode {\n            if (!child)\n                throw new Error(\"child is null\");\n\n            var numChildren: number = this._children.length;\n\n            if (index >= 0 && index <= numChildren) {\n                if (child._parent == this) {\n                    this.setChildIndex(child, index);\n                }\n                else {\n                    if (child._parent)\n                        child._parent.removeChild(child);\n\n                    var cnt: number = this._children.length;\n                    if (index == cnt)\n                        this._children.push(child);\n                    else\n                        this._children.splice(index, 0, child);\n\n                    child._parent = this;\n                    child._level = this._level + 1;\n                    child._setTree(this._tree);\n                    if (this._tree && this == this._tree.rootNode || this._cell && this._cell.parent && this._expanded)\n                        this._tree._afterInserted(child);\n                }\n\n                return child;\n            }\n            else {\n                throw new RangeError(\"Invalid child index\");\n            }\n        }\n\n        public removeChild(child: GTreeNode): GTreeNode {\n            var childIndex: number = this._children.indexOf(child);\n            if (childIndex != -1) {\n                this.removeChildAt(childIndex);\n            }\n            return child;\n        }\n\n        public removeChildAt(index: number): GTreeNode {\n            if (index >= 0 && index < this.numChildren) {\n                var child: GTreeNode = this._children[index];\n                this._children.splice(index, 1);\n\n                child._parent = null;\n                if (this._tree) {\n                    child._setTree(null);\n                    this._tree._afterRemoved(child);\n                }\n\n                return child;\n            }\n            else {\n                throw \"Invalid child index\";\n            }\n        }\n\n        public removeChildren(beginIndex?: number, endIndex?: number): void {\n            beginIndex = beginIndex || 0;\n            if (endIndex == null) endIndex = -1;\n            if (endIndex < 0 || endIndex >= this.numChildren)\n                endIndex = this.numChildren - 1;\n\n            for (var i: number = beginIndex; i <= endIndex; ++i)\n                this.removeChildAt(beginIndex);\n        }\n\n        public getChildAt(index: number): GTreeNode {\n            if (index >= 0 && index < this.numChildren)\n                return this._children[index];\n            else\n                throw \"Invalid child index\";\n        }\n\n        public getChildIndex(child: GTreeNode): number {\n            return this._children.indexOf(child);\n        }\n\n        public getPrevSibling(): GTreeNode {\n            if (this._parent == null)\n                return null;\n\n            var i: number = this._parent._children.indexOf(this);\n            if (i <= 0)\n                return null;\n\n            return this._parent._children[i - 1];\n        }\n\n        public getNextSibling(): GTreeNode {\n            if (this._parent == null)\n                return null;\n\n            var i: number = this._parent._children.indexOf(this);\n            if (i < 0 || i >= this._parent._children.length - 1)\n                return null;\n\n            return this._parent._children[i + 1];\n        }\n\n        public setChildIndex(child: GTreeNode, index: number): void {\n            var oldIndex: number = this._children.indexOf(child);\n            if (oldIndex == -1)\n                throw \"Not a child of this container\";\n\n            var cnt: number = this._children.length;\n            if (index < 0)\n                index = 0;\n            else if (index > cnt)\n                index = cnt;\n\n            if (oldIndex == index)\n                return;\n\n            this._children.splice(oldIndex, 1);\n            this._children.splice(index, 0, child);\n            if (this._tree && this == this._tree.rootNode || this._cell && this._cell.parent && this._expanded)\n                this._tree._afterMoved(child);\n        }\n\n        public swapChildren(child1: GTreeNode, child2: GTreeNode): void {\n            var index1: number = this._children.indexOf(child1);\n            var index2: number = this._children.indexOf(child2);\n            if (index1 == -1 || index2 == -1)\n                throw \"Not a child of this container\";\n            this.swapChildrenAt(index1, index2);\n        }\n\n        public swapChildrenAt(index1: number, index2: number): void {\n            var child1: GTreeNode = this._children[index1];\n            var child2: GTreeNode = this._children[index2];\n\n            this.setChildIndex(child1, index2);\n            this.setChildIndex(child2, index1);\n        }\n\n        public get numChildren(): number {\n            return this._children.length;\n        }\n\n        public expandToRoot(): void {\n            var p: GTreeNode = this;\n            while (p) {\n                p.expanded = true;\n                p = p.parent;\n            }\n        }\n\n        public get tree(): GTree {\n            return this._tree;\n        }\n\n        public _setTree(value: GTree): void {\n            this._tree = value;\n            if (this._tree && this._tree.treeNodeWillExpand && this._expanded)\n                this._tree.treeNodeWillExpand(this, true);\n\n            if (this._children) {\n                var cnt: number = this._children.length;\n                for (var i: number = 0; i < cnt; i++) {\n                    var node: GTreeNode = this._children[i];\n                    node._level = this._level + 1;\n                    node._setTree(value);\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "source/src/IUISource.ts",
    "content": "module fgui {\n\n    export interface IUISource {\n        fileName: string;\n        loaded: boolean;\n\n        load(callback: Function, thisObj: any): void;\n    }\n}"
  },
  {
    "path": "source/src/Margin.ts",
    "content": "\nmodule fgui {\n\n    export class Margin {\n        public left: number = 0;\n        public right: number = 0;\n        public top: number = 0;\n        public bottom: number = 0;\n\n        public constructor() {\n        }\n        \n        public copy(source: Margin): void {\n            this.top = source.top;\n            this.bottom = source.bottom;\n            this.left = source.left;\n            this.right = source.right;\n        }\n    }\n}"
  },
  {
    "path": "source/src/PackageItem.ts",
    "content": "///<reference path=\"utils/PixelHitTest.ts\"/>\n\nmodule fgui {\n\n    export class PackageItem {\n        public owner: UIPackage;\n\n        public type: PackageItemType;\n        public objectType?: ObjectType;\n        public id: string;\n        public name: string;\n        public width: number = 0;\n        public height: number = 0;\n        public file: string;\n        public decoded?: boolean;\n        public loading?: Array<Function>;\n        public rawData?: ByteBuffer;\n        public asset?: egret.Texture | egret.Sound | any;\n\n        public highResolution?: Array<string>;\n        public branches?: Array<string>;\n\n        //image\n        public scale9Grid?: egret.Rectangle;\n        public scaleByTile?: boolean;\n        public tileGridIndice?: number;\n        public smoothing?: boolean;\n        public pixelHitTestData?: PixelHitTestData;\n\n        //movieclip\n        public interval?: number;\n        public repeatDelay?: number;\n        public swing?: boolean;\n        public frames?: Array<Frame>;\n\n        //componenet\n        public extensionType?: any;\n\n        //font \n        public bitmapFont?: BitmapFont;\n\n        //skeleton\n        public skeletonAnchor?: egret.Point;\n        public armatureName?: string;\n\n        public constructor() {\n        }\n\n        public load(): Object {\n            return this.owner.getItemAsset(this);\n        }\n\n        public getBranch(): PackageItem {\n            if (this.branches && this.owner._branchIndex != -1) {\n                var itemId: string = this.branches[this.owner._branchIndex];\n                if (itemId)\n                    return this.owner.getItemById(itemId);\n            }\n\n            return this;\n        }\n\n        public getHighResolution(): PackageItem {\n            if (this.highResolution && GRoot.contentScaleLevel > 0) {\n                var itemId: string = this.highResolution[GRoot.contentScaleLevel - 1];\n                if (itemId)\n                    return this.owner.getItemById(itemId);\n            }\n\n            return this;\n        }\n\n        public toString(): string {\n            return this.name;\n        }\n    }\n}"
  },
  {
    "path": "source/src/PopupMenu.ts",
    "content": "module fgui {\r\n    export class PopupMenu {\r\n\r\n        protected _contentPane: GComponent;\r\n        protected _list: GList;\r\n\r\n        public constructor(resourceURL?: string) {\r\n            if (!resourceURL) {\r\n                resourceURL = UIConfig.popupMenu;\r\n                if (!resourceURL)\r\n                    throw \"UIConfig.popupMenu not defined\";\r\n            }\r\n            this._contentPane = UIPackage.createObjectFromURL(resourceURL).asCom;\r\n            this._contentPane.addEventListener(egret.Event.ADDED_TO_STAGE, this.__addedToStage, this);\r\n            this._list = <GList>(this._contentPane.getChild(\"list\"));\r\n            this._list.removeChildrenToPool();\r\n            this._list.addRelation(this._contentPane, RelationType.Width);\r\n            this._list.removeRelation(this._contentPane, RelationType.Height);\r\n            this._contentPane.addRelation(this._list, RelationType.Height);\r\n            this._list.addEventListener(ItemEvent.CLICK, this.__clickItem, this);\r\n        }\r\n\r\n        public dispose(): void {\r\n            this._contentPane.dispose();\r\n        }\r\n\r\n        public addItem(caption: string, callback?: (item?: ItemEvent) => void): GButton {\r\n            var item: GButton = this._list.addItemFromPool().asButton;\r\n            item.title = caption;\r\n            item.data = callback;\r\n            item.grayed = false;\r\n            var c: Controller = item.getController(\"checked\");\r\n            if (c)\r\n                c.selectedIndex = 0;\r\n            return item;\r\n        }\r\n\r\n        public addItemAt(caption: string, index: number, callback?: (item?: ItemEvent) => void): GButton {\r\n            var item: GButton = this._list.getFromPool().asButton;\r\n            this._list.addChildAt(item, index);\r\n            item.title = caption;\r\n            item.data = callback;\r\n            item.grayed = false;\r\n            var c: Controller = item.getController(\"checked\");\r\n            if (c)\r\n                c.selectedIndex = 0;\r\n            return item;\r\n        }\r\n\r\n        public addSeperator() {\r\n            if (UIConfig.popupMenu_seperator == null)\r\n                throw \"UIConfig.popupMenu_seperator not defined\";\r\n            this.list.addItemFromPool(UIConfig.popupMenu_seperator);\r\n        }\r\n\r\n        public getItemName(index: number): string {\r\n            var item: GObject = this._list.getChildAt(index);\r\n            return item.name;\r\n        }\r\n\r\n        public setItemText(name: string, caption: string) {\r\n            var item: GButton = this._list.getChild(name).asButton;\r\n            item.title = caption;\r\n        }\r\n\r\n        public setItemVisible(name: string, visible: boolean) {\r\n            var item: GButton = this._list.getChild(name).asButton;\r\n            if (item.visible != visible) {\r\n                item.visible = visible;\r\n                this._list.setBoundsChangedFlag();\r\n            }\r\n        }\r\n\r\n        public setItemGrayed(name: string, grayed: boolean) {\r\n            var item: GButton = this._list.getChild(name).asButton;\r\n            item.grayed = grayed;\r\n        }\r\n\r\n        public setItemCheckable(name: string, checkable: boolean) {\r\n            var item: GButton = this._list.getChild(name).asButton;\r\n            var c: Controller = item.getController(\"checked\");\r\n            if (c) {\r\n                if (checkable) {\r\n                    if (c.selectedIndex == 0)\r\n                        c.selectedIndex = 1;\r\n                }\r\n                else\r\n                    c.selectedIndex = 0;\r\n            }\r\n        }\r\n\r\n        public setItemChecked(name: string, checked: boolean) {\r\n            var item: GButton = this._list.getChild(name).asButton;\r\n            var c: Controller = item.getController(\"checked\");\r\n            if (c)\r\n                c.selectedIndex = checked ? 2 : 1;\r\n        }\r\n\r\n        public isItemChecked(name: string): boolean {\r\n            var item: GButton = this._list.getChild(name).asButton;\r\n            var c: Controller = item.getController(\"checked\");\r\n            if (c)\r\n                return c.selectedIndex == 2;\r\n            else\r\n                return false;\r\n        }\r\n\r\n        public removeItem(name: string): boolean {\r\n            var item: GButton = <GButton>this._list.getChild(name);\r\n            if (item) {\r\n                var index: number = this._list.getChildIndex(item);\r\n                this._list.removeChildToPoolAt(index);\r\n                return true;\r\n            }\r\n            else\r\n                return false;\r\n        }\r\n\r\n        public clearItems() {\r\n            this._list.removeChildrenToPool();\r\n        }\r\n\r\n        public get itemCount(): number {\r\n            return this._list.numChildren;\r\n        }\r\n\r\n        public get contentPane(): GComponent {\r\n            return this._contentPane;\r\n        }\r\n\r\n        public get list(): GList {\r\n            return this._list;\r\n        }\r\n\r\n        public show(target?: GObject, dir?: PopupDirection | boolean) {\r\n            var r: GRoot = target ? target.root : GRoot.inst;\r\n            r.showPopup(this.contentPane, (target instanceof GRoot) ? null : target, dir);\r\n        }\r\n\r\n        private __clickItem(evt: ItemEvent): void {\r\n            GTimers.inst.add(100, 1, this.__clickItem2, this, evt);\r\n        }\r\n\r\n        private __clickItem2(evt: ItemEvent): void {\r\n            var item: GButton = evt.itemObject.asButton;\r\n            if (item == null)\r\n                return;\r\n            if (item.grayed) {\r\n                this._list.selectedIndex = -1;\r\n                return;\r\n            }\r\n            var c: Controller = item.getController(\"checked\");\r\n            if (c && c.selectedIndex != 0) {\r\n                if (c.selectedIndex == 1)\r\n                    c.selectedIndex = 2;\r\n                else\r\n                    c.selectedIndex = 1;\r\n            }\r\n            var r: GRoot = <GRoot>(this._contentPane.parent);\r\n            r.hidePopup(this.contentPane);\r\n            if (item.data != null) {\r\n                if (item.data.length == 1)\r\n                    item.data(evt);\r\n                else\r\n                    item.data();\r\n            }\r\n        }\r\n\r\n        private __addedToStage(evt: egret.Event) {\r\n            this._list.selectedIndex = -1;\r\n            this._list.resizeToFit(100000, 10);\r\n        }\r\n    }\r\n}\r\n\r\n"
  },
  {
    "path": "source/src/RelationItem.ts",
    "content": "\r\nmodule fgui {\r\n\r\n    export class RelationItem {\r\n        private _owner: GObject;\r\n        private _target: GObject;\r\n        private _defs: Array<RelationDef>;\r\n        private _targetX: number;\r\n        private _targetY: number;\r\n        private _targetWidth: number;\r\n        private _targetHeight: number;\r\n\r\n        public constructor(owner: GObject) {\r\n            this._owner = owner;\r\n            this._defs = new Array<RelationDef>();\r\n        }\r\n\r\n        public get owner(): GObject {\r\n            return this._owner;\r\n        }\r\n\r\n        public set target(value: GObject) {\r\n            if (this._target != value) {\r\n                if (this._target)\r\n                    this.releaseRefTarget(this._target);\r\n                this._target = value;\r\n                if (this._target)\r\n                    this.addRefTarget(this._target);\r\n            }\r\n        }\r\n\r\n        public get target(): GObject {\r\n            return this._target;\r\n        }\r\n\r\n        public add(relationType: number, usePercent: boolean): void {\r\n            if (relationType == RelationType.Size) {\r\n                this.add(RelationType.Width, usePercent);\r\n                this.add(RelationType.Height, usePercent);\r\n                return;\r\n            }\r\n\r\n            var length: number = this._defs.length;\r\n            for (var i: number = 0; i < length; i++) {\r\n                var def: RelationDef = this._defs[i];\r\n                if (def.type == relationType)\r\n                    return;\r\n            }\r\n\r\n            this.internalAdd(relationType, usePercent);\r\n        }\r\n\r\n        public internalAdd(relationType: number, usePercent: boolean): void {\r\n            if (relationType == RelationType.Size) {\r\n                this.internalAdd(RelationType.Width, usePercent);\r\n                this.internalAdd(RelationType.Height, usePercent);\r\n                return;\r\n            }\r\n\r\n            var info: RelationDef = new RelationDef();\r\n            info.percent = usePercent;\r\n            info.type = relationType;\r\n            info.axis = (relationType <= RelationType.Right_Right || relationType == RelationType.Width || relationType >= RelationType.LeftExt_Left && relationType <= RelationType.RightExt_Right) ? 0 : 1;\r\n            this._defs.push(info);\r\n\r\n            //当使用中线关联时，因为需要除以2，很容易因为奇数宽度/高度造成小数点坐标；当使用百分比时，也会造成小数坐标；\r\n            //所以设置了这类关联的对象，自动启用pixelSnapping\r\n            if (usePercent || relationType == RelationType.Left_Center || relationType == RelationType.Center_Center || relationType == RelationType.Right_Center\r\n                || relationType == RelationType.Top_Middle || relationType == RelationType.Middle_Middle || relationType == RelationType.Bottom_Middle)\r\n                this._owner.pixelSnapping = true;\r\n        }\r\n\r\n        public remove(relationType: number = 0): void {\r\n            if (relationType == RelationType.Size) {\r\n                this.remove(RelationType.Width);\r\n                this.remove(RelationType.Height);\r\n                return;\r\n            }\r\n\r\n            var dc: number = this._defs.length;\r\n            for (var k: number = 0; k < dc; k++) {\r\n                if (this._defs[k].type == relationType) {\r\n                    this._defs.splice(k, 1);\r\n                    break;\r\n                }\r\n            }\r\n        }\r\n\r\n        public copyFrom(source: RelationItem): void {\r\n            this.target = source.target;\r\n\r\n            this._defs.length = 0;\r\n            var length: number = source._defs.length;\r\n            for (var i: number = 0; i < length; i++) {\r\n                var info: RelationDef = source._defs[i];\r\n                var info2: RelationDef = new RelationDef();\r\n                info2.copyFrom(info);\r\n                this._defs.push(info2);\r\n            }\r\n        }\r\n\r\n        public dispose(): void {\r\n            if (this._target) {\r\n                this.releaseRefTarget(this._target);\r\n                this._target = null;\r\n            }\r\n        }\r\n\r\n        public get isEmpty(): boolean {\r\n            return this._defs.length == 0;\r\n        }\r\n\r\n        public applyOnSelfResized(dWidth: number, dHeight: number, applyPivot: boolean): void {\r\n            var ox: number = this._owner.x;\r\n            var oy: number = this._owner.y;\r\n\r\n            var length: number = this._defs.length;\r\n            for (var i: number = 0; i < length; i++) {\r\n                var info: RelationDef = this._defs[i];\r\n                switch (info.type) {\r\n                    case RelationType.Center_Center:\r\n                        this._owner.x -= (0.5 - (applyPivot ? this._owner.pivotX : 0)) * dWidth;\r\n                        break;\r\n                    case RelationType.Right_Center:\r\n                    case RelationType.Right_Left:\r\n                    case RelationType.Right_Right:\r\n                        this._owner.x -= (1 - (applyPivot ? this._owner.pivotX : 0)) * dWidth;\r\n                        break;\r\n\r\n                    case RelationType.Middle_Middle:\r\n                        this._owner.y -= (0.5 - (applyPivot ? this._owner.pivotY : 0)) * dHeight;\r\n                        break;\r\n                    case RelationType.Bottom_Middle:\r\n                    case RelationType.Bottom_Top:\r\n                    case RelationType.Bottom_Bottom:\r\n                        this._owner.y -= (1 - (applyPivot ? this._owner.pivotY : 0)) * dHeight;\r\n                        break;\r\n                }\r\n            }\r\n\r\n            if (ox != this._owner.x || oy != this._owner.y) {\r\n                ox = this._owner.x - ox;\r\n                oy = this._owner.y - oy;\r\n\r\n                this._owner.updateGearFromRelations(1, ox, oy);\r\n\r\n                if (this._owner.parent) {\r\n                    var len: number = this._owner.parent._transitions.length;\r\n                    if (len > 0) {\r\n                        for (var i: number = 0; i < len; ++i) {\r\n                            this._owner.parent._transitions[i].updateFromRelations(this._owner.id, ox, oy);\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        private applyOnXYChanged(info: RelationDef, dx: number, dy: number): void {\r\n            var tmp: number;\r\n\r\n            switch (info.type) {\r\n                case RelationType.Left_Left:\r\n                case RelationType.Left_Center:\r\n                case RelationType.Left_Right:\r\n                case RelationType.Center_Center:\r\n                case RelationType.Right_Left:\r\n                case RelationType.Right_Center:\r\n                case RelationType.Right_Right:\r\n                    this._owner.x += dx;\r\n                    break;\r\n\r\n                case RelationType.Top_Top:\r\n                case RelationType.Top_Middle:\r\n                case RelationType.Top_Bottom:\r\n                case RelationType.Middle_Middle:\r\n                case RelationType.Bottom_Top:\r\n                case RelationType.Bottom_Middle:\r\n                case RelationType.Bottom_Bottom:\r\n                    this._owner.y += dy;\r\n                    break;\r\n\r\n                case RelationType.Width:\r\n                case RelationType.Height:\r\n                    break;\r\n\r\n                case RelationType.LeftExt_Left:\r\n                case RelationType.LeftExt_Right:\r\n                    if (this._owner != this._target.parent) {\r\n                        tmp = this._owner.xMin;\r\n                        this._owner.width = this._owner._rawWidth - dx;\r\n                        this._owner.xMin = tmp + dx;\r\n                    }\r\n                    else\r\n                        this._owner.width = this._owner._rawWidth - dx;\r\n                    break;\r\n\r\n                case RelationType.RightExt_Left:\r\n                case RelationType.RightExt_Right:\r\n                    if (this._owner != this._target.parent) {\r\n                        tmp = this._owner.xMin;\r\n                        this._owner.width = this._owner._rawWidth + dx;\r\n                        this._owner.xMin = tmp;\r\n                    }\r\n                    else\r\n                        this._owner.width = this._owner._rawWidth + dx;\r\n                    break;\r\n\r\n                case RelationType.TopExt_Top:\r\n                case RelationType.TopExt_Bottom:\r\n                    if (this._owner != this._target.parent) {\r\n                        tmp = this._owner.yMin;\r\n                        this._owner.height = this._owner._rawHeight - dy;\r\n                        this._owner.yMin = tmp + dy;\r\n                    }\r\n                    else\r\n                        this._owner.height = this._owner._rawHeight - dy;\r\n                    break;\r\n\r\n                case RelationType.BottomExt_Top:\r\n                case RelationType.BottomExt_Bottom:\r\n                    if (this._owner != this._target.parent) {\r\n                        tmp = this._owner.yMin;\r\n                        this._owner.height = this._owner._rawHeight + dy;\r\n                        this._owner.yMin = tmp;\r\n                    }\r\n                    else\r\n                        this._owner.height = this._owner._rawHeight + dy;\r\n                    break;\r\n            }\r\n        }\r\n\r\n        private applyOnSizeChanged(info: RelationDef): void {\r\n            var pos: number = 0, pivot: number = 0, delta: number = 0;\r\n            var v: number, tmp: number;\r\n\r\n            if (info.axis == 0) {\r\n                if (this._target != this._owner.parent) {\r\n                    pos = this._target.x;\r\n                    if (this._target.pivotAsAnchor)\r\n                        pivot = this._target.pivotX;\r\n                }\r\n\r\n                if (info.percent) {\r\n                    if (this._targetWidth != 0)\r\n                        delta = this._target._width / this._targetWidth;\r\n                }\r\n                else\r\n                    delta = this._target._width - this._targetWidth;\r\n            }\r\n            else {\r\n                if (this._target != this._owner.parent) {\r\n                    pos = this._target.y;\r\n                    if (this._target.pivotAsAnchor)\r\n                        pivot = this._target.pivotY;\r\n                }\r\n\r\n                if (info.percent) {\r\n                    if (this._targetHeight != 0)\r\n                        delta = this._target._height / this._targetHeight;\r\n                }\r\n                else\r\n                    delta = this._target._height - this._targetHeight;\r\n            }\r\n\r\n            switch (info.type) {\r\n                case RelationType.Left_Left:\r\n                    if (info.percent)\r\n                        this._owner.xMin = pos + (this._owner.xMin - pos) * delta;\r\n                    else if (pivot != 0)\r\n                        this._owner.x += delta * (-pivot);\r\n                    break;\r\n                case RelationType.Left_Center:\r\n                    if (info.percent)\r\n                        this._owner.xMin = pos + (this._owner.xMin - pos) * delta;\r\n                    else\r\n                        this._owner.x += delta * (0.5 - pivot);\r\n                    break;\r\n                case RelationType.Left_Right:\r\n                    if (info.percent)\r\n                        this._owner.xMin = pos + (this._owner.xMin - pos) * delta;\r\n                    else\r\n                        this._owner.x += delta * (1 - pivot);\r\n                    break;\r\n                case RelationType.Center_Center:\r\n                    if (info.percent)\r\n                        this._owner.xMin = pos + (this._owner.xMin + this._owner._rawWidth * 0.5 - pos) * delta - this._owner._rawWidth * 0.5;\r\n                    else\r\n                        this._owner.x += delta * (0.5 - pivot);\r\n                    break;\r\n                case RelationType.Right_Left:\r\n                    if (info.percent)\r\n                        this._owner.xMin = pos + (this._owner.xMin + this._owner._rawWidth - pos) * delta - this._owner._rawWidth;\r\n                    else if (pivot != 0)\r\n                        this._owner.x += delta * (-pivot);\r\n                    break;\r\n                case RelationType.Right_Center:\r\n                    if (info.percent)\r\n                        this._owner.xMin = pos + (this._owner.xMin + this._owner._rawWidth - pos) * delta - this._owner._rawWidth;\r\n                    else\r\n                        this._owner.x += delta * (0.5 - pivot);\r\n                    break;\r\n                case RelationType.Right_Right:\r\n                    if (info.percent)\r\n                        this._owner.xMin = pos + (this._owner.xMin + this._owner._rawWidth - pos) * delta - this._owner._rawWidth;\r\n                    else\r\n                        this._owner.x += delta * (1 - pivot);\r\n                    break;\r\n\r\n                case RelationType.Top_Top:\r\n                    if (info.percent)\r\n                        this._owner.yMin = pos + (this._owner.yMin - pos) * delta;\r\n                    else if (pivot != 0)\r\n                        this._owner.y += delta * (-pivot);\r\n                    break;\r\n                case RelationType.Top_Middle:\r\n                    if (info.percent)\r\n                        this._owner.yMin = pos + (this._owner.yMin - pos) * delta;\r\n                    else\r\n                        this._owner.y += delta * (0.5 - pivot);\r\n                    break;\r\n                case RelationType.Top_Bottom:\r\n                    if (info.percent)\r\n                        this._owner.yMin = pos + (this._owner.yMin - pos) * delta;\r\n                    else\r\n                        this._owner.y += delta * (1 - pivot);\r\n                    break;\r\n                case RelationType.Middle_Middle:\r\n                    if (info.percent)\r\n                        this._owner.yMin = pos + (this._owner.yMin + this._owner._rawHeight * 0.5 - pos) * delta - this._owner._rawHeight * 0.5;\r\n                    else\r\n                        this._owner.y += delta * (0.5 - pivot);\r\n                    break;\r\n                case RelationType.Bottom_Top:\r\n                    if (info.percent)\r\n                        this._owner.yMin = pos + (this._owner.yMin + this._owner._rawHeight - pos) * delta - this._owner._rawHeight;\r\n                    else if (pivot != 0)\r\n                        this._owner.y += delta * (-pivot);\r\n                    break;\r\n                case RelationType.Bottom_Middle:\r\n                    if (info.percent)\r\n                        this._owner.yMin = pos + (this._owner.yMin + this._owner._rawHeight - pos) * delta - this._owner._rawHeight;\r\n                    else\r\n                        this._owner.y += delta * (0.5 - pivot);\r\n                    break;\r\n                case RelationType.Bottom_Bottom:\r\n                    if (info.percent)\r\n                        this._owner.yMin = pos + (this._owner.yMin + this._owner._rawHeight - pos) * delta - this._owner._rawHeight;\r\n                    else\r\n                        this._owner.y += delta * (1 - pivot);\r\n                    break;\r\n\r\n                case RelationType.Width:\r\n                    if (this._owner._underConstruct && this._owner == this._target.parent)\r\n                        v = this._owner.sourceWidth - this._target.initWidth;\r\n                    else\r\n                        v = this._owner._rawWidth - this._targetWidth;\r\n                    if (info.percent)\r\n                        v = v * delta;\r\n                    if (this._target == this._owner.parent) {\r\n                        if (this._owner.pivotAsAnchor) {\r\n                            tmp = this._owner.xMin;\r\n                            this._owner.setSize(this._target._width + v, this._owner._rawHeight, true);\r\n                            this._owner.xMin = tmp;\r\n                        }\r\n                        else\r\n                            this._owner.setSize(this._target._width + v, this._owner._rawHeight, true);\r\n                    }\r\n                    else\r\n                        this._owner.width = this._target._width + v;\r\n                    break;\r\n                case RelationType.Height:\r\n                    if (this._owner._underConstruct && this._owner == this._target.parent)\r\n                        v = this._owner.sourceHeight - this._target.initHeight;\r\n                    else\r\n                        v = this._owner._rawHeight - this._targetHeight;\r\n                    if (info.percent)\r\n                        v = v * delta;\r\n                    if (this._target == this._owner.parent) {\r\n                        if (this._owner.pivotAsAnchor) {\r\n                            tmp = this._owner.yMin;\r\n                            this._owner.setSize(this._owner._rawWidth, this._target._height + v, true);\r\n                            this._owner.yMin = tmp;\r\n                        }\r\n                        else\r\n                            this._owner.setSize(this._owner._rawWidth, this._target._height + v, true);\r\n                    }\r\n                    else\r\n                        this._owner.height = this._target._height + v;\r\n                    break;\r\n\r\n                case RelationType.LeftExt_Left:\r\n                    tmp = this._owner.xMin;\r\n                    if (info.percent)\r\n                        v = pos + (tmp - pos) * delta - tmp;\r\n                    else\r\n                        v = delta * (-pivot);\r\n                    this._owner.width = this._owner._rawWidth - v;\r\n                    this._owner.xMin = tmp + v;\r\n                    break;\r\n                case RelationType.LeftExt_Right:\r\n                    tmp = this._owner.xMin;\r\n                    if (info.percent)\r\n                        v = pos + (tmp - pos) * delta - tmp;\r\n                    else\r\n                        v = delta * (1 - pivot);\r\n                    this._owner.width = this._owner._rawWidth - v;\r\n                    this._owner.xMin = tmp + v;\r\n                    break;\r\n                case RelationType.RightExt_Left:\r\n                    tmp = this._owner.xMin;\r\n                    if (info.percent)\r\n                        v = pos + (tmp + this._owner._rawWidth - pos) * delta - (tmp + this._owner._rawWidth);\r\n                    else\r\n                        v = delta * (-pivot);\r\n                    this._owner.width = this._owner._rawWidth + v;\r\n                    this._owner.xMin = tmp;\r\n                    break;\r\n                case RelationType.RightExt_Right:\r\n                    tmp = this._owner.xMin;\r\n                    if (info.percent) {\r\n                        if (this._owner == this._target.parent) {\r\n                            if (this._owner._underConstruct)\r\n                                this._owner.width = pos + this._target._width - this._target._width * pivot +\r\n                                    (this._owner.sourceWidth - pos - this._target.initWidth + this._target.initWidth * pivot) * delta;\r\n                            else\r\n                                this._owner.width = pos + (this._owner._rawWidth - pos) * delta;\r\n                        }\r\n                        else {\r\n                            v = pos + (tmp + this._owner._rawWidth - pos) * delta - (tmp + this._owner._rawWidth);\r\n                            this._owner.width = this._owner._rawWidth + v;\r\n                            this._owner.xMin = tmp;\r\n                        }\r\n                    }\r\n                    else {\r\n                        if (this._owner == this._target.parent) {\r\n                            if (this._owner._underConstruct)\r\n                                this._owner.width = this._owner.sourceWidth + (this._target._width - this._target.initWidth) * (1 - pivot);\r\n                            else\r\n                                this._owner.width = this._owner._rawWidth + delta * (1 - pivot);\r\n                        }\r\n                        else {\r\n                            v = delta * (1 - pivot);\r\n                            this._owner.width = this._owner._rawWidth + v;\r\n                            this._owner.xMin = tmp;\r\n                        }\r\n                    }\r\n                    break;\r\n                case RelationType.TopExt_Top:\r\n                    tmp = this._owner.yMin;\r\n                    if (info.percent)\r\n                        v = pos + (tmp - pos) * delta - tmp;\r\n                    else\r\n                        v = delta * (-pivot);\r\n                    this._owner.height = this._owner._rawHeight - v;\r\n                    this._owner.yMin = tmp + v;\r\n                    break;\r\n                case RelationType.TopExt_Bottom:\r\n                    tmp = this._owner.yMin;\r\n                    if (info.percent)\r\n                        v = pos + (tmp - pos) * delta - tmp;\r\n                    else\r\n                        v = delta * (1 - pivot);\r\n                    this._owner.height = this._owner._rawHeight - v;\r\n                    this._owner.yMin = tmp + v;\r\n                    break;\r\n                case RelationType.BottomExt_Top:\r\n                    tmp = this._owner.yMin;\r\n                    if (info.percent)\r\n                        v = pos + (tmp + this._owner._rawHeight - pos) * delta - (tmp + this._owner._rawHeight);\r\n                    else\r\n                        v = delta * (-pivot);\r\n                    this._owner.height = this._owner._rawHeight + v;\r\n                    this._owner.yMin = tmp;\r\n                    break;\r\n                case RelationType.BottomExt_Bottom:\r\n                    tmp = this._owner.yMin;\r\n                    if (info.percent) {\r\n                        if (this._owner == this._target.parent) {\r\n                            if (this._owner._underConstruct)\r\n                                this._owner.height = pos + this._target._height - this._target._height * pivot +\r\n                                    (this._owner.sourceHeight - pos - this._target.initHeight + this._target.initHeight * pivot) * delta;\r\n                            else\r\n                                this._owner.height = pos + (this._owner._rawHeight - pos) * delta;\r\n                        }\r\n                        else {\r\n                            v = pos + (tmp + this._owner._rawHeight - pos) * delta - (tmp + this._owner._rawHeight);\r\n                            this._owner.height = this._owner._rawHeight + v;\r\n                            this._owner.yMin = tmp;\r\n                        }\r\n                    }\r\n                    else {\r\n                        if (this._owner == this._target.parent) {\r\n                            if (this._owner._underConstruct)\r\n                                this._owner.height = this._owner.sourceHeight + (this._target._height - this._target.initHeight) * (1 - pivot);\r\n                            else\r\n                                this._owner.height = this._owner._rawHeight + delta * (1 - pivot);\r\n                        }\r\n                        else {\r\n                            v = delta * (1 - pivot);\r\n                            this._owner.height = this._owner._rawHeight + v;\r\n                            this._owner.yMin = tmp;\r\n                        }\r\n                    }\r\n                    break;\r\n            }\r\n        }\r\n\r\n        private addRefTarget(target: GObject): void {\r\n            if (target != this._owner.parent)\r\n                target.addEventListener(GObject.XY_CHANGED, this.__targetXYChanged, this);\r\n            target.addEventListener(GObject.SIZE_CHANGED, this.__targetSizeChanged, this);\r\n            target.addEventListener(GObject.SIZE_DELAY_CHANGE, this.__targetSizeWillChange, this);\r\n\r\n            this._targetX = this._target.x;\r\n            this._targetY = this._target.y;\r\n            this._targetWidth = this._target._width;\r\n            this._targetHeight = this._target._height;\r\n        }\r\n\r\n        private releaseRefTarget(target: GObject): void {\r\n            target.removeEventListener(GObject.XY_CHANGED, this.__targetXYChanged, this);\r\n            target.removeEventListener(GObject.SIZE_CHANGED, this.__targetSizeChanged, this);\r\n            target.removeEventListener(GObject.SIZE_DELAY_CHANGE, this.__targetSizeWillChange, this);\r\n        }\r\n\r\n        private __targetXYChanged(evt: Event): void {\r\n            if (this._owner.relations.handling != null || this._owner.group != null && this._owner.group._updating) {\r\n                this._targetX = this._target.x;\r\n                this._targetY = this._target.y;\r\n                return;\r\n            }\r\n\r\n            this._owner.relations.handling = this._target;\r\n\r\n            var ox: number = this._owner.x;\r\n            var oy: number = this._owner.y;\r\n            var dx: number = this._target.x - this._targetX;\r\n            var dy: number = this._target.y - this._targetY;\r\n            var length: number = this._defs.length;\r\n            for (var i: number = 0; i < length; i++) {\r\n                var info: RelationDef = this._defs[i];\r\n                this.applyOnXYChanged(info, dx, dy);\r\n            }\r\n            this._targetX = this._target.x;\r\n            this._targetY = this._target.y;\r\n\r\n            if (ox != this._owner.x || oy != this._owner.y) {\r\n                ox = this._owner.x - ox;\r\n                oy = this._owner.y - oy;\r\n\r\n                this._owner.updateGearFromRelations(1, ox, oy);\r\n\r\n                if (this._owner.parent) {\r\n                    var len: number = this._owner.parent._transitions.length;\r\n                    if (len > 0) {\r\n                        for (var i: number = 0; i < len; ++i) {\r\n                            this._owner.parent._transitions[i].updateFromRelations(this._owner.id, ox, oy);\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n            this._owner.relations.handling = null;\r\n        }\r\n\r\n        private __targetSizeChanged(evt: Event): void {\r\n            if (this._owner.relations.handling != null)\r\n                return;\r\n\r\n            this._owner.relations.handling = this._target;\r\n\r\n            var ox: number = this._owner.x;\r\n            var oy: number = this._owner.y;\r\n            var ow: number = this._owner._rawWidth;\r\n            var oh: number = this._owner._rawHeight;\r\n            var length: number = this._defs.length;\r\n            for (var i: number = 0; i < length; i++) {\r\n                var info: RelationDef = this._defs[i];\r\n                this.applyOnSizeChanged(info);\r\n            }\r\n            this._targetWidth = this._target._width;\r\n            this._targetHeight = this._target._height;\r\n\r\n            if (ox != this._owner.x || oy != this._owner.y) {\r\n                ox = this._owner.x - ox;\r\n                oy = this._owner.y - oy;\r\n\r\n                this._owner.updateGearFromRelations(1, ox, oy);\r\n\r\n                if (this._owner.parent) {\r\n                    var len: number = this._owner.parent._transitions.length;\r\n                    if (len > 0) {\r\n                        for (var i: number = 0; i < len; ++i) {\r\n                            this._owner.parent._transitions[i].updateFromRelations(this._owner.id, ox, oy);\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n\r\n            if (ow != this._owner._rawWidth || oh != this._owner._rawHeight) {\r\n                ow = this._owner._rawWidth - ow;\r\n                oh = this._owner._rawHeight - oh;\r\n\r\n                this._owner.updateGearFromRelations(2, ow, oh);\r\n            }\r\n\r\n            this._owner.relations.handling = null;\r\n        }\r\n\r\n        private __targetSizeWillChange(evt: Event): void {\r\n            this._owner.relations.sizeDirty = true;\r\n        }\r\n    }\r\n\r\n    export class RelationDef {\r\n        public percent: boolean;\r\n        public type: number;\r\n        public axis: number;\r\n\r\n        public constructor() {\r\n        }\r\n\r\n        public copyFrom(source: RelationDef): void {\r\n            this.percent = source.percent;\r\n            this.type = source.type;\r\n            this.axis = source.axis;\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "source/src/Relations.ts",
    "content": "\nmodule fgui {\n\n    export class Relations {\n        private _owner: GObject;\n        private _items: Array<RelationItem>;\n\n        public handling: GObject;\n        public sizeDirty: boolean;\n\n        public constructor(owner: GObject) {\n            this._owner = owner;\n            this._items = new Array<RelationItem>();\n        }\n\n        public add(target: GObject, relationType: number, usePercent?: boolean): void {\n            var length: number = this._items.length;\n            for (var i: number = 0; i < length; i++) {\n                var item: RelationItem = this._items[i];\n                if (item.target == target) {\n                    item.add(relationType, usePercent);\n                    return;\n                }\n            }\n            var newItem: RelationItem = new RelationItem(this._owner);\n            newItem.target = target;\n            newItem.add(relationType, usePercent);\n            this._items.push(newItem);\n        }\n\n        public remove(target: GObject, relationType?: number): void {\n            relationType = relationType || 0;\n            var cnt: number = this._items.length;\n            var i: number = 0;\n            while (i < cnt) {\n                var item: RelationItem = this._items[i];\n                if (item.target == target) {\n                    item.remove(relationType);\n                    if (item.isEmpty) {\n                        item.dispose();\n                        this._items.splice(i, 1);\n                        cnt--;\n                    }\n                    else\n                        i++;\n                }\n                else\n                    i++;\n            }\n        }\n\n        public contains(target: GObject): boolean {\n            var length: number = this._items.length;\n            for (var i: number = 0; i < length; i++) {\n                var item: RelationItem = this._items[i];\n                if (item.target == target)\n                    return true;\n            }\n            return false;\n        }\n\n        public clearFor(target: GObject): void {\n            var cnt: number = this._items.length;\n            var i: number = 0;\n            while (i < cnt) {\n                var item: RelationItem = this._items[i];\n                if (item.target == target) {\n                    item.dispose();\n                    this._items.splice(i, 1);\n                    cnt--;\n                }\n                else\n                    i++;\n            }\n        }\n\n        public clearAll(): void {\n            var length: number = this._items.length;\n            for (var i: number = 0; i < length; i++) {\n                var item: RelationItem = this._items[i];\n                item.dispose();\n            }\n            this._items.length = 0;\n        }\n\n        public copyFrom(source: Relations): void {\n            this.clearAll();\n\n            var arr: Array<RelationItem> = source._items;\n            var length: number = arr.length;\n            for (var i: number = 0; i < length; i++) {\n                var ri: RelationItem = arr[i];\n                var item: RelationItem = new RelationItem(this._owner);\n                item.copyFrom(ri);\n                this._items.push(item);\n            }\n        }\n\n        public dispose(): void {\n            this.clearAll();\n        }\n\n        public onOwnerSizeChanged(dWidth: number, dHeight: number, applyPivot: boolean): void {\n            if (this._items.length == 0)\n                return;\n\n            var length: number = this._items.length;\n            for (var i: number = 0; i < length; i++) {\n                var item: RelationItem = this._items[i];\n                item.applyOnSelfResized(dWidth, dHeight, applyPivot);\n            }\n        }\n\n        public ensureRelationsSizeCorrect(): void {\n            if (this._items.length == 0)\n                return;\n\n            this.sizeDirty = false;\n            var length: number = this._items.length;\n            for (var i: number = 0; i < length; i++) {\n                var item: RelationItem = this._items[i];\n                item.target.ensureSizeCorrect();\n            }\n        }\n\n        public get empty(): boolean {\n            return this._items.length == 0;\n        }\n\n        public setup(buffer: ByteBuffer, parentToChild: boolean): void {\n            var cnt: number = buffer.readByte();\n            var target: GObject;\n            for (var i: number = 0; i < cnt; i++) {\n                var targetIndex: number = buffer.readShort();\n                if (targetIndex == -1)\n                    target = this._owner.parent;\n                else if (parentToChild)\n                    target = (<GComponent>this._owner).getChildAt(targetIndex);\n                else\n                    target = this._owner.parent.getChildAt(targetIndex);\n\n                var newItem: RelationItem = new RelationItem(this._owner);\n                newItem.target = target;\n                this._items.push(newItem);\n\n                var cnt2: number = buffer.readByte();\n                for (var j: number = 0; j < cnt2; j++) {\n                    var rt: number = buffer.readByte();\n                    var usePercent: boolean = buffer.readBool();\n                    newItem.internalAdd(rt, usePercent);\n                }\n            }\n        }\n    }\n}"
  },
  {
    "path": "source/src/ScrollPane.ts",
    "content": "\nmodule fgui {\n\n    export class ScrollPane extends egret.EventDispatcher {\n        private _owner: GComponent;\n        private _container: egret.DisplayObjectContainer;\n        private _maskContainer: egret.DisplayObjectContainer;\n        private _alignContainer?: egret.DisplayObjectContainer;\n\n        private _scrollType: number;\n        private _scrollStep: number;\n        private _decelerationRate: number;\n        private _scrollBarMargin: Margin;\n        private _bouncebackEffect: boolean;\n        private _touchEffect: boolean;\n        private _scrollBarDisplayAuto?: boolean;\n        private _vScrollNone: boolean;\n        private _hScrollNone: boolean;\n        private _needRefresh: boolean;\n        private _refreshBarAxis: string;\n\n        private _displayOnLeft?: boolean;\n        private _snapToItem?: boolean;\n        public _displayInDemand?: boolean;\n        private _pageMode?: boolean;\n        private _inertiaDisabled?: boolean;\n        private _floating?: boolean;\n        private _dontClipMargin?: boolean;\n\n        private _xPos: number;\n        private _yPos: number;\n\n        private _viewSize: egret.Point;\n        private _contentSize: egret.Point;\n        private _overlapSize: egret.Point;\n        private _pageSize: egret.Point;\n        private _containerPos: egret.Point;\n        private _beginTouchPos: egret.Point;\n        private _lastTouchPos: egret.Point;\n        private _lastTouchGlobalPos: egret.Point;\n        private _velocity: egret.Point;\n        private _velocityScale: number;\n        private _lastMoveTime: number;\n        private _isHoldAreaDone: boolean;\n        private _aniFlag: number;\n        public _loop: number;\n        private _headerLockedSize: number;\n        private _footerLockedSize: number;\n        private _refreshEventDispatching: boolean;\n        private _dragged: boolean;\n\n        private _tweening: number;\n        private _tweenTime: egret.Point;\n        private _tweenDuration: egret.Point;\n        private _tweenStart: egret.Point;\n        private _tweenChange: egret.Point;\n\n        private _pageController?: Controller;\n\n        private _hzScrollBar?: GScrollBar;\n        private _vtScrollBar?: GScrollBar;\n        private _header?: GComponent;\n        private _footer?: GComponent;\n\n        public static draggingPane: ScrollPane;\n\n        public static SCROLL: string = \"__scroll\";\n        public static SCROLL_END: string = \"__scrollEnd\";\n        public static PULL_DOWN_RELEASE: string = \"pullDownRelease\";\n        public static PULL_UP_RELEASE: string = \"pullUpRelease\";\n\n        public constructor(owner: GComponent) {\n            super();\n\n            this._owner = owner;\n\n            this._maskContainer = new egret.DisplayObjectContainer();\n            this._owner._rootContainer.addChild(this._maskContainer);\n\n            this._container = this._owner._container;\n            this._container.x = 0;\n            this._container.y = 0;\n            this._maskContainer.addChild(this._container);\n\n            this._scrollBarMargin = new Margin();\n            this._xPos = 0;\n            this._yPos = 0;\n            this._aniFlag = 0;\n            this._tweening = 0;\n            this._footerLockedSize = 0;\n            this._headerLockedSize = 0;\n            this._viewSize = new egret.Point();\n            this._contentSize = new egret.Point();\n            this._pageSize = new egret.Point(1, 1);\n            this._overlapSize = new egret.Point();\n            this._tweenTime = new egret.Point();\n            this._tweenStart = new egret.Point();\n            this._tweenDuration = new egret.Point();\n            this._tweenChange = new egret.Point();\n            this._velocity = new egret.Point();\n            this._containerPos = new egret.Point();\n            this._beginTouchPos = new egret.Point();\n            this._lastTouchPos = new egret.Point();\n            this._lastTouchGlobalPos = new egret.Point();\n            this._scrollStep = UIConfig.defaultScrollStep;\n            this._decelerationRate = UIConfig.defaultScrollDecelerationRate;\n\n            this._owner.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__touchBegin, this);\n        }\n\n        public setup(buffer: ByteBuffer): void {\n            this._scrollType = buffer.readByte();\n            var scrollBarDisplay: ScrollBarDisplayType = buffer.readByte();\n            var flags: number = buffer.readInt();\n\n            if (buffer.readBool()) {\n                this._scrollBarMargin.top = buffer.readInt();\n                this._scrollBarMargin.bottom = buffer.readInt();\n                this._scrollBarMargin.left = buffer.readInt();\n                this._scrollBarMargin.right = buffer.readInt();\n            }\n\n            var vtScrollBarRes: string = buffer.readS();\n            var hzScrollBarRes: string = buffer.readS();\n            var headerRes: string = buffer.readS();\n            var footerRes: string = buffer.readS();\n\n            if ((flags & 1) != 0) this._displayOnLeft = true;\n            if ((flags & 2) != 0) this._snapToItem = true;\n            if ((flags & 4) != 0) this._displayInDemand = true;\n            if ((flags & 8) != 0) this._pageMode = true;\n            if (flags & 16)\n                this._touchEffect = true;\n            else if (flags & 32)\n                this._touchEffect = false;\n            else\n                this._touchEffect = UIConfig.defaultScrollTouchEffect;\n            if (flags & 64)\n                this._bouncebackEffect = true;\n            else if (flags & 128)\n                this._bouncebackEffect = false;\n            else\n                this._bouncebackEffect = UIConfig.defaultScrollBounceEffect;\n            if ((flags & 256) != 0) this._inertiaDisabled = true;\n            if ((flags & 512) == 0) this._maskContainer.scrollRect = new egret.Rectangle();\n            if ((flags & 1024) != 0) this._floating = true;\n            if ((flags & 2048) != 0) this._dontClipMargin = true;\n\n            if (scrollBarDisplay == ScrollBarDisplayType.Default)\n                scrollBarDisplay = UIConfig.defaultScrollBarDisplay;\n\n            if (scrollBarDisplay != ScrollBarDisplayType.Hidden) {\n                if (this._scrollType == ScrollType.Both || this._scrollType == ScrollType.Vertical) {\n                    var res: string = vtScrollBarRes ? vtScrollBarRes : UIConfig.verticalScrollBar;\n                    if (res) {\n                        this._vtScrollBar = <GScrollBar>UIPackage.createObjectFromURL(res);\n                        if (!this._vtScrollBar)\n                            throw \"cannot create scrollbar from \" + res;\n                        this._vtScrollBar.setScrollPane(this, true);\n                        this._owner._rootContainer.addChild(this._vtScrollBar.displayObject);\n                    }\n                }\n                if (this._scrollType == ScrollType.Both || this._scrollType == ScrollType.Horizontal) {\n                    var res: string = hzScrollBarRes ? hzScrollBarRes : UIConfig.horizontalScrollBar;\n                    if (res) {\n                        this._hzScrollBar = <GScrollBar>UIPackage.createObjectFromURL(res);\n                        if (!this._hzScrollBar)\n                            throw \"cannot create scrollbar from \" + res;\n                        this._hzScrollBar.setScrollPane(this, false);\n                        this._owner._rootContainer.addChild(this._hzScrollBar.displayObject);\n                    }\n                }\n\n                if (scrollBarDisplay == ScrollBarDisplayType.Auto)\n                    this._scrollBarDisplayAuto = true;\n                if (this._scrollBarDisplayAuto) {\n                    if (this._vtScrollBar)\n                        this._vtScrollBar.displayObject.visible = false;\n                    if (this._hzScrollBar)\n                        this._hzScrollBar.displayObject.visible = false;\n                }\n            }\n\n            if (headerRes) {\n                this._header = <GComponent>UIPackage.createObjectFromURL(headerRes);\n                if (!this._header)\n                    throw \"cannot create scrollPane header from \" + headerRes;\n            }\n\n            if (footerRes) {\n                this._footer = <GComponent>UIPackage.createObjectFromURL(footerRes);\n                if (!this._footer)\n                    throw \"cannot create scrollPane footer from \" + footerRes;\n            }\n\n            if (this._header || this._footer)\n                this._refreshBarAxis = (this._scrollType == ScrollType.Both || this._scrollType == ScrollType.Vertical) ? \"y\" : \"x\";\n\n            this.setSize(this._owner.width, this._owner.height);\n        }\n\n        public dispose(): void {\n            if (this._tweening != 0)\n                GTimers.inst.remove(this.tweenUpdate, this);\n\n            delete this._pageController;\n\n            if (this._hzScrollBar)\n                this._hzScrollBar.dispose();\n            if (this._vtScrollBar)\n                this._vtScrollBar.dispose();\n            if (this._header)\n                this._header.dispose();\n            if (this._footer)\n                this._footer.dispose();\n        }\n\n        public get owner(): GComponent {\n            return this._owner;\n        }\n\n        public get hzScrollBar(): GScrollBar {\n            return this._hzScrollBar;\n        }\n\n        public get vtScrollBar(): GScrollBar {\n            return this._vtScrollBar;\n        }\n\n        public get header(): GComponent {\n            return this._header;\n        }\n\n        public get footer(): GComponent {\n            return this._footer;\n        }\n\n        public get bouncebackEffect(): boolean {\n            return this._bouncebackEffect;\n        }\n\n        public set bouncebackEffect(sc: boolean) {\n            this._bouncebackEffect = sc;\n        }\n\n        public get touchEffect(): boolean {\n            return this._touchEffect;\n        }\n\n        public set touchEffect(sc: boolean) {\n            this._touchEffect = sc;\n        }\n\n        public set scrollStep(val: number) {\n            this._scrollStep = val;\n            if (this._scrollStep == 0)\n                this._scrollStep = UIConfig.defaultScrollStep;\n        }\n\n        public get decelerationRate(): number {\n            return this._decelerationRate;\n        }\n\n        public set decelerationRate(val: number) {\n            this._decelerationRate = val;\n        }\n\n        public get scrollStep(): number {\n            return this._scrollStep;\n        }\n\n        public get snapToItem(): boolean {\n            return this._snapToItem;\n        }\n\n        public set snapToItem(value: boolean) {\n            this._snapToItem = value;\n        }\n\n        public get isDragged(): boolean {\n            return this._dragged;\n        }\n\n        public get percX(): number {\n            return this._overlapSize.x == 0 ? 0 : this._xPos / this._overlapSize.x;\n        }\n\n        public set percX(value: number) {\n            this.setPercX(value, false);\n        }\n\n        public setPercX(value: number, ani: boolean = false): void {\n            this._owner.ensureBoundsCorrect();\n            this.setPosX(this._overlapSize.x * ToolSet.clamp01(value), ani);\n        }\n\n        public get percY(): number {\n            return this._overlapSize.y == 0 ? 0 : this._yPos / this._overlapSize.y;\n        }\n\n        public set percY(value: number) {\n            this.setPercY(value, false);\n        }\n\n        public setPercY(value: number, ani: boolean = false): void {\n            this._owner.ensureBoundsCorrect();\n            this.setPosY(this._overlapSize.y * ToolSet.clamp01(value), ani);\n        }\n\n        public get posX(): number {\n            return this._xPos;\n        }\n\n        public set posX(value: number) {\n            this.setPosX(value, false);\n        }\n\n        public setPosX(value: number, ani?: boolean): void {\n            this._owner.ensureBoundsCorrect();\n\n            if (this._loop == 1)\n                value = this.loopCheckingNewPos(value, \"x\");\n\n            value = ToolSet.clamp(value, 0, this._overlapSize.x);\n            if (value != this._xPos) {\n                this._xPos = value;\n                this.posChanged(ani);\n            }\n        }\n\n        public get posY(): number {\n            return this._yPos;\n        }\n\n        public set posY(value: number) {\n            this.setPosY(value, false);\n        }\n\n        public setPosY(value: number, ani?: boolean): void {\n            this._owner.ensureBoundsCorrect();\n\n            if (this._loop == 1)\n                value = this.loopCheckingNewPos(value, \"y\");\n\n            value = ToolSet.clamp(value, 0, this._overlapSize.y);\n            if (value != this._yPos) {\n                this._yPos = value;\n                this.posChanged(ani);\n            }\n        }\n\n        public get contentWidth(): number {\n            return this._contentSize.x;\n        }\n\n        public get contentHeight(): number {\n            return this._contentSize.y;\n        }\n\n        public get viewWidth(): number {\n            return this._viewSize.x;\n        }\n\n        public set viewWidth(value: number) {\n            value = value + this._owner.margin.left + this._owner.margin.right;\n            if (this._vtScrollBar && !this._floating)\n                value += this._vtScrollBar.width;\n            this._owner.width = value;\n        }\n\n        public get viewHeight(): number {\n            return this._viewSize.y;\n        }\n\n        public set viewHeight(value: number) {\n            value = value + this._owner.margin.top + this._owner.margin.bottom;\n            if (this._hzScrollBar && !this._floating)\n                value += this._hzScrollBar.height;\n            this._owner.height = value;\n        }\n\n        public get currentPageX(): number {\n            if (!this._pageMode)\n                return 0;\n\n            var page: number = Math.floor(this._xPos / this._pageSize.x);\n            if (this._xPos - page * this._pageSize.x > this._pageSize.x * 0.5)\n                page++;\n\n            return page;\n        }\n\n        public set currentPageX(value: number) {\n            this.setCurrentPageX(value, false);\n        }\n\n        public get currentPageY(): number {\n            if (!this._pageMode)\n                return 0;\n\n            var page: number = Math.floor(this._yPos / this._pageSize.y);\n            if (this._yPos - page * this._pageSize.y > this._pageSize.y * 0.5)\n                page++;\n\n            return page;\n        }\n\n        public set currentPageY(value: number) {\n            this.setCurrentPageY(value, false);\n        }\n\n        public setCurrentPageX(value: number, ani?: boolean): void {\n            if (!this._pageMode)\n                return;\n\n            this._owner.ensureBoundsCorrect();\n\n            if (this._overlapSize.x > 0)\n                this.setPosX(value * this._pageSize.x, ani);\n        }\n\n        public setCurrentPageY(value: number, ani?: boolean): void {\n            if (!this._pageMode)\n                return;\n\n            this._owner.ensureBoundsCorrect();\n\n            if (this._overlapSize.y > 0)\n                this.setPosY(value * this._pageSize.y, ani);\n        }\n\n        public get isBottomMost(): boolean {\n            return this._yPos == this._overlapSize.y || this._overlapSize.y == 0;\n        }\n\n        public get isRightMost(): boolean {\n            return this._xPos == this._overlapSize.x || this._overlapSize.x == 0;\n        }\n\n        public get pageController(): Controller {\n            return this._pageController;\n        }\n\n        public set pageController(value: Controller) {\n            this._pageController = value;\n        }\n\n        public get scrollingPosX(): number {\n            return ToolSet.clamp(-this._container.x, 0, this._overlapSize.x);\n        }\n\n        public get scrollingPosY(): number {\n            return ToolSet.clamp(-this._container.y, 0, this._overlapSize.y);\n        }\n\n        public scrollTop(ani?: boolean): void {\n            this.setPercY(0, ani);\n        }\n\n        public scrollBottom(ani?: boolean): void {\n            this.setPercY(1, ani);\n        }\n\n        public scrollUp(ratio?: number, ani?: boolean): void {\n            ratio = ratio || 1;\n            if (this._pageMode)\n                this.setPosY(this._yPos - this._pageSize.y * ratio, ani);\n            else\n                this.setPosY(this._yPos - this._scrollStep * ratio, ani);\n        }\n\n        public scrollDown(ratio?: number, ani?: boolean): void {\n            ratio = ratio || 1;\n            if (this._pageMode)\n                this.setPosY(this._yPos + this._pageSize.y * ratio, ani);\n            else\n                this.setPosY(this._yPos + this._scrollStep * ratio, ani);\n        }\n\n        public scrollLeft(ratio?: number, ani?: boolean): void {\n            ratio = ratio || 1;\n            if (this._pageMode)\n                this.setPosX(this._xPos - this._pageSize.x * ratio, ani);\n            else\n                this.setPosX(this._xPos - this._scrollStep * ratio, ani);\n        }\n\n        public scrollRight(ratio?: number, ani?: boolean): void {\n            ratio = ratio || 1;\n            if (this._pageMode)\n                this.setPosX(this._xPos + this._pageSize.x * ratio, ani);\n            else\n                this.setPosX(this._xPos + this._scrollStep * ratio, ani);\n        }\n\n        public scrollToView(target: egret.Rectangle | GObject, ani?: boolean, setFirst?: boolean): void {\n            this._owner.ensureBoundsCorrect();\n            if (this._needRefresh)\n                this.refresh();\n\n            var rect: egret.Rectangle;\n            if (target instanceof GObject) {\n                if (target.parent != this._owner) {\n                    target.parent.localToGlobalRect(target.x, target.y,\n                        target.width, target.height, s_rect);\n                    rect = this._owner.globalToLocalRect(s_rect.x, s_rect.y,\n                        s_rect.width, s_rect.height, s_rect);\n                }\n                else {\n                    rect = s_rect;\n                    rect.setTo(target.x, target.y, target.width, target.height);\n                }\n            }\n            else\n                rect = target;\n\n            if (this._overlapSize.y > 0) {\n                var bottom: number = this._yPos + this._viewSize.y;\n                if (setFirst || rect.y <= this._yPos || rect.height >= this._viewSize.y) {\n                    if (this._pageMode)\n                        this.setPosY(Math.floor(rect.y / this._pageSize.y) * this._pageSize.y, ani);\n                    else\n                        this.setPosY(rect.y, ani);\n                }\n                else if (rect.y + rect.height > bottom) {\n                    if (this._pageMode)\n                        this.setPosY(Math.floor(rect.y / this._pageSize.y) * this._pageSize.y, ani);\n                    else if (rect.height <= this._viewSize.y / 2)\n                        this.setPosY(rect.y + rect.height * 2 - this._viewSize.y, ani);\n                    else\n                        this.setPosY(rect.y + rect.height - this._viewSize.y, ani);\n                }\n            }\n            if (this._overlapSize.x > 0) {\n                var right: number = this._xPos + this._viewSize.x;\n                if (setFirst || rect.x <= this._xPos || rect.width >= this._viewSize.x) {\n                    if (this._pageMode)\n                        this.setPosX(Math.floor(rect.x / this._pageSize.x) * this._pageSize.x, ani);\n                    else\n                        this.setPosX(rect.x, ani);\n                }\n                else if (rect.x + rect.width > right) {\n                    if (this._pageMode)\n                        this.setPosX(Math.floor(rect.x / this._pageSize.x) * this._pageSize.x, ani);\n                    else if (rect.width <= this._viewSize.x / 2)\n                        this.setPosX(rect.x + rect.width * 2 - this._viewSize.x, ani);\n                    else\n                        this.setPosX(rect.x + rect.width - this._viewSize.x, ani);\n                }\n            }\n\n            if (!ani && this._needRefresh)\n                this.refresh();\n        }\n\n        public isChildInView(obj: GObject): boolean {\n            if (this._overlapSize.y > 0) {\n                var dist: number = obj.y + this._container.y;\n                if (dist < -obj.height || dist > this._viewSize.y)\n                    return false;\n            }\n\n            if (this._overlapSize.x > 0) {\n                dist = obj.x + this._container.x;\n                if (dist < -obj.width || dist > this._viewSize.x)\n                    return false;\n            }\n\n            return true;\n        }\n\n        public cancelDragging(): void {\n            this._owner.displayObject.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__touchMove, this);\n            this._owner.displayObject.removeEventListener(egret.TouchEvent.TOUCH_END, this.__touchEnd, this);\n            this._owner.displayObject.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.__touchTap, this);\n\n            if (ScrollPane.draggingPane == this)\n                ScrollPane.draggingPane = null;\n\n            _gestureFlag = 0;\n            this._dragged = false;\n            this._maskContainer.touchChildren = true;\n        }\n\n        public lockHeader(size: number): void {\n            if (this._headerLockedSize == size)\n                return;\n\n            this._headerLockedSize = size;\n\n            if (!this._refreshEventDispatching && this._container[this._refreshBarAxis] >= 0) {\n                this._tweenStart.setTo(this._container.x, this._container.y);\n                this._tweenChange.setTo(0, 0);\n                this._tweenChange[this._refreshBarAxis] = this._headerLockedSize - this._tweenStart[this._refreshBarAxis];\n                this._tweenDuration.setTo(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT);\n                this.startTween(2);\n            }\n        }\n\n        public lockFooter(size: number): void {\n            if (this._footerLockedSize == size)\n                return;\n\n            this._footerLockedSize = size;\n\n            if (!this._refreshEventDispatching && this._container[this._refreshBarAxis] <= -this._overlapSize[this._refreshBarAxis]) {\n                this._tweenStart.setTo(this._container.x, this._container.y);\n                this._tweenChange.setTo(0, 0);\n                var max: number = this._overlapSize[this._refreshBarAxis];\n                if (max == 0)\n                    max = Math.max(this._contentSize[this._refreshBarAxis] + this._footerLockedSize - this._viewSize[this._refreshBarAxis], 0);\n                else\n                    max += this._footerLockedSize;\n                this._tweenChange[this._refreshBarAxis] = -max - this._tweenStart[this._refreshBarAxis];\n                this._tweenDuration.setTo(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT);\n                this.startTween(2);\n            }\n        }\n\n        public onOwnerSizeChanged(): void {\n            this.setSize(this._owner.width, this._owner.height);\n            this.posChanged(false);\n        }\n\n        public handleControllerChanged(c: Controller): void {\n            if (this._pageController == c) {\n                if (this._scrollType == ScrollType.Horizontal)\n                    this.setCurrentPageX(c.selectedIndex, true);\n                else\n                    this.setCurrentPageY(c.selectedIndex, true);\n            }\n        }\n\n        private updatePageController(): void {\n            if (this._pageController && !this._pageController.changing) {\n                var index: number;\n                if (this._scrollType == ScrollType.Horizontal)\n                    index = this.currentPageX;\n                else\n                    index = this.currentPageY;\n                if (index < this._pageController.pageCount) {\n                    var c: Controller = this._pageController;\n                    this._pageController = null; //防止HandleControllerChanged的调用\n                    c.selectedIndex = index;\n                    this._pageController = c;\n                }\n            }\n        }\n\n        public adjustMaskContainer(): void {\n            var mx: number = 0, my: number = 0;\n            if (this._dontClipMargin) {\n                if (this._displayOnLeft && this._vtScrollBar && !this._floating)\n                    mx = this._vtScrollBar.width;\n            }\n            else {\n                if (this._displayOnLeft && this._vtScrollBar && !this._floating)\n                    mx = this._owner.margin.left + this._vtScrollBar.width;\n                else\n                    mx = this._owner.margin.left;\n                my = this._owner.margin.top;\n            }\n\n            this._maskContainer.x = mx;\n            this._maskContainer.y = my;\n\n            mx = this._owner._alignOffset.x;\n            my = this._owner._alignOffset.y;\n\n            if (mx != 0 || my != 0 || this._dontClipMargin) {\n                if (!this._alignContainer) {\n                    this._alignContainer = new egret.DisplayObjectContainer();\n                    this._maskContainer.addChild(this._alignContainer);\n                    this._alignContainer.addChild(this._container);\n                }\n            }\n\n            if (this._alignContainer) {\n                if (this._dontClipMargin) {\n                    mx += this._owner.margin.left;\n                    my += this._owner.margin.top;\n                }\n                this._alignContainer.x = mx;\n                this._alignContainer.y = my;\n            }\n        }\n\n        public setSize(aWidth: number, aHeight: number): void {\n            this.adjustMaskContainer();\n\n            if (this._hzScrollBar) {\n                this._hzScrollBar.y = aHeight - this._hzScrollBar.height;\n                if (this._vtScrollBar && !this._vScrollNone) {\n                    this._hzScrollBar.width = aWidth - this._vtScrollBar.width - this._scrollBarMargin.left - this._scrollBarMargin.right;\n                    if (this._displayOnLeft)\n                        this._hzScrollBar.x = this._scrollBarMargin.left + this._vtScrollBar.width;\n                    else\n                        this._hzScrollBar.x = this._scrollBarMargin.left;\n                }\n                else {\n                    this._hzScrollBar.width = aWidth - this._scrollBarMargin.left - this._scrollBarMargin.right;\n                    this._hzScrollBar.x = this._scrollBarMargin.left;\n                }\n            }\n            if (this._vtScrollBar) {\n                if (!this._displayOnLeft)\n                    this._vtScrollBar.x = aWidth - this._vtScrollBar.width;\n                if (this._hzScrollBar)\n                    this._vtScrollBar.height = aHeight - this._hzScrollBar.height - this._scrollBarMargin.top - this._scrollBarMargin.bottom;\n                else\n                    this._vtScrollBar.height = aHeight - this._scrollBarMargin.top - this._scrollBarMargin.bottom;\n                this._vtScrollBar.y = this._scrollBarMargin.top;\n            }\n\n            this._viewSize.x = aWidth;\n            this._viewSize.y = aHeight;\n            if (this._hzScrollBar && !this._floating)\n                this._viewSize.y -= this._hzScrollBar.height;\n            if (this._vtScrollBar && !this._floating)\n                this._viewSize.x -= this._vtScrollBar.width;\n            this._viewSize.x -= (this._owner.margin.left + this._owner.margin.right);\n            this._viewSize.y -= (this._owner.margin.top + this._owner.margin.bottom);\n\n            this._viewSize.x = Math.max(1, this._viewSize.x);\n            this._viewSize.y = Math.max(1, this._viewSize.y);\n            this._pageSize.x = this._viewSize.x;\n            this._pageSize.y = this._viewSize.y;\n\n            this.handleSizeChanged();\n        }\n\n        public setContentSize(aWidth: number, aHeight: number): void {\n            if (this._contentSize.x == aWidth && this._contentSize.y == aHeight)\n                return;\n\n            this._contentSize.x = aWidth;\n            this._contentSize.y = aHeight;\n            this.handleSizeChanged();\n        }\n\n        public changeContentSizeOnScrolling(deltaWidth: number, deltaHeight: number,\n            deltaPosX: number, deltaPosY: number): void {\n            var isRightmost: boolean = this._xPos == this._overlapSize.x;\n            var isBottom: boolean = this._yPos == this._overlapSize.y;\n\n            this._contentSize.x += deltaWidth;\n            this._contentSize.y += deltaHeight;\n            this.handleSizeChanged();\n\n            if (this._tweening == 1) {\n                //如果原来滚动位置是贴边，加入处理继续贴边。\n                if (deltaWidth != 0 && isRightmost && this._tweenChange.x < 0) {\n                    this._xPos = this._overlapSize.x;\n                    this._tweenChange.x = -this._xPos - this._tweenStart.x;\n                }\n\n                if (deltaHeight != 0 && isBottom && this._tweenChange.y < 0) {\n                    this._yPos = this._overlapSize.y;\n                    this._tweenChange.y = -this._yPos - this._tweenStart.y;\n                }\n            }\n            else if (this._tweening == 2) {\n                //重新调整起始位置，确保能够顺滑滚下去\n                if (deltaPosX != 0) {\n                    this._container.x -= deltaPosX;\n                    this._tweenStart.x -= deltaPosX;\n                    this._xPos = -this._container.x;\n                }\n                if (deltaPosY != 0) {\n                    this._container.y -= deltaPosY;\n                    this._tweenStart.y -= deltaPosY;\n                    this._yPos = -this._container.y;\n                }\n            }\n            else if (this._dragged) {\n                if (deltaPosX != 0) {\n                    this._container.x -= deltaPosX;\n                    this._containerPos.x -= deltaPosX;\n                    this._xPos = -this._container.x;\n                }\n                if (deltaPosY != 0) {\n                    this._container.y -= deltaPosY;\n                    this._containerPos.y -= deltaPosY;\n                    this._yPos = -this._container.y;\n                }\n            }\n            else {\n                //如果原来滚动位置是贴边，加入处理继续贴边。\n                if (deltaWidth != 0 && isRightmost) {\n                    this._xPos = this._overlapSize.x;\n                    this._container.x = -this._xPos;\n                }\n\n                if (deltaHeight != 0 && isBottom) {\n                    this._yPos = this._overlapSize.y;\n                    this._container.y = -this._yPos;\n                }\n            }\n\n            if (this._pageMode)\n                this.updatePageController();\n        }\n\n        private handleSizeChanged(): void {\n            if (this._displayInDemand) {\n                this._vScrollNone = this._contentSize.y <= this._viewSize.y;\n                this._hScrollNone = this._contentSize.x <= this._viewSize.x;\n            }\n\n            if (this._vtScrollBar) {\n                if (this._contentSize.y == 0)\n                    this._vtScrollBar.setDisplayPerc(0);\n                else\n                    this._vtScrollBar.setDisplayPerc(Math.min(1, this._viewSize.y / this._contentSize.y));\n            }\n            if (this._hzScrollBar) {\n                if (this._contentSize.x == 0)\n                    this._hzScrollBar.setDisplayPerc(0);\n                else\n                    this._hzScrollBar.setDisplayPerc(Math.min(1, this._viewSize.x / this._contentSize.x));\n            }\n\n            this.updateScrollBarVisible();\n\n            var rect: egret.Rectangle = this._maskContainer.scrollRect;\n            if (rect) {\n                rect.width = this._viewSize.x;\n                rect.height = this._viewSize.y;\n                if (this._vScrollNone && this._vtScrollBar)\n                    rect.width += this._vtScrollBar.width;\n                if (this._hScrollNone && this._hzScrollBar)\n                    rect.height += this._hzScrollBar.height;\n                if (this._dontClipMargin) {\n                    rect.width += (this._owner.margin.left + this._owner.margin.right);\n                    rect.height += (this._owner.margin.top + this._owner.margin.bottom);\n                }\n                this._maskContainer.scrollRect = rect;\n            }\n\n            if (this._scrollType == ScrollType.Horizontal || this._scrollType == ScrollType.Both)\n                this._overlapSize.x = Math.ceil(Math.max(0, this._contentSize.x - this._viewSize.x));\n            else\n                this._overlapSize.x = 0;\n            if (this._scrollType == ScrollType.Vertical || this._scrollType == ScrollType.Both)\n                this._overlapSize.y = Math.ceil(Math.max(0, this._contentSize.y - this._viewSize.y));\n            else\n                this._overlapSize.y = 0;\n\n            //边界检查\n            this._xPos = ToolSet.clamp(this._xPos, 0, this._overlapSize.x);\n            this._yPos = ToolSet.clamp(this._yPos, 0, this._overlapSize.y);\n            if (this._refreshBarAxis != null) {\n                var max: number = this._overlapSize[this._refreshBarAxis];\n                if (max == 0)\n                    max = Math.max(this._contentSize[this._refreshBarAxis] + this._footerLockedSize - this._viewSize[this._refreshBarAxis], 0);\n                else\n                    max += this._footerLockedSize;\n\n                if (this._refreshBarAxis == \"x\") {\n                    this._container.x = ToolSet.clamp(this._container.x, -max, this._headerLockedSize);\n                    this._container.y = ToolSet.clamp(this._container.y, -this._overlapSize.y, 0);\n                }\n                else {\n                    this._container.x = ToolSet.clamp(this._container.x, -this._overlapSize.x, 0);\n                    this._container.y = ToolSet.clamp(this._container.y, -max, this._headerLockedSize);\n                }\n\n                if (this._header) {\n                    if (this._refreshBarAxis == \"x\")\n                        this._header.height = this._viewSize.y;\n                    else\n                        this._header.width = this._viewSize.x;\n                }\n\n                if (this._footer) {\n                    if (this._refreshBarAxis == \"y\")\n                        this._footer.height = this._viewSize.y;\n                    else\n                        this._footer.width = this._viewSize.x;\n                }\n            }\n            else {\n                this._container.x = ToolSet.clamp(this._container.x, -this._overlapSize.x, 0);\n                this._container.y = ToolSet.clamp(this._container.y, -this._overlapSize.y, 0);\n            }\n\n            this.updateScrollBarPos();\n            if (this._pageMode)\n                this.updatePageController();\n        }\n\n        private posChanged(ani: boolean): void {\n            if (this._aniFlag == 0)\n                this._aniFlag = ani ? 1 : -1;\n            else if (this._aniFlag == 1 && !ani)\n                this._aniFlag = -1;\n\n            this._needRefresh = true;\n            GTimers.inst.callLater(this.refresh, this);\n            if (this._tweening != 0)\n                this.killTween();\n        }\n\n        private refresh(): void {\n            this._needRefresh = false;\n            GTimers.inst.remove(this.refresh, this);\n\n            if (this._pageMode || this._snapToItem) {\n                sEndPos.setTo(-this._xPos, -this._yPos);\n                this.alignPosition(sEndPos, false);\n                this._xPos = -sEndPos.x;\n                this._yPos = -sEndPos.y;\n            }\n\n            this.refresh2();\n\n            this.dispatchEventWith(ScrollPane.SCROLL);\n            if (this._needRefresh) //在onScroll事件里开发者可能修改位置，这里再刷新一次，避免闪烁\n            {\n                this._needRefresh = false;\n                GTimers.inst.remove(this.refresh, this);\n\n                this.refresh2();\n            }\n\n            this.updateScrollBarPos();\n            this._aniFlag = 0;\n        }\n\n        private refresh2() {\n            if (this._aniFlag == 1 && !this._dragged) {\n                var posX: number;\n                var posY: number;\n\n                if (this._overlapSize.x > 0)\n                    posX = -Math.floor(this._xPos);\n                else {\n                    if (this._container.x != 0)\n                        this._container.x = 0;\n                    posX = 0;\n                }\n                if (this._overlapSize.y > 0)\n                    posY = -Math.floor(this._yPos);\n                else {\n                    if (this._container.y != 0)\n                        this._container.y = 0;\n                    posY = 0;\n                }\n\n                if (posX != this._container.x || posY != this._container.y) {\n                    this._tweenDuration.setTo(TWEEN_TIME_GO, TWEEN_TIME_GO);\n                    this._tweenStart.setTo(this._container.x, this._container.y);\n                    this._tweenChange.setTo(posX - this._tweenStart.x, posY - this._tweenStart.y);\n                    this.startTween(1);\n                }\n                else if (this._tweening != 0)\n                    this.killTween();\n            }\n            else {\n                if (this._tweening != 0)\n                    this.killTween();\n\n                this._container.x = Math.floor(-this._xPos);\n                this._container.y = Math.floor(-this._yPos);\n\n                this.loopCheckingCurrent();\n            }\n\n            if (this._pageMode)\n                this.updatePageController();\n        }\n\n        private __touchBegin(evt: egret.TouchEvent): void {\n            if (!this._touchEffect)\n                return;\n\n            if (this._tweening != 0) {\n                this.killTween();\n                this._dragged = true;\n            }\n            else\n                this._dragged = false;\n\n            var pt: egret.Point = this._owner.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n\n            this._containerPos.setTo(this._container.x, this._container.y);\n            this._beginTouchPos.setTo(pt.x, pt.y);\n            this._lastTouchPos.setTo(pt.x, pt.y);\n            this._lastTouchGlobalPos.setTo(evt.stageX, evt.stageY);\n            this._isHoldAreaDone = false;\n            this._velocity.setTo(0, 0);\n            this._velocityScale = 1;\n            this._lastMoveTime = egret.getTimer() / 1000;\n\n            this._owner.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_MOVE, this.__touchMove, this);\n            this._owner.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_END, this.__touchEnd, this);\n            this._owner.displayObject.stage.addEventListener(egret.TouchEvent.TOUCH_TAP, this.__touchTap, this);\n        }\n\n        private __touchMove(evt: egret.TouchEvent): void {\n            if (this._owner.displayObject.stage == null)\n                return;\n\n            if (!this._touchEffect)\n                return;\n\n            if (ScrollPane.draggingPane && ScrollPane.draggingPane != this || GObject.draggingObject) //已经有其他拖动\n                return;\n\n            var pt: egret.Point = this._owner.globalToLocal(evt.stageX, evt.stageY, s_vec2);\n\n            var sensitivity: number = UIConfig.touchScrollSensitivity;\n            var diff: number, diff2: number;\n            var sv: boolean, sh: boolean, st: boolean;\n\n            if (this._scrollType == ScrollType.Vertical) {\n                if (!this._isHoldAreaDone) {\n                    //表示正在监测垂直方向的手势\n                    _gestureFlag |= 1;\n\n                    diff = Math.abs(this._beginTouchPos.y - pt.y);\n                    if (diff < sensitivity)\n                        return;\n\n                    if ((_gestureFlag & 2) != 0) //已经有水平方向的手势在监测，那么我们用严格的方式检查是不是按垂直方向移动，避免冲突\n                    {\n                        diff2 = Math.abs(this._beginTouchPos.x - pt.x);\n                        if (diff < diff2) //不通过则不允许滚动了\n                            return;\n                    }\n                }\n\n                sv = true;\n            }\n            else if (this._scrollType == ScrollType.Horizontal) {\n                if (!this._isHoldAreaDone) {\n                    _gestureFlag |= 2;\n\n                    diff = Math.abs(this._beginTouchPos.x - pt.x);\n                    if (diff < sensitivity)\n                        return;\n\n                    if ((_gestureFlag & 1) != 0) {\n                        diff2 = Math.abs(this._beginTouchPos.y - pt.y);\n                        if (diff < diff2)\n                            return;\n                    }\n                }\n\n                sh = true;\n            }\n            else {\n                _gestureFlag = 3;\n\n                if (!this._isHoldAreaDone) {\n                    diff = Math.abs(this._beginTouchPos.y - pt.y);\n                    if (diff < sensitivity) {\n                        diff = Math.abs(this._beginTouchPos.x - pt.x);\n                        if (diff < sensitivity)\n                            return;\n                    }\n                }\n\n                sv = sh = true;\n            }\n\n            var newPosX: number = Math.floor(this._containerPos.x + pt.x - this._beginTouchPos.x);\n            var newPosY: number = Math.floor(this._containerPos.y + pt.y - this._beginTouchPos.y);\n\n            if (sv) {\n                if (newPosY > 0) {\n                    if (!this._bouncebackEffect)\n                        this._container.y = 0;\n                    else if (this._header && this._header.maxHeight != 0)\n                        this._container.y = Math.floor(Math.min(newPosY * 0.5, this._header.maxHeight));\n                    else\n                        this._container.y = Math.floor(Math.min(newPosY * 0.5, this._viewSize.y * PULL_RATIO));\n                }\n                else if (newPosY < -this._overlapSize.y) {\n                    if (!this._bouncebackEffect)\n                        this._container.y = -this._overlapSize.y;\n                    else if (this._footer && this._footer.maxHeight > 0)\n                        this._container.y = Math.floor(Math.max((newPosY + this._overlapSize.y) * 0.5, -this._footer.maxHeight) - this._overlapSize.y);\n                    else\n                        this._container.y = Math.floor(Math.max((newPosY + this._overlapSize.y) * 0.5, -this._viewSize.y * PULL_RATIO) - this._overlapSize.y);\n                }\n                else\n                    this._container.y = newPosY;\n            }\n\n            if (sh) {\n                if (newPosX > 0) {\n                    if (!this._bouncebackEffect)\n                        this._container.x = 0;\n                    else if (this._header && this._header.maxWidth != 0)\n                        this._container.x = Math.floor(Math.min(newPosX * 0.5, this._header.maxWidth));\n                    else\n                        this._container.x = Math.floor(Math.min(newPosX * 0.5, this._viewSize.x * PULL_RATIO));\n                }\n                else if (newPosX < 0 - this._overlapSize.x) {\n                    if (!this._bouncebackEffect)\n                        this._container.x = -this._overlapSize.x;\n                    else if (this._footer && this._footer.maxWidth > 0)\n                        this._container.x = Math.floor(Math.max((newPosX + this._overlapSize.x) * 0.5, -this._footer.maxWidth) - this._overlapSize.x);\n                    else\n                        this._container.x = Math.floor(Math.max((newPosX + this._overlapSize.x) * 0.5, -this._viewSize.x * PULL_RATIO) - this._overlapSize.x);\n                }\n                else\n                    this._container.x = newPosX;\n            }\n\n            //更新速度\n            var now: number = egret.getTimer() / 1000;\n            var deltaTime: number = Math.max(now - this._lastMoveTime, 1 / 60);\n            var deltaPositionX: number = pt.x - this._lastTouchPos.x;\n            var deltaPositionY: number = pt.y - this._lastTouchPos.y;\n            if (!sh)\n                deltaPositionX = 0;\n            if (!sv)\n                deltaPositionY = 0;\n            if (deltaTime != 0) {\n                var frameRate: number = this._owner.displayObject.stage.frameRate;\n                var elapsed: number = deltaTime * frameRate - 1;\n                if (elapsed > 1) //速度衰减\n                {\n                    var factor: number = Math.pow(0.833, elapsed);\n                    this._velocity.x = this._velocity.x * factor;\n                    this._velocity.y = this._velocity.y * factor;\n                }\n                this._velocity.x = ToolSet.lerp(this._velocity.x, deltaPositionX * 60 / frameRate / deltaTime, deltaTime * 10);\n                this._velocity.y = ToolSet.lerp(this._velocity.y, deltaPositionY * 60 / frameRate / deltaTime, deltaTime * 10);\n            }\n\n            /*速度计算使用的是本地位移，但在后续的惯性滚动判断中需要用到屏幕位移，所以这里要记录一个位移的比例。\n            */\n            var deltaGlobalPositionX: number = this._lastTouchGlobalPos.x - evt.stageX;\n            var deltaGlobalPositionY: number = this._lastTouchGlobalPos.y - evt.stageY;\n            if (deltaPositionX != 0)\n                this._velocityScale = Math.abs(deltaGlobalPositionX / deltaPositionX);\n            else if (deltaPositionY != 0)\n                this._velocityScale = Math.abs(deltaGlobalPositionY / deltaPositionY);\n\n            this._lastTouchPos.setTo(pt.x, pt.y);\n            this._lastTouchGlobalPos.setTo(evt.stageX, evt.stageY);\n            this._lastMoveTime = now;\n\n            //同步更新pos值\n            if (this._overlapSize.x > 0)\n                this._xPos = ToolSet.clamp(-this._container.x, 0, this._overlapSize.x);\n            if (this._overlapSize.y > 0)\n                this._yPos = ToolSet.clamp(-this._container.y, 0, this._overlapSize.y);\n\n            //循环滚动特别检查\n            if (this._loop != 0) {\n                newPosX = this._container.x;\n                newPosY = this._container.y;\n                if (this.loopCheckingCurrent()) {\n                    this._containerPos.x += this._container.x - newPosX;\n                    this._containerPos.y += this._container.y - newPosY;\n                }\n            }\n\n            ScrollPane.draggingPane = this;\n            this._isHoldAreaDone = true;\n            this._dragged = true;\n            this._maskContainer.touchChildren = false;\n\n            this.updateScrollBarPos();\n            this.updateScrollBarVisible();\n            if (this._pageMode)\n                this.updatePageController();\n\n            this.dispatchEventWith(ScrollPane.SCROLL);\n        }\n\n        private __touchEnd(evt: egret.TouchEvent): void {\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_MOVE, this.__touchMove, this);\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_END, this.__touchEnd, this);\n            evt.currentTarget.removeEventListener(egret.TouchEvent.TOUCH_TAP, this.__touchTap, this);\n\n            if (ScrollPane.draggingPane == this)\n                ScrollPane.draggingPane = null;\n\n            _gestureFlag = 0;\n\n            if (!this._dragged || !this._touchEffect || this._owner.displayObject.stage == null) {\n                this._dragged = false;\n                this._maskContainer.touchChildren = true;\n                return;\n            }\n\n            // touch事件不一定都是以tap结束,拖拽的结束动作是touchEnd,这时需要正确处理isDragged标记位.否则在播放滚动动画时会因为处于拖拽状态而使滚动动画失效\n            this._dragged = false;\n            this._maskContainer.touchChildren = true;\n\n            this._tweenStart.setTo(this._container.x, this._container.y);\n\n            sEndPos.setTo(this._tweenStart.x, this._tweenStart.y);\n            var flag: boolean = false;\n            if (this._container.x > 0) {\n                sEndPos.x = 0;\n                flag = true;\n            }\n            else if (this._container.x < -this._overlapSize.x) {\n                sEndPos.x = -this._overlapSize.x;\n                flag = true;\n            }\n            if (this._container.y > 0) {\n                sEndPos.y = 0;\n                flag = true;\n            }\n            else if (this._container.y < -this._overlapSize.y) {\n                sEndPos.y = -this._overlapSize.y;\n                flag = true;\n            }\n            if (flag) {\n                this._tweenChange.setTo(sEndPos.x - this._tweenStart.x, sEndPos.y - this._tweenStart.y);\n                if (this._tweenChange.x < -UIConfig.touchDragSensitivity || this._tweenChange.y < -UIConfig.touchDragSensitivity) {\n                    this._refreshEventDispatching = true;\n                    this.dispatchEventWith(ScrollPane.PULL_DOWN_RELEASE);\n                    this._refreshEventDispatching = false;\n                }\n                else if (this._tweenChange.x > UIConfig.touchDragSensitivity || this._tweenChange.y > UIConfig.touchDragSensitivity) {\n                    this._refreshEventDispatching = true;\n                    this.dispatchEventWith(ScrollPane.PULL_UP_RELEASE);\n                    this._refreshEventDispatching = false;\n                }\n\n                if (this._headerLockedSize > 0 && sEndPos[this._refreshBarAxis] == 0) {\n                    sEndPos[this._refreshBarAxis] = this._headerLockedSize;\n                    this._tweenChange.x = sEndPos.x - this._tweenStart.x;\n                    this._tweenChange.y = sEndPos.y - this._tweenStart.y;\n                }\n                else if (this._footerLockedSize > 0 && sEndPos[this._refreshBarAxis] == -this._overlapSize[this._refreshBarAxis]) {\n                    var max: number = this._overlapSize[this._refreshBarAxis];\n                    if (max == 0)\n                        max = Math.max(this._contentSize[this._refreshBarAxis] + this._footerLockedSize - this._viewSize[this._refreshBarAxis], 0);\n                    else\n                        max += this._footerLockedSize;\n                    sEndPos[this._refreshBarAxis] = -max;\n                    this._tweenChange.x = sEndPos.x - this._tweenStart.x;\n                    this._tweenChange.y = sEndPos.y - this._tweenStart.y;\n                }\n\n                this._tweenDuration.setTo(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT);\n            }\n            else {\n                //更新速度\n                if (!this._inertiaDisabled) {\n                    var frameRate: number = this._owner.displayObject.stage.frameRate;\n                    var elapsed: number = (egret.getTimer() / 1000 - this._lastMoveTime) * frameRate - 1;\n                    if (elapsed > 1) {\n                        var factor: number = Math.pow(0.833, elapsed);\n                        this._velocity.x = this._velocity.x * factor;\n                        this._velocity.y = this._velocity.y * factor;\n                    }\n                    //根据速度计算目标位置和需要时间\n                    this.updateTargetAndDuration(this._tweenStart, sEndPos);\n                }\n                else\n                    this._tweenDuration.setTo(TWEEN_TIME_DEFAULT, TWEEN_TIME_DEFAULT);\n                sOldChange.setTo(sEndPos.x - this._tweenStart.x, sEndPos.y - this._tweenStart.y);\n\n                //调整目标位置\n                this.loopCheckingTarget(sEndPos);\n                if (this._pageMode || this._snapToItem)\n                    this.alignPosition(sEndPos, true);\n\n                this._tweenChange.x = sEndPos.x - this._tweenStart.x;\n                this._tweenChange.y = sEndPos.y - this._tweenStart.y;\n                if (this._tweenChange.x == 0 && this._tweenChange.y == 0) {\n                    this.updateScrollBarVisible();\n                    return;\n                }\n\n                //如果目标位置已调整，随之调整需要时间\n                if (this._pageMode || this._snapToItem) {\n                    this.fixDuration(\"x\", sOldChange.x);\n                    this.fixDuration(\"y\", sOldChange.y);\n                }\n            }\n\n            this.startTween(2);\n        }\n\n        private __touchTap(evt: egret.TouchEvent): void {\n            this._dragged = false;\n        }\n\n        private updateScrollBarPos(): void {\n            if (this._vtScrollBar)\n                this._vtScrollBar.setScrollPerc(this._overlapSize.y == 0 ? 0 : ToolSet.clamp(-this._container.y, 0, this._overlapSize.y) / this._overlapSize.y);\n\n            if (this._hzScrollBar)\n                this._hzScrollBar.setScrollPerc(this._overlapSize.x == 0 ? 0 : ToolSet.clamp(-this._container.x, 0, this._overlapSize.x) / this._overlapSize.x);\n\n            this.checkRefreshBar();\n        }\n\n        public updateScrollBarVisible(): void {\n            if (this._vtScrollBar) {\n                if (this._viewSize.y <= this._vtScrollBar.minSize || this._vScrollNone)\n                    this._vtScrollBar.displayObject.visible = false;\n                else\n                    this.updateScrollBarVisible2(this._vtScrollBar);\n            }\n\n            if (this._hzScrollBar) {\n                if (this._viewSize.x <= this._hzScrollBar.minSize || this._hScrollNone)\n                    this._hzScrollBar.displayObject.visible = false;\n                else\n                    this.updateScrollBarVisible2(this._hzScrollBar);\n            }\n        }\n\n        private updateScrollBarVisible2(bar: GScrollBar): void {\n            if (this._scrollBarDisplayAuto)\n                GTween.kill(bar, false, \"alpha\");\n\n            if (this._scrollBarDisplayAuto && this._tweening == 0 && !this._dragged && !bar.gripDragging) {\n                if (bar.displayObject.visible)\n                    GTween.to(1, 0, 0.5).setDelay(0.5).onComplete(this.__barTweenComplete, this).setTarget(bar, \"alpha\");\n            }\n            else {\n                bar.alpha = 1;\n                bar.displayObject.visible = true;\n            }\n        }\n\n        private __barTweenComplete(tweener: GTweener): void {\n            var bar: GObject = <GObject>(tweener.target);\n            bar.alpha = 1;\n            bar.displayObject.visible = false;\n        }\n\n        private getLoopPartSize(division: number, axis: string): number {\n            return (this._contentSize[axis] + (axis == \"x\" ? (<GList><any>this._owner).columnGap : (<GList><any>this._owner).lineGap)) / division;\n        }\n\n        private loopCheckingCurrent(): boolean {\n            var changed: boolean = false;\n            if (this._loop == 1 && this._overlapSize.x > 0) {\n                if (this._xPos < 0.001) {\n                    this._xPos += this.getLoopPartSize(2, \"x\");\n                    changed = true;\n                }\n                else if (this._xPos >= this._overlapSize.x) {\n                    this._xPos -= this.getLoopPartSize(2, \"x\");\n                    changed = true;\n                }\n            }\n            else if (this._loop == 2 && this._overlapSize.y > 0) {\n                if (this._yPos < 0.001) {\n                    this._yPos += this.getLoopPartSize(2, \"y\");\n                    changed = true;\n                }\n                else if (this._yPos >= this._overlapSize.y) {\n                    this._yPos -= this.getLoopPartSize(2, \"y\");\n                    changed = true;\n                }\n            }\n\n            if (changed) {\n                this._container.x = Math.floor(-this._xPos);\n                this._container.y = Math.floor(-this._yPos);\n            }\n\n            return changed;\n        }\n\n        private loopCheckingTarget(endPos: egret.Point): void {\n            if (this._loop == 1)\n                this.loopCheckingTarget2(endPos, \"x\");\n\n            if (this._loop == 2)\n                this.loopCheckingTarget2(endPos, \"y\");\n        }\n\n        private loopCheckingTarget2(endPos: egret.Point, axis: string): void {\n            var halfSize: number;\n            var tmp: number;\n            if (endPos[axis] > 0) {\n                halfSize = this.getLoopPartSize(2, axis);\n                tmp = this._tweenStart[axis] - halfSize;\n                if (tmp <= 0 && tmp >= -this._overlapSize[axis]) {\n                    endPos[axis] -= halfSize;\n                    this._tweenStart[axis] = tmp;\n                }\n            }\n            else if (endPos[axis] < -this._overlapSize[axis]) {\n                halfSize = this.getLoopPartSize(2, axis);\n                tmp = this._tweenStart[axis] + halfSize;\n                if (tmp <= 0 && tmp >= -this._overlapSize[axis]) {\n                    endPos[axis] += halfSize;\n                    this._tweenStart[axis] = tmp;\n                }\n            }\n        }\n\n        private loopCheckingNewPos(value: number, axis: string): number {\n            if (this._overlapSize[axis] == 0)\n                return value;\n\n            var pos: number = axis == \"x\" ? this._xPos : this._yPos;\n            var changed: boolean = false;\n            var v: number;\n            if (value < 0.001) {\n                value += this.getLoopPartSize(2, axis);\n                if (value > pos) {\n                    v = this.getLoopPartSize(6, axis);\n                    v = Math.ceil((value - pos) / v) * v;\n                    pos = ToolSet.clamp(pos + v, 0, this._overlapSize[axis]);\n                    changed = true;\n                }\n            }\n            else if (value >= this._overlapSize[axis]) {\n                value -= this.getLoopPartSize(2, axis);\n                if (value < pos) {\n                    v = this.getLoopPartSize(6, axis);\n                    v = Math.ceil((pos - value) / v) * v;\n                    pos = ToolSet.clamp(pos - v, 0, this._overlapSize[axis]);\n                    changed = true;\n                }\n            }\n\n            if (changed) {\n                if (axis == \"x\")\n                    this._container.x = -Math.floor(pos);\n                else\n                    this._container.y = -Math.floor(pos);\n            }\n\n            return value;\n        }\n\n        private alignPosition(pos: egret.Point, inertialScrolling: boolean): void {\n            if (this._pageMode) {\n                pos.x = this.alignByPage(pos.x, \"x\", inertialScrolling);\n                pos.y = this.alignByPage(pos.y, \"y\", inertialScrolling);\n            }\n            else if (this._snapToItem) {\n                var pt: egret.Point = this._owner.getSnappingPosition(-pos.x, -pos.y, s_vec2);\n                if (pos.x < 0 && pos.x > -this._overlapSize.x)\n                    pos.x = -pt.x;\n                if (pos.y < 0 && pos.y > -this._overlapSize.y)\n                    pos.y = -pt.y;\n            }\n        }\n\n        private alignByPage(pos: number, axis: string, inertialScrolling: boolean): number {\n            var page: number;\n\n            if (pos > 0)\n                page = 0;\n            else if (pos < -this._overlapSize[axis])\n                page = Math.ceil(this._contentSize[axis] / this._pageSize[axis]) - 1;\n            else {\n                page = Math.floor(-pos / this._pageSize[axis]);\n                var change: number = inertialScrolling ? (pos - this._containerPos[axis]) : (pos - this._container[axis]);\n                var testPageSize: number = Math.min(this._pageSize[axis], this._contentSize[axis] - (page + 1) * this._pageSize[axis]);\n                var delta: number = -pos - page * this._pageSize[axis];\n\n                //页面吸附策略\n                if (Math.abs(change) > this._pageSize[axis])//如果滚动距离超过1页,则需要超过页面的一半，才能到更下一页\n                {\n                    if (delta > testPageSize * 0.5)\n                        page++;\n                }\n                else //否则只需要页面的1/3，当然，需要考虑到左移和右移的情况\n                {\n                    if (delta > testPageSize * (change < 0 ? 0.3 : 0.7))\n                        page++;\n                }\n\n                //重新计算终点\n                pos = -page * this._pageSize[axis];\n                if (pos < -this._overlapSize[axis]) //最后一页未必有pageSize那么大\n                    pos = -this._overlapSize[axis];\n            }\n\n            //惯性滚动模式下，会增加判断尽量不要滚动超过一页\n            if (inertialScrolling) {\n                var oldPos: number = this._tweenStart[axis];\n                var oldPage: number;\n                if (oldPos > 0)\n                    oldPage = 0;\n                else if (oldPos < -this._overlapSize[axis])\n                    oldPage = Math.ceil(this._contentSize[axis] / this._pageSize[axis]) - 1;\n                else\n                    oldPage = Math.floor(-oldPos / this._pageSize[axis]);\n                var startPage: number = Math.floor(-this._containerPos[axis] / this._pageSize[axis]);\n                if (Math.abs(page - startPage) > 1 && Math.abs(oldPage - startPage) <= 1) {\n                    if (page > startPage)\n                        page = startPage + 1;\n                    else\n                        page = startPage - 1;\n                    pos = -page * this._pageSize[axis];\n                }\n            }\n\n            return pos;\n        }\n\n        private updateTargetAndDuration(orignPos: egret.Point, resultPos: egret.Point): void {\n            resultPos.x = this.updateTargetAndDuration2(orignPos.x, \"x\");\n            resultPos.y = this.updateTargetAndDuration2(orignPos.y, \"y\");\n        }\n\n        private updateTargetAndDuration2(pos: number, axis: string): number {\n            var v: number = this._velocity[axis];\n            var duration: number = 0;\n            if (pos > 0)\n                pos = 0;\n            else if (pos < -this._overlapSize[axis])\n                pos = -this._overlapSize[axis];\n            else {\n                //以屏幕像素为基准\n                var isMobile: boolean = egret.Capabilities.isMobile;\n                var v2: number = Math.abs(v) * this._velocityScale;\n                //在移动设备上，需要对不同分辨率做一个适配，我们的速度判断以1136分辨率为基准\n                if (isMobile)\n                    v2 *= 1136 / Math.max(this._owner.displayObject.stage.stageWidth, this._owner.displayObject.stage.stageHeight);\n                //这里有一些阈值的处理，因为在低速内，不希望产生较大的滚动（甚至不滚动）\n                var ratio: number = 0;\n\n                if (this._pageMode || !isMobile) {\n                    if (v2 > 500)\n                        ratio = Math.pow((v2 - 500) / 500, 2);\n                }\n                else {\n                    if (v2 > 1000)\n                        ratio = Math.pow((v2 - 1000) / 1000, 2);\n                }\n                if (ratio != 0) {\n                    if (ratio > 1)\n                        ratio = 1;\n\n                    v2 *= ratio;\n                    v *= ratio;\n                    this._velocity[axis] = v;\n\n                    //算法：v*（this._decelerationRate的n次幂）= 60，即在n帧后速度降为60（假设每秒60帧）。\n                    duration = Math.log(60 / v2) / Math.log(this._decelerationRate) / 60;\n\n                    //计算距离要使用本地速度\n                    //理论公式貌似滚动的距离不够，改为经验公式\n                    //var change:number = (v/ 60 - 1) / (1 - this._decelerationRate);\n                    var change: number = Math.floor(v * duration * 0.4);\n                    pos += change;\n                }\n            }\n\n            if (duration < TWEEN_TIME_DEFAULT)\n                duration = TWEEN_TIME_DEFAULT;\n            this._tweenDuration[axis] = duration;\n\n            return pos;\n        }\n\n        private fixDuration(axis: string, oldChange: number): void {\n            if (this._tweenChange[axis] == 0 || Math.abs(this._tweenChange[axis]) >= Math.abs(oldChange))\n                return;\n\n            var newDuration: number = Math.abs(this._tweenChange[axis] / oldChange) * this._tweenDuration[axis];\n            if (newDuration < TWEEN_TIME_DEFAULT)\n                newDuration = TWEEN_TIME_DEFAULT;\n\n            this._tweenDuration[axis] = newDuration;\n        }\n\n        private startTween(type: number): void {\n            this._tweenTime.setTo(0, 0);\n            this._tweening = type;\n            GTimers.inst.add(1, 0, this.tweenUpdate, this);\n\n            this.updateScrollBarVisible();\n        }\n\n        private killTween(): void {\n            if (this._tweening == 1) //取消类型为1的tween需立刻设置到终点\n            {\n                this._container.x = this._tweenStart.x + this._tweenChange.x;\n                this._container.y = this._tweenStart.y + this._tweenChange.y;\n                this.dispatchEventWith(ScrollPane.SCROLL);\n            }\n\n            this._tweening = 0;\n            GTimers.inst.remove(this.tweenUpdate, this);\n\n            this.updateScrollBarVisible();\n\n            this.dispatchEventWith(ScrollPane.SCROLL_END);\n        }\n\n        private checkRefreshBar(): void {\n            if (this._header == null && this._footer == null)\n                return;\n\n            var pos: number = this._container[this._refreshBarAxis];\n            if (this._header) {\n                if (pos > 0) {\n                    if (this._header.displayObject.parent == null)\n                        this._maskContainer.addChildAt(this._header.displayObject, 0);\n                    var pt: egret.Point = s_vec2;\n                    pt.setTo(this._header.width, this._header.height);\n                    pt[this._refreshBarAxis] = pos;\n                    this._header.setSize(pt.x, pt.y);\n                }\n                else {\n                    if (this._header.displayObject.parent)\n                        this._maskContainer.removeChild(this._header.displayObject);\n                }\n            }\n\n            if (this._footer) {\n                var max: number = this._overlapSize[this._refreshBarAxis];\n                if (pos < -max || max == 0 && this._footerLockedSize > 0) {\n                    if (this._footer.displayObject.parent == null)\n                        this._maskContainer.addChildAt(this._footer.displayObject, 0);\n\n                    pt = s_vec2;\n                    pt.setTo(this._footer.x, this._footer.y);\n                    if (max > 0)\n                        pt[this._refreshBarAxis] = pos + this._contentSize[this._refreshBarAxis];\n                    else\n                        pt[this._refreshBarAxis] = Math.max(Math.min(pos + this._viewSize[this._refreshBarAxis], this._viewSize[this._refreshBarAxis] - this._footerLockedSize),\n                            this._viewSize[this._refreshBarAxis] - this._contentSize[this._refreshBarAxis]);\n                    this._footer.setXY(pt.x, pt.y);\n\n                    pt.setTo(this._footer.width, this._footer.height);\n                    if (max > 0)\n                        pt[this._refreshBarAxis] = -max - pos;\n                    else\n                        pt[this._refreshBarAxis] = this._viewSize[this._refreshBarAxis] - this._footer[this._refreshBarAxis];\n                    this._footer.setSize(pt.x, pt.y);\n                }\n                else {\n                    if (this._footer.displayObject.parent)\n                        this._maskContainer.removeChild(this._footer.displayObject);\n                }\n            }\n        }\n\n        private tweenUpdate(timestamp: number): boolean {\n            var nx: number = this.runTween(\"x\");\n            var ny: number = this.runTween(\"y\");\n\n            this._container.x = nx;\n            this._container.y = ny;\n\n            if (this._tweening == 2) {\n                if (this._overlapSize.x > 0)\n                    this._xPos = ToolSet.clamp(-nx, 0, this._overlapSize.x);\n                if (this._overlapSize.y > 0)\n                    this._yPos = ToolSet.clamp(-ny, 0, this._overlapSize.y);\n\n                if (this._pageMode)\n                    this.updatePageController();\n            }\n\n            if (this._tweenChange.x == 0 && this._tweenChange.y == 0) {\n                this._tweening = 0;\n                GTimers.inst.remove(this.tweenUpdate, this);\n\n                this.loopCheckingCurrent();\n                this.updateScrollBarPos();\n                this.updateScrollBarVisible();\n\n                this.dispatchEventWith(ScrollPane.SCROLL);\n                this.dispatchEventWith(ScrollPane.SCROLL_END);\n            }\n            else {\n                this.updateScrollBarPos();\n                this.dispatchEventWith(ScrollPane.SCROLL);\n            }\n\n            return true;\n        }\n\n        private runTween(axis: string): number {\n            var newValue: number;\n            if (this._tweenChange[axis] != 0) {\n                this._tweenTime[axis] += GTimers.deltaTime / 1000;\n                if (this._tweenTime[axis] >= this._tweenDuration[axis]) {\n                    newValue = this._tweenStart[axis] + this._tweenChange[axis];\n                    this._tweenChange[axis] = 0;\n                }\n                else {\n                    var ratio: number = easeFunc(this._tweenTime[axis], this._tweenDuration[axis]);\n                    newValue = this._tweenStart[axis] + Math.floor(this._tweenChange[axis] * ratio);\n                }\n\n                var threshold1: number = 0;\n                var threshold2: number = -this._overlapSize[axis];\n                if (this._headerLockedSize > 0 && this._refreshBarAxis == axis)\n                    threshold1 = this._headerLockedSize;\n                if (this._footerLockedSize > 0 && this._refreshBarAxis == axis) {\n                    var max: number = this._overlapSize[this._refreshBarAxis];\n                    if (max == 0)\n                        max = Math.max(this._contentSize[this._refreshBarAxis] + this._footerLockedSize - this._viewSize[this._refreshBarAxis], 0);\n                    else\n                        max += this._footerLockedSize;\n                    threshold2 = -max;\n                }\n\n                if (this._tweening == 2 && this._bouncebackEffect) {\n                    if (newValue > 20 + threshold1 && this._tweenChange[axis] > 0\n                        || newValue > threshold1 && this._tweenChange[axis] == 0)//开始回弹\n                    {\n                        this._tweenTime[axis] = 0;\n                        this._tweenDuration[axis] = TWEEN_TIME_DEFAULT;\n                        this._tweenChange[axis] = -newValue + threshold1;\n                        this._tweenStart[axis] = newValue;\n                    }\n                    else if (newValue < threshold2 - 20 && this._tweenChange[axis] < 0\n                        || newValue < threshold2 && this._tweenChange[axis] == 0)//开始回弹\n                    {\n                        this._tweenTime[axis] = 0;\n                        this._tweenDuration[axis] = TWEEN_TIME_DEFAULT;\n                        this._tweenChange[axis] = threshold2 - newValue;\n                        this._tweenStart[axis] = newValue;\n                    }\n                }\n                else {\n                    if (newValue > threshold1) {\n                        newValue = threshold1;\n                        this._tweenChange[axis] = 0;\n                    }\n                    else if (newValue < threshold2) {\n                        newValue = threshold2;\n                        this._tweenChange[axis] = 0;\n                    }\n                }\n            }\n            else\n                newValue = this._container[axis];\n\n            return newValue;\n        }\n    }\n\n    var _gestureFlag: number = 0;\n\n    const TWEEN_TIME_GO: number = 0.5; //调用SetPos(ani)时使用的缓动时间\n    const TWEEN_TIME_DEFAULT: number = 0.3; //惯性滚动的最小缓动时间\n    const PULL_RATIO: number = 0.5; //下拉过顶或者上拉过底时允许超过的距离占显示区域的比例\n\n    var s_vec2: egret.Point = new egret.Point();\n    var s_rect: egret.Rectangle = new egret.Rectangle();\n    var sEndPos: egret.Point = new egret.Point();\n    var sOldChange: egret.Point = new egret.Point();\n\n    function easeFunc(t: number, d: number): number {\n        return (t = t / d - 1) * t * t + 1;//cubicOut\n    }\n}"
  },
  {
    "path": "source/src/Transition.ts",
    "content": "module fgui {\r\n    export class Transition {\r\n\r\n        public name: string;\r\n\r\n        private _owner: GComponent;\r\n        private _ownerBaseX: number = 0;\r\n        private _ownerBaseY: number = 0;\r\n        private _items: Array<Item>;\r\n        private _totalTimes: number = 0;\r\n        private _totalTasks: number = 0;\r\n        private _playing: boolean;\r\n        private _paused: boolean;\r\n        private _onComplete: Function;\r\n        private _onCompleteCaller: any;\r\n        private _onCompleteParam: any;\r\n        private _options: number = 0;\r\n        private _reversed: boolean;\r\n        private _totalDuration: number = 0;\r\n        private _autoPlay: boolean;\r\n        private _autoPlayTimes: number = 1;\r\n        private _autoPlayDelay: number = 0;\r\n        private _timeScale: number = 1;\r\n        private _startTime: number = 0;\r\n        private _endTime: number = 0;\r\n\r\n        public constructor(owner: GComponent) {\r\n            this._owner = owner;\r\n            this._items = new Array<Item>();\r\n        }\r\n\r\n        public play(onComplete?: () => void, onCompleteObj?: any, onCompleteParam?: any,\r\n            times?: number, delay?: number, startTime?: number, endTime?: number) {\r\n            this._play(onComplete, onCompleteObj, onCompleteParam, times, delay, startTime, endTime, false);\r\n        }\r\n\r\n        public playReverse(onComplete?: () => void, onCompleteObj?: any, onCompleteParam?: any,\r\n            times?: number, delay?: number) {\r\n            this._play(onComplete, onCompleteObj, onCompleteParam, times, delay, 0, -1, true);\r\n        }\r\n\r\n        public changePlayTimes(value: number): void {\r\n            this._totalTimes = value;\r\n        }\r\n\r\n        public setAutoPlay(value: boolean, times?: number, delay?: number) {\r\n            if (times == undefined) times = -1;\r\n            if (delay == undefined) delay = 0;\r\n            if (this._autoPlay != value) {\r\n                this._autoPlay = value;\r\n                this._autoPlayTimes = times;\r\n                this._autoPlayDelay = delay;\r\n\r\n                if (this._autoPlay) {\r\n                    if (this._owner.onStage)\r\n                        this.play(null, null, this._autoPlayTimes, this._autoPlayDelay);\r\n                }\r\n                else {\r\n                    if (!this._owner.onStage)\r\n                        this.stop(false, true);\r\n                }\r\n            }\r\n        }\r\n\r\n        private _play(onComplete: Function, onCompleteCaller: any, onCompleteParam: any,\r\n            times: number, delay: number, startTime: number, endTime: number, reversed: boolean) {\r\n            if (times == undefined) times = 1;\r\n            if (delay == undefined) delay = 0;\r\n            if (startTime == undefined) startTime = 0;\r\n            if (endTime == undefined) endTime = -1;\r\n\r\n            this.stop(true, true);\r\n\r\n            this._totalTimes = times;\r\n            this._reversed = reversed;\r\n            this._startTime = startTime;\r\n            this._endTime = endTime;\r\n            this._playing = true;\r\n            this._paused = false;\r\n            this._onComplete = onComplete;\r\n            this._onCompleteParam = onCompleteParam;\r\n            this._onCompleteCaller = onCompleteCaller;\r\n\r\n            var cnt: number = this._items.length;\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                var item: Item = this._items[i];\r\n                if (!item.target) {\r\n                    if (item.targetId)\r\n                        item.target = this._owner.getChildById(item.targetId);\r\n                    else\r\n                        item.target = this._owner;\r\n                }\r\n                else if (item.target != this._owner && item.target.parent != this._owner)\r\n                    item.target = null;\r\n\r\n                if (item.target && item.type == ActionType.Transition) {\r\n                    var trans: Transition = (<GComponent>item.target).getTransition(item.value.transName);\r\n                    if (trans == this)\r\n                        trans = null;\r\n                    if (trans) {\r\n                        if (item.value.playTimes == 0) //stop\r\n                        {\r\n                            var j: number;\r\n                            for (j = i - 1; j >= 0; j--) {\r\n                                var item2: Item = this._items[j];\r\n                                if (item2.type == ActionType.Transition) {\r\n                                    if (item2.value.trans == trans) {\r\n                                        item2.value.stopTime = item.time - item2.time;\r\n                                        break;\r\n                                    }\r\n                                }\r\n                            }\r\n                            if (j < 0)\r\n                                item.value.stopTime = 0;\r\n                            else\r\n                                trans = null;//no need to handle stop anymore\r\n                        }\r\n                        else\r\n                            item.value.stopTime = -1;\r\n                    }\r\n                    item.value.trans = trans;\r\n                }\r\n            }\r\n\r\n            if (delay == 0)\r\n                this.onDelayedPlay();\r\n            else\r\n                GTween.delayedCall(delay).setTarget(this).onComplete(this.onDelayedPlay, this);\r\n        }\r\n\r\n        public stop(setToComplete?: boolean, processCallback?: boolean): void {\r\n            if (setToComplete == undefined) setToComplete = true;\r\n            if (!this._playing)\r\n                return;\r\n\r\n            this._playing = false;\r\n            this._totalTasks = 0;\r\n            this._totalTimes = 0;\r\n            var func: Function = this._onComplete;\r\n            var param: any = this._onCompleteParam;\r\n            var thisObj: any = this._onCompleteCaller;\r\n            this._onComplete = null;\r\n            this._onCompleteParam = null;\r\n            this._onCompleteCaller = null;\r\n\r\n            GTween.kill(this);//delay start\r\n\r\n            var cnt: number = this._items.length;\r\n            if (this._reversed) {\r\n                for (var i: number = cnt - 1; i >= 0; i--) {\r\n                    var item: Item = this._items[i];\r\n                    if (!item.target)\r\n                        continue;\r\n\r\n                    this.stopItem(item, setToComplete);\r\n                }\r\n            }\r\n            else {\r\n                for (i = 0; i < cnt; i++) {\r\n                    item = this._items[i];\r\n                    if (!item.target)\r\n                        continue;\r\n\r\n                    this.stopItem(item, setToComplete);\r\n                }\r\n            }\r\n\r\n            if (processCallback && func != null) {\r\n                func.call(thisObj, param);\r\n            }\r\n        }\r\n\r\n        private stopItem(item: Item, setToComplete: boolean): void {\r\n            if (item.displayLockToken != 0) {\r\n                item.target.releaseDisplayLock(item.displayLockToken);\r\n                item.displayLockToken = 0;\r\n            }\r\n\r\n            if (item.tweener) {\r\n                item.tweener.kill(setToComplete);\r\n                item.tweener = null;\r\n\r\n                if (item.type == ActionType.Shake && !setToComplete) //震动必须归位，否则下次就越震越远了。\r\n                {\r\n                    item.target._gearLocked = true;\r\n                    item.target.setXY(item.target.x - item.value.lastOffsetX, item.target.y - item.value.lastOffsetY);\r\n                    item.target._gearLocked = false;\r\n                }\r\n            }\r\n\r\n            if (item.type == ActionType.Transition) {\r\n                var trans: Transition = item.value.trans;\r\n                if (trans)\r\n                    trans.stop(setToComplete, false);\r\n            }\r\n        }\r\n\r\n        public setPaused(paused: boolean): void {\r\n            if (!this._playing || this._paused == paused)\r\n                return;\r\n\r\n            this._paused = paused;\r\n            var tweener: GTweener = GTween.getTween(this);\r\n            if (tweener)\r\n                tweener.setPaused(paused);\r\n\r\n            var cnt: number = this._items.length;\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                var item: Item = this._items[i];\r\n                if (!item.target)\r\n                    continue;\r\n\r\n                if (item.type == ActionType.Transition) {\r\n                    if (item.value.trans)\r\n                        item.value.trans.setPaused(paused);\r\n                }\r\n                else if (item.type == ActionType.Animation) {\r\n                    if (paused) {\r\n                        item.value.flag = item.target.getProp(ObjectPropID.Playing);\r\n                        item.target.setProp(ObjectPropID.Playing, false);\r\n                    }\r\n                    else\r\n                        item.target.setProp(ObjectPropID.Playing, item.value.flag);\r\n                }\r\n\r\n                if (item.tweener)\r\n                    item.tweener.setPaused(paused);\r\n            }\r\n        }\r\n\r\n        public dispose(): void {\r\n            if (this._playing)\r\n                GTween.kill(this);//delay start\r\n\r\n            var cnt: number = this._items.length;\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                var item: Item = this._items[i];\r\n                if (item.tweener) {\r\n                    item.tweener.kill();\r\n                    item.tweener = null;\r\n                }\r\n\r\n                item.target = null;\r\n                item.hook = null;\r\n                if (item.tweenConfig)\r\n                    item.tweenConfig.endHook = null;\r\n            }\r\n\r\n            this._items.length = 0;\r\n            this._playing = false;\r\n            this._onComplete = null;\r\n            this._onCompleteCaller = null;\r\n            this._onCompleteParam = null;\r\n        }\r\n\r\n        public get playing(): boolean {\r\n            return this._playing;\r\n        }\r\n\r\n        public setValue(label: string, ...args): void {\r\n            var cnt: number = this._items.length;\r\n            var value: TValue;\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                var item: Item = this._items[i];\r\n                if (item.label == label) {\r\n                    if (item.tweenConfig)\r\n                        value = item.tweenConfig.startValue;\r\n                    else\r\n                        value = item.value;\r\n                }\r\n                else if (item.tweenConfig && item.tweenConfig.endLabel == label) {\r\n                    value = item.tweenConfig.endValue;\r\n                }\r\n                else\r\n                    continue;\r\n\r\n                switch (item.type) {\r\n                    case ActionType.XY:\r\n                    case ActionType.Size:\r\n                    case ActionType.Pivot:\r\n                    case ActionType.Scale:\r\n                    case ActionType.Skew:\r\n                        value.b1 = true;\r\n                        value.b2 = true;\r\n                        value.f1 = parseFloat(args[0]);\r\n                        value.f2 = parseFloat(args[1]);\r\n                        break;\r\n\r\n                    case ActionType.Alpha:\r\n                        value.f1 = parseFloat(args[0]);\r\n                        break;\r\n\r\n                    case ActionType.Rotation:\r\n                        value.f1 = parseFloat(args[0]);\r\n                        break;\r\n\r\n                    case ActionType.Color:\r\n                        value.f1 = parseFloat(args[0]);\r\n                        break;\r\n\r\n                    case ActionType.Animation:\r\n                        value.frame = parseInt(args[0]);\r\n                        if (args.length > 1)\r\n                            value.playing = args[1];\r\n                        break;\r\n\r\n                    case ActionType.Visible:\r\n                        value.visible = args[0];\r\n                        break;\r\n\r\n                    case ActionType.Sound:\r\n                        value.sound = args[0];\r\n                        if (args.length > 1)\r\n                            value.volume = parseFloat(args[1]);\r\n                        break;\r\n\r\n                    case ActionType.Transition:\r\n                        value.transName = args[0];\r\n                        if (args.length > 1)\r\n                            value.playTimes = parseInt(args[1]);\r\n                        break;\r\n\r\n                    case ActionType.Shake:\r\n                        value.amplitude = parseFloat(args[0]);\r\n                        if (args.length > 1)\r\n                            value.duration = parseFloat(args[1]);\r\n                        break;\r\n\r\n                    case ActionType.ColorFilter:\r\n                        value.f1 = parseFloat(args[0]);\r\n                        value.f2 = parseFloat(args[1]);\r\n                        value.f3 = parseFloat(args[2]);\r\n                        value.f4 = parseFloat(args[3]);\r\n                        break;\r\n\r\n                    case ActionType.Text:\r\n                    case ActionType.Icon:\r\n                        value.text = args[0];\r\n                        break;\r\n                }\r\n            }\r\n        }\r\n\r\n        public setHook(label: string, callback: Function, caller?: any): void {\r\n            var cnt: number = this._items.length;\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                var item: Item = this._items[i];\r\n                if (item.label == label) {\r\n                    item.hook = callback;\r\n                    item.hookCaller = caller;\r\n                    break;\r\n                }\r\n                else if (item.tweenConfig && item.tweenConfig.endLabel == label) {\r\n                    item.tweenConfig.endHook = callback;\r\n                    item.tweenConfig.endHookCaller = caller;\r\n                    break;\r\n                }\r\n            }\r\n        }\r\n\r\n        public clearHooks(): void {\r\n            var cnt: number = this._items.length;\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                var item: Item = this._items[i];\r\n                item.hook = null;\r\n                item.hookCaller = null;\r\n                if (item.tweenConfig) {\r\n                    item.tweenConfig.endHook = null;\r\n                    item.tweenConfig.endHookCaller = null;\r\n                }\r\n            }\r\n        }\r\n\r\n        public setTarget(label: string, newTarget: GObject): void {\r\n            var cnt: number = this._items.length;\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                var item: Item = this._items[i];\r\n                if (item.label == label) {\r\n                    item.targetId = (newTarget == this._owner || !newTarget) ? \"\" : newTarget.id;\r\n                    if (this._playing) {\r\n                        if (item.targetId.length > 0)\r\n                            item.target = this._owner.getChildById(item.targetId);\r\n                        else\r\n                            item.target = this._owner;\r\n                    }\r\n                    else\r\n                        item.target = null;\r\n                }\r\n            }\r\n        }\r\n\r\n        public setDuration(label: string, value: number): void {\r\n            var cnt: number = this._items.length;\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                var item: Item = this._items[i];\r\n                if (item.tweenConfig && item.label == label)\r\n                    item.tweenConfig.duration = value;\r\n            }\r\n        }\r\n\r\n        public getLabelTime(label: string): number {\r\n            var cnt: number = this._items.length;\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                var item: Item = this._items[i];\r\n                if (item.label == label)\r\n                    return item.time;\r\n                else if (item.tweenConfig && item.tweenConfig.endLabel == label)\r\n                    return item.time + item.tweenConfig.duration;\r\n            }\r\n\r\n            return Number.NaN;\r\n        }\r\n\r\n        public get timeScale(): number {\r\n            return this._timeScale;\r\n        }\r\n\r\n        public set timeScale(value: number) {\r\n            if (this._timeScale != value) {\r\n                this._timeScale = value;\r\n                if (this._playing) {\r\n                    var cnt: number = this._items.length;\r\n                    for (var i: number = 0; i < cnt; i++) {\r\n                        var item: Item = this._items[i];\r\n                        if (item.tweener)\r\n                            item.tweener.setTimeScale(value);\r\n                        else if (item.type == ActionType.Transition) {\r\n                            if (item.value.trans)\r\n                                item.value.trans.timeScale = value;\r\n                        }\r\n                        else if (item.type == ActionType.Animation) {\r\n                            if (item.target)\r\n                                item.target.setProp(ObjectPropID.TimeScale, value);\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        public updateFromRelations(targetId: string, dx: number, dy: number): void {\r\n            var cnt: number = this._items.length;\r\n            if (cnt == 0)\r\n                return;\r\n\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                var item: Item = this._items[i];\r\n                if (item.type == ActionType.XY && item.targetId == targetId) {\r\n                    if (item.tweenConfig) {\r\n                        item.tweenConfig.startValue.f1 += dx;\r\n                        item.tweenConfig.startValue.f2 += dy;\r\n                        item.tweenConfig.endValue.f1 += dx;\r\n                        item.tweenConfig.endValue.f2 += dy;\r\n                    }\r\n                    else {\r\n                        item.value.f1 += dx;\r\n                        item.value.f2 += dy;\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        public onOwnerAddedToStage(): void {\r\n            if (this._autoPlay && !this._playing)\r\n                this.play(null, null, null, this._autoPlayTimes, this._autoPlayDelay);\r\n        }\r\n\r\n        public onOwnerRemovedFromStage(): void {\r\n            if ((this._options & OPTION_AUTO_STOP_DISABLED) == 0)\r\n                this.stop((this._options & OPTION_AUTO_STOP_AT_END) != 0 ? true : false, false);\r\n        }\r\n\r\n        private onDelayedPlay(): void {\r\n            this.internalPlay();\r\n\r\n            this._playing = this._totalTasks > 0;\r\n            if (this._playing) {\r\n                if ((this._options & OPTION_IGNORE_DISPLAY_CONTROLLER) != 0) {\r\n                    var cnt: number = this._items.length;\r\n                    for (var i: number = 0; i < cnt; i++) {\r\n                        var item: Item = this._items[i];\r\n                        if (item.target && item.target != this._owner)\r\n                            item.displayLockToken = item.target.addDisplayLock();\r\n                    }\r\n                }\r\n            }\r\n            else if (this._onComplete != null) {\r\n                var func: Function = this._onComplete;\r\n                var param: any = this._onCompleteParam;\r\n                var thisObj: any = this._onCompleteCaller;\r\n                this._onComplete = null;\r\n                this._onCompleteParam = null;\r\n                this._onCompleteCaller = null;\r\n                func.call(thisObj, param);\r\n            }\r\n        }\r\n\r\n        private internalPlay(): void {\r\n            this._ownerBaseX = this._owner.x;\r\n            this._ownerBaseY = this._owner.y;\r\n\r\n            this._totalTasks = 1;\r\n\r\n            var cnt: number = this._items.length;\r\n            var item: Item;\r\n            var needSkipAnimations: boolean = false;\r\n            var i: number;\r\n\r\n            if (!this._reversed) {\r\n                for (i = 0; i < cnt; i++) {\r\n                    item = this._items[i];\r\n                    if (!item.target)\r\n                        continue;\r\n\r\n                    if (item.type == ActionType.Animation && this._startTime != 0 && item.time <= this._startTime) {\r\n                        needSkipAnimations = true;\r\n                        item.value.flag = false;\r\n                    }\r\n                    else\r\n                        this.playItem(item);\r\n                }\r\n            }\r\n            else {\r\n                for (i = cnt - 1; i >= 0; i--) {\r\n                    item = this._items[i];\r\n                    if (!item.target)\r\n                        continue;\r\n\r\n                    this.playItem(item);\r\n                }\r\n            }\r\n\r\n            if (needSkipAnimations)\r\n                this.skipAnimations();\r\n\r\n            this._totalTasks--;\r\n        }\r\n\r\n        private playItem(item: Item): void {\r\n            var time: number;\r\n            if (item.tweenConfig) {\r\n                if (this._reversed)\r\n                    time = (this._totalDuration - item.time - item.tweenConfig.duration);\r\n                else\r\n                    time = item.time;\r\n                if (this._endTime == -1 || time <= this._endTime) {\r\n                    var startValue: TValue;\r\n                    var endValue: TValue;\r\n                    if (this._reversed) {\r\n                        startValue = item.tweenConfig.endValue;\r\n                        endValue = item.tweenConfig.startValue;\r\n                    }\r\n                    else {\r\n                        startValue = item.tweenConfig.startValue;\r\n                        endValue = item.tweenConfig.endValue;\r\n                    }\r\n\r\n                    item.value.b1 = startValue.b1 || endValue.b1;\r\n                    item.value.b2 = startValue.b2 || endValue.b2;\r\n\r\n                    switch (item.type) {\r\n                        case ActionType.XY:\r\n                        case ActionType.Size:\r\n                        case ActionType.Scale:\r\n                        case ActionType.Skew:\r\n                            item.tweener = GTween.to2(startValue.f1, startValue.f2, endValue.f1, endValue.f2, item.tweenConfig.duration);\r\n                            break;\r\n\r\n                        case ActionType.Alpha:\r\n                        case ActionType.Rotation:\r\n                            item.tweener = GTween.to(startValue.f1, endValue.f1, item.tweenConfig.duration);\r\n                            break;\r\n\r\n                        case ActionType.Color:\r\n                            item.tweener = GTween.toColor(startValue.f1, endValue.f1, item.tweenConfig.duration);\r\n                            break;\r\n\r\n                        case ActionType.ColorFilter:\r\n                            item.tweener = GTween.to4(startValue.f1, startValue.f2, startValue.f3, startValue.f4,\r\n                                endValue.f1, endValue.f2, endValue.f3, endValue.f4, item.tweenConfig.duration);\r\n                            break;\r\n                    }\r\n\r\n                    item.tweener.setDelay(time)\r\n                        .setEase(item.tweenConfig.easeType)\r\n                        .setRepeat(item.tweenConfig.repeat, item.tweenConfig.yoyo)\r\n                        .setTimeScale(this._timeScale)\r\n                        .setTarget(item)\r\n                        .onStart(this.onTweenStart, this)\r\n                        .onUpdate(this.onTweenUpdate, this)\r\n                        .onComplete(this.onTweenComplete, this);\r\n\r\n                    if (this._endTime >= 0)\r\n                        item.tweener.setBreakpoint(this._endTime - time);\r\n\r\n                    this._totalTasks++;\r\n                }\r\n            }\r\n            else if (item.type == ActionType.Shake) {\r\n                if (this._reversed)\r\n                    time = (this._totalDuration - item.time - item.value.duration);\r\n                else\r\n                    time = item.time;\r\n\r\n                item.value.offsetX = item.value.offsetY = 0;\r\n                item.value.lastOffsetX = item.value.lastOffsetY = 0;\r\n                item.tweener = GTween.shake(0, 0, item.value.amplitude, item.value.duration)\r\n                    .setDelay(time)\r\n                    .setTimeScale(this._timeScale)\r\n                    .setTarget(item)\r\n                    .onUpdate(this.onTweenUpdate, this)\r\n                    .onComplete(this.onTweenComplete, this);\r\n\r\n                if (this._endTime >= 0)\r\n                    item.tweener.setBreakpoint(this._endTime - item.time);\r\n\r\n                this._totalTasks++;\r\n            }\r\n            else {\r\n                if (this._reversed)\r\n                    time = (this._totalDuration - item.time);\r\n                else\r\n                    time = item.time;\r\n\r\n                if (time <= this._startTime) {\r\n                    this.applyValue(item);\r\n                    this.callHook(item, false);\r\n                }\r\n                else if (this._endTime == -1 || time <= this._endTime) {\r\n                    this._totalTasks++;\r\n                    item.tweener = GTween.delayedCall(time)\r\n                        .setTimeScale(this._timeScale)\r\n                        .setTarget(item)\r\n                        .onComplete(this.onDelayedPlayItem, this);\r\n                }\r\n            }\r\n\r\n            if (item.tweener != null)\r\n                item.tweener.seek(this._startTime);\r\n        }\r\n\r\n        private skipAnimations(): void {\r\n            var frame: number;\r\n            var playStartTime: number;\r\n            var playTotalTime: number;\r\n            var value: TValue;\r\n            var target: GObject;\r\n            var item: Item;\r\n\r\n            var cnt: number = this._items.length;\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                item = this._items[i];\r\n                if (item.type != ActionType.Animation || item.time > this._startTime)\r\n                    continue;\r\n\r\n                value = item.value;\r\n                if (value.flag)\r\n                    continue;\r\n\r\n                target = item.target;\r\n                frame = target.getProp(ObjectPropID.Frame);\r\n                playStartTime = target.getProp(ObjectPropID.Playing) ? 0 : -1;\r\n                playTotalTime = 0;\r\n\r\n                for (var j: number = i; j < cnt; j++) {\r\n                    item = this._items[j];\r\n                    if (item.type != ActionType.Animation || item.target != target || item.time > this._startTime)\r\n                        continue;\r\n\r\n                    value = item.value;\r\n                    value.flag = true;\r\n\r\n                    if (value.frame != -1) {\r\n                        frame = value.frame;\r\n                        if (value.playing)\r\n                            playStartTime = item.time;\r\n                        else\r\n                            playStartTime = -1;\r\n                        playTotalTime = 0;\r\n                    }\r\n                    else {\r\n                        if (value.playing) {\r\n                            if (playStartTime < 0)\r\n                                playStartTime = item.time;\r\n                        }\r\n                        else {\r\n                            if (playStartTime >= 0)\r\n                                playTotalTime += (item.time - playStartTime);\r\n                            playStartTime = -1;\r\n                        }\r\n                    }\r\n\r\n                    this.callHook(item, false);\r\n                }\r\n\r\n                if (playStartTime >= 0)\r\n                    playTotalTime += (this._startTime - playStartTime);\r\n\r\n                target.setProp(ObjectPropID.Playing, playStartTime >= 0);\r\n                target.setProp(ObjectPropID.Frame, frame);\r\n                if (playTotalTime > 0)\r\n                    target.setProp(ObjectPropID.DeltaTime, playTotalTime * 1000);\r\n            }\r\n        }\r\n\r\n        private onDelayedPlayItem(tweener: GTweener): void {\r\n            var item: Item = <Item>tweener.target;\r\n            item.tweener = null;\r\n            this._totalTasks--;\r\n\r\n            this.applyValue(item);\r\n            this.callHook(item, false);\r\n\r\n            this.checkAllComplete();\r\n        }\r\n\r\n        private onTweenStart(tweener: GTweener): void {\r\n            var item: Item = <Item>tweener.target;\r\n\r\n            if (item.type == ActionType.XY || item.type == ActionType.Size) //位置和大小要到start才最终确认起始值\r\n            {\r\n                var startValue: TValue;\r\n                var endValue: TValue;\r\n\r\n                if (this._reversed) {\r\n                    startValue = item.tweenConfig.endValue;\r\n                    endValue = item.tweenConfig.startValue;\r\n                }\r\n                else {\r\n                    startValue = item.tweenConfig.startValue;\r\n                    endValue = item.tweenConfig.endValue;\r\n                }\r\n\r\n                if (item.type == ActionType.XY) {\r\n                    if (item.target != this._owner) {\r\n                        if (!startValue.b1)\r\n                            tweener.startValue.x = item.target.x;\r\n                        else if (startValue.b3) //percent\r\n                            tweener.startValue.x = startValue.f1 * this._owner.width;\r\n\r\n                        if (!startValue.b2)\r\n                            tweener.startValue.y = item.target.y;\r\n                        else if (startValue.b3) //percent\r\n                            tweener.startValue.y = startValue.f2 * this._owner.height;\r\n\r\n                        if (!endValue.b1)\r\n                            tweener.endValue.x = tweener.startValue.x;\r\n                        else if (endValue.b3)\r\n                            tweener.endValue.x = endValue.f1 * this._owner.width;\r\n\r\n                        if (!endValue.b2)\r\n                            tweener.endValue.y = tweener.startValue.y;\r\n                        else if (endValue.b3)\r\n                            tweener.endValue.y = endValue.f2 * this._owner.height;\r\n                    }\r\n                    else {\r\n                        if (!startValue.b1)\r\n                            tweener.startValue.x = item.target.x - this._ownerBaseX;\r\n                        if (!startValue.b2)\r\n                            tweener.startValue.y = item.target.y - this._ownerBaseY;\r\n\r\n                        if (!endValue.b1)\r\n                            tweener.endValue.x = tweener.startValue.x;\r\n                        if (!endValue.b2)\r\n                            tweener.endValue.y = tweener.startValue.y;\r\n                    }\r\n                }\r\n                else {\r\n                    if (!startValue.b1)\r\n                        tweener.startValue.x = item.target.width;\r\n                    if (!startValue.b2)\r\n                        tweener.startValue.y = item.target.height;\r\n\r\n                    if (!endValue.b1)\r\n                        tweener.endValue.x = tweener.startValue.x;\r\n                    if (!endValue.b2)\r\n                        tweener.endValue.y = tweener.startValue.y;\r\n                }\r\n\r\n                if (item.tweenConfig.path) {\r\n                    item.value.b1 = item.value.b2 = true;\r\n                    tweener.setPath(item.tweenConfig.path);\r\n                }\r\n            }\r\n\r\n            this.callHook(item, false);\r\n        }\r\n\r\n        private onTweenUpdate(tweener: GTweener): void {\r\n            var item: Item = <Item>tweener.target;\r\n            switch (item.type) {\r\n                case ActionType.XY:\r\n                case ActionType.Size:\r\n                case ActionType.Scale:\r\n                case ActionType.Skew:\r\n                    item.value.f1 = tweener.value.x;\r\n                    item.value.f2 = tweener.value.y;\r\n                    if (item.tweenConfig.path) {\r\n                        item.value.f1 += tweener.startValue.x;\r\n                        item.value.f2 += tweener.startValue.y;\r\n                    }\r\n                    break;\r\n\r\n                case ActionType.Alpha:\r\n                case ActionType.Rotation:\r\n                    item.value.f1 = tweener.value.x;\r\n                    break;\r\n\r\n                case ActionType.Color:\r\n                    item.value.f1 = tweener.value.color;\r\n                    break;\r\n\r\n                case ActionType.ColorFilter:\r\n                    item.value.f1 = tweener.value.x;\r\n                    item.value.f2 = tweener.value.y;\r\n                    item.value.f3 = tweener.value.z;\r\n                    item.value.f4 = tweener.value.w;\r\n                    break;\r\n\r\n                case ActionType.Shake:\r\n                    item.value.offsetX = tweener.deltaValue.x;\r\n                    item.value.offsetY = tweener.deltaValue.y;\r\n                    break;\r\n            }\r\n\r\n            this.applyValue(item);\r\n        }\r\n\r\n        private onTweenComplete(tweener: GTweener): void {\r\n            var item: Item = <Item>tweener.target;\r\n            item.tweener = null;\r\n            this._totalTasks--;\r\n\r\n            if (tweener.allCompleted) //当整体播放结束时间在这个tween的中间时不应该调用结尾钩子\r\n                this.callHook(item, true);\r\n\r\n            this.checkAllComplete();\r\n        }\r\n\r\n        private onPlayTransCompleted(item: Item): void {\r\n            this._totalTasks--;\r\n\r\n            this.checkAllComplete();\r\n        }\r\n\r\n        private callHook(item: Item, tweenEnd: boolean): void {\r\n            if (tweenEnd) {\r\n                if (item.tweenConfig && item.tweenConfig.endHook)\r\n                    item.tweenConfig.endHook.call(item.tweenConfig.endHookCaller);\r\n            }\r\n            else {\r\n                if (item.time >= this._startTime && item.hook != null)\r\n                    item.hook.call(item.hookCaller);\r\n            }\r\n        }\r\n\r\n        private checkAllComplete(): void {\r\n            if (this._playing && this._totalTasks == 0) {\r\n                if (this._totalTimes < 0) {\r\n                    this.internalPlay();\r\n                    if (this._totalTasks == 0)\r\n                        GTween.delayedCall(0).setTarget(this).onComplete(this.checkAllComplete, this);\r\n                }\r\n                else {\r\n                    this._totalTimes--;\r\n                    if (this._totalTimes > 0) {\r\n                        this.internalPlay();\r\n                        if (this._totalTasks == 0)\r\n                            GTween.delayedCall(0).setTarget(this).onComplete(this.checkAllComplete, this);\r\n                    }\r\n                    else {\r\n                        this._playing = false;\r\n\r\n                        var cnt: number = this._items.length;\r\n                        for (var i: number = 0; i < cnt; i++) {\r\n                            var item: Item = this._items[i];\r\n                            if (item.target && item.displayLockToken != 0) {\r\n                                item.target.releaseDisplayLock(item.displayLockToken);\r\n                                item.displayLockToken = 0;\r\n                            }\r\n                        }\r\n\r\n                        if (this._onComplete != null) {\r\n                            var func: Function = this._onComplete;\r\n                            var param: any = this._onCompleteParam;\r\n                            var thisObj: any = this._onCompleteCaller;\r\n                            this._onComplete = null;\r\n                            this._onCompleteParam = null;\r\n                            this._onCompleteCaller = null;\r\n                            func.call(thisObj, param);\r\n                        }\r\n                    }\r\n                }\r\n            }\r\n        }\r\n\r\n        private applyValue(item: Item): void {\r\n            item.target._gearLocked = true;\r\n            var value: any = item.value;\r\n\r\n            switch (item.type) {\r\n                case ActionType.XY:\r\n                    if (item.target == this._owner) {\r\n                        if (value.b1 && value.b2)\r\n                            item.target.setXY(value.f1 + this._ownerBaseX, value.f2 + this._ownerBaseY);\r\n                        else if (value.b1)\r\n                            item.target.x = value.f1 + this._ownerBaseX;\r\n                        else\r\n                            item.target.y = value.f2 + this._ownerBaseY;\r\n                    }\r\n                    else {\r\n                        if (value.b3) //position in percent\r\n                        {\r\n                            if (value.b1 && value.b2)\r\n                                item.target.setXY(value.f1 * this._owner.width, value.f2 * this._owner.height);\r\n                            else if (value.b1)\r\n                                item.target.x = value.f1 * this._owner.width;\r\n                            else if (value.b2)\r\n                                item.target.y = value.f2 * this._owner.height;\r\n                        }\r\n                        else {\r\n                            if (value.b1 && value.b2)\r\n                                item.target.setXY(value.f1, value.f2);\r\n                            else if (value.b1)\r\n                                item.target.x = value.f1;\r\n                            else if (value.b2)\r\n                                item.target.y = value.f2;\r\n                        }\r\n                    }\r\n                    break;\r\n\r\n                case ActionType.Size:\r\n                    if (!value.b1)\r\n                        value.f1 = item.target.width;\r\n                    if (!value.b2)\r\n                        value.f2 = item.target.height;\r\n                    item.target.setSize(value.f1, value.f2);\r\n                    break;\r\n\r\n                case ActionType.Pivot:\r\n                    item.target.setPivot(value.f1, value.f2, item.target.pivotAsAnchor);\r\n                    break;\r\n\r\n                case ActionType.Alpha:\r\n                    item.target.alpha = value.f1;\r\n                    break;\r\n\r\n                case ActionType.Rotation:\r\n                    item.target.rotation = value.f1;\r\n                    break;\r\n\r\n                case ActionType.Scale:\r\n                    item.target.setScale(value.f1, value.f2);\r\n                    break;\r\n\r\n                case ActionType.Skew:\r\n                    item.target.setSkew(value.f1, value.f2);\r\n                    break;\r\n\r\n                case ActionType.Color:\r\n                    item.target.setProp(ObjectPropID.Color, value.f1);\r\n                    break;\r\n\r\n                case ActionType.Animation:\r\n                    if (value.frame >= 0)\r\n                        item.target.setProp(ObjectPropID.Frame, value.frame);\r\n                    item.target.setProp(ObjectPropID.Playing, value.playing);\r\n                    item.target.setProp(ObjectPropID.TimeScale, this._timeScale);\r\n                    break;\r\n\r\n                case ActionType.Visible:\r\n                    item.target.visible = value.visible;\r\n                    break;\r\n\r\n                case ActionType.Transition:\r\n                    if (this._playing) {\r\n                        var trans: Transition = value.trans;\r\n                        if (trans) {\r\n                            this._totalTasks++;\r\n                            var startTime: number = this._startTime > item.time ? (this._startTime - item.time) : 0;\r\n                            var endTime: number = this._endTime >= 0 ? (this._endTime - item.time) : -1;\r\n                            if (value.stopTime >= 0 && (endTime < 0 || endTime > value.stopTime))\r\n                                endTime = value.stopTime;\r\n                            trans.timeScale = this._timeScale;\r\n                            trans._play(this.onPlayTransCompleted, this, item, value.playTimes, 0, startTime, endTime, this._reversed);\r\n                        }\r\n                    }\r\n                    break;\r\n\r\n                case ActionType.Sound:\r\n                    if (this._playing && item.time >= this._startTime) {\r\n                        if (!value.audioClip) {\r\n                            var pi: PackageItem = UIPackage.getItemByURL(value.sound);\r\n                            if (pi)\r\n                                value.audioClip = <egret.Sound>pi.owner.getItemAsset(pi);\r\n                        }\r\n                        if (value.audioClip)\r\n                            GRoot.inst.playOneShotSound(value.audioClip, value.volume);\r\n                    }\r\n                    break;\r\n\r\n                case ActionType.Shake:\r\n                    item.target.setXY(item.target.x - value.lastOffsetX + value.offsetX, item.target.y - value.lastOffsetY + value.offsetY);\r\n                    value.lastOffsetX = value.offsetX;\r\n                    value.lastOffsetY = value.offsetY;\r\n                    break;\r\n\r\n                case ActionType.ColorFilter:\r\n                    {\r\n                        ToolSet.setColorFilter(item.target.displayObject, [value.f1, value.f2, value.f3, value.f4]);\r\n                        break;\r\n                    }\r\n                case ActionType.Text:\r\n                    item.target.text = value.text;\r\n                    break;\r\n\r\n                case ActionType.Icon:\r\n                    item.target.icon = value.text;\r\n                    break;\r\n            }\r\n\r\n            item.target._gearLocked = false;\r\n        }\r\n\r\n        public setup(buffer: ByteBuffer): void {\r\n            this.name = buffer.readS();\r\n            this._options = buffer.readInt();\r\n            this._autoPlay = buffer.readBool();\r\n            this._autoPlayTimes = buffer.readInt();\r\n            this._autoPlayDelay = buffer.readFloat();\r\n\r\n            var cnt: number = buffer.readShort();\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                var dataLen: number = buffer.readShort();\r\n                var curPos: number = buffer.position;\r\n\r\n                buffer.seek(curPos, 0);\r\n\r\n                var item: Item = new Item(buffer.readByte());\r\n                this._items[i] = item;\r\n\r\n                item.time = buffer.readFloat();\r\n                var targetId: number = buffer.readShort();\r\n                if (targetId < 0)\r\n                    item.targetId = \"\";\r\n                else\r\n                    item.targetId = this._owner.getChildAt(targetId).id;\r\n                item.label = buffer.readS();\r\n\r\n                if (buffer.readBool()) {\r\n                    buffer.seek(curPos, 1);\r\n\r\n                    item.tweenConfig = new TweenConfig();\r\n                    item.tweenConfig.duration = buffer.readFloat();\r\n                    if (item.time + item.tweenConfig.duration > this._totalDuration)\r\n                        this._totalDuration = item.time + item.tweenConfig.duration;\r\n                    item.tweenConfig.easeType = buffer.readByte();\r\n                    item.tweenConfig.repeat = buffer.readInt();\r\n                    item.tweenConfig.yoyo = buffer.readBool();\r\n                    item.tweenConfig.endLabel = buffer.readS();\r\n\r\n                    buffer.seek(curPos, 2);\r\n\r\n                    this.decodeValue(item, buffer, item.tweenConfig.startValue);\r\n\r\n                    buffer.seek(curPos, 3);\r\n\r\n                    this.decodeValue(item, buffer, item.tweenConfig.endValue);\r\n\r\n                    if (buffer.version >= 2) {\r\n                        var pathLen: number = buffer.readInt();\r\n                        if (pathLen > 0) {\r\n                            item.tweenConfig.path = new GPath();\r\n                            var pts: Array<GPathPoint> = new Array<GPathPoint>();\r\n\r\n                            for (var j: number = 0; j < pathLen; j++) {\r\n                                var curveType: number = buffer.readByte();\r\n                                switch (curveType) {\r\n                                    case CurveType.Bezier:\r\n                                        pts.push(GPathPoint.newBezierPoint(buffer.readFloat(), buffer.readFloat(),\r\n                                            buffer.readFloat(), buffer.readFloat()));\r\n                                        break;\r\n\r\n                                    case CurveType.CubicBezier:\r\n                                        pts.push(GPathPoint.newCubicBezierPoint(buffer.readFloat(), buffer.readFloat(),\r\n                                            buffer.readFloat(), buffer.readFloat(),\r\n                                            buffer.readFloat(), buffer.readFloat()));\r\n                                        break;\r\n\r\n                                    default:\r\n                                        pts.push(GPathPoint.newPoint(buffer.readFloat(), buffer.readFloat(), curveType));\r\n                                        break;\r\n                                }\r\n                            }\r\n\r\n                            item.tweenConfig.path.create(pts);\r\n                        }\r\n                    }\r\n                }\r\n                else {\r\n                    if (item.time > this._totalDuration)\r\n                        this._totalDuration = item.time;\r\n\r\n                    buffer.seek(curPos, 2);\r\n\r\n                    this.decodeValue(item, buffer, item.value);\r\n                }\r\n\r\n                buffer.position = curPos + dataLen;\r\n            }\r\n        }\r\n\r\n        private decodeValue(item: Item, buffer: ByteBuffer, value: TValue): void {\r\n            switch (item.type) {\r\n                case ActionType.XY:\r\n                case ActionType.Size:\r\n                case ActionType.Pivot:\r\n                case ActionType.Skew:\r\n                    value.b1 = buffer.readBool();\r\n                    value.b2 = buffer.readBool();\r\n                    value.f1 = buffer.readFloat();\r\n                    value.f2 = buffer.readFloat();\r\n\r\n                    if (buffer.version >= 2 && item.type == ActionType.XY)\r\n                        value.b3 = buffer.readBool(); //percent\r\n                    break;\r\n\r\n                case ActionType.Alpha:\r\n                case ActionType.Rotation:\r\n                    value.f1 = buffer.readFloat();\r\n                    break;\r\n\r\n                case ActionType.Scale:\r\n                    value.f1 = buffer.readFloat();\r\n                    value.f2 = buffer.readFloat();\r\n                    break;\r\n\r\n                case ActionType.Color:\r\n                    value.f1 = buffer.readColor();\r\n                    break;\r\n\r\n                case ActionType.Animation:\r\n                    value.playing = buffer.readBool();\r\n                    value.frame = buffer.readInt();\r\n                    break;\r\n\r\n                case ActionType.Visible:\r\n                    value.visible = buffer.readBool();\r\n                    break;\r\n\r\n                case ActionType.Sound:\r\n                    value.sound = buffer.readS();\r\n                    value.volume = buffer.readFloat();\r\n                    break;\r\n\r\n                case ActionType.Transition:\r\n                    value.transName = buffer.readS();\r\n                    value.playTimes = buffer.readInt();\r\n                    break;\r\n\r\n                case ActionType.Shake:\r\n                    value.amplitude = buffer.readFloat();\r\n                    value.duration = buffer.readFloat();\r\n                    break;\r\n\r\n                case ActionType.ColorFilter:\r\n                    value.f1 = buffer.readFloat();\r\n                    value.f2 = buffer.readFloat();\r\n                    value.f3 = buffer.readFloat();\r\n                    value.f4 = buffer.readFloat();\r\n                    break;\r\n\r\n                case ActionType.Text:\r\n                case ActionType.Icon:\r\n                    value.text = buffer.readS();\r\n                    break;\r\n            }\r\n        }\r\n    }\r\n\r\n    const OPTION_IGNORE_DISPLAY_CONTROLLER: number = 1;\r\n    const OPTION_AUTO_STOP_DISABLED: number = 2;\r\n    const OPTION_AUTO_STOP_AT_END: number = 4;\r\n\r\n    class ActionType {\r\n        public static XY: number = 0;\r\n        public static Size: number = 1;\r\n        public static Scale: number = 2;\r\n        public static Pivot: number = 3;\r\n        public static Alpha: number = 4;\r\n        public static Rotation: number = 5;\r\n        public static Color: number = 6;\r\n        public static Animation: number = 7;\r\n        public static Visible: number = 8;\r\n        public static Sound: number = 9;\r\n        public static Transition: number = 10;\r\n        public static Shake: number = 11;\r\n        public static ColorFilter: number = 12;\r\n        public static Skew: number = 13;\r\n        public static Text: number = 14;\r\n        public static Icon: number = 15;\r\n        public static Unknown: number = 16;\r\n    }\r\n\r\n    class Item {\r\n        public time: number;\r\n        public targetId: string;\r\n        public type: number;\r\n        public tweenConfig?: TweenConfig;\r\n        public label?: string;\r\n        public value?: TValue;\r\n        public hook?: Function;\r\n        public hookCaller?: any;\r\n\r\n        public tweener?: GTweener;\r\n        public target: GObject;\r\n        public displayLockToken: number;\r\n\r\n        public constructor(type: number) {\r\n            this.type = type;\r\n            this.value = {};\r\n            this.displayLockToken = 0;\r\n        }\r\n    }\r\n\r\n    class TweenConfig {\r\n        public duration: number = 0;\r\n        public easeType: number;\r\n        public repeat: number = 0;\r\n        public yoyo?: boolean;\r\n        public startValue: TValue;\r\n        public endValue: TValue;\r\n        public endLabel: string;\r\n        public endHook?: Function;\r\n        public endHookCaller?: any;\r\n        public path?: GPath;\r\n\r\n        public constructor() {\r\n            this.easeType = EaseType.QuadOut;\r\n            this.startValue = { b1: true, b2: true };\r\n            this.endValue = { b1: true, b2: true };\r\n        }\r\n    }\r\n\r\n    interface TValue {\r\n        visible?: boolean;\r\n\r\n        frame?: number;\r\n        playing?: boolean;\r\n        flag?: boolean;\r\n\r\n        sound?: string;\r\n        volume?: number;\r\n        audioClip?: egret.Sound;\r\n\r\n        transName?: string;\r\n        playTimes?: number;\r\n        trans?: Transition;\r\n        stopTime?: number;\r\n\r\n        amplitude?: number;\r\n        duration?: number;\r\n        offsetX?: number;\r\n        offsetY?: number;\r\n        lastOffsetX?: number;\r\n        lastOffsetY?: number;\r\n\r\n        text?: string;\r\n\r\n        f1?: number;\r\n        f2?: number;\r\n        f3?: number;\r\n        f4?: number;\r\n\r\n        b1?: boolean;\r\n        b2?: boolean;\r\n        b3?: boolean;\r\n    }\r\n}"
  },
  {
    "path": "source/src/TranslationHelper.ts",
    "content": "module fgui {\r\n    export class TranslationHelper {\r\n        public static strings: { [index: string]: { [index: string]: string } };\r\n\r\n        public static loadFromXML(source: string): void {\r\n            let strings = {};\r\n            TranslationHelper.strings = strings;\r\n\r\n            var xml: any = egret.XML.parse(source);\r\n            var nodes: any = xml.children;\r\n            var length1: number = nodes.length;\r\n            for (var i1: number = 0; i1 < length1; i1++) {\r\n                var cxml: any = nodes[i1];\r\n                if (cxml.name == \"string\") {\r\n                    var key: string = cxml.attributes.name;\r\n                    var text: string = cxml.children.length > 0 ? cxml.children[0].text : \"\";\r\n                    var i: number = key.indexOf(\"-\");\r\n                    if (i == -1)\r\n                        continue;\r\n\r\n                    var key2: string = key.substr(0, i);\r\n                    var key3: string = key.substr(i + 1);\r\n                    var col: any = strings[key2];\r\n                    if (!col) {\r\n                        col = {};\r\n                        strings[key2] = col;\r\n                    }\r\n                    col[key3] = text;\r\n                }\r\n            }\r\n        }\r\n\r\n        public static translateComponent(item: PackageItem): void {\r\n            if (TranslationHelper.strings == null)\r\n                return;\r\n\r\n            var compStrings: { [index: string]: string } = TranslationHelper.strings[item.owner.id + item.id];\r\n            if (compStrings == null)\r\n                return;\r\n\r\n            var elementId: string, value: string;\r\n            var buffer: ByteBuffer = item.rawData;\r\n            var nextPos: number;\r\n            var itemCount: number;\r\n            var i: number, j: number, k: number;\r\n            var dataLen: number;\r\n            var curPos: number;\r\n            var valueCnt: number;\r\n            var page: string;\r\n\r\n            buffer.seek(0, 2);\r\n\r\n            var childCount: number = buffer.readShort();\r\n            for (i = 0; i < childCount; i++) {\r\n                dataLen = buffer.readShort();\r\n                curPos = buffer.position;\r\n\r\n                buffer.seek(curPos, 0);\r\n\r\n                var baseType: number = buffer.readByte();\r\n                var type: number = baseType;\r\n                buffer.skip(4);\r\n                elementId = buffer.readS();\r\n\r\n                if (type == ObjectType.Component) {\r\n                    if (buffer.seek(curPos, 6))\r\n                        type = buffer.readByte();\r\n                }\r\n\r\n                buffer.seek(curPos, 1);\r\n\r\n                if ((value = compStrings[elementId + \"-tips\"]) != null)\r\n                    buffer.writeS(value);\r\n\r\n                buffer.seek(curPos, 2);\r\n\r\n                var gearCnt: number = buffer.readShort();\r\n                for (j = 0; j < gearCnt; j++) {\r\n                    nextPos = buffer.readShort();\r\n                    nextPos += buffer.position;\r\n\r\n                    if (buffer.readByte() == 6) //gearText\r\n                    {\r\n                        buffer.skip(2);//controller\r\n                        valueCnt = buffer.readShort();\r\n                        for (k = 0; k < valueCnt; k++) {\r\n                            page = buffer.readS();\r\n                            if (page != null) {\r\n                                if ((value = compStrings[elementId + \"-texts_\" + k]) != null)\r\n                                    buffer.writeS(value);\r\n                                else\r\n                                    buffer.skip(2);\r\n                            }\r\n                        }\r\n\r\n                        if (buffer.readBool() && (value = compStrings[elementId + \"-texts_def\"]) != null)\r\n                            buffer.writeS(value);\r\n                    }\r\n\r\n                    if (baseType == ObjectType.Component && buffer.version >= 2) {\r\n                        buffer.seek(curPos, 4);\r\n\r\n                        buffer.skip(2); //pageController\r\n\r\n                        buffer.skip(4 * buffer.readShort());\r\n\r\n                        var cpCount: number = buffer.readShort();\r\n                        for (var k: number = 0; k < cpCount; k++) {\r\n                            var target: string = buffer.readS();\r\n                            var propertyId: number = buffer.readShort();\r\n                            if (propertyId == 0 && (value = compStrings[elementId + \"-cp-\" + target]) != null)\r\n                                buffer.writeS(value);\r\n                            else\r\n                                buffer.skip(2);\r\n                        }\r\n                    }\r\n\r\n                    buffer.position = nextPos;\r\n                }\r\n\r\n                switch (type) {\r\n                    case ObjectType.Text:\r\n                    case ObjectType.RichText:\r\n                    case ObjectType.InputText:\r\n                        {\r\n                            if ((value = compStrings[elementId]) != null) {\r\n                                buffer.seek(curPos, 6);\r\n                                buffer.writeS(value);\r\n                            }\r\n                            if ((value = compStrings[elementId + \"-prompt\"]) != null) {\r\n                                buffer.seek(curPos, 4);\r\n                                buffer.writeS(value);\r\n                            }\r\n                            break;\r\n                        }\r\n\r\n                    case ObjectType.List:\r\n                    case ObjectType.Tree:\r\n                        {\r\n                            buffer.seek(curPos, 8);\r\n                            buffer.skip(2);\r\n                            itemCount = buffer.readShort();\r\n                            for (j = 0; j < itemCount; j++) {\r\n                                nextPos = buffer.readShort();\r\n                                nextPos += buffer.position;\r\n\r\n                                buffer.skip(2); //url\r\n                                if (type == ObjectType.Tree)\r\n                                    buffer.skip(2);\r\n\r\n                                //title\r\n                                if ((value = compStrings[elementId + \"-\" + j]) != null)\r\n                                    buffer.writeS(value);\r\n                                else\r\n                                    buffer.skip(2);\r\n\r\n                                //selected title\r\n                                if ((value = compStrings[elementId + \"-\" + j + \"-0\"]) != null)\r\n                                    buffer.writeS(value);\r\n                                else\r\n                                    buffer.skip(2);\r\n\r\n                                if (buffer.version >= 2) {\r\n                                    buffer.skip(6);\r\n                                    buffer.skip(buffer.readUnsignedShort() * 4);//controllers\r\n\r\n                                    var cpCount: number = buffer.readUnsignedShort();\r\n                                    for (var k: number = 0; k < cpCount; k++) {\r\n                                        var target: string = buffer.readS();\r\n                                        var propertyId: number = buffer.readUnsignedShort();\r\n                                        if (propertyId == 0 && (value = compStrings[elementId + \"-\" + j + \"-\" + target]) != null)\r\n                                            buffer.writeS(value);\r\n                                        else\r\n                                            buffer.skip(2);\r\n                                    }\r\n                                }\r\n\r\n                                buffer.position = nextPos;\r\n                            }\r\n                            break;\r\n                        }\r\n\r\n                    case ObjectType.Label:\r\n                        {\r\n                            if (buffer.seek(curPos, 6) && buffer.readByte() == type) {\r\n                                if ((value = compStrings[elementId]) != null)\r\n                                    buffer.writeS(value);\r\n                                else\r\n                                    buffer.skip(2);\r\n\r\n                                buffer.skip(2);\r\n                                if (buffer.readBool())\r\n                                    buffer.skip(4);\r\n                                buffer.skip(4);\r\n                                if (buffer.readBool() && (value = compStrings[elementId + \"-prompt\"]) != null)\r\n                                    buffer.writeS(value);\r\n                            }\r\n                            break;\r\n                        }\r\n\r\n                    case ObjectType.Button:\r\n                        {\r\n                            if (buffer.seek(curPos, 6) && buffer.readByte() == type) {\r\n                                if ((value = compStrings[elementId]) != null)\r\n                                    buffer.writeS(value);\r\n                                else\r\n                                    buffer.skip(2);\r\n                                if ((value = compStrings[elementId + \"-0\"]) != null)\r\n                                    buffer.writeS(value);\r\n                            }\r\n                            break;\r\n                        }\r\n\r\n                    case ObjectType.ComboBox:\r\n                        {\r\n                            if (buffer.seek(curPos, 6) && buffer.readByte() == type) {\r\n                                itemCount = buffer.readShort();\r\n                                for (j = 0; j < itemCount; j++) {\r\n                                    nextPos = buffer.readShort();\r\n                                    nextPos += buffer.position;\r\n\r\n                                    if ((value = compStrings[elementId + \"-\" + j]) != null)\r\n                                        buffer.writeS(value);\r\n\r\n                                    buffer.position = nextPos;\r\n                                }\r\n\r\n                                if ((value = compStrings[elementId]) != null)\r\n                                    buffer.writeS(value);\r\n                            }\r\n\r\n                            break;\r\n                        }\r\n                }\r\n\r\n                buffer.position = curPos + dataLen;\r\n            }\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "source/src/UIConfig.ts",
    "content": "\nmodule fgui {\n\n    export class UIConfig {\n        public constructor() {\n        }\n\n        //Default font name\n        public static defaultFont: string = \"SimSun\";\n\n        //Resource using in Window.ShowModalWait for locking the window.\n        public static windowModalWaiting: string;\n        //Resource using in GRoot.ShowModalWait for locking the screen.\n        public static globalModalWaiting: string;\n\n        //When a modal window is in front, the background becomes dark.\n        public static modalLayerColor: number = 0x333333;\n        public static modalLayerAlpha: number = 0.2;\n\n        //Default button click sound\n        public static buttonSound: string;\n        public static buttonSoundVolumeScale: number = 1;\n\n        //Default button click sound\n        public static horizontalScrollBar: string;\n        public static verticalScrollBar: string;\n        //Scrolling step in pixels\n        public static defaultScrollStep: number = 25;\n\t\t//Deceleration ratio of scrollpane when its in touch dragging.\n\t\tpublic static defaultScrollDecelerationRate:number = 0.967;\n        //Default scrollbar display mode. Recommened visible for Desktop and Auto for mobile.\n        public static defaultScrollBarDisplay: number = ScrollBarDisplayType.Visible;\n        //Allow dragging the content to scroll. Recommeded true for mobile.\n        public static defaultScrollTouchEffect: boolean = true;\n        //The \"rebound\" effect in the scolling container. Recommeded true for mobile.\n        public static defaultScrollBounceEffect: boolean = true;\n\n        //Resources for PopupMenu.\n        public static popupMenu: string;\n        //Resources for seperator of PopupMenu.\n        public static popupMenu_seperator: string;\n        //In case of failure of loading content for GLoader, use this sign to indicate an error.\n        public static loaderErrorSign: string;\n        //Resources for tooltips.\n        public static tooltipsWin: string;\n\n        //Max items displayed in combobox without scrolling.\n        public static defaultComboBoxVisibleItemCount: number = 10;\n\n        // Pixel offsets of finger to trigger scrolling.\n        public static touchScrollSensitivity: number = 20;\n\n        // Pixel offsets of finger to trigger dragging.\n        public static touchDragSensitivity: number = 10;\n\n        // Pixel offsets of mouse pointer to trigger dragging.\n        public static clickDragSensitivity: number = 2;\n\n        // When click the window, brings to front automatically.\n        public static bringWindowToFrontOnClick: boolean = true;\n\n        public static frameTimeForAsyncUIConstruction: number = 2;\n    }\n}"
  },
  {
    "path": "source/src/UIObjectFactory.ts",
    "content": "\nmodule fgui {\n\n    export class UIObjectFactory {\n        public static extensions: { [index: string]: new () => GComponent } = {};\n        public static loaderType: new () => GLoader;\n        public static loader3DType: new () => GLoader3D;\n\n        public constructor() {\n        }\n\n        public static setExtension(url: string, type: new () => GComponent): void {\n            if (url == null)\n                throw \"Invaild url: \" + url;\n\n            var pi: PackageItem = UIPackage.getItemByURL(url);\n            if (pi)\n                pi.extensionType = type;\n\n            UIObjectFactory.extensions[url] = type;\n        }\n\n        public static setPackageItemExtension(url: string, type: new () => GComponent): void {\n            UIObjectFactory.setExtension(url, type);\n        }\n\n        public static setLoaderExtension(type: new () => GLoader): void {\n            UIObjectFactory.loaderType = type;\n        }\n\n        public static setLoader3DExtension(type: new () => GLoader3D): void {\n            UIObjectFactory.loader3DType = type;\n        }\n\n        public static resolvePackageItemExtension(pi: PackageItem): void {\n            var extensionType = UIObjectFactory.extensions[\"ui://\" + pi.owner.id + pi.id];\n            if (!extensionType)\n                extensionType = UIObjectFactory.extensions[\"ui://\" + pi.owner.name + \"/\" + pi.name];\n            if (extensionType)\n                pi.extensionType = extensionType;\n        }\n\n        public static newObject(type: number | PackageItem, userClass?: new () => GObject): GObject {\n            var obj: GObject;\n\n            if (typeof type === 'number') {\n                switch (type) {\n                    case ObjectType.Image:\n                        return new GImage();\n\n                    case ObjectType.MovieClip:\n                        return new GMovieClip();\n\n                    case ObjectType.Component:\n                        return new GComponent();\n\n                    case ObjectType.Text:\n                        return new GTextField();\n\n                    case ObjectType.RichText:\n                        return new GRichTextField();\n\n                    case ObjectType.InputText:\n                        return new GTextInput();\n\n                    case ObjectType.Group:\n                        return new GGroup();\n\n                    case ObjectType.List:\n                        return new GList();\n\n                    case ObjectType.Graph:\n                        return new GGraph();\n\n                    case ObjectType.Loader:\n                        if (UIObjectFactory.loaderType)\n                            return new UIObjectFactory.loaderType();\n                        else\n                            return new GLoader();\n\n                    case ObjectType.Button:\n                        return new GButton();\n\n                    case ObjectType.Label:\n                        return new GLabel();\n\n                    case ObjectType.ProgressBar:\n                        return new GProgressBar();\n\n                    case ObjectType.Slider:\n                        return new GSlider();\n\n                    case ObjectType.ScrollBar:\n                        return new GScrollBar();\n\n                    case ObjectType.ComboBox:\n                        return new GComboBox();\n\n                    case ObjectType.Tree:\n                        return new GTree();\n\n                    case ObjectType.Loader3D:\n                        if (UIObjectFactory.loader3DType) {\n                            return new UIObjectFactory.loader3DType();\n                        } else {\n                            return new GLoader3D();\n                        }\n\n                    default:\n                        return null;\n                }\n            }\n            else {\n                if (type.type == PackageItemType.Component) {\n                    if (userClass)\n                        obj = new userClass();\n                    else if (type.extensionType)\n                        obj = new type.extensionType();\n                    else\n                        obj = UIObjectFactory.newObject(type.objectType);\n                }\n                else\n                    obj = UIObjectFactory.newObject(type.objectType);\n\n                if (obj)\n                    obj.packageItem = type;\n            }\n\n            return obj;\n        }\n    }\n}"
  },
  {
    "path": "source/src/UIPackage.ts",
    "content": "\nmodule fgui {\n\n    type PackageDependency = { id: string, name: string };\n\n    export class UIPackage {\n        private _id: string;\n        private _name: string;\n        private _items: Array<PackageItem>;\n        private _itemsById: { [index: string]: PackageItem };\n        private _itemsByName: { [index: string]: PackageItem };\n        private _resKey: string;\n        private _customId: string;\n        private _sprites: { [index: string]: AtlasSprite };\n\n        private _dependencies: Array<PackageDependency>;\n        private _branches: Array<string>;\n        public _branchIndex: number;\n\n        //internal\n        public static _constructing: number = 0;\n\n        private static _instById: { [index: string]: UIPackage } = {};\n        private static _instByName: { [index: string]: UIPackage } = {};\n        private static _branch: string = \"\";\n        private static _vars: { [index: string]: string } = {};\n\n        public constructor() {\n            this._items = [];\n            this._itemsById = {};\n            this._itemsByName = {};\n            this._sprites = {};\n            this._dependencies = [];\n            this._branches = [];\n            this._branchIndex = -1;\n        }\n\n        public static get branch(): string {\n            return UIPackage._branch;\n        }\n\n        public static set branch(value: string) {\n            UIPackage._branch = value;\n            for (var pkgId in UIPackage._instById) {\n                var pkg: UIPackage = UIPackage._instById[pkgId];\n                if (pkg._branches) {\n                    pkg._branchIndex = pkg._branches.indexOf(value);\n                }\n            }\n        }\n\n        public static getVar(key: string): string {\n            return UIPackage._vars[key];\n        }\n\n        public static setVar(key: string, value: string) {\n            UIPackage._vars[key] = value;\n        }\n\n        public static getById(id: string): UIPackage {\n            return UIPackage._instById[id];\n        }\n\n        public static getByName(name: string): UIPackage {\n            return UIPackage._instByName[name];\n        }\n\n        public static async loadPackage(resKey: string): Promise<UIPackage> {\n            return new Promise<UIPackage>(async resolve => {\n                let pkg: UIPackage = UIPackage._instById[resKey];\n                if (pkg) {\n                    resolve(pkg);\n                    return;\n                }\n\n                const asset = await RES.getResAsync(getAssetResKey(resKey, \"fui\"));\n                pkg = new UIPackage();\n                pkg._resKey = resKey;\n                pkg.loadPackage(new ByteBuffer(asset));\n                let cnt: number = pkg._items.length;\n                let tasks = [];\n                for (var i: number = 0; i < cnt; i++) {\n                    var pi: PackageItem = pkg._items[i];\n                    if (pi.type == PackageItemType.Atlas || pi.type == PackageItemType.Sound) {\n                        tasks.push(RES.getResAsync(pi.file));\n                    }\n                }\n\n                if (tasks.length > 0)\n                    await Promise.all(tasks);\n\n                UIPackage._instById[pkg.id] = pkg;\n                UIPackage._instByName[pkg.name] = pkg;\n                UIPackage._instById[pkg._resKey] = pkg;\n\n                resolve(pkg);\n            });\n        }\n\n        public static addPackage(resKey: string, descData?: ArrayBuffer): UIPackage {\n            if (!descData) {\n                descData = RES.getRes(resKey);\n                if (!descData)\n                    throw \"Resource '\" + resKey + \"' not found, please check default.res.json!\";\n            }\n\n            var pkg: UIPackage = new UIPackage();\n            pkg._resKey = resKey;\n            pkg.loadPackage(new ByteBuffer(descData));\n            UIPackage._instById[pkg.id] = pkg;\n            UIPackage._instByName[pkg.name] = pkg;\n            UIPackage._instById[resKey] = pkg;\n            return pkg;\n        }\n\n        public static removePackage(packageIdOrName: string): void {\n            var pkg: UIPackage = UIPackage._instById[packageIdOrName];\n            if (!pkg)\n                pkg = UIPackage._instByName[packageIdOrName];\n            if (!pkg)\n                throw new Error(\"unknown package: \" + packageIdOrName);\n\n            pkg.dispose();\n            delete UIPackage._instById[pkg.id];\n            delete UIPackage._instByName[pkg.name];\n            delete UIPackage._instById[pkg._resKey];\n            if (pkg._customId != null)\n                delete UIPackage._instById[pkg._customId];\n        }\n\n        public static createObject(pkgName: string, resName: string, userClass?: new () => GObject): GObject {\n            var pkg: UIPackage = UIPackage.getByName(pkgName);\n            if (pkg)\n                return pkg.createObject(resName, userClass);\n            else\n                return null;\n        }\n\n        public static createObjectFromURL(url: string, userClass?: new () => GObject): GObject {\n            var pi: PackageItem = UIPackage.getItemByURL(url);\n            if (pi)\n                return pi.owner.internalCreateObject(pi, userClass);\n            else\n                return null;\n        }\n\n        public static getItemURL(pkgName: string, resName: string): string {\n            var pkg: UIPackage = UIPackage.getByName(pkgName);\n            if (!pkg)\n                return null;\n\n            var pi: PackageItem = pkg._itemsByName[resName];\n            if (!pi)\n                return null;\n\n            return \"ui://\" + pkg.id + pi.id;\n        }\n\n        public static getItemByURL(url: string): PackageItem {\n            var pos1: number = url.indexOf(\"//\");\n            if (pos1 == -1)\n                return null;\n\n            var pos2: number = url.indexOf(\"/\", pos1 + 2);\n            if (pos2 == -1) {\n                if (url.length > 13) {\n                    var pkgId: string = url.substr(5, 8);\n                    var pkg: UIPackage = UIPackage.getById(pkgId);\n                    if (pkg != null) {\n                        var srcId: string = url.substr(13);\n                        return pkg.getItemById(srcId);\n                    }\n                }\n            }\n            else {\n                var pkgName: string = url.substr(pos1 + 2, pos2 - pos1 - 2);\n                pkg = UIPackage.getByName(pkgName);\n                if (pkg != null) {\n                    var srcName: string = url.substr(pos2 + 1);\n                    return pkg.getItemByName(srcName);\n                }\n            }\n\n            return null;\n        }\n\n        public static normalizeURL(url: string): string {\n            if (url == null)\n                return null;\n\n            var pos1: number = url.indexOf(\"//\");\n            if (pos1 == -1)\n                return null;\n\n            var pos2: number = url.indexOf(\"/\", pos1 + 2);\n            if (pos2 == -1)\n                return url;\n\n            var pkgName: string = url.substr(pos1 + 2, pos2 - pos1 - 2);\n            var srcName: string = url.substr(pos2 + 1);\n            return UIPackage.getItemURL(pkgName, srcName);\n        }\n\n        public static setStringsSource(source: string): void {\n            TranslationHelper.loadFromXML(source);\n        }\n\n        private loadPackage(buffer: ByteBuffer): void {\n            if (buffer.readUnsignedInt() != 0x46475549)\n                throw \"FairyGUI: old package format found in '\" + this._resKey + \"'\";\n\n            buffer.version = buffer.readInt();\n            var compressed: boolean = buffer.readBool();\n            this._id = buffer.readUTF();\n            this._name = buffer.readUTF();\n            buffer.skip(20);\n\n            if (compressed) {\n                var buf: Uint8Array = new Uint8Array(buffer.buffer, buffer.position, buffer.length - buffer.position);\n                var inflater: Zlib.RawInflate = new Zlib.RawInflate(buf);\n                let buffer2: ByteBuffer = new ByteBuffer(inflater.decompress());\n                buffer2.version = buffer.version;\n                buffer = buffer2;\n            }\n\n            var ver2: boolean = buffer.version >= 2;\n            var indexTablePos: number = buffer.position;\n            var cnt: number;\n            var i: number;\n            var nextPos: number;\n            var str: string;\n            var branchIncluded: boolean;\n\n            buffer.seek(indexTablePos, 4);\n\n            cnt = buffer.readInt();\n            var stringTable: Array<string> = new Array<string>(cnt);\n            stringTable.reduceRight\n            for (i = 0; i < cnt; i++)\n                stringTable[i] = buffer.readUTF();\n            buffer.stringTable = stringTable;\n\n            buffer.seek(indexTablePos, 0);\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++)\n                this._dependencies.push({ id: buffer.readS(), name: buffer.readS() });\n\n            if (ver2) {\n                cnt = buffer.readShort();\n                if (cnt > 0) {\n                    this._branches = buffer.readSArray(cnt);\n                    if (UIPackage._branch)\n                        this._branchIndex = this._branches.indexOf(UIPackage._branch);\n                }\n\n                branchIncluded = cnt > 0;\n            }\n\n            buffer.seek(indexTablePos, 1);\n\n            var pi: PackageItem;\n            var path: string = this._resKey;\n            let pos = path.lastIndexOf('/');\n            let shortPath = pos == -1 ? \"\" : path.substr(0, pos + 1);\n            path = path + \"_\";\n\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++) {\n                nextPos = buffer.readInt();\n                nextPos += buffer.position;\n\n                pi = new PackageItem();\n                pi.owner = this;\n                pi.type = buffer.readByte();\n                pi.id = buffer.readS();\n                pi.name = buffer.readS();\n                buffer.readS(); //path\n                pi.file = buffer.readS();\n                buffer.readBool();//exported\n                pi.width = buffer.readInt();\n                pi.height = buffer.readInt();\n\n                switch (pi.type) {\n                    case PackageItemType.Image:\n                        {\n                            pi.objectType = ObjectType.Image;\n                            var scaleOption: number = buffer.readByte();\n                            if (scaleOption == 1) {\n                                pi.scale9Grid = new egret.Rectangle();\n                                pi.scale9Grid.x = buffer.readInt();\n                                pi.scale9Grid.y = buffer.readInt();\n                                pi.scale9Grid.width = buffer.readInt();\n                                pi.scale9Grid.height = buffer.readInt();\n\n                                pi.tileGridIndice = buffer.readInt();\n                            }\n                            else if (scaleOption == 2)\n                                pi.scaleByTile = true;\n\n                            pi.smoothing = buffer.readBool();\n                            break;\n                        }\n\n                    case PackageItemType.MovieClip:\n                        {\n                            pi.smoothing = buffer.readBool();\n                            pi.objectType = ObjectType.MovieClip;\n                            pi.rawData = buffer.readBuffer();\n                            break;\n                        }\n\n                    case PackageItemType.Font:\n                        {\n                            pi.rawData = buffer.readBuffer();\n                            break;\n                        }\n\n                    case PackageItemType.Component:\n                        {\n                            var extension: number = buffer.readByte();\n                            if (extension > 0)\n                                pi.objectType = extension;\n                            else\n                                pi.objectType = ObjectType.Component;\n                            pi.rawData = buffer.readBuffer();\n\n                            UIObjectFactory.resolvePackageItemExtension(pi);\n                            break;\n                        }\n\n                    case PackageItemType.Atlas:\n                    case PackageItemType.Sound:\n                    case PackageItemType.Misc:\n                        {\n                            let pos = pi.file.lastIndexOf(\".\");\n                            pi.file = path + (pos == -1 ? pi.file : getAssetResKey(pi.file.substring(0, pos), pi.file.substring(pos + 1)));\n                            break;\n                        }\n\n                    case PackageItemType.Spine:\n                    case PackageItemType.DragonBones:\n                        {\n                            let pos = pi.file.lastIndexOf(\".\");\n                            pi.file = shortPath + (pos == -1 ? pi.file : pi.file.substring(0, pos));\n                            pi.skeletonAnchor = new egret.Point();\n                            pi.skeletonAnchor.x = buffer.readFloat();\n                            pi.skeletonAnchor.y = buffer.readFloat();\n                            break;\n                        }\n                }\n\n                if (ver2) {\n                    str = buffer.readS();//branch\n                    if (str)\n                        pi.name = str + \"/\" + pi.name;\n\n                    var branchCnt: number = buffer.readUnsignedByte();\n                    if (branchCnt > 0) {\n                        if (branchIncluded)\n                            pi.branches = buffer.readSArray(branchCnt);\n                        else\n                            this._itemsById[buffer.readS()] = pi;\n                    }\n\n                    var highResCnt: number = buffer.readUnsignedByte();\n                    if (highResCnt > 0)\n                        pi.highResolution = buffer.readSArray(highResCnt);\n                }\n\n                this._items.push(pi);\n                this._itemsById[pi.id] = pi;\n                if (pi.name != null)\n                    this._itemsByName[pi.name] = pi;\n\n                buffer.position = nextPos;\n            }\n\n            buffer.seek(indexTablePos, 2);\n\n            cnt = buffer.readShort();\n            for (i = 0; i < cnt; i++) {\n                nextPos = buffer.readShort();\n                nextPos += buffer.position;\n\n                var itemId: string = buffer.readS();\n                pi = this._itemsById[buffer.readS()];\n\n                let sprite: AtlasSprite = { atlas: pi, rect: new egret.Rectangle(), offset: new egret.Point(), originalSize: new egret.Point() };\n                sprite.rect.x = buffer.readInt();\n                sprite.rect.y = buffer.readInt();\n                sprite.rect.width = buffer.readInt();\n                sprite.rect.height = buffer.readInt();\n                sprite.rotated = buffer.readBool();\n                if (ver2 && buffer.readBool()) {\n                    sprite.offset.x = buffer.readInt();\n                    sprite.offset.y = buffer.readInt();\n                    sprite.originalSize.x = buffer.readInt();\n                    sprite.originalSize.y = buffer.readInt();\n                }\n                else {\n                    sprite.originalSize.x = sprite.rect.width;\n                    sprite.originalSize.y = sprite.rect.height;\n                }\n                this._sprites[itemId] = sprite;\n\n                buffer.position = nextPos;\n            }\n\n            if (buffer.seek(indexTablePos, 3)) {\n                cnt = buffer.readShort();\n                for (i = 0; i < cnt; i++) {\n                    nextPos = buffer.readInt();\n                    nextPos += buffer.position;\n\n                    pi = this._itemsById[buffer.readS()];\n                    if (pi && pi.type == PackageItemType.Image) {\n                        pi.pixelHitTestData = new PixelHitTestData();\n                        pi.pixelHitTestData.load(buffer);\n                    }\n\n                    buffer.position = nextPos;\n                }\n            }\n        }\n\n        public dispose(): void {\n            var cnt: number = this._items.length;\n            for (var i: number = 0; i < cnt; i++) {\n                var pi: PackageItem = this._items[i];\n                if (pi.type == PackageItemType.Atlas) {\n                    RES.destroyRes(pi.file, false);\n                }\n                else if (pi.type == PackageItemType.Sound) {\n                    //egret failed to do this\n                    //RES.destroyRes(pi.file, false);\n                }\n            }\n        }\n\n        public get id(): string {\n            return this._id;\n        }\n\n        public get name(): string {\n            return this._name;\n        }\n\n        public get customId(): string {\n            return this._customId;\n        }\n\n        public set customId(value: string) {\n            if (this._customId != null)\n                delete UIPackage._instById[this._customId];\n            this._customId = value;\n            if (this._customId != null)\n                UIPackage._instById[this._customId] = this;\n        }\n\n        public createObject(resName: string, userClass?: new () => GObject): GObject {\n            var pi: PackageItem = this._itemsByName[resName];\n            if (pi)\n                return this.internalCreateObject(pi, userClass);\n            else\n                return null;\n        }\n\n        public internalCreateObject(item: PackageItem, userClass?: new () => GObject): GObject {\n            var g: GObject = UIObjectFactory.newObject(item, userClass);\n\n            if (g == null)\n                return null;\n\n            UIPackage._constructing++;\n            g.constructFromResource();\n            UIPackage._constructing--;\n            return g;\n        }\n\n        public getItemById(itemId: string): PackageItem {\n            return this._itemsById[itemId];\n        }\n\n        public getItemByName(resName: string): PackageItem {\n            return this._itemsByName[resName];\n        }\n\n        public getItemAssetByName(resName: string): Object {\n            var pi: PackageItem = this._itemsByName[resName];\n            if (pi == null) {\n                throw \"Resource not found -\" + resName;\n            }\n\n            return this.getItemAsset(pi);\n        }\n\n        public getItemAsset(item: PackageItem): Object {\n            switch (item.type) {\n                case PackageItemType.Image:\n                    if (!item.decoded) {\n                        item.decoded = true;\n                        var sprite: AtlasSprite = this._sprites[item.id];\n                        if (sprite) {\n                            var atlas: egret.Texture = <egret.Texture>this.getItemAsset(sprite.atlas);\n                            item.asset = new egret.Texture();\n                            item.asset.bitmapData = atlas.bitmapData;\n                            item.asset.$initData(atlas.$bitmapX + sprite.rect.x, atlas.$bitmapY + sprite.rect.y,\n                                sprite.rect.width, sprite.rect.height,\n                                sprite.offset.x, sprite.offset.y,\n                                sprite.originalSize.x, sprite.originalSize.y,\n                                atlas.$sourceWidth, atlas.$sourceHeight,\n                                sprite.rotated);\n                        }\n                    }\n                    return item.asset;\n\n                case PackageItemType.Atlas:\n                case PackageItemType.Sound:\n                    if (!item.decoded) {\n                        item.decoded = true;\n                        item.asset = RES.getRes(item.file);\n                        if (!item.asset)\n                            console.log(\"Resource '\" + item.file + \"' not found, please check default.res.json!\");\n                    }\n                    return item.asset;\n\n                case PackageItemType.Font:\n                    if (!item.decoded) {\n                        item.decoded = true;\n                        this.loadFont(item);\n                    }\n                    return item.bitmapFont;\n\n                case PackageItemType.MovieClip:\n                    if (!item.decoded) {\n                        item.decoded = true;\n                        this.loadMovieClip(item);\n                    }\n                    return item.frames;\n\n                case PackageItemType.Misc:\n                    if (item.file)\n                        return RES.getRes(item.file);\n                    else\n                        return null;\n\n                default:\n                    return null;\n            }\n        }\n\n        public getItemAssetAsync(item: PackageItem, onComplete?: (err: any, item: PackageItem) => void): void {\n            if (item.decoded) {\n                onComplete(null, item);\n                return;\n            }\n\n            if (item.loading) {\n                item.loading.push(onComplete);\n                return;\n            }\n\n            switch (item.type) {\n                case PackageItemType.DragonBones:\n                    item.loading = [onComplete];\n                    this.loadDragonBones(item);\n                    break;\n\n                default:\n                    this.getItemAsset(item);\n                    onComplete(null, item);\n                    break;\n            }\n        }\n\n        private loadMovieClip(item: PackageItem): void {\n            var buffer: ByteBuffer = item.rawData;\n\n            buffer.seek(0, 0);\n\n            item.interval = buffer.readInt();\n            item.swing = buffer.readBool();\n            item.repeatDelay = buffer.readInt();\n\n            buffer.seek(0, 1);\n\n            var frameCount: number = buffer.readShort();\n            item.frames = Array<Frame>(frameCount);\n\n            var spriteId: string;\n            var sprite: AtlasSprite;\n            var fx: number;\n            var fy: number;\n\n            for (var i: number = 0; i < frameCount; i++) {\n                var nextPos: number = buffer.readShort();\n                nextPos += buffer.position;\n\n                let frame: Frame = {};\n                fx = buffer.readInt();\n                fy = buffer.readInt();\n                buffer.readInt();//width\n                buffer.readInt();//height\n                frame.addDelay = buffer.readInt();\n                spriteId = buffer.readS();\n\n                if (spriteId != null && (sprite = this._sprites[spriteId]) != null) {\n                    var atlas: egret.Texture = <egret.Texture>this.getItemAsset(sprite.atlas);\n                    frame.texture = new egret.Texture();\n                    frame.texture.bitmapData = atlas.bitmapData;\n                    frame.texture.$initData(atlas.$bitmapX + sprite.rect.x, atlas.$bitmapY + sprite.rect.y,\n                        sprite.rect.width, sprite.rect.height,\n                        fx, fy,\n                        item.width, item.height,\n                        atlas.$sourceWidth, atlas.$sourceHeight, sprite.rotated);\n                }\n                item.frames[i] = frame;\n\n                buffer.position = nextPos;\n            }\n        }\n\n        private loadFont(item: PackageItem): void {\n            var font: BitmapFont = new BitmapFont();\n            item.bitmapFont = font;\n            var buffer: ByteBuffer = item.rawData;\n\n            buffer.seek(0, 0);\n\n            font.ttf = buffer.readBool();\n            font.tint = buffer.readBool();\n            font.resizable = buffer.readBool();\n            buffer.readBool(); //has channel\n            font.size = buffer.readInt();\n            var xadvance: number = buffer.readInt();\n            var lineHeight: number = buffer.readInt();\n\n            var mainTexture: egret.Texture;\n            var mainSprite: AtlasSprite = this._sprites[item.id];\n            if (mainSprite)\n                mainTexture = <egret.Texture>(this.getItemAsset(mainSprite.atlas));\n\n            buffer.seek(0, 1);\n\n            var bg: BMGlyph;\n            var cnt: number = buffer.readInt();\n            for (var i: number = 0; i < cnt; i++) {\n                var nextPos: number = buffer.readShort();\n                nextPos += buffer.position;\n\n                bg = {};\n                var ch: string = buffer.readChar();\n                font.glyphs[ch] = bg;\n\n                var img: string = buffer.readS();\n                var bx: number = buffer.readInt();\n                var by: number = buffer.readInt();\n                bg.x = buffer.readInt();\n                bg.y = buffer.readInt();\n                bg.width = buffer.readInt();\n                bg.height = buffer.readInt();\n                bg.advance = buffer.readInt();\n                bg.channel = buffer.readByte();\n                if (bg.channel == 1)\n                    bg.channel = 3;\n                else if (bg.channel == 2)\n                    bg.channel = 2;\n                else if (bg.channel == 3)\n                    bg.channel = 1;\n\n                if (font.ttf) {\n                    bg.texture = new egret.Texture();\n                    bg.texture.bitmapData = mainTexture.bitmapData;\n                    bg.texture.$initData(mainTexture.$bitmapX + bx + mainSprite.rect.x, mainTexture.$bitmapY + by + mainSprite.rect.y,\n                        bg.width, bg.height,\n                        mainSprite.offset.x, mainSprite.offset.y,\n                        mainSprite.originalSize.x, mainSprite.originalSize.y,\n                        mainTexture.$sourceWidth, mainTexture.$sourceHeight,\n                        mainSprite.rotated);\n\n                    bg.lineHeight = lineHeight;\n                }\n                else {\n                    var charImg: PackageItem = this._itemsById[img];\n                    if (charImg) {\n                        this.getItemAsset(charImg);\n                        bg.width = charImg.width;\n                        bg.height = charImg.height;\n                        bg.texture = <egret.Texture>charImg.asset;\n                    }\n\n                    if (bg.advance == 0) {\n                        if (xadvance == 0)\n                            bg.advance = bg.x + bg.width;\n                        else\n\n                            bg.advance = xadvance;\n                    }\n\n                    bg.lineHeight = bg.y < 0 ? bg.height : (bg.y + bg.height);\n                    if (bg.lineHeight < font.size)\n                        bg.lineHeight = font.size;\n                }\n                buffer.position = nextPos;\n            }\n        }\n\n        private loadDragonBones(item: PackageItem): void {\n            let jsonFile = getAssetResKey(item.file, [\"json\", \"dbbin\"]);\n            let str = item.file.replace(\"_ske\", \"_tex\");\n            let atlasFile = getAssetResKey(str, \"json\");\n            let texFile = getAssetResKey(str, \"png\");\n\n            let task1 = RES.getResAsync(jsonFile);\n            let task2 = RES.getResAsync(atlasFile);\n            let task3 = RES.getResAsync(texFile);\n\n            Promise.all([task1, task2, task3]).then(values => {\n                let egretFactory: dragonBones.EgretFactory = dragonBones.EgretFactory.factory;\n                let asset = {\n                    data: egretFactory.parseDragonBonesData(values[0]),\n                    atlasData: egretFactory.parseTextureAtlasData(values[1], values[2])\n                };\n                item.asset = asset;\n                item.armatureName = asset.data.armatureNames[0];\n\n                let arr = item.loading;\n                delete item.loading;\n                arr.forEach(e => e(null, item));\n            }).catch((reason) => {\n                let arr = item.loading;\n                delete item.loading;\n                arr.forEach(e => e(reason, item));\n            });\n        }\n    }\n\n    interface AtlasSprite {\n        atlas: PackageItem;\n        rect: egret.Rectangle;\n        offset: egret.Point;\n        originalSize: egret.Point;\n        rotated?: boolean;\n    }\n\n    function getAssetResKey(file: string, types: Array<string> | string): string {\n        if (Array.isArray(types)) {\n            for (var i: number = 0; i < types.length; i++) {\n                let key = file + \"_\" + types[i];\n                if (RES.hasRes(key))\n                    return key;\n            }\n            return file;\n        }\n        else {\n            let key = file + \"_\" + types;\n            if (RES.hasRes(key))\n                return key;\n            return file;\n        }\n    }\n}"
  },
  {
    "path": "source/src/Window.ts",
    "content": "\nmodule fgui {\n\n    export class Window extends GComponent {\n        private _contentPane: GComponent;\n        private _modalWaitPane: GObject;\n        private _closeButton: GObject;\n        private _dragArea: GObject;\n        private _contentArea: GObject;\n        private _frame: GComponent;\n        private _modal: boolean;\n\n        private _uiSources?: Array<IUISource>;\n        private _inited?: boolean;\n        private _loading?: boolean;\n\n        protected _requestingCmd: number = 0;\n\n        public bringToFontOnClick: boolean;\n\n        public constructor() {\n            super();\n\n            this._uiSources = new Array<IUISource>();\n            this.bringToFontOnClick = UIConfig.bringWindowToFrontOnClick;\n\n            this.displayObject.addEventListener(egret.Event.ADDED_TO_STAGE, this.__onShown, this);\n            this.displayObject.addEventListener(egret.Event.REMOVED_FROM_STAGE, this.__onHidden, this);\n            this.displayObject.addEventListener(egret.TouchEvent.TOUCH_BEGIN, this.__mouseDown, this, true);\n        }\n\n        public addUISource(source: IUISource): void {\n            this._uiSources.push(source);\n        }\n\n        public set contentPane(val: GComponent) {\n            if (this._contentPane != val) {\n                if (this._contentPane)\n                    this.removeChild(this._contentPane);\n                this._contentPane = val;\n                if (this._contentPane) {\n                    this.addChild(this._contentPane);\n                    this.setSize(this._contentPane.width, this._contentPane.height);\n                    this._contentPane.addRelation(this, RelationType.Size);\n                    this._frame = <GComponent>(this._contentPane.getChild(\"frame\"));\n                    if (this._frame) {\n                        this.closeButton = this._frame.getChild(\"closeButton\");\n                        this.dragArea = this._frame.getChild(\"dragArea\");\n                        this.contentArea = this._frame.getChild(\"contentArea\");\n                    }\n                }\n            }\n        }\n\n        public get contentPane(): GComponent {\n            return this._contentPane;\n        }\n\n        public get frame(): GComponent {\n            return this._frame;\n        }\n\n        public get closeButton(): GObject {\n            return this._closeButton;\n        }\n\n        public set closeButton(value: GObject) {\n            if (this._closeButton)\n                this._closeButton.removeClickListener(this.closeEventHandler, this);\n            this._closeButton = value;\n            if (this._closeButton)\n                this._closeButton.addClickListener(this.closeEventHandler, this);\n        }\n\n        public get dragArea(): GObject {\n            return this._dragArea;\n        }\n\n        public set dragArea(value: GObject) {\n            if (this._dragArea != value) {\n                if (this._dragArea) {\n                    this._dragArea.draggable = false;\n                    this._dragArea.removeEventListener(DragEvent.DRAG_START, this.__dragStart, this);\n                }\n\n                this._dragArea = value;\n                if (this._dragArea) {\n                    if ((this._dragArea instanceof GGraph) && this._dragArea.displayObject == null)\n                        this._dragArea.asGraph.drawRect(0, 0, 0, 0, 0);\n                    this._dragArea.draggable = true;\n                    this._dragArea.addEventListener(DragEvent.DRAG_START, this.__dragStart, this);\n                }\n            }\n        }\n\n        public get contentArea(): GObject {\n            return this._contentArea;\n        }\n\n        public set contentArea(value: GObject) {\n            this._contentArea = value;\n        }\n\n        public show(): void {\n            GRoot.inst.showWindow(this);\n        }\n\n        public showOn(root: GRoot): void {\n            root.showWindow(this);\n        }\n\n        public hide(): void {\n            if (this.isShowing)\n                this.doHideAnimation();\n        }\n\n        public hideImmediately(): void {\n            var r: GRoot = (this.parent instanceof GRoot) ? this.parent : null;\n            if (!r)\n                r = GRoot.inst;\n            r.hideWindowImmediately(this);\n        }\n\n        public centerOn(r: GRoot, restraint?: boolean) {\n            this.setXY(Math.round((r.width - this.width) / 2), Math.round((r.height - this.height) / 2));\n            if (restraint) {\n                this.addRelation(r, RelationType.Center_Center);\n                this.addRelation(r, RelationType.Middle_Middle);\n            }\n        }\n\n        public toggleStatus(): void {\n            if (this.isTop)\n                this.hide();\n            else\n                this.show();\n        }\n\n        public get isShowing(): boolean {\n            return this.parent != null;\n        }\n\n        public get isTop(): boolean {\n            return this.parent != null && this.parent.getChildIndex(this) == this.parent.numChildren - 1;\n        }\n\n        public get modal(): boolean {\n            return this._modal;\n        }\n\n        public set modal(val: boolean) {\n            this._modal = val;\n        }\n\n        public bringToFront(): void {\n            this.root.bringToFront(this);\n        }\n\n        public showModalWait(requestingCmd?: number): void {\n            if (requestingCmd != undefined)\n                this._requestingCmd = requestingCmd;\n\n            if (UIConfig.windowModalWaiting) {\n                if (!this._modalWaitPane)\n                    this._modalWaitPane = UIPackage.createObjectFromURL(UIConfig.windowModalWaiting);\n\n                this.layoutModalWaitPane();\n\n                this.addChild(this._modalWaitPane);\n            }\n        }\n\n        protected layoutModalWaitPane(): void {\n            if (this._contentArea) {\n                var pt: egret.Point = this._frame.localToGlobal();\n                pt = this.globalToLocal(pt.x, pt.y, pt);\n                this._modalWaitPane.setXY(pt.x + this._contentArea.x, pt.y + this._contentArea.y);\n                this._modalWaitPane.setSize(this._contentArea.width, this._contentArea.height);\n            }\n            else\n                this._modalWaitPane.setSize(this.width, this.height);\n        }\n\n        public closeModalWait(requestingCmd?: number): boolean {\n            if (requestingCmd != null && requestingCmd != 0) {\n                if (this._requestingCmd != requestingCmd)\n                    return false;\n            }\n            this._requestingCmd = 0;\n\n            if (this._modalWaitPane && this._modalWaitPane.parent != null)\n                this.removeChild(this._modalWaitPane);\n\n            return true;\n        }\n\n        public get modalWaiting(): boolean {\n            return this._modalWaitPane && this._modalWaitPane.parent != null;\n        }\n\n        public init(): void {\n            if (this._inited || this._loading)\n                return;\n\n            if (this._uiSources.length > 0) {\n                this._loading = false;\n                var cnt: number = this._uiSources.length;\n                for (var i: number = 0; i < cnt; i++) {\n                    var lib: IUISource = this._uiSources[i];\n                    if (!lib.loaded) {\n                        lib.load(this.__uiLoadComplete, this);\n                        this._loading = true;\n                    }\n                }\n\n                if (!this._loading)\n                    this._init();\n            }\n            else\n                this._init();\n        }\n\n        protected onInit(): void {\n        }\n\n        protected onShown(): void {\n        }\n\n        protected onHide(): void {\n        }\n\n        protected doShowAnimation(): void {\n            this.onShown();\n        }\n\n        protected doHideAnimation(): void {\n            this.hideImmediately();\n        }\n\n        private __uiLoadComplete(): void {\n            var cnt: number = this._uiSources.length;\n            for (var i: number = 0; i < cnt; i++) {\n                var lib: IUISource = this._uiSources[i];\n                if (!lib.loaded)\n                    return;\n            }\n\n            this._loading = false;\n            this._init();\n        }\n\n        private _init(): void {\n            this._inited = true;\n            this.onInit();\n\n            if (this.isShowing)\n                this.doShowAnimation();\n        }\n\n        public dispose(): void {\n            this.displayObject.removeEventListener(egret.Event.ADDED_TO_STAGE, this.__onShown, this);\n            this.displayObject.removeEventListener(egret.Event.REMOVED_FROM_STAGE, this.__onHidden, this);\n            if (this.parent)\n                this.hideImmediately();\n\n            super.dispose();\n        }\n\n        protected closeEventHandler(evt: egret.Event): void {\n            this.hide();\n        }\n\n        private __onShown(evt: egret.Event): void {\n            if (!this._inited)\n                this.init();\n            else\n                this.doShowAnimation();\n        }\n\n        private __onHidden(evt: egret.Event): void {\n            this.closeModalWait();\n            this.onHide();\n        }\n\n        private __mouseDown(evt: egret.Event): void {\n            if (this.isShowing && this.bringToFontOnClick)\n                this.bringToFront();\n        }\n\n        private __dragStart(evt: DragEvent): void {\n            evt.preventDefault();\n\n            this.startDrag(evt.touchPointID, evt.stageX, evt.stageY);\n        }\n    }\n}"
  },
  {
    "path": "source/src/action/ChangePageAction.ts",
    "content": "/// <reference path=\"ControllerAction.ts\" />\r\n\r\nmodule fgui {\r\n\r\n    export class ChangePageAction extends ControllerAction {\r\n\r\n        public objectId: string;\r\n        public controllerName: string;\r\n        public targetPage: string;\r\n\r\n        public constructor() {\r\n            super();\r\n        }\r\n\r\n        protected enter(controller: Controller): void {\r\n            if (!this.controllerName)\r\n                return;\r\n\r\n            var gcom: GComponent;\r\n            if (this.objectId) {\r\n                var obj: GObject = controller.parent.getChildById(this.objectId);\r\n                if (obj instanceof GComponent)\r\n                    gcom = <GComponent><any>obj;\r\n                else\r\n                    return;\r\n            }\r\n            else\r\n                gcom = controller.parent;\r\n            if (gcom) {\r\n                var cc: Controller = gcom.getController(this.controllerName);\r\n                if (cc && cc != controller && !cc.changing) {\r\n                    if (this.targetPage == \"~1\") {\r\n                        if (controller.selectedIndex < cc.pageCount)\r\n                            cc.selectedIndex = controller.selectedIndex;\r\n                    }\r\n                    else if (this.targetPage == \"~2\")\r\n                        cc.selectedPage = controller.selectedPage;\r\n                    else\r\n                        cc.selectedPageId = this.targetPage;\r\n                }\r\n            }\r\n        }\r\n\r\n        public setup(buffer: ByteBuffer): void {\r\n            super.setup(buffer);\r\n\r\n            this.objectId = buffer.readS();\r\n            this.controllerName = buffer.readS();\r\n            this.targetPage = buffer.readS();\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "source/src/action/ControllerAction.ts",
    "content": "module fgui {\r\n\r\n    export class ControllerAction {\r\n\r\n        public fromPage: string[];\r\n        public toPage: string[];\r\n\r\n        public static createAction(type: number): ControllerAction {\r\n            switch (type) {\r\n                case 0:\r\n                    return new PlayTransitionAction();\r\n\r\n                case 1:\r\n                    return new ChangePageAction();\r\n            }\r\n            return null;\r\n        }\r\n\r\n        public constructor() {\r\n        }\r\n\r\n        public run(controller: Controller, prevPage: string, curPage: string): void {\r\n            if ((this.fromPage == null || this.fromPage.length == 0 || this.fromPage.indexOf(prevPage) != -1)\r\n                && (this.toPage == null || this.toPage.length == 0 || this.toPage.indexOf(curPage) != -1))\r\n                this.enter(controller);\r\n            else\r\n                this.leave(controller);\r\n        }\r\n\r\n        protected enter(controller: Controller): void {\r\n\r\n        }\r\n\r\n        protected leave(controller: Controller): void {\r\n\r\n        }\r\n\r\n        public setup(buffer: ByteBuffer): void {\r\n            var cnt: number;\r\n            var i: number;\r\n\r\n            cnt = buffer.readShort();\r\n            this.fromPage = [];\r\n            for (i = 0; i < cnt; i++)\r\n                this.fromPage[i] = buffer.readS();\r\n\r\n            cnt = buffer.readShort();\r\n            this.toPage = [];\r\n            for (i = 0; i < cnt; i++)\r\n                this.toPage[i] = buffer.readS();\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "source/src/action/PlayTransitionAction.ts",
    "content": "module fgui {\r\n\r\n    export class PlayTransitionAction extends ControllerAction {\r\n\r\n        public transitionName: string;\r\n        public playTimes: number;\r\n        public delay: number;\r\n        public stopOnExit: boolean;\r\n\r\n        private _currentTransition: Transition;\r\n\r\n        public constructor() {\r\n            super();\r\n\r\n            this.playTimes = 1;\r\n            this.delay = 0;\r\n            this.stopOnExit = false;\r\n        }\r\n\r\n        protected enter(controller: Controller): void {\r\n            var trans: Transition = controller.parent.getTransition(this.transitionName);\r\n            if (trans) {\r\n                if (this._currentTransition && this._currentTransition.playing)\r\n                    trans.changePlayTimes(this.playTimes);\r\n                else\r\n                    trans.play(null, null, null, this.playTimes, this.delay);\r\n                this._currentTransition = trans;\r\n            }\r\n        }\r\n\r\n        protected leave(controller: Controller): void {\r\n            if (this.stopOnExit && this._currentTransition) {\r\n                this._currentTransition.stop();\r\n                this._currentTransition = null;\r\n            }\r\n        }\r\n\r\n        public setup(buffer:ByteBuffer): void {\r\n            super.setup(buffer);\r\n\r\n\t\t\tthis.transitionName = buffer.readS();\r\n\t\t\tthis.playTimes = buffer.readInt();\r\n\t\t\tthis.delay = buffer.readFloat();\r\n\t\t\tthis.stopOnExit = buffer.readBool();\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "source/src/display/BitmapFont.ts",
    "content": "\nmodule fgui {\n\n    export class BitmapFont {\n        public id: string;\n        public size: number = 0;\n        public ttf: boolean;\n        public glyphs: { [index: string]: BMGlyph };\n        public resizable: boolean;\n        public tint: boolean;\n\n        public constructor() {\n            this.glyphs = {};\n        }\n    }\n\n    export interface BMGlyph {\n        x?: number;\n        y?: number;\n        width?: number;\n        height?: number;\n        advance?: number;\n        lineHeight?: number;\n        channel?: number;\n        texture?: egret.Texture;\n    }\n}"
  },
  {
    "path": "source/src/display/FillUtils.ts",
    "content": "namespace fgui {\n    export function fillImage(w: number, h: number, method: number, origin: number, clockwise: boolean, amount: number): Array<number> {\n        if (amount <= 0)\n            return null;\n        else if (amount >= 0.9999)\n            return [0, 0, w, 0, w, h, 0, h];\n\n        var points: Array<number>;\n        switch (method) {\n            case FillMethod.Horizontal:\n                points = fillHorizontal(w, h, origin, amount);\n                break;\n\n            case FillMethod.Vertical:\n                points = fillVertical(w, h, origin, amount);\n                break;\n\n            case FillMethod.Radial90:\n                points = fillRadial90(w, h, origin, clockwise, amount);\n                break;\n\n            case FillMethod.Radial180:\n                points = fillRadial180(w, h, origin, clockwise, amount);\n                break;\n\n            case FillMethod.Radial360:\n                points = fillRadial360(w, h, origin, clockwise, amount);\n                break;\n        }\n        return points;\n    }\n\n    function fillHorizontal(w: number, h: number, origin: number, amount: number): Array<number> {\n        var w2: number = w * amount;\n        if (origin == FillOrigin.Left || origin == FillOrigin.Top)\n            return [0, 0, w2, 0, w2, h, 0, h];\n        else\n            return [w, 0, w, h, w - w2, h, w - w2, 0];\n    }\n\n    function fillVertical(w: number, h: number, origin: number, amount: number): Array<number> {\n        var h2: number = h * amount;\n        if (origin == FillOrigin.Left || origin == FillOrigin.Top)\n            return [0, 0, 0, h2, w, h2, w, 0];\n        else\n            return [0, h, w, h, w, h - h2, 0, h - h2];\n    }\n\n    function fillRadial90(w: number, h: number, origin: number, clockwise: boolean, amount: number): Array<number> {\n        if (clockwise && (origin == FillOrigin.TopRight || origin == FillOrigin.BottomLeft)\n            || !clockwise && (origin == FillOrigin.TopLeft || origin == FillOrigin.BottomRight)) {\n            amount = 1 - amount;\n        }\n        var v: number, v2: number, h2: number;\n        v = Math.tan(Math.PI / 2 * amount);\n        h2 = w * v;\n        v2 = (h2 - h) / h2;\n        var points: Array<number>;\n\n        switch (origin) {\n            case FillOrigin.TopLeft:\n                if (clockwise) {\n                    if (h2 <= h)\n                        points = [0, 0, w, h2, w, 0];\n                    else\n                        points = [0, 0, w * (1 - v2), h, w, h, w, 0];\n                }\n                else {\n                    if (h2 <= h)\n                        points = [0, 0, w, h2, w, h, 0, h];\n                    else\n                        points = [0, 0, w * (1 - v2), h, 0, h];\n                }\n                break;\n\n            case FillOrigin.TopRight:\n                if (clockwise) {\n                    if (h2 <= h)\n                        points = [w, 0, 0, h2, 0, h, w, h];\n                    else\n                        points = [w, 0, w * v2, h, w, h];\n                }\n                else {\n                    if (h2 <= h)\n                        points = [w, 0, 0, h2, 0, 0];\n                    else\n                        points = [w, 0, w * v2, h, 0, h, 0, 0];\n                }\n                break;\n\n            case FillOrigin.BottomLeft:\n                if (clockwise) {\n                    if (h2 <= h)\n                        points = [0, h, w, h - h2, w, 0, 0, 0];\n                    else\n                        points = [0, h, w * (1 - v2), 0, 0, 0];\n                }\n                else {\n                    if (h2 <= h)\n                        points = [0, h, w, h - h2, w, h];\n                    else\n                        points = [0, h, w * (1 - v2), 0, w, 0, w, h];\n                }\n\n                break;\n\n            case FillOrigin.BottomRight:\n                if (clockwise) {\n                    if (h2 <= h)\n                        points = [w, h, 0, h - h2, 0, h];\n                    else\n                        points = [w, h, w * v2, 0, 0, 0, 0, h];\n                }\n                else {\n                    if (h2 <= h)\n                        points = [w, h, 0, h - h2, 0, 0, w, 0];\n                    else\n                        points = [w, h, w * v2, 0, w, 0];\n                }\n                break;\n        }\n        return points;\n    }\n\n    function movePoints(points: Array<number>, offsetX: number, offsetY: number): void {\n        var cnt: number = points.length;\n        for (var i: number = 0; i < cnt; i += 2) {\n            points[i] += offsetX;\n            points[i + 1] += offsetY;\n        }\n    }\n\n    function fillRadial180(w: number, h: number, origin: number, clockwise: boolean, amount: number): Array<number> {\n        var points: Array<number>;\n        switch (origin) {\n            case FillOrigin.Top:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial90(w / 2, h,\n                        clockwise ? FillOrigin.TopLeft : FillOrigin.TopRight,\n                        clockwise,\n                        amount);\n                    if (clockwise)\n                        movePoints(points, w / 2, 0);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial90(w / 2, h,\n                        clockwise ? FillOrigin.TopRight : FillOrigin.TopLeft,\n                        clockwise,\n                        amount);\n                    if (clockwise)\n                        points.push(w, h, w, 0);\n                    else {\n                        movePoints(points, w / 2, 0);\n                        points.push(0, h, 0, 0);\n                    }\n\n                }\n                break;\n\n            case FillOrigin.Bottom:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial90(w / 2, h,\n                        clockwise ? FillOrigin.BottomRight : FillOrigin.BottomLeft,\n                        clockwise,\n                        amount);\n                    if (!clockwise)\n                        movePoints(points, w / 2, 0);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial90(w / 2, h,\n                        clockwise ? FillOrigin.BottomLeft : FillOrigin.BottomRight,\n                        clockwise,\n                        amount);\n                    if (clockwise) {\n                        movePoints(points, w / 2, 0);\n                        points.push(0, 0, 0, h);\n                    }\n                    else\n                        points.push(w, 0, w, h);\n                }\n                break;\n\n            case FillOrigin.Left:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial90(w, h / 2,\n                        clockwise ? FillOrigin.BottomLeft : FillOrigin.TopLeft,\n                        clockwise,\n                        amount);\n                    if (!clockwise)\n                        movePoints(points, 0, h / 2);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial90(w, h / 2,\n                        clockwise ? FillOrigin.TopLeft : FillOrigin.BottomLeft,\n                        clockwise,\n                        amount);\n                    if (clockwise) {\n                        movePoints(points, 0, h / 2);\n                        points.push(w, 0, 0, 0);\n                    }\n                    else\n                        points.push(w, h, 0, h);\n                }\n                break;\n\n            case FillOrigin.Right:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial90(w, h / 2,\n                        clockwise ? FillOrigin.TopRight : FillOrigin.BottomRight,\n                        clockwise,\n                        amount);\n                    if (clockwise)\n                        movePoints(points, 0, h / 2);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial90(w, h / 2,\n                        clockwise ? FillOrigin.BottomRight : FillOrigin.TopRight,\n                        clockwise,\n                        amount);\n                    if (clockwise)\n                        points.push(0, h, w, h);\n                    else {\n                        movePoints(points, 0, h / 2);\n                        points.push(0, 0, w, 0);\n                    }\n                }\n                break;\n        }\n\n        return points;\n    }\n\n    function fillRadial360(w: number, h: number, origin: number, clockwise: boolean, amount: number): Array<number> {\n        var points: Array<number>;\n        switch (origin) {\n            case FillOrigin.Top:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial180(w / 2, h,\n                        clockwise ? FillOrigin.Left : FillOrigin.Right,\n                        clockwise,\n                        amount);\n                    if (clockwise)\n                        movePoints(points, w / 2, 0);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial180(w / 2, h,\n                        clockwise ? FillOrigin.Right : FillOrigin.Left,\n                        clockwise,\n                        amount);\n                    if (clockwise)\n                        points.push(w, h, w, 0, w / 2, 0);\n                    else {\n                        movePoints(points, w / 2, 0);\n                        points.push(0, h, 0, 0, w / 2, 0);\n                    }\n                }\n                break;\n\n            case FillOrigin.Bottom:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial180(w / 2, h,\n                        clockwise ? FillOrigin.Right : FillOrigin.Left,\n                        clockwise,\n                        amount);\n                    if (!clockwise)\n                        movePoints(points, w / 2, 0);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial180(w / 2, h,\n                        clockwise ? FillOrigin.Left : FillOrigin.Right,\n                        clockwise,\n                        amount);\n                    if (clockwise) {\n                        movePoints(points, w / 2, 0);\n                        points.push(0, 0, 0, h, w / 2, h);\n                    }\n                    else\n                        points.push(w, 0, w, h, w / 2, h);\n                }\n                break;\n\n            case FillOrigin.Left:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial180(w, h / 2,\n                        clockwise ? FillOrigin.Bottom : FillOrigin.Top,\n                        clockwise,\n                        amount);\n                    if (!clockwise)\n                        movePoints(points, 0, h / 2);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial180(w, h / 2,\n                        clockwise ? FillOrigin.Top : FillOrigin.Bottom,\n                        clockwise,\n                        amount);\n                    if (clockwise) {\n                        movePoints(points, 0, h / 2);\n                        points.push(w, 0, 0, 0, 0, h / 2);\n                    }\n                    else\n                        points.push(w, h, 0, h, 0, h / 2);\n                }\n                break;\n\n            case FillOrigin.Right:\n                if (amount <= 0.5) {\n                    amount = amount / 0.5;\n                    points = fillRadial180(w, h / 2,\n                        clockwise ? FillOrigin.Top : FillOrigin.Bottom,\n                        clockwise,\n                        amount);\n                    if (clockwise)\n                        movePoints(points, 0, h / 2);\n                }\n                else {\n                    amount = (amount - 0.5) / 0.5;\n                    points = fillRadial180(w, h / 2,\n                        clockwise ? FillOrigin.Bottom : FillOrigin.Top,\n                        clockwise,\n                        amount);\n                    if (clockwise)\n                        points.push(0, h, w, h, w, h / 2);\n                    else {\n                        movePoints(points, 0, h / 2);\n                        points.push(0, 0, w, 0, w, h / 2);\n                    }\n                }\n                break;\n        }\n\n        return points;\n    }\n}"
  },
  {
    "path": "source/src/display/Image.ts",
    "content": "module fgui {\n    export class Image extends egret.Bitmap {\n        private _fillMethod: number = 0;\n        private _fillOrigin: number = 0;\n        private _fillAmount: number = 0;\n        private _fillClockwise?: boolean;\n        private _mask?: egret.Shape;\n        private _maskDirtyFlag?: boolean;\n        private _color: number;\n\n        constructor() {\n            super();\n\n            this._color = 0xFFFFFF;\n        }\n\n        public get color(): number {\n            return this._color;\n        }\n\n        public set color(value: number) {\n            if (this._color != value) {\n                this._color = value;\n                if (this.tint == undefined) //5.2.24 之前没有，用滤镜\n                    ToolSet.setColorFilter(this, value);\n                else\n                    this.tint = value;\n            }\n        }\n\n        public $setX(value: number): boolean {\n            if (this.mask)\n                this.mask.x = value;\n            return super.$setX(value);\n        }\n\n        public $setY(value: number): boolean {\n            if (this.mask)\n                this.mask.y = value;\n            return super.$setY(value);\n        }\n\n        public get fillMethod(): FillMethod {\n            return this._fillMethod;\n        }\n\n        public set fillMethod(value: FillMethod) {\n            if (this._fillMethod != value) {\n                this._fillMethod = value;\n\n                if (this._fillMethod != 0) {\n                    if (!this._mask) {\n                        this._mask = new egret.Shape();\n                        this._mask.touchEnabled = false;\n                    }\n                    this.mask = this._mask;\n                    this._mask.x = this.x;\n                    this._mask.y = this.y;\n                    this.addEventListener(egret.Event.RESIZE, this.markChanged, this);\n                    this.markChanged();\n                }\n                else if (this.mask) {\n                    this._mask.graphics.clear();\n                    this.mask = null;\n                    this.removeEventListener(egret.Event.RESIZE, this.markChanged, this);\n                }\n            }\n        }\n\n        public get fillOrigin(): number {\n            return this._fillOrigin;\n        }\n\n        public set fillOrigin(value: number) {\n            if (this._fillOrigin != value) {\n                this._fillOrigin = value;\n                if (this._fillMethod != 0)\n                    this.markChanged();\n            }\n        }\n\n        public get fillClockwise(): boolean {\n            return this._fillClockwise;\n        }\n\n        public set fillClockwise(value: boolean) {\n            if (this._fillClockwise != value) {\n                this._fillClockwise = value;\n                if (this._fillMethod != 0)\n                    this.markChanged();\n            }\n        }\n\n        public get fillAmount(): number {\n            return this._fillAmount;\n        }\n\n        public set fillAmount(value: number) {\n            if (this._fillAmount != value) {\n                this._fillAmount = value;\n                if (this._fillMethod != 0)\n                    this.markChanged();\n            }\n        }\n\n        private markChanged(): void {\n            if (!this._maskDirtyFlag) {\n                this._maskDirtyFlag = true;\n\n                GTimers.inst.callLater(this.doFill, this);\n            }\n        }\n\n        private doFill(): void {\n            this._maskDirtyFlag = false;\n\n            if (!this._mask.parent && this.parent)\n                this.parent.addChild(this._mask);\n\n            var w: number = this.width;\n            var h: number = this.height;\n            var g: egret.Graphics = this._mask.graphics;\n            g.clear();\n\n            if (w == 0 || h == 0)\n                return;\n\n            var points: Array<number> = fillImage(w, h, this._fillMethod, this._fillOrigin, this._fillClockwise, this._fillAmount);\n            if (!points)\n                return;\n\n            g.beginFill(0, 1);\n            ToolSet.fillPath(g, points, 0, 0);\n            g.endFill();\n        }\n    }\n}\n"
  },
  {
    "path": "source/src/display/MovieClip.ts",
    "content": "///<reference path=\"Image.ts\"/>\n\nmodule fgui {\n    export interface Frame {\n        addDelay?: number;\n        texture?: egret.Texture;\n    }\n\n    export class MovieClip extends Image {\n        public interval: number = 0;\n        public swing: boolean;\n        public repeatDelay: number = 0;\n        public timeScale: number = 1;\n\n        private _playing: boolean = true;\n        private _frameCount: number = 0;\n        private _frames: Array<Frame>;\n        private _frame: number = 0;\n        private _start: number = 0;\n        private _end: number = 0;\n        private _times: number = 0;\n        private _endAt: number = 0;\n        private _status: number = 0; //0-none, 1-next loop, 2-ending, 3-ended\n        private _callback: Function;\n        private _callbackObj: any;\n        private _smoothing: boolean;\n\n        private _frameElapsed: number = 0; //当前帧延迟\n        private _reversed: boolean = false;\n        private _repeatedCount: number = 0;\n\n        public constructor() {\n            super();\n\n            this.touchEnabled = false;\n\n            this.setPlaySettings();\n        }\n\n        public get frames(): Array<Frame> {\n            return this._frames;\n        }\n\n        public set frames(value: Array<Frame>) {\n            this._frames = value;\n            this.scale9Grid = null;\n            this.fillMode = egret.BitmapFillMode.SCALE;\n\n            if (this._frames)\n                this._frameCount = this._frames.length;\n            else\n                this._frameCount = 0;\n\n            if (this._end == -1 || this._end > this._frameCount - 1)\n                this._end = this._frameCount - 1;\n            if (this._endAt == -1 || this._endAt > this._frameCount - 1)\n                this._endAt = this._frameCount - 1;\n\n            if (this._frame < 0 || this._frame > this._frameCount - 1)\n                this._frame = this._frameCount - 1;\n\n            this.drawFrame();\n\n            this._frameElapsed = 0;\n            this._repeatedCount = 0;\n            this._reversed = false;\n\n            this.checkTimer();\n        }\n\n        public get frameCount(): number {\n            return this._frameCount;\n        }\n\n        public get frame(): number {\n            return this._frame;\n        }\n\n        public set frame(value: number) {\n            if (this._frame != value) {\n                if (this._frames && value >= this._frameCount)\n                    value = this._frameCount - 1;\n\n                this._frame = value;\n                this._frameElapsed = 0;\n                this.drawFrame();\n            }\n        }\n\n        public get playing(): boolean {\n            return this._playing;\n        }\n\n        public set playing(value: boolean) {\n            if (this._playing != value) {\n                this._playing = value;\n                this.checkTimer();\n            }\n        }\n\n        public get smoothing(): boolean {\n            return this._smoothing;\n        }\n\n        public set smoothing(value: boolean) {\n            this._smoothing = value;\n        }\n\n        public rewind(): void {\n            this._frame = 0;\n            this._frameElapsed = 0;\n            this._reversed = false;\n            this._repeatedCount = 0;\n\n            this.drawFrame();\n        }\n\n        public syncStatus(anotherMc: MovieClip): void {\n            this._frame = anotherMc._frame;\n            this._frameElapsed = anotherMc._frameElapsed;\n            this._reversed = anotherMc._reversed;\n            this._repeatedCount = anotherMc._repeatedCount;\n\n            this.drawFrame();\n        }\n\n        public advance(timeInMiniseconds: number): void {\n            var beginFrame: number = this._frame;\n            var beginReversed: boolean = this._reversed;\n            var backupTime: number = timeInMiniseconds;\n\n            while (true) {\n                var tt: number = this.interval + this._frames[this._frame].addDelay;\n                if (this._frame == 0 && this._repeatedCount > 0)\n                    tt += this.repeatDelay;\n                if (timeInMiniseconds < tt) {\n                    this._frameElapsed = 0;\n                    break;\n                }\n\n                timeInMiniseconds -= tt;\n\n                if (this.swing) {\n                    if (this._reversed) {\n                        this._frame--;\n                        if (this._frame <= 0) {\n                            this._frame = 0;\n                            this._repeatedCount++;\n                            this._reversed = !this._reversed;\n                        }\n                    }\n                    else {\n                        this._frame++;\n                        if (this._frame > this._frameCount - 1) {\n                            this._frame = Math.max(0, this._frameCount - 2);\n                            this._repeatedCount++;\n                            this._reversed = !this._reversed;\n                        }\n                    }\n                }\n                else {\n                    this._frame++;\n                    if (this._frame > this._frameCount - 1) {\n                        this._frame = 0;\n                        this._repeatedCount++;\n                    }\n                }\n\n                if (this._frame == beginFrame && this._reversed == beginReversed) //走了一轮了\n                {\n                    var roundTime: number = backupTime - timeInMiniseconds; //这就是一轮需要的时间\n                    timeInMiniseconds -= Math.floor(timeInMiniseconds / roundTime) * roundTime; //跳过\n                }\n            }\n\n            this.drawFrame();\n        }\n\n        //从start帧开始，播放到end帧（-1表示结尾），重复times次（0表示无限循环），循环结束后，停止在endAt帧（-1表示参数end）\n        public setPlaySettings(start?: number, end?: number, times?: number, endAt?: number, endCallback?: Function, callbackObj?: any): void {\n            if (start == undefined) start = 0;\n            if (end == undefined) end = -1;\n            if (times == undefined) times = 0;\n            if (endAt == undefined) endAt = -1;\n            \n            this._start = start;\n            this._end = end;\n            if (this._end == -1 || this._end > this._frameCount - 1)\n                this._end = this._frameCount - 1;\n            this._times = times;\n            this._endAt = endAt;\n            if (this._endAt == -1)\n                this._endAt = this._end;\n            this._status = 0;\n            this._callback = endCallback;\n            this._callbackObj = callbackObj;\n\n            this.frame = start;\n        }\n\n        private update(): void {\n            if (!this._playing || this._frameCount == 0 || this._status == 3)\n                return;\n\n            var dt: number = GTimers.deltaTime;\n            if (this.timeScale != 1)\n                dt *= this.timeScale;\n\n            this._frameElapsed += dt;\n            var tt: number = this.interval + this._frames[this._frame].addDelay;\n            if (this._frame == 0 && this._repeatedCount > 0)\n                tt += this.repeatDelay;\n            if (this._frameElapsed < tt)\n                return;\n\n            this._frameElapsed -= tt;\n            if (this._frameElapsed > this.interval)\n                this._frameElapsed = this.interval;\n\n            if (this.swing) {\n                if (this._reversed) {\n                    this._frame--;\n                    if (this._frame <= 0) {\n                        this._frame = 0;\n                        this._repeatedCount++;\n                        this._reversed = !this._reversed;\n                    }\n                }\n                else {\n                    this._frame++;\n                    if (this._frame > this._frameCount - 1) {\n                        this._frame = Math.max(0, this._frameCount - 2);\n                        this._repeatedCount++;\n                        this._reversed = !this._reversed;\n                    }\n                }\n            }\n            else {\n                this._frame++;\n                if (this._frame > this._frameCount - 1) {\n                    this._frame = 0;\n                    this._repeatedCount++;\n                }\n            }\n\n            if (this._status == 1) //new loop\n            {\n                this._frame = this._start;\n                this._frameElapsed = 0;\n                this._status = 0;\n            }\n            else if (this._status == 2) //ending\n            {\n                this._frame = this._endAt;\n                this._frameElapsed = 0;\n                this._status = 3; //ended\n\n                //play end\n                if (this._callback != null) {\n                    var callback: Function = this._callback;\n                    var caller: any = this._callbackObj;\n                    this._callback = null;\n                    this._callbackObj = null;\n                    callback.call(caller);\n                }\n            }\n            else {\n                if (this._frame == this._end) {\n                    if (this._times > 0) {\n                        this._times--;\n                        if (this._times == 0)\n                            this._status = 2;  //ending\n                        else\n                            this._status = 1; //new loop\n                    }\n                    else if (this._start != 0)\n                        this._status = 1; //new loop\n                }\n            }\n\n            this.drawFrame();\n        }\n\n        private drawFrame(): void {\n            if (this._frameCount > 0 && this._frame < this._frames.length) {\n                var frame: Frame = this._frames[this._frame];\n                this.texture = frame.texture;\n            }\n            else\n                this.texture = null;\n        }\n\n        private checkTimer(): void {\n            if (this._playing && this._frameCount > 0 && this.stage != null)\n                GTimers.inst.add(1, 0, this.update, this);\n            else\n                GTimers.inst.remove(this.update, this);\n        }\n\n        $onAddToStage(stage: egret.Stage, nestLevel: number): void {\n            super.$onAddToStage(stage, nestLevel);\n\n            if (this._playing && this._frameCount > 0)\n                GTimers.inst.add(1, 0, this.update, this);\n        }\n\n        $onRemoveFromStage(): void {\n            super.$onRemoveFromStage();\n\n            GTimers.inst.remove(this.update, this);\n        }\n    }\n}"
  },
  {
    "path": "source/src/display/UIContainer.ts",
    "content": "\r\nmodule fgui {\r\n\r\n    export class UIContainer extends egret.DisplayObjectContainer {\r\n        private _hitArea?: PixelHitTest | egret.DisplayObject;\r\n        private _cachedMatrix?: egret.Matrix;\r\n        private _cachedHitArea?: boolean;\r\n        private _opaque?: boolean;\r\n\r\n        public constructor() {\r\n            super();\r\n            \r\n            this.touchEnabled = true;\r\n            this.touchChildren = true;\r\n        }\r\n\r\n        public cacheHitArea(value: boolean) {\r\n            this._cachedHitArea = value;\r\n            if (value) {\r\n                if (!this._cachedMatrix)\r\n                    this._cachedMatrix = new egret.Matrix();\r\n                this._cachedMatrix.copyFrom(this.$getInvertedConcatenatedMatrix());\r\n            }\r\n        }\r\n\r\n        public get hitArea(): PixelHitTest | egret.DisplayObject {\r\n            return this._hitArea;\r\n        }\r\n\r\n        public set hitArea(value: PixelHitTest | egret.DisplayObject) {\r\n            this._hitArea = value;\r\n        }\r\n\r\n        public get opaque(): boolean {\r\n            return this._opaque;\r\n        }\r\n\r\n        public set opaque(value: boolean) {\r\n            this._opaque = value;\r\n        }\r\n\r\n        public $hitTest(stageX: number, stageY: number): egret.DisplayObject {\r\n            if (!this.$visible)\r\n                return null;\r\n\r\n            if (this._hitArea) {\r\n                if (!this.touchEnabled)\r\n                    return null;\r\n\r\n                if ((<any>this._hitArea).$graphics) {\r\n                    if (!(<any>this._hitArea).$graphics.$hitTest(stageX, stageY))\r\n                        return null;\r\n                }\r\n                else {\r\n                    let m: egret.Matrix = this._cachedHitArea ? this._cachedMatrix : this.$getInvertedConcatenatedMatrix();\r\n                    let localX: number = m.a * stageX + m.c * stageY + m.tx;\r\n                    let localY: number = m.b * stageX + m.d * stageY + m.ty;\r\n\r\n                    if (!(<PixelHitTest>this._hitArea).contains(localX, localY))\r\n                        return null;\r\n                }\r\n\r\n                return this;\r\n            }\r\n\r\n            let ret: egret.DisplayObject = super.$hitTest(stageX, stageY);\r\n            if (ret == this && !this.touchEnabled)\r\n                return null;\r\n\r\n            if (ret == null && this._opaque) {\r\n                let m: egret.Matrix = this._cachedHitArea ? this._cachedMatrix : this.$getInvertedConcatenatedMatrix();\r\n                let localX: number = m.a * stageX + m.c * stageY + m.tx;\r\n                let localY: number = m.b * stageX + m.d * stageY + m.ty;\r\n                if (localX >= 0 && localY >= 0 && localX <= this.$explicitWidth && localY <= this.$explicitHeight)\r\n                    return this;\r\n                else\r\n                    return null;\r\n            }\r\n            else if (ret == this && !this._opaque)\r\n                return null;\r\n            else\r\n                return ret;\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "source/src/event/DragEvent.ts",
    "content": "\nmodule fgui {\n\n    export class DragEvent extends egret.Event {\n        public stageX: number;\n        public stageY: number;\n        public touchPointID: number = 0;\n\n        private _prevented: boolean;\n\n        public static DRAG_START: string = \"__dragStart\";\n        public static DRAG_END: string = \"__dragEnd\";\n        public static DRAG_MOVING: string = \"__dragMoving\";\n\n        public constructor(type: string, stageX: number = 0, stageY: number = 0, touchPointID: number = -1) {\n            super(type, false);\n\n            this.stageX = stageX;\n            this.stageY = stageY;\n            this.touchPointID = touchPointID;\n        }\n\n        public preventDefault(): void {\n            this._prevented = true;\n        }\n\n        public isDefaultPrevented(): boolean {\n            return this._prevented;\n        }\n    }\n}"
  },
  {
    "path": "source/src/event/DropEvent.ts",
    "content": "module fgui {\n    export class DropEvent extends egret.Event {\n\n        public source: any;\n\n        public static DROP: string = \"__drop\";\n\n        public constructor(type: string, source?: any) {\n            super(type, false);\n            this.source = source;\n        }\n    }\n}\n"
  },
  {
    "path": "source/src/event/ItemEvent.ts",
    "content": "\nmodule fgui {\n\n    export class ItemEvent extends egret.Event {\n        public itemObject: GObject;\n        public stageX: number;\n        public stageY: number;\n\n        public static CLICK: string = \"___itemClick\";\n\n        public constructor(type: string, itemObject: GObject = null, stageX: number = 0, stageY: number = 0) {\n            super(type, false);\n            this.itemObject = itemObject;\n            this.stageX = stageX;\n            this.stageY = stageY;\n        }\n    }\n}"
  },
  {
    "path": "source/src/event/StateChangeEvent.ts",
    "content": "\nmodule fgui {\n\n    export class StateChangeEvent extends egret.Event {\n        public static CHANGED: string = \"___stateChanged\";\n\n        public constructor(type: string) {\n            super(type, false);\n        }\n    }\n}"
  },
  {
    "path": "source/src/gears/GearAnimation.ts",
    "content": "///<reference path=\"GearBase.ts\"/>\n\nnamespace fgui {\n    interface Value {\n        playing?: boolean;\n        frame?: number;\n    }\n\n    export class GearAnimation extends GearBase {\n        private _storage: { [index: string]: Value };\n        private _default: Value;\n\n        constructor(owner: GObject) {\n            super(owner);\n        }\n\n        protected init(): void {\n            this._default = {\n                playing: this._owner.getProp(ObjectPropID.Playing),\n                frame: this._owner.getProp(ObjectPropID.Frame)\n            };\n            this._storage = {};\n        }\n\n        protected addStatus(pageId: string, buffer: ByteBuffer): void {\n            var gv: Value;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n            gv.playing = buffer.readBool();\n            gv.frame = buffer.readInt();\n        }\n\n        public apply(): void {\n            this._owner._gearLocked = true;\n\n            var gv: Value = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n\n            this._owner.setProp(ObjectPropID.Playing, gv.playing);\n            this._owner.setProp(ObjectPropID.Frame, gv.frame);\n\n            this._owner._gearLocked = false;\n        }\n\n        public updateState(): void {\n            var gv: Value = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n\n            gv.playing = this._owner.getProp(ObjectPropID.Playing);\n            gv.frame = this._owner.getProp(ObjectPropID.Frame);\n        }\n    }\n}"
  },
  {
    "path": "source/src/gears/GearBase.ts",
    "content": "namespace fgui {\r\n    export class GearBase {\r\n        public static disableAllTweenEffect: boolean;\r\n\r\n        protected _owner: GObject;\r\n        protected _controller: Controller;\r\n        protected _tweenConfig?: GearTweenConfig;\r\n\r\n        public static create(owner: GObject, index: number): GearBase {\r\n            if (!Classes)\r\n                Classes = [\r\n                    GearDisplay, GearXY, GearSize, GearLook, GearColor,\r\n                    GearAnimation, GearText, GearIcon, GearDisplay2, GearFontSize\r\n                ];\r\n            return new (Classes[index])(owner);\r\n        }\r\n\r\n        constructor(owner: GObject) {\r\n            this._owner = owner;\r\n        }\r\n\r\n        public dispose(): void {\r\n            if (this._tweenConfig && this._tweenConfig._tweener) {\r\n                this._tweenConfig._tweener.kill();\r\n                this._tweenConfig._tweener = null;\r\n            }\r\n        }\r\n\r\n        public get controller(): Controller {\r\n            return this._controller;\r\n        }\r\n\r\n        public set controller(val: Controller) {\r\n            if (val != this._controller) {\r\n                this._controller = val;\r\n                if (this._controller)\r\n                    this.init();\r\n            }\r\n        }\r\n\r\n        public get tweenConfig(): GearTweenConfig {\r\n            if (!this._tweenConfig)\r\n                this._tweenConfig = new GearTweenConfig();\r\n            return this._tweenConfig;\r\n        }\r\n\r\n        public setup(buffer: ByteBuffer): void {\r\n            this._controller = this._owner.parent.getControllerAt(buffer.readShort());\r\n            this.init();\r\n\r\n            var i: number;\r\n            var page: string;\r\n            var cnt: number = buffer.readShort();\r\n\r\n            if (this instanceof GearDisplay) {\r\n                this.pages = buffer.readSArray(cnt);\r\n            }\r\n            else if (this instanceof GearDisplay2) {\r\n                this.pages = buffer.readSArray(cnt);\r\n            }\r\n            else {\r\n                for (i = 0; i < cnt; i++) {\r\n                    page = buffer.readS();\r\n                    if (page == null)\r\n                        continue;\r\n\r\n                    this.addStatus(page, buffer);\r\n                }\r\n\r\n                if (buffer.readBool())\r\n                    this.addStatus(null, buffer);\r\n            }\r\n\r\n            if (buffer.readBool()) {\r\n                this._tweenConfig = new GearTweenConfig();\r\n                this._tweenConfig.easeType = buffer.readByte();\r\n                this._tweenConfig.duration = buffer.readFloat();\r\n                this._tweenConfig.delay = buffer.readFloat();\r\n            }\r\n\r\n            if (buffer.version >= 2) {\r\n                if (this instanceof GearXY) {\r\n                    if (buffer.readBool()) {\r\n                        this.positionsInPercent = true;\r\n                        for (i = 0; i < cnt; i++) {\r\n                            page = buffer.readS();\r\n                            if (page == null)\r\n                                continue;\r\n\r\n                            this.addExtStatus(page, buffer);\r\n                        }\r\n\r\n                        if (buffer.readBool())\r\n                            this.addExtStatus(null, buffer);\r\n                    }\r\n                }\r\n                else if (this instanceof GearDisplay2)\r\n                    this.condition = buffer.readByte();\r\n            }\r\n        }\r\n\r\n        public updateFromRelations(dx: number, dy: number): void {\r\n\r\n        }\r\n\r\n        protected addStatus(pageId: string, buffer: ByteBuffer): void {\r\n\r\n        }\r\n\r\n        protected init(): void {\r\n\r\n        }\r\n\r\n        public apply(): void {\r\n        }\r\n\r\n        public updateState(): void {\r\n        }\r\n    }\r\n\r\n    var Classes: Array<typeof GearBase>;\r\n\r\n    export class GearTweenConfig {\r\n        public tween: boolean;\r\n        public easeType: number;\r\n        public duration: number;\r\n        public delay: number;\r\n\r\n        public _displayLockToken: number;\r\n        public _tweener: GTweener;\r\n\r\n        constructor() {\r\n            this.tween = true;\r\n            this.easeType = EaseType.QuadOut;\r\n            this.duration = 0.3;\r\n            this.delay = 0;\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "source/src/gears/GearColor.ts",
    "content": "\nnamespace fgui {\n    interface Value {\n        color?: number;\n        strokeColor?: number;\n    }\n\n    export class GearColor extends GearBase {\n        private _storage: { [index: string]: Value };\n        private _default: Value;\n\n        public constructor(owner: GObject) {\n            super(owner);\n        }\n\n        protected init(): void {\n            this._default = {\n                color: this._owner.getProp(ObjectPropID.Color),\n                strokeColor: this._owner.getProp(ObjectPropID.OutlineColor)\n            };\n            this._storage = {};\n        }\n\n        protected addStatus(pageId: string, buffer: ByteBuffer): void {\n            var gv: Value;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n            gv.color = buffer.readColor();\n            gv.strokeColor = buffer.readColor();\n        }\n\n        public apply(): void {\n            this._owner._gearLocked = true;\n\n            var gv: Value = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n\n            this._owner.setProp(ObjectPropID.Color, gv.color);\n            this._owner.setProp(ObjectPropID.OutlineColor, gv.strokeColor);\n\n            this._owner._gearLocked = false;\n        }\n\n        public updateState(): void {\n            var gv: Value = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n\n            gv.color = this._owner.getProp(ObjectPropID.Color);\n            gv.strokeColor = this._owner.getProp(ObjectPropID.OutlineColor);\n        }\n    }\n}"
  },
  {
    "path": "source/src/gears/GearDisplay.ts",
    "content": "\nnamespace fgui {\n\n    export class GearDisplay extends GearBase {\n        public pages: string[];\n        private _visible: number;\n        private _displayLockToken: number;\n\n        public constructor(owner: GObject) {\n            super(owner);\n\n            this._displayLockToken = 1;\n            this._visible = 0;\n        }\n\n        protected init(): void {\n            this.pages = null;\n        }\n\n        public apply(): void {\n            this._displayLockToken++;\n            if (this._displayLockToken == 0)\n                this._displayLockToken = 1;\n\n            if (this.pages == null || this.pages.length == 0\n                || this.pages.indexOf(this._controller.selectedPageId) != -1)\n                this._visible = 1;\n            else\n                this._visible = 0;\n        }\n\n\n        public addLock(): number {\n            this._visible++;\n            return this._displayLockToken;\n        }\n\n        public releaseLock(token: number): void {\n            if (token == this._displayLockToken)\n                this._visible--;\n        }\n\n        public get connected(): boolean {\n            return this._controller == null || this._visible > 0;\n        }\n    }\n}"
  },
  {
    "path": "source/src/gears/GearDisplay2.ts",
    "content": "namespace fgui {\n    export class GearDisplay2 extends GearBase {\n        public pages: string[];\n        public condition: number;\n\n        private _visible: number = 0;\n\n        constructor(owner: GObject) {\n            super(owner);\n        }\n\n        protected init(): void {\n            this.pages = null;\n        }\n\n        public apply(): void {\n            if (this.pages == null || this.pages.length == 0\n                || this.pages.indexOf(this._controller.selectedPageId) != -1)\n                this._visible = 1;\n            else\n                this._visible = 0;\n        }\n\n        public evaluate(connected: boolean): boolean {\n            var v: boolean = this._controller == null || this._visible > 0;\n            if (this.condition == 0)\n                v = v && connected;\n            else\n                v = v || connected;\n            return v;\n        }\n    }\n}"
  },
  {
    "path": "source/src/gears/GearFontSize.ts",
    "content": "namespace fgui {\n    export class GearFontSize extends GearBase {\n        private _storage: { [index: string]: number };\n        private _default: number = 0;\n\n        constructor(owner: GObject) {\n            super(owner);\n        }\n\n        protected init(): void {\n            this._default = this._owner.getProp(ObjectPropID.FontSize);\n            this._storage = {};\n        }\n\n        protected addStatus(pageId: string, buffer: ByteBuffer): void {\n            if (pageId == null)\n                this._default = buffer.readInt();\n            else\n                this._storage[pageId] = buffer.readInt();\n        }\n\n        public apply(): void {\n            this._owner._gearLocked = true;\n\n            var data: any = this._storage[this._controller.selectedPageId];\n            if (data != undefined)\n                this._owner.setProp(ObjectPropID.FontSize, data);\n            else\n                this._owner.setProp(ObjectPropID.FontSize, this._default);\n\n            this._owner._gearLocked = false;\n        }\n\n        public updateState(): void {\n            this._storage[this._controller.selectedPageId] = this._owner.getProp(ObjectPropID.FontSize);\n        }\n    }\n}"
  },
  {
    "path": "source/src/gears/GearIcon.ts",
    "content": "\nnamespace fgui {\n\n    export class GearIcon extends GearBase {\n        private _storage: { [index: string]: string };\n        private _default: string;\n\n        public constructor(owner: GObject) {\n            super(owner);\n        }\n\n        protected init(): void {\n            this._default = this._owner.icon;\n            this._storage = {};\n        }\n\n        protected addStatus(pageId: string, buffer: ByteBuffer): void {\n            if (pageId == null)\n                this._default = buffer.readS();\n            else\n                this._storage[pageId] = buffer.readS();\n        }\n\n        public apply(): void {\n            this._owner._gearLocked = true;\n\n            var data: any = this._storage[this._controller.selectedPageId];\n            if (data !== undefined)\n                this._owner.icon = data;\n            else\n                this._owner.icon = this._default;\n\n            this._owner._gearLocked = false;\n        }\n\n        public updateState(): void {\n            this._storage[this._controller.selectedPageId] = this._owner.icon;\n        }\n    }\n}"
  },
  {
    "path": "source/src/gears/GearLook.ts",
    "content": "\nnamespace fgui {\n\n    interface Value {\n        alpha?: number;\n        rotation?: number;\n        grayed?: boolean;\n        touchable?: boolean;\n    }\n\n    export class GearLook extends GearBase {\n        private _storage: { [index: string]: Value };\n        private _default: Value;\n\n        public constructor(owner: GObject) {\n            super(owner);\n        }\n\n        protected init(): void {\n            this._default = {\n                alpha: this._owner.alpha,\n                rotation: this._owner.rotation,\n                grayed: this._owner.grayed,\n                touchable: this._owner.touchable\n            };\n            this._storage = {};\n        }\n\n        protected addStatus(pageId: string, buffer: ByteBuffer): void {\n            var gv: Value;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n            gv.alpha = buffer.readFloat();\n            gv.rotation = buffer.readFloat();\n            gv.grayed = buffer.readBool();\n            gv.touchable = buffer.readBool();\n        }\n\n        public apply(): void {\n            var gv: Value = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n\n            if (this._tweenConfig && this._tweenConfig.tween && !UIPackage._constructing && !GearBase.disableAllTweenEffect) {\n                this._owner._gearLocked = true;\n                this._owner.grayed = gv.grayed;\n                this._owner.touchable = gv.touchable;\n                this._owner._gearLocked = false;\n                if (this._tweenConfig._tweener) {\n                    if (this._tweenConfig._tweener.endValue.x != gv.alpha || this._tweenConfig._tweener.endValue.y != gv.rotation) {\n                        this._tweenConfig._tweener.kill(true);\n                        this._tweenConfig._tweener = null;\n                    }\n                    else\n                        return;\n                }\n\n                var a: boolean = gv.alpha != this._owner.alpha;\n                var b: boolean = gv.rotation != this._owner.rotation;\n                if (a || b) {\n                    if (this._owner.checkGearController(0, this._controller))\n                        this._tweenConfig._displayLockToken = this._owner.addDisplayLock();\n\n                    this._tweenConfig._tweener = GTween.to2(this._owner.alpha, this._owner.rotation, gv.alpha, gv.rotation, this._tweenConfig.duration)\n                        .setDelay(this._tweenConfig.delay)\n                        .setEase(this._tweenConfig.easeType)\n                        .setUserData((a ? 1 : 0) + (b ? 2 : 0))\n                        .setTarget(this)\n                        .onUpdate(this.__tweenUpdate, this)\n                        .onComplete(this.__tweenComplete, this);\n                }\n            }\n            else {\n                this._owner._gearLocked = true;\n                this._owner.grayed = gv.grayed;\n                this._owner.touchable = gv.touchable;\n                this._owner.alpha = gv.alpha;\n                this._owner.rotation = gv.rotation;\n                this._owner._gearLocked = false;\n            }\n        }\n\n        private __tweenUpdate(tweener: GTweener): void {\n            var flag: number = tweener.userData;\n            this._owner._gearLocked = true;\n            if ((flag & 1) != 0)\n                this._owner.alpha = tweener.value.x;\n            if ((flag & 2) != 0)\n                this._owner.rotation = tweener.value.y;\n            this._owner._gearLocked = false;\n        }\n\n        private __tweenComplete(): void {\n            if (this._tweenConfig._displayLockToken != 0) {\n                this._owner.releaseDisplayLock(this._tweenConfig._displayLockToken);\n                this._tweenConfig._displayLockToken = 0;\n            }\n            this._tweenConfig._tweener = null;\n        }\n\n        public updateState(): void {\n            var gv: Value = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n\n            gv.alpha = this._owner.alpha;\n            gv.rotation = this._owner.rotation;\n            gv.grayed = this._owner.grayed;\n            gv.touchable = this._owner.touchable;\n        }\n    }\n}\n"
  },
  {
    "path": "source/src/gears/GearSize.ts",
    "content": "\nnamespace fgui {\n    interface Value {\n        width?: number;\n        height?: number;\n        scaleX?: number;\n        scaleY?: number;\n    }\n\n    export class GearSize extends GearBase {\n        private _storage: { [index: string]: Value };\n        private _default: Value;\n\n        public constructor(owner: GObject) {\n            super(owner);\n        }\n\n        protected init(): void {\n            this._default = {\n                width: this._owner.width,\n                height: this._owner.height,\n                scaleX: this._owner.scaleX,\n                scaleY: this._owner.scaleY\n            };\n            this._storage = {};\n        }\n\n        protected addStatus(pageId: string, buffer: ByteBuffer): void {\n            var gv: Value;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n\n            gv.width = buffer.readInt();\n            gv.height = buffer.readInt();\n            gv.scaleX = buffer.readFloat();\n            gv.scaleY = buffer.readFloat();\n        }\n\n        public apply(): void {\n            var gv: Value = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n\n            if (this._tweenConfig && this._tweenConfig.tween && !UIPackage._constructing && !GearBase.disableAllTweenEffect) {\n                if (this._tweenConfig._tweener) {\n                    if (this._tweenConfig._tweener.endValue.x != gv.width || this._tweenConfig._tweener.endValue.y != gv.height\n                        || this._tweenConfig._tweener.endValue.z != gv.scaleX || this._tweenConfig._tweener.endValue.w != gv.scaleY) {\n                        this._tweenConfig._tweener.kill(true);\n                        this._tweenConfig._tweener = null;\n                    }\n                    else\n                        return;\n                }\n\n                var a: boolean = gv.width != this._owner.width || gv.height != this._owner.height;\n                var b: boolean = gv.scaleX != this._owner.scaleX || gv.scaleY != this._owner.scaleY;\n                if (a || b) {\n                    if (this._owner.checkGearController(0, this._controller))\n                        this._tweenConfig._displayLockToken = this._owner.addDisplayLock();\n\n                    this._tweenConfig._tweener = GTween.to4(this._owner.width, this._owner.height, this._owner.scaleX, this._owner.scaleY, gv.width, gv.height, gv.scaleX, gv.scaleY, this._tweenConfig.duration)\n                        .setDelay(this._tweenConfig.delay)\n                        .setEase(this._tweenConfig.easeType)\n                        .setUserData((a ? 1 : 0) + (b ? 2 : 0))\n                        .setTarget(this)\n                        .onUpdate(this.__tweenUpdate, this)\n                        .onComplete(this.__tweenComplete, this);\n                }\n            }\n            else {\n                this._owner._gearLocked = true;\n                this._owner.setSize(gv.width, gv.height, this._owner.gearXY.controller == this._controller);\n                this._owner.setScale(gv.scaleX, gv.scaleY);\n                this._owner._gearLocked = false;\n            }\n        }\n\n        private __tweenUpdate(tweener: GTweener): void {\n            var flag: number = tweener.userData;\n            this._owner._gearLocked = true;\n            if ((flag & 1) != 0)\n                this._owner.setSize(tweener.value.x, tweener.value.y, this._owner.checkGearController(1, this._controller));\n            if ((flag & 2) != 0)\n                this._owner.setScale(tweener.value.z, tweener.value.w);\n            this._owner._gearLocked = false;\n        }\n\n        private __tweenComplete(): void {\n            if (this._tweenConfig._displayLockToken != 0) {\n                this._owner.releaseDisplayLock(this._tweenConfig._displayLockToken);\n                this._tweenConfig._displayLockToken = 0;\n            }\n            this._tweenConfig._tweener = null;\n        }\n\n        public updateState(): void {\n            var gv: Value = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n            gv.width = this._owner.width;\n            gv.height = this._owner.height;\n            gv.scaleX = this._owner.scaleX;\n            gv.scaleY = this._owner.scaleY;\n        }\n\n        public updateFromRelations(dx: number, dy: number): void {\n            if (this._controller == null || this._storage == null)\n                return;\n\n            for (var key in this._storage) {\n                var gv: Value = this._storage[key];\n                gv.width += dx;\n                gv.height += dy;\n            }\n            this._default.width += dx;\n            this._default.height += dy;\n\n            this.updateState();\n        }\n    }\n}"
  },
  {
    "path": "source/src/gears/GearText.ts",
    "content": "\nnamespace fgui {\n\n    export class GearText extends GearBase {\n        private _storage: { [index: string]: string };\n        private _default: string;\n\n        public constructor(owner: GObject) {\n            super(owner);\n        }\n\n        protected init(): void {\n            this._default = this._owner.text;\n            this._storage = {};\n        }\n\n        protected addStatus(pageId: string, buffer: ByteBuffer): void {\n            if (pageId == null)\n                this._default = buffer.readS();\n            else\n                this._storage[pageId] = buffer.readS();\n        }\n\n        public apply(): void {\n            this._owner._gearLocked = true;\n\n            var data: any = this._storage[this._controller.selectedPageId];\n            if (data !== undefined)\n                this._owner.text = data;\n            else\n                this._owner.text = this._default;\n\n            this._owner._gearLocked = false;\n        }\n\n        public updateState(): void {\n            this._storage[this._controller.selectedPageId] = this._owner.text;\n        }\n    }\n}"
  },
  {
    "path": "source/src/gears/GearXY.ts",
    "content": "namespace fgui {\n    interface Value {\n        x?: number;\n        y?: number;\n        px?: number;\n        py?: number;\n    }\n\n    export class GearXY extends GearBase {\n        public positionsInPercent: boolean;\n\n        private _storage: { [index: string]: Value };\n        private _default: Value;\n\n        constructor(owner: GObject) {\n            super(owner);\n        }\n\n        protected init(): void {\n            this._default = {\n                x: this._owner.x,\n                y: this._owner.y,\n                px: this._owner.x / this._owner.parent.width,\n                py: this._owner.y / this._owner.parent.height\n            };\n            this._storage = {};\n        }\n\n        protected addStatus(pageId: string, buffer: ByteBuffer): void {\n            var gv: Value;\n            if (pageId == null)\n                gv = this._default;\n            else\n                this._storage[pageId] = gv = {};\n            gv.x = buffer.readInt();\n            gv.y = buffer.readInt();\n        }\n\n        public addExtStatus(pageId: string, buffer: ByteBuffer): void {\n            var gv: Value;\n            if (pageId == null)\n                gv = this._default;\n            else\n                gv = this._storage[pageId];\n            gv.px = buffer.readFloat();\n            gv.py = buffer.readFloat();\n        }\n\n        public apply(): void {\n            var gv: Value = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                gv = this._default;\n\n            var ex: number;\n            var ey: number;\n\n            if (this.positionsInPercent && this._owner.parent) {\n                ex = gv.px * this._owner.parent.width;\n                ey = gv.py * this._owner.parent.height;\n            }\n            else {\n                ex = gv.x;\n                ey = gv.y;\n            }\n\n            if (this._tweenConfig && this._tweenConfig.tween && !UIPackage._constructing && !GearBase.disableAllTweenEffect) {\n                if (this._tweenConfig._tweener) {\n                    if (this._tweenConfig._tweener.endValue.x != ex || this._tweenConfig._tweener.endValue.y != ey) {\n                        this._tweenConfig._tweener.kill(true);\n                        this._tweenConfig._tweener = null;\n                    }\n                    else\n                        return;\n                }\n\n                var ox: number = this._owner.x;\n                var oy: number = this._owner.y;\n\n                if (ox != ex || oy != ey) {\n                    if (this._owner.checkGearController(0, this._controller))\n                        this._tweenConfig._displayLockToken = this._owner.addDisplayLock();\n\n                    this._tweenConfig._tweener = GTween.to2(ox, oy, ex, ey, this._tweenConfig.duration)\n                        .setDelay(this._tweenConfig.delay)\n                        .setEase(this._tweenConfig.easeType)\n                        .setTarget(this)\n                        .onUpdate(this.__tweenUpdate, this)\n                        .onComplete(this.__tweenComplete, this);\n                }\n            }\n            else {\n                this._owner._gearLocked = true;\n                this._owner.setXY(ex, ey);\n                this._owner._gearLocked = false;\n            }\n        }\n\n        private __tweenUpdate(tweener: GTweener): void {\n            this._owner._gearLocked = true;\n            this._owner.setXY(tweener.value.x, tweener.value.y);\n            this._owner._gearLocked = false;\n        }\n\n        private __tweenComplete(): void {\n            if (this._tweenConfig._displayLockToken != 0) {\n                this._owner.releaseDisplayLock(this._tweenConfig._displayLockToken);\n                this._tweenConfig._displayLockToken = 0;\n            }\n            this._tweenConfig._tweener = null;\n        }\n\n        public updateState(): void {\n            var gv: Value = this._storage[this._controller.selectedPageId];\n            if (!gv)\n                this._storage[this._controller.selectedPageId] = gv = {};\n\n            gv.x = this._owner.x;\n            gv.y = this._owner.y;\n            gv.px = this._owner.x / this._owner.parent.width;\n            gv.py = this._owner.y / this._owner.parent.height;\n        }\n\n        public updateFromRelations(dx: number, dy: number): void {\n            if (this._controller == null || this._storage == null || this.positionsInPercent)\n                return;\n\n            for (var key in this._storage) {\n                var pt: Value = this._storage[key];\n                pt.x += dx;\n                pt.y += dy;\n            }\n            this._default.x += dx;\n            this._default.y += dy;\n\n            this.updateState();\n        }\n    }\n}"
  },
  {
    "path": "source/src/tween/EaseManager.ts",
    "content": "// Author: Daniele Giardini - http://www.demigiant.com\r\n// Created: 2014/07/19 14:11\r\n// \r\n// License Copyright (c) Daniele Giardini.\r\n// This work is subject to the terms at http://dotween.demigiant.com/license.php\r\n// \r\n// =============================================================\r\n// Contains Daniele Giardini's C# port of the easing equations created by Robert Penner\r\n// (all easing equations except for Flash, InFlash, OutFlash, InOutFlash,\r\n// which use some parts of Robert Penner's equations but were created by Daniele Giardini)\r\n// http://robertpenner.com/easing, see license below:\r\n// =============================================================\r\n//\r\n// TERMS OF USE - EASING EQUATIONS\r\n//\r\n// Open source under the BSD License.\r\n//\r\n// Copyright ? 2001 Robert Penner\r\n// All rights reserved.\r\n//\r\n// Redistribution and use in source and binary forms, with or without modification,\r\n// are permitted provided that the following conditions are met:\r\n//\r\n// - Redistributions of source code must retain the above copyright notice,\r\n// this list of conditions and the following disclaimer.\r\n// - Redistributions in binary form must reproduce the above copyright notice,\r\n// this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\r\n// - Neither the name of the author nor the names of contributors may be used to endorse\r\n// or promote products derived from this software without specific prior written permission.\r\n// - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,\r\n// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\r\n// IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\r\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\r\n// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\r\n// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,\r\n// EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\r\n\r\nnamespace fgui {\r\n    const _PiOver2: number = Math.PI * 0.5;\r\n    const _TwoPi: number = Math.PI * 2;\r\n\r\n    export function evaluateEase(easeType: number, time: number, duration: number, overshootOrAmplitude: number, period: number): number {\r\n        switch (easeType) {\r\n            case EaseType.Linear:\r\n                return time / duration;\r\n            case EaseType.SineIn:\r\n                return -Math.cos(time / duration * _PiOver2) + 1;\r\n            case EaseType.SineOut:\r\n                return Math.sin(time / duration * _PiOver2);\r\n            case EaseType.SineInOut:\r\n                return -0.5 * (Math.cos(Math.PI * time / duration) - 1);\r\n            case EaseType.QuadIn:\r\n                return (time /= duration) * time;\r\n            case EaseType.QuadOut:\r\n                return -(time /= duration) * (time - 2);\r\n            case EaseType.QuadInOut:\r\n                if ((time /= duration * 0.5) < 1) return 0.5 * time * time;\r\n                return -0.5 * ((--time) * (time - 2) - 1);\r\n            case EaseType.CubicIn:\r\n                return (time /= duration) * time * time;\r\n            case EaseType.CubicOut:\r\n                return ((time = time / duration - 1) * time * time + 1);\r\n            case EaseType.CubicInOut:\r\n                if ((time /= duration * 0.5) < 1) return 0.5 * time * time * time;\r\n                return 0.5 * ((time -= 2) * time * time + 2);\r\n            case EaseType.QuartIn:\r\n                return (time /= duration) * time * time * time;\r\n            case EaseType.QuartOut:\r\n                return -((time = time / duration - 1) * time * time * time - 1);\r\n            case EaseType.QuartInOut:\r\n                if ((time /= duration * 0.5) < 1) return 0.5 * time * time * time * time;\r\n                return -0.5 * ((time -= 2) * time * time * time - 2);\r\n            case EaseType.QuintIn:\r\n                return (time /= duration) * time * time * time * time;\r\n            case EaseType.QuintOut:\r\n                return ((time = time / duration - 1) * time * time * time * time + 1);\r\n            case EaseType.QuintInOut:\r\n                if ((time /= duration * 0.5) < 1) return 0.5 * time * time * time * time * time;\r\n                return 0.5 * ((time -= 2) * time * time * time * time + 2);\r\n            case EaseType.ExpoIn:\r\n                return (time == 0) ? 0 : Math.pow(2, 10 * (time / duration - 1));\r\n            case EaseType.ExpoOut:\r\n                if (time == duration) return 1;\r\n                return (-Math.pow(2, -10 * time / duration) + 1);\r\n            case EaseType.ExpoInOut:\r\n                if (time == 0) return 0;\r\n                if (time == duration) return 1;\r\n                if ((time /= duration * 0.5) < 1) return 0.5 * Math.pow(2, 10 * (time - 1));\r\n                return 0.5 * (-Math.pow(2, -10 * --time) + 2);\r\n            case EaseType.CircIn:\r\n                return -(Math.sqrt(1 - (time /= duration) * time) - 1);\r\n            case EaseType.CircOut:\r\n                return Math.sqrt(1 - (time = time / duration - 1) * time);\r\n            case EaseType.CircInOut:\r\n                if ((time /= duration * 0.5) < 1) return -0.5 * (Math.sqrt(1 - time * time) - 1);\r\n                return 0.5 * (Math.sqrt(1 - (time -= 2) * time) + 1);\r\n            case EaseType.ElasticIn:\r\n                var s0: number;\r\n                if (time == 0) return 0;\r\n                if ((time /= duration) == 1) return 1;\r\n                if (period == 0) period = duration * 0.3;\r\n                if (overshootOrAmplitude < 1) {\r\n                    overshootOrAmplitude = 1;\r\n                    s0 = period / 4;\r\n                }\r\n                else s0 = period / _TwoPi * Math.asin(1 / overshootOrAmplitude);\r\n                return -(overshootOrAmplitude * Math.pow(2, 10 * (time -= 1)) * Math.sin((time * duration - s0) * _TwoPi / period));\r\n            case EaseType.ElasticOut:\r\n                var s1: number;\r\n                if (time == 0) return 0;\r\n                if ((time /= duration) == 1) return 1;\r\n                if (period == 0) period = duration * 0.3;\r\n                if (overshootOrAmplitude < 1) {\r\n                    overshootOrAmplitude = 1;\r\n                    s1 = period / 4;\r\n                }\r\n                else s1 = period / _TwoPi * Math.asin(1 / overshootOrAmplitude);\r\n                return (overshootOrAmplitude * Math.pow(2, -10 * time) * Math.sin((time * duration - s1) * _TwoPi / period) + 1);\r\n            case EaseType.ElasticInOut:\r\n                var s: number;\r\n                if (time == 0) return 0;\r\n                if ((time /= duration * 0.5) == 2) return 1;\r\n                if (period == 0) period = duration * (0.3 * 1.5);\r\n                if (overshootOrAmplitude < 1) {\r\n                    overshootOrAmplitude = 1;\r\n                    s = period / 4;\r\n                }\r\n                else s = period / _TwoPi * Math.asin(1 / overshootOrAmplitude);\r\n                if (time < 1) return -0.5 * (overshootOrAmplitude * Math.pow(2, 10 * (time -= 1)) * Math.sin((time * duration - s) * _TwoPi / period));\r\n                return overshootOrAmplitude * Math.pow(2, -10 * (time -= 1)) * Math.sin((time * duration - s) * _TwoPi / period) * 0.5 + 1;\r\n            case EaseType.BackIn:\r\n                return (time /= duration) * time * ((overshootOrAmplitude + 1) * time - overshootOrAmplitude);\r\n            case EaseType.BackOut:\r\n                return ((time = time / duration - 1) * time * ((overshootOrAmplitude + 1) * time + overshootOrAmplitude) + 1);\r\n            case EaseType.BackInOut:\r\n                if ((time /= duration * 0.5) < 1) return 0.5 * (time * time * (((overshootOrAmplitude *= (1.525)) + 1) * time - overshootOrAmplitude));\r\n                return 0.5 * ((time -= 2) * time * (((overshootOrAmplitude *= (1.525)) + 1) * time + overshootOrAmplitude) + 2);\r\n            case EaseType.BounceIn:\r\n                return bounce_easeIn(time, duration);\r\n            case EaseType.BounceOut:\r\n                return bounce_easeOut(time, duration);\r\n            case EaseType.BounceInOut:\r\n                return bounce_easeInOut(time, duration);\r\n\r\n            default:\r\n                return -(time /= duration) * (time - 2);\r\n        }\r\n    }\r\n\r\n    function bounce_easeIn(time: number, duration: number): number {\r\n        return 1 - bounce_easeOut(duration - time, duration);\r\n    }\r\n\r\n    function bounce_easeOut(time: number, duration: number): number {\r\n        if ((time /= duration) < (1 / 2.75)) {\r\n            return (7.5625 * time * time);\r\n        }\r\n        if (time < (2 / 2.75)) {\r\n            return (7.5625 * (time -= (1.5 / 2.75)) * time + 0.75);\r\n        }\r\n        if (time < (2.5 / 2.75)) {\r\n            return (7.5625 * (time -= (2.25 / 2.75)) * time + 0.9375);\r\n        }\r\n        return (7.5625 * (time -= (2.625 / 2.75)) * time + 0.984375);\r\n    }\r\n\r\n    function bounce_easeInOut(time: number, duration: number): number {\r\n        if (time < duration * 0.5) {\r\n            return bounce_easeIn(time * 2, duration) * 0.5;\r\n        }\r\n        return bounce_easeOut(time * 2 - duration, duration) * 0.5 + 0.5;\r\n    }\r\n}"
  },
  {
    "path": "source/src/tween/EaseType.ts",
    "content": "namespace fgui {\r\n    export class EaseType {\r\n        public static Linear: number = 0;\r\n        public static SineIn: number = 1;\r\n        public static SineOut: number = 2;\r\n        public static SineInOut: number = 3;\r\n        public static QuadIn: number = 4;\r\n        public static QuadOut: number = 5;\r\n        public static QuadInOut: number = 6;\r\n        public static CubicIn: number = 7;\r\n        public static CubicOut: number = 8;\r\n        public static CubicInOut: number = 9;\r\n        public static QuartIn: number = 10;\r\n        public static QuartOut: number = 11;\r\n        public static QuartInOut: number = 12;\r\n        public static QuintIn: number = 13;\r\n        public static QuintOut: number = 14;\r\n        public static QuintInOut: number = 15;\r\n        public static ExpoIn: number = 16;\r\n        public static ExpoOut: number = 17;\r\n        public static ExpoInOut: number = 18;\r\n        public static CircIn: number = 19;\r\n        public static CircOut: number = 20;\r\n        public static CircInOut: number = 21;\r\n        public static ElasticIn: number = 22;\r\n        public static ElasticOut: number = 23;\r\n        public static ElasticInOut: number = 24;\r\n        public static BackIn: number = 25;\r\n        public static BackOut: number = 26;\r\n        public static BackInOut: number = 27;\r\n        public static BounceIn: number = 28;\r\n        public static BounceOut: number = 29;\r\n        public static BounceInOut: number = 30;\r\n        public static Custom: number = 31;\r\n    }\r\n}"
  },
  {
    "path": "source/src/tween/GPath.ts",
    "content": "namespace fgui {\n    export class GPath {\n        private _segments: Array<Segment>;\n        private _points: Array<egret.Point>;\n        private _fullLength: number;\n\n        constructor() {\n            this._segments = new Array<Segment>();\n            this._points = new Array<egret.Point>();\n        }\n\n        public get length(): number {\n            return this._fullLength;\n        }\n\n        public create(pt1: Array<GPathPoint> | GPathPoint, pt2?: GPathPoint, pt3?: GPathPoint, pt4?: GPathPoint): void {\n            var points: Array<GPathPoint>;\n            if (Array.isArray(pt1))\n                points = pt1;\n            else {\n                points = new Array<GPathPoint>();\n                points.push(pt1);\n                points.push(pt2);\n                if (pt3)\n                    points.push(pt3);\n                if (pt4)\n                    points.push(pt4);\n            }\n\n            this._segments.length = 0;\n            this._points.length = 0;\n            this._fullLength = 0;\n\n            var cnt: number = points.length;\n            if (cnt == 0)\n                return;\n\n            var splinePoints: Array<egret.Point> = s_points;\n            splinePoints.length = 0;\n\n            var prev: GPathPoint = points[0];\n            if (prev.curveType == CurveType.CRSpline)\n                splinePoints.push(new egret.Point(prev.x, prev.y));\n\n            for (var i: number = 1; i < cnt; i++) {\n                var current: GPathPoint = points[i];\n\n                if (prev.curveType != CurveType.CRSpline) {\n                    var seg: Segment = {};\n                    seg.type = prev.curveType;\n                    seg.ptStart = this._points.length;\n                    if (prev.curveType == CurveType.Straight) {\n                        seg.ptCount = 2;\n                        this._points.push(new egret.Point(prev.x, prev.y));\n                        this._points.push(new egret.Point(current.x, current.y));\n                    }\n                    else if (prev.curveType == CurveType.Bezier) {\n                        seg.ptCount = 3;\n                        this._points.push(new egret.Point(prev.x, prev.y));\n                        this._points.push(new egret.Point(current.x, current.y));\n                        this._points.push(new egret.Point(prev.control1_x, prev.control1_y));\n                    }\n                    else if (prev.curveType == CurveType.CubicBezier) {\n                        seg.ptCount = 4;\n                        this._points.push(new egret.Point(prev.x, prev.y));\n                        this._points.push(new egret.Point(current.x, current.y));\n                        this._points.push(new egret.Point(prev.control1_x, prev.control1_y));\n                        this._points.push(new egret.Point(prev.control2_x, prev.control2_y));\n                    }\n                    seg.length = ToolSet.distance(prev.x, prev.y, current.x, current.y);\n                    this._fullLength += seg.length;\n                    this._segments.push(seg);\n                }\n\n                if (current.curveType != CurveType.CRSpline) {\n                    if (splinePoints.length > 0) {\n                        splinePoints.push(new egret.Point(current.x, current.y));\n                        this.createSplineSegment();\n                    }\n                }\n                else\n                    splinePoints.push(new egret.Point(current.x, current.y));\n\n                prev = current;\n            }\n\n            if (splinePoints.length > 1)\n                this.createSplineSegment();\n        }\n\n        private createSplineSegment(): void {\n            var splinePoints: Array<egret.Point> = s_points;\n            var cnt: number = splinePoints.length;\n            splinePoints.splice(0, 0, splinePoints[0]);\n            splinePoints.push(splinePoints[cnt]);\n            splinePoints.push(splinePoints[cnt]);\n            cnt += 3;\n\n            var seg: Segment = {};\n            seg.type = CurveType.CRSpline;\n            seg.ptStart = this._points.length;\n            seg.ptCount = cnt;\n\n            this._points = this._points.concat(splinePoints);\n\n            seg.length = 0;\n            for (var i: number = 1; i < cnt; i++) {\n                seg.length += ToolSet.distance(splinePoints[i - 1].x, splinePoints[i - 1].y,\n                    splinePoints[i].x, splinePoints[i].y);\n            }\n            this._fullLength += seg.length;\n            this._segments.push(seg);\n            splinePoints.length = 0;\n        }\n\n        public clear(): void {\n            this._segments.length = 0;\n            this._points.length = 0;\n        }\n\n        public getPointAt(t: number, result?: egret.Point): egret.Point {\n            if (!result)\n                result = new egret.Point();\n            else\n                result.x = result.y = 0;\n\n            t = ToolSet.clamp01(t);\n            var cnt: number = this._segments.length;\n            if (cnt == 0) {\n                return result;\n            }\n\n            var seg: Segment;\n            if (t == 1) {\n                seg = this._segments[cnt - 1];\n\n                if (seg.type == CurveType.Straight) {\n                    result.x = ToolSet.lerp(this._points[seg.ptStart].x, this._points[seg.ptStart + 1].x, t);\n                    result.y = ToolSet.lerp(this._points[seg.ptStart].y, this._points[seg.ptStart + 1].y, t);\n\n                    return result;\n                }\n                else if (seg.type == CurveType.Bezier || seg.type == CurveType.CubicBezier)\n                    return this.onBezierCurve(seg.ptStart, seg.ptCount, t, result);\n                else\n                    return this.onCRSplineCurve(seg.ptStart, seg.ptCount, t, result);\n            }\n\n            var len: number = t * this._fullLength;\n            for (var i: number = 0; i < cnt; i++) {\n                seg = this._segments[i];\n\n                len -= seg.length;\n                if (len < 0) {\n                    t = 1 + len / seg.length;\n\n                    if (seg.type == CurveType.Straight) {\n                        result.x = ToolSet.lerp(this._points[seg.ptStart].x, this._points[seg.ptStart + 1].x, t);\n                        result.y = ToolSet.lerp(this._points[seg.ptStart].y, this._points[seg.ptStart + 1].y, t);\n                    }\n                    else if (seg.type == CurveType.Bezier || seg.type == CurveType.CubicBezier)\n                        result = this.onBezierCurve(seg.ptStart, seg.ptCount, t, result);\n                    else\n                        result = this.onCRSplineCurve(seg.ptStart, seg.ptCount, t, result);\n\n                    break;\n                }\n            }\n\n            return result;\n        }\n\n        public get segmentCount(): number {\n            return this._segments.length;\n        }\n\n        public getAnchorsInSegment(segmentIndex: number, points?: Array<egret.Point>): Array<egret.Point> {\n            if (points == null)\n                points = new Array<egret.Point>();\n\n            var seg: Segment = this._segments[segmentIndex];\n            for (var i: number = 0; i < seg.ptCount; i++)\n                points.push(new egret.Point(this._points[seg.ptStart + i].x, this._points[seg.ptStart + i].y));\n\n            return points;\n        }\n\n        public getPointsInSegment(segmentIndex: number, t0: number, t1: number, points?: Array<egret.Point>, ts?: Array<number>, pointDensity?: number): Array<egret.Point> {\n            if (points == null)\n                points = new Array<egret.Point>();\n            if (!pointDensity || isNaN(pointDensity))\n                pointDensity = 0.1;\n\n            if (ts)\n                ts.push(t0);\n            var seg: Segment = this._segments[segmentIndex];\n            if (seg.type == CurveType.Straight) {\n                points.push(new egret.Point(ToolSet.lerp(this._points[seg.ptStart].x, this._points[seg.ptStart + 1].x, t0),\n                    ToolSet.lerp(this._points[seg.ptStart].y, this._points[seg.ptStart + 1].y, t0)));\n                points.push(new egret.Point(ToolSet.lerp(this._points[seg.ptStart].x, this._points[seg.ptStart + 1].x, t1),\n                    ToolSet.lerp(this._points[seg.ptStart].y, this._points[seg.ptStart + 1].y, t1)));\n            }\n            else {\n                var func: Function;\n                if (seg.type == CurveType.Bezier || seg.type == CurveType.CubicBezier)\n                    func = this.onBezierCurve;\n                else\n                    func = this.onCRSplineCurve;\n\n                points.push(func.call(this, seg.ptStart, seg.ptCount, t0, new egret.Point()));\n                var SmoothAmount: number = Math.min(seg.length * pointDensity, 50);\n                for (var j: number = 0; j <= SmoothAmount; j++) {\n                    var t: number = j / SmoothAmount;\n                    if (t > t0 && t < t1) {\n                        points.push(func.call(this, seg.ptStart, seg.ptCount, t, new egret.Point()));\n                        if (ts != null)\n                            ts.push(t);\n                    }\n                }\n                points.push(func.call(this, seg.ptStart, seg.ptCount, t1, new egret.Point()));\n            }\n\n            if (ts != null)\n                ts.push(t1);\n\n            return points;\n        }\n\n        public getAllPoints(points?: Array<egret.Point>, ts?: Array<number>, pointDensity?: number): Array<egret.Point> {\n            if (points == null)\n                points = new Array<egret.Point>();\n            if (!pointDensity || isNaN(pointDensity))\n                pointDensity = 0.1;\n\n            var cnt: number = this._segments.length;\n            for (var i: number = 0; i < cnt; i++)\n                this.getPointsInSegment(i, 0, 1, points, ts, pointDensity);\n\n            return points;\n        }\n\n        private onCRSplineCurve(ptStart: number, ptCount: number, t: number, result: egret.Point): egret.Point {\n            var adjustedIndex: number = Math.floor(t * (ptCount - 4)) + ptStart; //Since the equation works with 4 points, we adjust the starting point depending on t to return a point on the specific segment\n\n            var p0x: number = this._points[adjustedIndex].x;\n            var p0y: number = this._points[adjustedIndex].y;\n            var p1x: number = this._points[adjustedIndex + 1].x;\n            var p1y: number = this._points[adjustedIndex + 1].y;\n            var p2x: number = this._points[adjustedIndex + 2].x;\n            var p2y: number = this._points[adjustedIndex + 2].y;\n            var p3x: number = this._points[adjustedIndex + 3].x;\n            var p3y: number = this._points[adjustedIndex + 3].y;\n\n            var adjustedT: number = (t == 1) ? 1 : ToolSet.repeat(t * (ptCount - 4), 1); // Then we adjust t to be that value on that new piece of segment... for t == 1f don't use repeat (that would return 0f);\n\n            var t0: number = ((-adjustedT + 2) * adjustedT - 1) * adjustedT * 0.5;\n            var t1: number = (((3 * adjustedT - 5) * adjustedT) * adjustedT + 2) * 0.5;\n            var t2: number = ((-3 * adjustedT + 4) * adjustedT + 1) * adjustedT * 0.5;\n            var t3: number = ((adjustedT - 1) * adjustedT * adjustedT) * 0.5;\n\n            result.x = p0x * t0 + p1x * t1 + p2x * t2 + p3x * t3;\n            result.y = p0y * t0 + p1y * t1 + p2y * t2 + p3y * t3;\n\n            return result;\n        }\n\n        private onBezierCurve(ptStart: number, ptCount: number, t: number, result: egret.Point): egret.Point {\n            var t2: number = 1 - t;\n            var p0x: number = this._points[ptStart].x;\n            var p0y: number = this._points[ptStart].y;\n            var p1x: number = this._points[ptStart + 1].x;\n            var p1y: number = this._points[ptStart + 1].y;\n            var cp0x: number = this._points[ptStart + 2].x;\n            var cp0y: number = this._points[ptStart + 2].y;\n\n            if (ptCount == 4) {\n                var cp1x: number = this._points[ptStart + 3].x;\n                var cp1y: number = this._points[ptStart + 3].y;\n                result.x = t2 * t2 * t2 * p0x + 3 * t2 * t2 * t * cp0x + 3 * t2 * t * t * cp1x + t * t * t * p1x;\n                result.y = t2 * t2 * t2 * p0y + 3 * t2 * t2 * t * cp0y + 3 * t2 * t * t * cp1y + t * t * t * p1y;\n            }\n            else {\n                result.x = t2 * t2 * p0x + 2 * t2 * t * cp0x + t * t * p1x;\n                result.y = t2 * t2 * p0y + 2 * t2 * t * cp0y + t * t * p1y;\n            }\n\n            return result;\n        }\n    }\n\n    var s_points: Array<egret.Point> = new Array<egret.Point>();\n\n    interface Segment {\n        type?: number;\n        length?: number;\n        ptStart?: number;\n        ptCount?: number;\n    }\n}"
  },
  {
    "path": "source/src/tween/GPathPoint.ts",
    "content": "namespace fgui {\n    export enum CurveType {\n        CRSpline,\n        Bezier,\n        CubicBezier,\n        Straight\n    }\n\n    export class GPathPoint {\n        public x: number;\n        public y: number;\n\n        public control1_x: number;\n        public control1_y: number;\n\n        public control2_x: number;\n        public control2_y: number;\n\n        public curveType: number;\n\n        constructor() {\n            this.x = 0;\n            this.y = 0;\n            this.control1_x = 0;\n            this.control1_y = 0;\n            this.control2_x = 0;\n            this.control2_y = 0;\n            this.curveType = 0;\n        }\n\n        public static newPoint(x: number = 0, y: number = 0, curveType: number = 0): GPathPoint {\n            var pt: GPathPoint = new GPathPoint();\n            pt.x = x;\n            pt.y = y;\n            pt.control1_x = 0;\n            pt.control1_y = 0;\n            pt.control2_x = 0;\n            pt.control2_y = 0;\n            pt.curveType = curveType;\n\n            return pt;\n        }\n\n        public static newBezierPoint(x: number = 0, y: number = 0,\n            control1_x: number = 0, control1_y: number = 0): GPathPoint {\n            var pt: GPathPoint = new GPathPoint();\n            pt.x = x;\n            pt.y = y;\n            pt.control1_x = control1_x;\n            pt.control1_y = control1_y;\n            pt.control2_x = 0;\n            pt.control2_y = 0;\n            pt.curveType = CurveType.Bezier;\n\n            return pt;\n        }\n\n        public static newCubicBezierPoint(x: number = 0, y: number = 0,\n            control1_x: number = 0, control1_y: number = 0,\n            control2_x: number = 0, control2_y: number = 0): GPathPoint {\n            var pt: GPathPoint = new GPathPoint();\n            pt.x = x;\n            pt.y = y;\n            pt.control1_x = control1_x;\n            pt.control1_y = control1_y;\n            pt.control2_x = control2_x;\n            pt.control2_y = control2_y;\n            pt.curveType = CurveType.CubicBezier;\n\n            return pt;\n        }\n\n        public clone(): GPathPoint {\n            var ret: GPathPoint = new GPathPoint();\n            ret.x = this.x;\n            ret.y = this.y;\n            ret.control1_x = this.control1_x;\n            ret.control1_y = this.control1_y;\n            ret.control2_x = this.control2_x;\n            ret.control2_y = this.control2_y;\n            ret.curveType = this.curveType;\n\n            return ret;\n        }\n    }\n}"
  },
  {
    "path": "source/src/tween/GTween.ts",
    "content": "namespace fgui {\r\n    export class GTween {\r\n        public static catchCallbackExceptions: boolean = true;\r\n\r\n        public static to(start: number, end: number, duration: number): GTweener {\r\n            return TweenManager.createTween()._to(start, end, duration);\r\n        }\r\n\r\n        public static to2(start: number, start2: number, end: number, end2: number, duration: number): GTweener {\r\n            return TweenManager.createTween()._to2(start, start2, end, end2, duration);\r\n        }\r\n\r\n        public static to3(start: number, start2: number, start3: number,\r\n            end: number, end2: number, end3: number, duration: number): GTweener {\r\n            return TweenManager.createTween()._to3(start, start2, start3, end, end2, end3, duration);\r\n        }\r\n\r\n        public static to4(start: number, start2: number, start3: number, start4: number,\r\n            end: number, end2: number, end3: number, end4: number, duration: number): GTweener {\r\n            return TweenManager.createTween()._to4(start, start2, start3, start4, end, end2, end3, end4, duration);\r\n        }\r\n\r\n        public static toColor(start: number, end: number, duration: number): GTweener {\r\n            return TweenManager.createTween()._toColor(start, end, duration);\r\n        }\r\n\r\n        public static delayedCall(delay: number): GTweener {\r\n            return TweenManager.createTween().setDelay(delay);\r\n        }\r\n\r\n        public static shake(startX: number, startY: number, amplitude: number, duration: number): GTweener {\r\n            return TweenManager.createTween()._shake(startX, startY, amplitude, duration);\r\n        }\r\n\r\n        public static isTweening(target: any, propType?: any): Boolean {\r\n            return TweenManager.isTweening(target, propType);\r\n        }\r\n\r\n        public static kill(target: any, complete?: boolean, propType?: any): void {\r\n            TweenManager.killTweens(target, complete, propType);\r\n        }\r\n\r\n        public static getTween(target: any, propType?: any): GTweener {\r\n            return TweenManager.getTween(target, propType);\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "source/src/tween/GTweener.ts",
    "content": "module fgui {\r\n    export class GTweener {\r\n        public _target: any;\r\n        public _propType: any;\r\n        public _killed: boolean;\r\n        public _paused: boolean;\r\n\r\n        private _delay: number;\r\n        private _duration: number;\r\n        private _breakpoint: number;\r\n        private _easeType: number;\r\n        private _easeOvershootOrAmplitude: number;\r\n        private _easePeriod: number;\r\n        private _repeat: number;\r\n        private _yoyo: boolean;\r\n        private _timeScale: number;\r\n        private _snapping: boolean;\r\n        private _userData: any;\r\n        private _path: GPath;\r\n\r\n        private _onUpdate: Function;\r\n        private _onStart: Function;\r\n        private _onComplete: Function;\r\n        private _onUpdateCaller: any;\r\n        private _onStartCaller: any;\r\n        private _onCompleteCaller: any;\r\n\r\n        private _startValue: TweenValue;\r\n        private _endValue: TweenValue;\r\n        private _value: TweenValue;\r\n        private _deltaValue: TweenValue;\r\n        private _valueSize: number;\r\n\r\n        private _started: boolean;\r\n        private _ended: number;\r\n        private _elapsedTime: number;\r\n        private _normalizedTime: number;\r\n\r\n        public constructor() {\r\n            this._startValue = new TweenValue();\r\n            this._endValue = new TweenValue();\r\n            this._value = new TweenValue();\r\n            this._deltaValue = new TweenValue();\r\n\r\n            this._reset();\r\n        }\r\n\r\n        public setDelay(value: number): GTweener {\r\n            this._delay = value;\r\n            return this;\r\n        }\r\n\r\n        public get delay(): number {\r\n            return this._delay;\r\n        }\r\n\r\n        public setDuration(value: number): GTweener {\r\n            this._duration = value;\r\n            return this;\r\n        }\r\n\r\n        public get duration(): number {\r\n            return this._duration;\r\n        }\r\n\r\n        public setBreakpoint(value: number): GTweener {\r\n            this._breakpoint = value;\r\n            return this;\r\n        }\r\n\r\n        public setEase(value: number): GTweener {\r\n            this._easeType = value;\r\n            return this;\r\n        }\r\n\r\n        public setEasePeriod(value: number): GTweener {\r\n            this._easePeriod = value;\r\n            return this;\r\n        }\r\n\r\n        public setEaseOvershootOrAmplitude(value: number): GTweener {\r\n            this._easeOvershootOrAmplitude = value;\r\n            return this;\r\n        }\r\n\r\n        public setRepeat(repeat: number, yoyo?: boolean): GTweener {\r\n            this._repeat = repeat;\r\n            this._yoyo = yoyo;\r\n            return this;\r\n        }\r\n\r\n        public get repeat(): number {\r\n            return this._repeat;\r\n        }\r\n\r\n        public setTimeScale(value: number): GTweener {\r\n            this._timeScale = value;\r\n            return this;\r\n        }\r\n\r\n        public setSnapping(value: boolean): GTweener {\r\n            this._snapping = value;\r\n            return this;\r\n        }\r\n\r\n        public setTarget(value: any, propType?: any): GTweener {\r\n            this._target = value;\r\n            this._propType = propType;\r\n            return this;\r\n        }\r\n\r\n        public get target(): any {\r\n            return this._target;\r\n        }\r\n\r\n        public setUserData(value: any): GTweener {\r\n            this._userData = value;\r\n            return this;\r\n        }\r\n\r\n        public get userData(): any {\r\n            return this._userData;\r\n        }\r\n\r\n        public setPath(value: GPath): GTweener {\r\n            this._path = value;\r\n            return this;\r\n        }\r\n\r\n        public onUpdate(callback: Function, caller?: any): GTweener {\r\n            this._onUpdate = callback;\r\n            this._onUpdateCaller = caller;\r\n            return this;\r\n        }\r\n\r\n        public onStart(callback: Function, caller?: any): GTweener {\r\n            this._onStart = callback;\r\n            this._onStartCaller = caller;\r\n            return this;\r\n        }\r\n\r\n        public onComplete(callback: Function, caller?: any): GTweener {\r\n            this._onComplete = callback;\r\n            this._onCompleteCaller = caller;\r\n            return this;\r\n        }\r\n\r\n        public get startValue(): TweenValue {\r\n            return this._startValue;\r\n        }\r\n\r\n        public get endValue(): TweenValue {\r\n            return this._endValue;\r\n        }\r\n\r\n        public get value(): TweenValue {\r\n            return this._value;\r\n        }\r\n\r\n        public get deltaValue(): TweenValue {\r\n            return this._deltaValue;\r\n        }\r\n\r\n        public get normalizedTime(): number {\r\n            return this._normalizedTime;\r\n        }\r\n\r\n        public get completed(): boolean {\r\n            return this._ended != 0;\r\n        }\r\n\r\n        public get allCompleted(): boolean {\r\n            return this._ended == 1;\r\n        }\r\n\r\n        public setPaused(paused: boolean): GTweener {\r\n            this._paused = paused;\r\n            return this;\r\n        }\r\n\r\n        public seek(time: number): void {\r\n            if (this._killed)\r\n                return;\r\n\r\n            this._elapsedTime = time;\r\n            if (this._elapsedTime < this._delay) {\r\n                if (this._started)\r\n                    this._elapsedTime = this._delay;\r\n                else\r\n                    return;\r\n            }\r\n\r\n            this.update();\r\n        }\r\n\r\n        public kill(complete?: boolean): void {\r\n            if (this._killed)\r\n                return;\r\n\r\n            if (complete) {\r\n                if (this._ended == 0) {\r\n                    if (this._breakpoint >= 0)\r\n                        this._elapsedTime = this._delay + this._breakpoint;\r\n                    else if (this._repeat >= 0)\r\n                        this._elapsedTime = this._delay + this._duration * (this._repeat + 1);\r\n                    else\r\n                        this._elapsedTime = this._delay + this._duration * 2;\r\n                    this.update();\r\n                }\r\n\r\n                this.callCompleteCallback();\r\n            }\r\n\r\n            this._killed = true;\r\n        }\r\n\r\n        public _to(start: number, end: number, duration: number): GTweener {\r\n            this._valueSize = 1;\r\n            this._startValue.x = start;\r\n            this._endValue.x = end;\r\n            this._value.x = start;\r\n            this._duration = duration;\r\n            return this;\r\n        }\r\n\r\n        public _to2(start: number, start2: number, end: number, end2: number, duration: number): GTweener {\r\n            this._valueSize = 2;\r\n            this._startValue.x = start;\r\n            this._endValue.x = end;\r\n            this._startValue.y = start2;\r\n            this._endValue.y = end2;\r\n            this._value.x = start;\r\n            this._value.y = start2;\r\n            this._duration = duration;\r\n            return this;\r\n        }\r\n\r\n        public _to3(start: number, start2: number, start3: number,\r\n            end: number, end2: number, end3: number, duration: number): GTweener {\r\n            this._valueSize = 3;\r\n            this._startValue.x = start;\r\n            this._endValue.x = end;\r\n            this._startValue.y = start2;\r\n            this._endValue.y = end2;\r\n            this._startValue.z = start3;\r\n            this._endValue.z = end3;\r\n            this._value.x = start;\r\n            this._value.y = start2;\r\n            this._value.z = start3;\r\n            this._duration = duration;\r\n            return this;\r\n        }\r\n\r\n        public _to4(start: number, start2: number, start3: number, start4: number,\r\n            end: number, end2: number, end3: number, end4: number, duration: number): GTweener {\r\n            this._valueSize = 4;\r\n            this._startValue.x = start;\r\n            this._endValue.x = end;\r\n            this._startValue.y = start2;\r\n            this._endValue.y = end2;\r\n            this._startValue.z = start3;\r\n            this._endValue.z = end3;\r\n            this._startValue.w = start4;\r\n            this._endValue.w = end4;\r\n            this._value.x = start;\r\n            this._value.y = start2;\r\n            this._value.z = start3;\r\n            this._value.w = start4;\r\n            this._duration = duration;\r\n            return this;\r\n        }\r\n\r\n        public _toColor(start: number, end: number, duration: number): GTweener {\r\n            this._valueSize = 4;\r\n            this._startValue.color = start;\r\n            this._endValue.color = end;\r\n            this._value.color = start;\r\n            this._duration = duration;\r\n            return this;\r\n        }\r\n\r\n        public _shake(startX: number, startY: number, amplitude: number, duration: number): GTweener {\r\n            this._valueSize = 5;\r\n            this._startValue.x = startX;\r\n            this._startValue.y = startY;\r\n            this._startValue.w = amplitude;\r\n            this._duration = duration;\r\n            return this;\r\n        }\r\n\r\n        public _init(): void {\r\n            this._delay = 0;\r\n            this._duration = 0;\r\n            this._breakpoint = -1;\r\n            this._easeType = EaseType.QuadOut;\r\n            this._timeScale = 1;\r\n            this._easePeriod = 0;\r\n            this._easeOvershootOrAmplitude = 1.70158;\r\n            this._snapping = false;\r\n            this._repeat = 0;\r\n            this._yoyo = false;\r\n            this._valueSize = 0;\r\n            this._started = false;\r\n            this._paused = false;\r\n            this._killed = false;\r\n            this._elapsedTime = 0;\r\n            this._normalizedTime = 0;\r\n            this._ended = 0;\r\n        }\r\n\r\n        public _reset(): void {\r\n            this._target = null;\r\n            this._propType = null;\r\n            this._userData = null;\r\n            this._path = null;\r\n            this._onStart = this._onUpdate = this._onComplete = null;\r\n            this._onStartCaller = this._onUpdateCaller = this._onCompleteCaller = null;\r\n        }\r\n\r\n        public _update(dt: number): void {\r\n            if (this._timeScale != 1)\r\n                dt *= this._timeScale;\r\n            if (dt == 0)\r\n                return;\r\n\r\n            if (this._ended != 0) //Maybe completed by seek\r\n            {\r\n                this.callCompleteCallback();\r\n                this._killed = true;\r\n                return;\r\n            }\r\n\r\n            this._elapsedTime += dt;\r\n            this.update();\r\n\r\n            if (this._ended != 0) {\r\n                if (!this._killed) {\r\n                    this.callCompleteCallback();\r\n                    this._killed = true;\r\n                }\r\n            }\r\n        }\r\n\r\n        private update(): void {\r\n            this._ended = 0;\r\n\r\n            if (this._valueSize == 0) //DelayedCall\r\n            {\r\n                if (this._elapsedTime >= this._delay + this._duration)\r\n                    this._ended = 1;\r\n\r\n                return;\r\n            }\r\n\r\n            if (!this._started) {\r\n                if (this._elapsedTime < this._delay)\r\n                    return;\r\n\r\n                this._started = true;\r\n                this.callStartCallback();\r\n                if (this._killed)\r\n                    return;\r\n            }\r\n\r\n            var reversed: boolean = false;\r\n            var tt: number = this._elapsedTime - this._delay;\r\n            if (this._breakpoint >= 0 && tt >= this._breakpoint) {\r\n                tt = this._breakpoint;\r\n                this._ended = 2;\r\n            }\r\n\r\n            if (this._repeat != 0) {\r\n                var round: number = Math.floor(tt / this._duration);\r\n                tt -= this._duration * round;\r\n                if (this._yoyo)\r\n                    reversed = round % 2 == 1;\r\n\r\n                if (this._repeat > 0 && this._repeat - round < 0) {\r\n                    if (this._yoyo)\r\n                        reversed = this._repeat % 2 == 1;\r\n                    tt = this._duration;\r\n                    this._ended = 1;\r\n                }\r\n            }\r\n            else if (tt >= this._duration) {\r\n                tt = this._duration;\r\n                this._ended = 1;\r\n            }\r\n\r\n            this._normalizedTime = evaluateEase(this._easeType, reversed ? (this._duration - tt) : tt, this._duration,\r\n                this._easeOvershootOrAmplitude, this._easePeriod);\r\n\r\n            this._value.setZero();\r\n            this._deltaValue.setZero();\r\n\r\n            if (this._valueSize == 5) {\r\n                if (this._ended == 0) {\r\n                    var r: number = this._startValue.w * (1 - this._normalizedTime);\r\n                    var rx: number = r * (Math.random() > 0.5 ? 1 : -1);\r\n                    var ry: number = r * (Math.random() > 0.5 ? 1 : -1);\r\n\r\n                    this._deltaValue.x = rx;\r\n                    this._deltaValue.y = ry;\r\n                    this._value.x = this._startValue.x + rx;\r\n                    this._value.y = this._startValue.y + ry;\r\n                }\r\n                else {\r\n                    this._value.x = this._startValue.x;\r\n                    this._value.y = this._startValue.y;\r\n                }\r\n            }\r\n            else if (this._path) {\r\n                var pt: egret.Point = s_vec2;\r\n                this._path.getPointAt(this._normalizedTime, pt);\r\n                if (this._snapping) {\r\n                    pt.x = Math.round(pt.x);\r\n                    pt.y = Math.round(pt.y);\r\n                }\r\n                this._deltaValue.x = pt.x - this._value.x;\r\n                this._deltaValue.y = pt.y - this._value.y;\r\n                this._value.x = pt.x;\r\n                this._value.y = pt.y;\r\n            }\r\n            else {\r\n                for (var i: number = 0; i < this._valueSize; i++) {\r\n                    var n1: number = this._startValue.getField(i);\r\n                    var n2: number = this._endValue.getField(i);\r\n                    var f: number = n1 + (n2 - n1) * this._normalizedTime;\r\n                    if (this._snapping)\r\n                        f = Math.round(f);\r\n                    this._deltaValue.setField(i, f - this._value.getField(i));\r\n                    this._value.setField(i, f);\r\n                }\r\n            }\r\n\r\n            if (this._target != null && this._propType != null) {\r\n                if (this._propType instanceof Function) {\r\n                    switch (this._valueSize) {\r\n                        case 1:\r\n                            this._propType.call(this._target, this._value.x);\r\n                            break;\r\n                        case 2:\r\n                            this._propType.call(this._target, this._value.x, this._value.y);\r\n                            break;\r\n                        case 3:\r\n                            this._propType.call(this._target, this._value.x, this._value.y, this._value.z);\r\n                            break;\r\n                        case 4:\r\n                            this._propType.call(this._target, this._value.x, this._value.y, this._value.z, this._value.w);\r\n                            break;\r\n                        case 5:\r\n                            this._propType.call(this._target, this._value.color);\r\n                            break;\r\n                        case 6:\r\n                            this._propType.call(this._target, this._value.x, this._value.y);\r\n                            break;\r\n                    }\r\n                }\r\n                else {\r\n                    if (this._valueSize == 5)\r\n                        this._target[this._propType] = this._value.color;\r\n                    else\r\n                        this._target[this._propType] = this._value.x;\r\n                }\r\n            }\r\n\r\n            this.callUpdateCallback();\r\n        }\r\n\r\n        private callStartCallback(): void {\r\n            if (this._onStart != null) {\r\n                try {\r\n                    this._onStart.call(this._onStartCaller, this);\r\n                }\r\n                catch (err) {\r\n                    console.log(\"FairyGUI: error in start callback > \" + err);\r\n                }\r\n            }\r\n        }\r\n\r\n        private callUpdateCallback(): void {\r\n            if (this._onUpdate != null) {\r\n                try {\r\n                    this._onUpdate.call(this._onUpdateCaller, this);\r\n                }\r\n                catch (err) {\r\n                    console.log(\"FairyGUI: error in update callback > \" + err);\r\n                }\r\n            }\r\n        }\r\n\r\n        private callCompleteCallback(): void {\r\n            if (this._onComplete != null) {\r\n                try {\r\n                    this._onComplete.call(this._onCompleteCaller, this);\r\n                }\r\n                catch (err) {\r\n                    console.log(\"FairyGUI: error in complete callback > \" + err);\r\n                }\r\n            }\r\n        }\r\n    }\r\n\r\n    var s_vec2: egret.Point = new egret.Point();\r\n}"
  },
  {
    "path": "source/src/tween/TweenManager.ts",
    "content": "module fgui {\r\n    export class TweenManager {\r\n        public static createTween(): GTweener {\r\n            if (!_inited) {\r\n                egret.startTick(TweenManager.update, null);\r\n                _inited = true;\r\n                _lastTime = egret.getTimer();\r\n            }\r\n\r\n            var tweener: GTweener;\r\n            var cnt: number = _tweenerPool.length;\r\n            if (cnt > 0) {\r\n                tweener = _tweenerPool.pop();\r\n            }\r\n            else\r\n                tweener = new GTweener();\r\n            tweener._init();\r\n            _activeTweens[_totalActiveTweens++] = tweener;\r\n\r\n            if (_totalActiveTweens == _activeTweens.length)\r\n                _activeTweens.length = _activeTweens.length + Math.ceil(_activeTweens.length * 0.5);\r\n\r\n            return tweener;\r\n        }\r\n\r\n        public static isTweening(target: any, propType?: any): boolean {\r\n            if (target == null)\r\n                return false;\r\n\r\n            var anyType: boolean = propType == null;\r\n            for (var i: number = 0; i < _totalActiveTweens; i++) {\r\n                var tweener: GTweener = _activeTweens[i];\r\n                if (tweener != null && tweener.target == target && !tweener._killed\r\n                    && (anyType || tweener._propType == propType))\r\n                    return true;\r\n            }\r\n\r\n            return false;\r\n        }\r\n\r\n        public static killTweens(target: any, completed?: boolean, propType?: any): boolean {\r\n            if (target == null)\r\n                return false;\r\n\r\n            var flag: boolean = false;\r\n            var cnt: number = _totalActiveTweens;\r\n            var anyType: boolean = propType == null;\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                var tweener: GTweener = _activeTweens[i];\r\n                if (tweener != null && tweener.target == target && !tweener._killed\r\n                    && (anyType || tweener._propType == propType)) {\r\n                    tweener.kill(completed);\r\n                    flag = true;\r\n                }\r\n            }\r\n\r\n            return flag;\r\n        }\r\n\r\n        public static getTween(target: any, propType?: any): GTweener {\r\n            if (target == null)\r\n                return null;\r\n\r\n            var cnt: number = _totalActiveTweens;\r\n            var anyType: boolean = propType == null;\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                var tweener: GTweener = _activeTweens[i];\r\n                if (tweener != null && tweener.target == target && !tweener._killed\r\n                    && (anyType || tweener._propType == propType)) {\r\n                    return tweener;\r\n                }\r\n            }\r\n\r\n            return null;\r\n        }\r\n\r\n        private static update(timestamp: number): boolean {\r\n            var dt: number = timestamp - _lastTime;\r\n            _lastTime = timestamp;\r\n\r\n            dt /= 1000;\r\n\r\n            var cnt: number = _totalActiveTweens;\r\n            var freePosStart: number = -1;\r\n            var freePosCount: number = 0;\r\n            for (var i: number = 0; i < cnt; i++) {\r\n                var tweener: GTweener = _activeTweens[i];\r\n                if (tweener == null) {\r\n                    if (freePosStart == -1)\r\n                        freePosStart = i;\r\n                    freePosCount++;\r\n                }\r\n                else if (tweener._killed) {\r\n                    tweener._reset();\r\n                    _tweenerPool.push(tweener);\r\n                    _activeTweens[i] = null;\r\n\r\n                    if (freePosStart == -1)\r\n                        freePosStart = i;\r\n                    freePosCount++;\r\n                }\r\n                else {\r\n                    if ((tweener._target instanceof GObject) && (<GObject>(tweener._target)).isDisposed)\r\n                        tweener._killed = true;\r\n                    else if (!tweener._paused)\r\n                        tweener._update(dt);\r\n\r\n                    if (freePosStart != -1) {\r\n                        _activeTweens[freePosStart] = tweener;\r\n                        _activeTweens[i] = null;\r\n                        freePosStart++;\r\n                    }\r\n                }\r\n            }\r\n\r\n            if (freePosStart >= 0) {\r\n                if (_totalActiveTweens != cnt) //new tweens added\r\n                {\r\n                    var j: number = cnt;\r\n                    cnt = _totalActiveTweens - cnt;\r\n                    for (i = 0; i < cnt; i++)\r\n                        _activeTweens[freePosStart++] = _activeTweens[j++];\r\n                }\r\n                _totalActiveTweens = freePosStart;\r\n            }\r\n\r\n            return false;\r\n        }\r\n    }\r\n\r\n    var _activeTweens: Array<GTweener> = new Array<GTweener>(30);\r\n    var _tweenerPool: Array<GTweener> = new Array<GTweener>();\r\n    var _totalActiveTweens: number = 0;\r\n    var _lastTime: number = 0;\r\n    var _inited: boolean;\r\n}"
  },
  {
    "path": "source/src/tween/TweenValue.ts",
    "content": "namespace fgui {\r\n    export class TweenValue {\r\n        public x: number;\r\n        public y: number;\r\n        public z: number;\r\n        public w: number;\r\n\r\n        public constructor() {\r\n            this.x = this.y = this.z = this.w = 0;\r\n        }\r\n\r\n        public get color(): number {\r\n            return (this.w << 24) + (this.x << 16) + (this.y << 8) + this.z;\r\n        }\r\n\r\n        public set color(value: number) {\r\n            this.x = (value & 0xFF0000) >> 16;\r\n            this.y = (value & 0x00FF00) >> 8;\r\n            this.z = (value & 0x0000FF);\r\n            this.w = (value & 0xFF000000) >> 24;\r\n        }\r\n\r\n        public getField(index: number): number {\r\n            switch (index) {\r\n                case 0:\r\n                    return this.x;\r\n                case 1:\r\n                    return this.y;\r\n                case 2:\r\n                    return this.z;\r\n                case 3:\r\n                    return this.w;\r\n                default:\r\n                    throw new Error(\"Index out of bounds: \" + index);\r\n            }\r\n        }\r\n\r\n        public setField(index: number, value: number): void {\r\n            switch (index) {\r\n                case 0:\r\n                    this.x = value;\r\n                    break;\r\n                case 1:\r\n                    this.y = value;\r\n                    break;\r\n                case 2:\r\n                    this.z = value;\r\n                    break;\r\n                case 3:\r\n                    this.w = value;\r\n                    break;\r\n                default:\r\n                    throw new Error(\"Index out of bounds: \" + index);\r\n            }\r\n        }\r\n\r\n        public setZero(): void {\r\n            this.x = this.y = this.z = this.w = 0;\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "source/src/utils/ByteBuffer.ts",
    "content": "module fgui {\r\n\r\n    export class ByteBuffer extends egret.ByteArray {\r\n        public stringTable?: Array<string>;\r\n        public version: number = 0;\r\n\r\n        public constructor(buffer?: ArrayBuffer | Uint8Array, bufferExtSize?: number) {\r\n            super(buffer, bufferExtSize);\r\n        }\r\n\r\n        public skip(count: number): void {\r\n            this.position += count;\r\n        }\r\n\r\n        public readBool(): boolean {\r\n            return this.readByte() == 1;\r\n        }\r\n\r\n        public readS(): string {\r\n            var index: number = this.readUnsignedShort();\r\n            if (index == 65534) //null\r\n                return null;\r\n            else if (index == 65533)\r\n                return \"\"\r\n            else\r\n                return this.stringTable[index];\r\n        }\r\n\r\n        public readSArray(cnt: number): Array<string> {\r\n            var ret: Array<string> = new Array<string>(cnt);\r\n            for (var i: number = 0; i < cnt; i++)\r\n                ret[i] = this.readS();\r\n\r\n            return ret;\r\n        }\r\n\r\n        public writeS(value: string): void {\r\n            var index: number = this.readUnsignedShort();\r\n            if (index != 65534 && index != 65533)\r\n                this.stringTable[index] = value;\r\n        }\r\n\r\n        public readColor(hasAlpha?: boolean): number {\r\n            var r: number = this.readUnsignedByte();\r\n            var g: number = this.readUnsignedByte();\r\n            var b: number = this.readUnsignedByte();\r\n            var a: number = this.readUnsignedByte();\r\n\r\n            return (hasAlpha ? (a << 24) : 0) + (r << 16) + (g << 8) + b;\r\n        }\r\n\r\n        public readChar(): string {\r\n            var i: number = this.readUnsignedShort();\r\n            return String.fromCharCode(i);\r\n        }\r\n\r\n        public readBuffer(): ByteBuffer {\r\n            var count: number = this.readUnsignedInt();\r\n            var ba: ByteBuffer = new ByteBuffer(new Uint8Array(this.buffer, this.position, count));\r\n            ba.stringTable = this.stringTable;\r\n            ba.version = this.version;\r\n            this.position += count;\r\n            return ba;\r\n        }\r\n\r\n        public seek(indexTablePos: number, blockIndex: number): boolean {\r\n            var tmp: number = this.position;\r\n            this.position = indexTablePos;\r\n            var segCount: number = this.readByte();\r\n            if (blockIndex < segCount) {\r\n                var useShort: boolean = this.readByte() == 1;\r\n                var newPos: number;\r\n                if (useShort) {\r\n                    this.position += 2 * blockIndex;\r\n                    newPos = this.readUnsignedShort();\r\n                }\r\n                else {\r\n                    this.position += 4 * blockIndex;\r\n                    newPos = this.readUnsignedInt();\r\n                }\r\n\r\n                if (newPos > 0) {\r\n                    this.position = indexTablePos + newPos;\r\n                    return true;\r\n                }\r\n                else {\r\n                    this.position = tmp;\r\n                    return false;\r\n                }\r\n            }\r\n            else {\r\n                this.position = tmp;\r\n                return false;\r\n            }\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "source/src/utils/ColorMatrix.ts",
    "content": "\r\nnamespace fgui {\r\n\r\n    export class ColorMatrix {\r\n        public readonly matrix: Array<number>;\r\n\r\n        public constructor(p_brightness?: number, p_contrast?: number, p_saturation?: number, p_hue?: number) {\r\n            this.matrix = new Array<number>(LENGTH);\r\n            this.reset();\r\n\r\n            if (p_brightness !== undefined || p_contrast !== undefined || p_saturation !== undefined || p_hue !== undefined)\r\n                this.adjustColor(p_brightness, p_contrast, p_saturation, p_hue);\r\n        }\r\n\r\n        public reset(): void {\r\n            for (var i: number = 0; i < LENGTH; i++) {\r\n                this.matrix[i] = IDENTITY_MATRIX[i];\r\n            }\r\n        }\r\n\r\n        public invert(): void {\r\n            this.multiplyMatrix([-1, 0, 0, 0, 255,\r\n                0, -1, 0, 0, 255,\r\n                0, 0, -1, 0, 255,\r\n                0, 0, 0, 1, 0]);\r\n        }\r\n\r\n        public adjustColor(p_brightness: number, p_contrast: number, p_saturation: number, p_hue: number): void {\r\n            this.adjustHue(p_hue || 0);\r\n            this.adjustContrast(p_contrast || 0);\r\n            this.adjustBrightness(p_brightness || 0);\r\n            this.adjustSaturation(p_saturation || 0);\r\n        }\r\n\r\n        public adjustBrightness(p_val: number): void {\r\n            p_val = this.cleanValue(p_val, 1) * 255;\r\n            this.multiplyMatrix([\r\n                1, 0, 0, 0, p_val,\r\n                0, 1, 0, 0, p_val,\r\n                0, 0, 1, 0, p_val,\r\n                0, 0, 0, 1, 0\r\n            ]);\r\n        }\r\n\r\n        public adjustContrast(p_val: number): void {\r\n            p_val = this.cleanValue(p_val, 1);\r\n            var s: number = p_val + 1;\r\n            var o: number = 128 * (1 - s);\r\n            this.multiplyMatrix([\r\n                s, 0, 0, 0, o,\r\n                0, s, 0, 0, o,\r\n                0, 0, s, 0, o,\r\n                0, 0, 0, 1, 0\r\n            ]);\r\n        }\r\n\r\n        public adjustSaturation(p_val: number): void {\r\n            p_val = this.cleanValue(p_val, 1);\r\n            p_val += 1;\r\n\r\n            var invSat: number = 1 - p_val;\r\n            var invLumR: number = invSat * LUMA_R;\r\n            var invLumG: number = invSat * LUMA_G;\r\n            var invLumB: number = invSat * LUMA_B;\r\n\r\n            this.multiplyMatrix([\r\n                (invLumR + p_val), invLumG, invLumB, 0, 0,\r\n                invLumR, (invLumG + p_val), invLumB, 0, 0,\r\n                invLumR, invLumG, (invLumB + p_val), 0, 0,\r\n                0, 0, 0, 1, 0\r\n            ]);\r\n        }\r\n\r\n        public adjustHue(p_val: number): void {\r\n            p_val = this.cleanValue(p_val, 1);\r\n            p_val *= Math.PI;\r\n\r\n            var cos: number = Math.cos(p_val);\r\n            var sin: number = Math.sin(p_val);\r\n\r\n            this.multiplyMatrix([\r\n                ((LUMA_R + (cos * (1 - LUMA_R))) + (sin * -(LUMA_R))), ((LUMA_G + (cos * -(LUMA_G))) + (sin * -(LUMA_G))), ((LUMA_B + (cos * -(LUMA_B))) + (sin * (1 - LUMA_B))), 0, 0,\r\n                ((LUMA_R + (cos * -(LUMA_R))) + (sin * 0.143)), ((LUMA_G + (cos * (1 - LUMA_G))) + (sin * 0.14)), ((LUMA_B + (cos * -(LUMA_B))) + (sin * -0.283)), 0, 0,\r\n                ((LUMA_R + (cos * -(LUMA_R))) + (sin * -((1 - LUMA_R)))), ((LUMA_G + (cos * -(LUMA_G))) + (sin * LUMA_G)), ((LUMA_B + (cos * (1 - LUMA_B))) + (sin * LUMA_B)), 0, 0,\r\n                0, 0, 0, 1, 0\r\n            ]);\r\n        }\r\n\r\n        public concat(p_matrix: Array<number>): void {\r\n            if (p_matrix.length != LENGTH) { return; }\r\n            this.multiplyMatrix(p_matrix);\r\n        }\r\n\r\n        public clone(): ColorMatrix {\r\n            var result: ColorMatrix = new ColorMatrix();\r\n            result.copyMatrix(this.matrix);\r\n            return result;\r\n        }\r\n\r\n        protected copyMatrix(p_matrix: Array<number>): void {\r\n            var l: number = LENGTH;\r\n            for (var i: number = 0; i < l; i++) {\r\n                this.matrix[i] = p_matrix[i];\r\n            }\r\n        }\r\n\r\n        protected multiplyMatrix(p_matrix: Array<number>): void {\r\n            var col: Array<number> = [];\r\n\r\n            var i: number = 0;\r\n\r\n            for (var y: number = 0; y < 4; ++y) {\r\n                for (var x: number = 0; x < 5; ++x) {\r\n                    col[i + x] = p_matrix[i] * this.matrix[x] +\r\n                        p_matrix[i + 1] * this.matrix[x + 5] +\r\n                        p_matrix[i + 2] * this.matrix[x + 10] +\r\n                        p_matrix[i + 3] * this.matrix[x + 15] +\r\n                        (x == 4 ? p_matrix[i + 4] : 0);\r\n                }\r\n\r\n                i += 5;\r\n            }\r\n\r\n            this.copyMatrix(col);\r\n        }\r\n\r\n        protected cleanValue(p_val: number, p_limit: number): number {\r\n            return Math.min(p_limit, Math.max(-p_limit, p_val));\r\n        }\r\n    }\r\n\r\n    // identity matrix constant:\r\n    const IDENTITY_MATRIX: Array<number> = [\r\n        1, 0, 0, 0, 0,\r\n        0, 1, 0, 0, 0,\r\n        0, 0, 1, 0, 0,\r\n        0, 0, 0, 1, 0\r\n    ];\r\n    const LENGTH: number = IDENTITY_MATRIX.length;\r\n\r\n    const LUMA_R: number = 0.299;\r\n    const LUMA_G: number = 0.587;\r\n    const LUMA_B: number = 0.114;\r\n}"
  },
  {
    "path": "source/src/utils/GTimers.ts",
    "content": "\nmodule fgui {\n\n    export class GTimers {\n        private _items: any;\n        private _itemPool: any;\n\n        private _enumI: number = 0;\n        private _enumCount: number = 0;\n        private _lastTime: number = 0;\n\n        public static deltaTime: number = 0;\n        public static time: number = 0;\n\n        public static readonly inst: GTimers = new GTimers();\n\n        public constructor() {\n            this._items = new Array<TimerItem>();\n            this._itemPool = new Array<TimerItem>();\n\n            this._lastTime = egret.getTimer();\n            GTimers.time = this._lastTime;\n            egret.startTick(this.__timer, this);\n        }\n\n        private getItem(): TimerItem {\n            if (this._itemPool.length)\n                return this._itemPool.pop();\n            else\n                return new TimerItem();\n        }\n\n        private findItem(callback: Function, thisObj?: any): TimerItem {\n            var len: number = this._items.length;\n            for (var i: number = 0; i < len; i++) {\n                var item: TimerItem = this._items[i];\n                if (item.callback == callback && item.thisObj == thisObj)\n                    return item;\n            }\n            return null;\n        }\n\n        public add(delayInMiniseconds: number, repeat: number, callback: Function, thisObj?: any, callbackParam?: any): void {\n            var item: TimerItem = this.findItem(callback, thisObj);\n            if (!item) {\n                item = this.getItem();\n                item.callback = callback;\n                item.hasParam = callback.length == 1;\n                item.thisObj = thisObj;\n                this._items.push(item);\n            }\n            item.delay = delayInMiniseconds;\n            item.counter = 0;\n            item.repeat = repeat;\n            item.param = callbackParam;\n            item.end = false;\n        }\n\n        public callLater(callback: Function, thisObj?: any, callbackParam?: any): void {\n            this.add(1, 1, callback, thisObj, callbackParam);\n        }\n\n        public callDelay(delay: number, callback: Function, thisObj?: any, callbackParam?: any): void {\n            this.add(delay, 1, callback, thisObj, callbackParam);\n        }\n\n        public exists(callback: Function, thisObj?: any): boolean {\n            var item: TimerItem = this.findItem(callback, thisObj);\n            return item != null;\n        }\n\n        public remove(callback: Function, thisObj?: any): void {\n            var item: TimerItem = this.findItem(callback, thisObj);\n            if (item) {\n                var i: number = this._items.indexOf(item);\n                this._items.splice(i, 1);\n                if (i < this._enumI)\n                    this._enumI--;\n                this._enumCount--;\n\n                item.reset();\n                this._itemPool.push(item);\n            }\n        }\n\n        private __timer(timeStamp: number): boolean {\n            GTimers.time = timeStamp;\n            GTimers.deltaTime = timeStamp - this._lastTime;\n            this._lastTime = timeStamp;\n\n            this._enumI = 0;\n            this._enumCount = this._items.length;\n\n            while (this._enumI < this._enumCount) {\n                var item: TimerItem = this._items[this._enumI];\n                this._enumI++;\n\n                if (item.advance(GTimers.deltaTime)) {\n                    if (item.end) {\n                        this._enumI--;\n                        this._enumCount--;\n                        this._items.splice(this._enumI, 1);\n                    }\n\n                    if (item.hasParam)\n                        item.callback.call(item.thisObj, item.param);\n                    else\n                        item.callback.call(item.thisObj);\n\n                    if (item.end) {\n                        item.reset();\n                        this._itemPool.push(item);\n                    }\n                }\n            }\n\n            return false;\n        }\n    }\n\n\n    class TimerItem {\n        public delay: number = 0;\n        public counter: number = 0;\n        public repeat: number = 0;\n        public callback: Function;\n        public thisObj: any;\n        public param: any;\n\n        public hasParam: boolean;\n        public end: boolean;\n\n        public constructor() {\n        }\n\n        public advance(elapsed: number): boolean {\n            this.counter += elapsed;\n            if (this.counter >= this.delay) {\n                this.counter -= this.delay;\n                if (this.counter > this.delay)\n                    this.counter = this.delay;\n\n                if (this.repeat > 0) {\n                    this.repeat--;\n                    if (this.repeat == 0)\n                        this.end = true;\n                }\n\n                return true;\n            }\n            else\n                return false;\n        }\n\n        public reset(): void {\n            this.callback = null;\n            this.thisObj = null;\n            this.param = null;\n        }\n    }\n}"
  },
  {
    "path": "source/src/utils/PixelHitTest.ts",
    "content": "namespace fgui {\r\n    export class PixelHitTest {\r\n        private _data: PixelHitTestData;\r\n\r\n        public offsetX: number;\r\n        public offsetY: number;\r\n        public scaleX: number;\r\n        public scaleY: number;\r\n\r\n        constructor(data: PixelHitTestData, offsetX: number, offsetY: number) {\r\n            this._data = data;\r\n            this.offsetX = offsetX;\r\n            this.offsetY = offsetY;\r\n\r\n            this.scaleX = 1;\r\n            this.scaleY = 1;\r\n        }\r\n\r\n        public contains(x: number, y: number): boolean {\r\n            x = Math.floor((x / this.scaleX - this.offsetX) * this._data.scale);\r\n            y = Math.floor((y / this.scaleY - this.offsetY) * this._data.scale);\r\n            if (x < 0 || y < 0 || x >= this._data.pixelWidth)\r\n                return false;\r\n\r\n            var pos: number = y * this._data.pixelWidth + x;\r\n            var pos2: number = Math.floor(pos / 8);\r\n            var pos3: number = pos % 8;\r\n\r\n            if (pos2 >= 0 && pos2 < this._data.pixels.length)\r\n                return ((this._data.pixels[pos2] >> pos3) & 0x1) == 1;\r\n            else\r\n                return false;\r\n        }\r\n    }\r\n\r\n    export class PixelHitTestData {\r\n        public pixelWidth: number;\r\n        public scale: number;\r\n        public pixels: number[];\r\n\r\n        constructor() {\r\n        }\r\n\r\n        public load(ba: ByteBuffer): void {\r\n            ba.readInt();\r\n            this.pixelWidth = ba.readInt();\r\n            this.scale = 1 / ba.readByte();\r\n            var len: number = ba.readInt();\r\n            this.pixels = [];\r\n            for (var i: number = 0; i < len; i++) {\r\n                var j: number = ba.readByte();\r\n                if (j < 0)\r\n                    j += 256;\r\n\r\n                this.pixels[i] = j;\r\n            }\r\n        }\r\n    }\r\n}"
  },
  {
    "path": "source/src/utils/ToolSet.ts",
    "content": "/// <reference path=\"UBBParser.ts\" />\n\nmodule fgui {\n\n    export class ToolSet {\n        public static startsWith(source: string, str: string, ignoreCase?: boolean): boolean {\n            if (!source)\n                return false;\n            else if (source.length < str.length)\n                return false;\n            else {\n                source = source.substring(0, str.length);\n                if (!ignoreCase)\n                    return source == str;\n                else\n                    return source.toLowerCase() == str.toLowerCase();\n            }\n        }\n\n        public static trimRight(targetString: string): string {\n            var tempChar: string = \"\";\n            for (var i: number = targetString.length - 1; i >= 0; i--) {\n                tempChar = targetString.charAt(i);\n                if (tempChar != \" \" && tempChar != \"\\n\" && tempChar != \"\\r\") {\n                    break;\n                }\n            }\n            return targetString.substring(0, i + 1);\n        }\n\n        public static convertToHtmlColor(argb: number, hasAlpha?: boolean): string {\n            var alpha: string;\n            if (hasAlpha)\n                alpha = (argb >> 24 & 0xFF).toString(16);\n            else\n                alpha = \"\";\n            var red: string = (argb >> 16 & 0xFF).toString(16);\n            var green: string = (argb >> 8 & 0xFF).toString(16);\n            var blue: string = (argb & 0xFF).toString(16);\n            if (alpha.length == 1)\n                alpha = \"0\" + alpha;\n            if (red.length == 1)\n                red = \"0\" + red;\n            if (green.length == 1)\n                green = \"0\" + green;\n            if (blue.length == 1)\n                blue = \"0\" + blue;\n            return \"#\" + alpha + red + green + blue;\n        }\n\n        public static convertFromHtmlColor(str: string, hasAlpha?: boolean): number {\n            if (str.length < 1)\n                return 0;\n\n            if (str.charAt(0) == \"#\")\n                str = str.substr(1);\n\n            if (str.length == 8)\n                return (parseInt(str.substr(0, 2), 16) << 24) + parseInt(str.substr(2), 16);\n            else if (hasAlpha)\n                return 0xFF000000 + parseInt(str, 16);\n            else\n                return parseInt(str, 16);\n        }\n\n        public static displayObjectToGObject(obj: egret.DisplayObject): GObject {\n            while (obj && !(obj instanceof egret.Stage)) {\n                if (obj[\"$owner\"])\n                    return GObject.cast(obj);\n\n                obj = obj.parent;\n            }\n            return null;\n        }\n\n        public static encodeHTML(str: string): string {\n            if (!str)\n                return \"\";\n            else\n                return str.replace(/&/g, \"&amp;\").replace(/</g, \"&lt;\")\n                    .replace(/>/g, \"&gt;\").replace(/'/g, \"&apos;\").replace(/\"/g, \"&quot;\");\n        }\n\n        public static clamp(value: number, min: number, max: number): number {\n            if (value < min)\n                value = min;\n            else if (value > max)\n                value = max;\n            return value;\n        }\n\n        public static clamp01(value: number): number {\n            if (value > 1)\n                value = 1;\n            else if (value < 0)\n                value = 0;\n            return value;\n        }\n\n        public static lerp(start: number, end: number, percent: number): number {\n            return (start + percent * (end - start));\n        }\n\n        public static repeat(t: number, length: number): number {\n            return t - Math.floor(t / length) * length;\n        }\n\n        public static distance(x1: number, y1: number, x2: number, y2: number): number {\n            return Math.sqrt(Math.pow(x1 - x2, 2) + Math.pow(y1 - y2, 2));\n        }\n\n        public static fillPath(ctx: egret.Graphics, points: number[], px: number, py: number): void {\n            var cnt: number = points.length;\n            ctx.moveTo(points[0] + px, points[1] + py);\n            for (var i: number = 2; i < cnt; i += 2)\n                ctx.lineTo(points[i] + px, points[i + 1] + py);\n            ctx.lineTo(points[0] + px, points[1] + py);\n        }\n\n        public static setColorFilter(obj: egret.DisplayObject, color?: number | number[] | boolean): void {\n            var filter: egret.ColorMatrixFilter = (<any>obj).$_colorFilter_; //cached instance\n            var filters: egret.Filter[] = obj.filters;\n\n            var toApplyColor: number | number[];\n            var toApplyGray: boolean;\n            var tp: string = typeof (color);\n            if (tp == \"boolean\") //gray\n            {\n                toApplyColor = filter ? (<any>filter).$_color_ : null;\n                toApplyGray = <boolean>color;\n            }\n            else {\n                toApplyColor = color == 0xFFFFFF ? null : <number | number[]>color;\n                toApplyGray = filter ? (<any>filter).$_grayed_ : false;\n            }\n\n            if ((!toApplyColor && toApplyColor !== 0) && !toApplyGray) {\n                if (filters && filter) {\n                    var i: number = filters.indexOf(filter);\n                    if (i != -1) {\n                        filters.splice(i, 1);\n                        if (filters.length > 0)\n                            obj.filters = filters;\n                        else\n                            obj.filters = null;\n                    }\n                }\n                return;\n            }\n\n            if (!filter) {\n                filter = new egret.ColorMatrixFilter();\n                (<any>obj).$_colorFilter_ = filter;\n            }\n            if (!filters)\n                filters = [filter];\n            else {\n                let i: number = filters.indexOf(filter);\n                if (i == -1)\n                    filters.push(filter);\n            }\n            obj.filters = filters;\n\n            (<any>filter).$_color_ = toApplyColor;\n            (<any>filter).$_grayed_ = toApplyGray;\n\n            let mat = filter.matrix;\n\n            if (toApplyGray) {\n                for (let i = 0; i < 20; i++)\n                    mat[i] = grayScaleMatrix[i];\n            }\n            else if (toApplyColor instanceof Array) {\n                getColorMatrix(toApplyColor[0], toApplyColor[1], toApplyColor[2], toApplyColor[3], mat);\n            }\n            else {\n                for (let i = 0; i < 20; i++) {\n                    mat[i] = (i == 0 || i == 6 || i == 12 || i == 18) ? 1 : 0;\n                }\n\n                mat[0] = ((<number>color >> 16) & 0xFF) / 255;\n                mat[6] = ((<number>color >> 8) & 0xFF) / 255;\n                mat[12] = (<number>color & 0xFF) / 255;\n            }\n\n            filter.matrix = mat;\n        }\n    }\n\n    const grayScaleMatrix = [\n        0.3, 0.6, 0, 0, 0,\n        0.3, 0.6, 0, 0, 0,\n        0.3, 0.6, 0, 0, 0,\n        0, 0, 0, 1, 0\n    ];\n\n    let helper: ColorMatrix = new ColorMatrix();\n    function getColorMatrix(p_brightness: number, p_contrast: number, p_saturation: number, p_hue: number, result: number[]): void {\n        if (!result)\n            result = new Array<number>(ColorMatrix.length);\n        helper.reset();\n        helper.adjustColor(p_brightness, p_contrast, p_saturation, p_hue);\n        helper.matrix.forEach((e, i) => result[i] = e);\n    }\n}"
  },
  {
    "path": "source/src/utils/UBBParser.ts",
    "content": "\nmodule fgui {\n\n    export class UBBParser {\n        private _text: string;\n        private _readPos: number = 0;\n\n        protected _handlers: { [index: string]: (tagName: string, end: boolean, attr: string) => string };\n\n        public smallFontSize: number = 12;\n        public normalFontSize: number = 14;\n        public largeFontSize: number = 16;\n\n        public defaultImgWidth: number = 0;\n        public defaultImgHeight: number = 0;\n\n        public static inst: UBBParser = new UBBParser();\n\n        public constructor() {\n            this._handlers = {};\n            this._handlers[\"url\"] = this.onTag_URL;\n            this._handlers[\"img\"] = this.onTag_IMG;\n            this._handlers[\"b\"] = this.onTag_Simple;\n            this._handlers[\"i\"] = this.onTag_Simple;\n            this._handlers[\"u\"] = this.onTag_Simple;\n            this._handlers[\"sup\"] = this.onTag_Simple;\n            this._handlers[\"sub\"] = this.onTag_Simple;\n            this._handlers[\"color\"] = this.onTag_COLOR;\n            this._handlers[\"font\"] = this.onTag_FONT;\n            this._handlers[\"size\"] = this.onTag_SIZE;\n        }\n\n        protected onTag_URL(tagName: string, end: boolean, attr: string): string {\n            if (!end) {\n                if (attr != null)\n                    return \"<a href=\\\"\" + attr + \"\\\" target=\\\"_blank\\\">\";\n                else {\n                    var href: string = this.getTagText();\n                    return \"<a href=\\\"\" + href + \"\\\" target=\\\"_blank\\\">\";\n                }\n            }\n            else\n                return \"</a>\";\n        }\n\n        protected onTag_IMG(tagName: string, end: boolean, attr: string): string {\n            if (!end) {\n                var src: string = this.getTagText(true);\n                if (!src)\n                    return null;\n\n                if (this.defaultImgWidth)\n                    return \"<img src=\\\"\" + src + \"\\\" width=\\\"\" + this.defaultImgWidth + \"\\\" height=\\\"\" + this.defaultImgHeight + \"\\\"/>\";\n                else\n                    return \"<img src=\\\"\" + src + \"\\\"/>\";\n            }\n            else\n                return null;\n        }\n\n        protected onTag_Simple(tagName: string, end: boolean, attr: string): string {\n            return end ? (\"</\" + tagName + \">\") : (\"<\" + tagName + \">\");\n        }\n\n        protected onTag_COLOR(tagName: string, end: boolean, attr: string): string {\n            if (!end)\n                return \"<font color=\\\"\" + attr + \"\\\">\";\n            else\n                return \"</font>\";\n        }\n\n        protected onTag_FONT(tagName: string, end: boolean, attr: string): string {\n            if (!end)\n                return \"<font face=\\\"\" + attr + \"\\\">\";\n            else\n                return \"</font>\";\n        }\n\n        protected onTag_SIZE(tagName: string, end: boolean, attr: string): string {\n            if (!end) {\n                if (attr == \"normal\")\n                    attr = \"\" + this.normalFontSize;\n                else if (attr == \"small\")\n                    attr = \"\" + this.smallFontSize;\n                else if (attr == \"large\")\n                    attr = \"\" + this.largeFontSize;\n                else if (attr.length && attr.charAt(0) == \"+\")\n                    attr = \"\" + (this.smallFontSize + parseInt(attr.substr(1)));\n                else if (attr.length && attr.charAt(0) == \"-\")\n                    attr = \"\" + (this.smallFontSize - parseInt(attr.substr(1)));\n                return \"<font size=\\\"\" + attr + \"\\\">\";\n            }\n            else\n                return \"</font>\";\n        }\n\n        protected getTagText(remove: boolean = false): string {\n            var pos1: number = this._readPos;\n            var pos2: number;\n            var result: string = \"\";\n            while ((pos2 = this._text.indexOf(\"[\", pos1)) != -1) {\n                if (this._text.charCodeAt(pos2 - 1) == 92)//\\\n                {\n                    result += this._text.substring(pos1, pos2 - 1);\n                    result += \"[\";\n                    pos1 = pos2 + 1;\n                }\n                else {\n                    result += this._text.substring(pos1, pos2);\n                    break;\n                }\n            }\n            if (pos2 == -1)\n                return null;\n\n            if (remove)\n                this._readPos = pos2;\n\n            return result;\n        }\n\n        public parse(text: string, remove?: boolean): string {\n            this._text = text;\n            var pos1: number = 0, pos2: number, pos3: number;\n            var end: boolean;\n            var tag: string, attr: string;\n            var repl: string;\n            var func: Function;\n            var result: string = \"\";\n            while ((pos2 = this._text.indexOf(\"[\", pos1)) != -1) {\n                if (pos2 > 0 && this._text.charCodeAt(pos2 - 1) == 92)//\\\n                {\n                    result += this._text.substring(pos1, pos2 - 1);\n                    result += \"[\";\n                    pos1 = pos2 + 1;\n                    continue;\n                }\n\n                result += this._text.substring(pos1, pos2);\n                pos1 = pos2;\n                pos2 = this._text.indexOf(\"]\", pos1);\n                if (pos2 == -1)\n                    break;\n\n                end = this._text.charAt(pos1 + 1) == '/';\n                tag = this._text.substring(end ? pos1 + 2 : pos1 + 1, pos2);\n                this._readPos = pos2 + 1;\n                attr = null;\n                repl = null;\n                pos3 = tag.indexOf(\"=\");\n                if (pos3 != -1) {\n                    attr = tag.substring(pos3 + 1);\n                    tag = tag.substring(0, pos3);\n                }\n                tag = tag.toLowerCase();\n                func = this._handlers[tag];\n                if (func != null) {\n                    if (!remove) {\n                        repl = func.call(this, tag, end, attr);\n                        if (repl != null)\n                            result += repl;\n                    }\n                }\n                else\n                    result += this._text.substring(pos1, this._readPos);\n                pos1 = this._readPos;\n            }\n\n            if (pos1 < this._text.length)\n                result += this._text.substr(pos1);\n\n            this._text = null;\n\n            return result;\n        }\n    }\n}"
  },
  {
    "path": "source/tsconfig.json",
    "content": "{\r\n  \"compilerOptions\": {\r\n    \"module\": \"system\",\r\n    \"target\": \"es5\",\r\n    \"declaration\": true,\r\n    \"sourceMap\": false,\r\n    \"removeComments\": true,\r\n    \"outFile\": \"./fairygui.js\",\r\n    \"lib\": [\r\n      \"es5\",\r\n      \"dom\",\r\n      \"es2015.promise\"\r\n  ] ,\r\n  },\r\n  \"include\": [\r\n    \"src\",\r\n    \"lib\"\r\n  ],\r\n  \"exclude\": [\r\n    \"node_modules\"\r\n  ]\r\n}"
  }
]